Skip to content

Commit 526790c

Browse files
authored
fix(rust-guard): remove redundant match arm in author_association_floor_from_str (#3654)
Two match arms in `author_association_floor_from_str` both returned `vec![]`, making `"FIRST_TIMER" | "NONE"` dead code — fully subsumed by the wildcard below it. ## Changes - **`guards/github-guard/rust-guard/src/labels/helpers.rs`**: Drop the `"FIRST_TIMER" | "NONE"` arm; fold into the wildcard with a clarifying comment. ```rust // Before "FIRST_TIMER" | "NONE" => vec![], _ => vec![], // After _ => vec![], // FIRST_TIMER, NONE, or any unrecognised value ``` No behaviour change. The `lib.rs` duplicate integrity-branch issue noted in the report was already resolved in the codebase. > [!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-build4291131586/b514/launcher.test /tmp/go-build4291131586/b514/launcher.test -test.testlogfile=/tmp/go-build4291131586/b514/testlog.txt -test.paniconexit0 -test.timeout=10m0s E=3 .cfg /tmp/go-build406-ifaceassert x_amd64/vet . --gdwarf2 --64 x_amd64/vet .cfg�� /yaml.v3@v3.0.1/apic.go /yaml.v3@v3.0.1/decode.go x_amd64/vet ute.go mentation.go -o x_amd64/vet` (dns block) > - `invalid-host-that-does-not-exist-12345.com` > - Triggering command: `/tmp/go-build4291131586/b496/config.test /tmp/go-build4291131586/b496/config.test -test.testlogfile=/tmp/go-build4291131586/b496/testlog.txt -test.paniconexit0 -test.timeout=10m0s /tmp/go-build4291131586/b338/vet.cfg oding@v0.5.4/iso8601/parse.go oding@v0.5.4/iso8601/valid.go x_amd64/vet --gdwarf-5 nal/protolazy -o x_amd64/vet 4459�� g_.a ache/go/1.25.8/x64/src/log/log.go x_amd64/vet --gdwarf-5 4459165/b239/ -o x_amd64/vet` (dns block) > - `nonexistent.local` > - Triggering command: `/tmp/go-build4291131586/b514/launcher.test /tmp/go-build4291131586/b514/launcher.test -test.testlogfile=/tmp/go-build4291131586/b514/testlog.txt -test.paniconexit0 -test.timeout=10m0s E=3 .cfg /tmp/go-build406-ifaceassert x_amd64/vet . --gdwarf2 --64 x_amd64/vet .cfg�� /yaml.v3@v3.0.1/apic.go /yaml.v3@v3.0.1/decode.go x_amd64/vet ute.go mentation.go -o x_amd64/vet` (dns block) > - `slow.example.com` > - Triggering command: `/tmp/go-build4291131586/b514/launcher.test /tmp/go-build4291131586/b514/launcher.test -test.testlogfile=/tmp/go-build4291131586/b514/testlog.txt -test.paniconexit0 -test.timeout=10m0s E=3 .cfg /tmp/go-build406-ifaceassert x_amd64/vet . --gdwarf2 --64 x_amd64/vet .cfg�� /yaml.v3@v3.0.1/apic.go /yaml.v3@v3.0.1/decode.go x_amd64/vet ute.go mentation.go -o x_amd64/vet` (dns block) > - `this-host-does-not-exist-12345.com` > - Triggering command: `/tmp/go-build4291131586/b523/mcp.test /tmp/go-build4291131586/b523/mcp.test -test.testlogfile=/tmp/go-build4291131586/b523/testlog.txt -test.paniconexit0 -test.timeout=10m0s .cfg�� 4459165/b389/_pk-p -I x_amd64/vet --gdwarf-5 g/grpc/internal//usr/bin/runc -o x_amd64/vet .cfg�� lhk-/9CAufbOhYsrgo1.25.8 /tmp/go-build406-c=4 x_amd64/vet . _value&#34;].&#34;\n&#34;; --64 x_amd64/vet` (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>
2 parents dfac8a5 + c10cbd4 commit 526790c

File tree

1 file changed

+1
-2
lines changed
  • guards/github-guard/rust-guard/src/labels

1 file changed

+1
-2
lines changed

guards/github-guard/rust-guard/src/labels/helpers.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -917,8 +917,7 @@ pub fn author_association_floor_from_str(
917917
match normalized.as_str() {
918918
"OWNER" | "MEMBER" | "COLLABORATOR" => writer_integrity(scope, ctx),
919919
"CONTRIBUTOR" | "FIRST_TIME_CONTRIBUTOR" => reader_integrity(scope, ctx),
920-
"FIRST_TIMER" | "NONE" => vec![],
921-
_ => vec![],
920+
_ => vec![], // FIRST_TIMER, NONE, or any unrecognised value
922921
}
923922
}
924923

0 commit comments

Comments
 (0)