Fix unused imports compile error in Rust guard labels/mod.rs#5089
Merged
Conversation
Agent-Logs-Url: https://github.com/github/gh-aw-mcpg/sessions/4ca5f2f7-6b9b-480f-baa5-17e2369a543c Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix failing GitHub Actions job 'docker'
Fix unused imports compile error in Rust guard labels/mod.rs
May 4, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a Rust -D warnings build failure in the GitHub WASM guard by ensuring test-only label helper re-exports are only compiled in test builds, eliminating unused-import warnings in release builds.
Changes:
- Add
#[cfg(test)]to thehas_demotion_label/has_promotion_labelre-export inlabels/mod.rsto prevent unused-import warnings in non-test builds. - Apply minor whitespace/formatting cleanup in a couple Go files (no functional changes).
Show a summary per file
| File | Description |
|---|---|
| internal/strutil/format_duration_test.go | Gofmt-style indentation cleanup within existing tests. |
| internal/server/circuit_breaker.go | Removes a stray whitespace-only blank line. |
| internal/server/circuit_breaker_test.go | Removes a stray whitespace-only blank line. |
| guards/github-guard/rust-guard/src/labels/mod.rs | Gates test-only helper re-exports with #[cfg(test)] to avoid unused_imports under -D warnings. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 3/4 changed files
- Comments generated: 0
This was referenced May 4, 2026
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
dockerCI job was failing during the WASM guard build becausehas_demotion_labelandhas_promotion_labelwere re-exported unconditionally inlabels/mod.rs, but are only used in test code. With-D warnings, Rust treats this as a compile error.Change
Added
#[cfg(test)]to the re-export, matching the existing pattern forhas_approval_labelandsecret_label:Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
example.com/tmp/go-build1708705991/b513/launcher.test /tmp/go-build1708705991/b513/launcher.test -test.testlogfile=/tmp/go-build1708705991/b513/testlog.txt -test.paniconexit0 -test.timeout=10m0s -goversion go1.25.9 -c=4 -nolocalimports -importcfg /tmp/go-build1708705991/b504/importcfg -pack /tmp/go-build1708705991/b504/_testmain.go o_.o�� 64/src/net -trimpath x_amd64/vet 617502/b172/ google.golang.or-test.testlogfile=/tmp/go-build1708705991/b498/testlog.txt -lang=go1.24 x_amd64/vet(dns block)invalid-host-that-does-not-exist-12345.com/tmp/go-build1708705991/b495/config.test /tmp/go-build1708705991/b495/config.test -test.testlogfile=/tmp/go-build1708705991/b495/testlog.txt -test.paniconexit0 -test.timeout=10m0s /tmp/go-build1708705991/b393/vet.cfg aHyH/ZRyj9BryPL3itfTYaHyH k/gh-aw-mcpg/gh-aw-mcpg/internal/guard/guard.go x_amd64/vet 617502/b172/ net/http/interna-unsafeptr=false -lang=go1.25 x_amd64/vet o_.o�� ache/go/1.25.9/x64/src/runtime/cgo -fPIC x_amd64/vet ut-2187906326.c -Wl,--no-gc-sect-atomic -fmessage-length-bool x_amd64/vet(dns block)nonexistent.local/tmp/go-build1708705991/b513/launcher.test /tmp/go-build1708705991/b513/launcher.test -test.testlogfile=/tmp/go-build1708705991/b513/testlog.txt -test.paniconexit0 -test.timeout=10m0s -goversion go1.25.9 -c=4 -nolocalimports -importcfg /tmp/go-build1708705991/b504/importcfg -pack /tmp/go-build1708705991/b504/_testmain.go o_.o�� 64/src/net -trimpath x_amd64/vet 617502/b172/ google.golang.or-test.testlogfile=/tmp/go-build1708705991/b498/testlog.txt -lang=go1.24 x_amd64/vet(dns block)slow.example.com/tmp/go-build1708705991/b513/launcher.test /tmp/go-build1708705991/b513/launcher.test -test.testlogfile=/tmp/go-build1708705991/b513/testlog.txt -test.paniconexit0 -test.timeout=10m0s -goversion go1.25.9 -c=4 -nolocalimports -importcfg /tmp/go-build1708705991/b504/importcfg -pack /tmp/go-build1708705991/b504/_testmain.go o_.o�� 64/src/net -trimpath x_amd64/vet 617502/b172/ google.golang.or-test.testlogfile=/tmp/go-build1708705991/b498/testlog.txt -lang=go1.24 x_amd64/vet(dns block)this-host-does-not-exist-12345.com/tmp/go-build1708705991/b522/mcp.test /tmp/go-build1708705991/b522/mcp.test -test.testlogfile=/tmp/go-build1708705991/b522/testlog.txt -test.paniconexit0 -test.timeout=10m0s(dns block)If you need me to access, download, or install something from one of these locations, you can either: