Commit 684f7fa
authored
Fix unused imports compile error in Rust guard labels/mod.rs (#5089)
The `docker` CI job was failing during the WASM guard build because
`has_demotion_label` and `has_promotion_label` were re-exported
unconditionally in `labels/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 for
`has_approval_label` and `secret_label`:
```rust
// Before
pub use helpers::{has_demotion_label, has_promotion_label};
// After
#[cfg(test)]
pub use helpers::{has_demotion_label, has_promotion_label};
```
> [!WARNING]
>
> <details>
> <summary>Firewall rules blocked me from connecting to one or more
addresses (expand for details)</summary>
>
> #### I tried to connect to the following addresses, but was blocked by
firewall rules:
>
> - `example.com`
> - Triggering command: `/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`
> - Triggering command: `/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`
> - Triggering command: `/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`
> - Triggering command: `/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`
> - Triggering command: `/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:
>
> - Configure [Actions setup
steps](https://gh.io/copilot/actions-setup-steps) to set up my
environment, which run before the firewall is enabled
> - Add the appropriate URLs or hosts to the custom allowlist in this
repository's [Copilot coding agent
settings](https://github.com/github/gh-aw-mcpg/settings/copilot/coding_agent)
(admins only)
>
> </details>4 files changed
Lines changed: 12 additions & 13 deletions
File tree
- guards/github-guard/rust-guard/src/labels
- internal
- server
- strutil
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
229 | | - | |
230 | 229 | | |
231 | 230 | | |
232 | 231 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
443 | 443 | | |
444 | 444 | | |
445 | 445 | | |
446 | | - | |
447 | 446 | | |
448 | 447 | | |
449 | 448 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
173 | 173 | | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
181 | 181 | | |
0 commit comments