Commit 0f464bf
authored
rust-guard: remove dead params from
Two small cleanup items in the Rust guard: `issue_integrity` carried two
never-read parameters (`_owner`, `_repo`) that forced callers to perform
unnecessary string splits, and `tool_rules.rs` was heap-allocating a
`String` on every `actions_get` call just to do an equality check.
## Changes
- **`labels/helpers.rs`** — drop `_owner: &str` and `_repo: &str` from
`issue_integrity` signature
- **`labels/response_items.rs`** — remove `repo_owner` split (existed
solely to fill the dead arg)
- **`labels/response_paths.rs`** — remove `owner` split + stale `//
Extract owner from repo for owner check` comment
- **`labels/mod.rs`** — update all 10 test call sites to match new
signature
- **`labels/tool_rules.rs`** — replace heap-allocating comparison with
zero-allocation `.as_str()` idiom:
```rust
// Before — allocates on every actions_get call
tool_args.get("method") == Some(&Value::String("download_workflow_run_artifact".to_string()))
// After — allocation-free
tool_args.get("method").and_then(|v| v.as_str()) == Some("download_workflow_run_artifact")
```
> [!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-build1926788072/b332/launcher.test
/tmp/go-build1926788072/b332/launcher.test
-test.testlogfile=/tmp/go-build1926788072/b332/testlog.txt
-test.paniconexit0 -test.timeout=10m0s
/tmp/go-build1926788072/b253/vet.cfg 64/src/runtime/cgo
erive-f8a9da973ea849b8.serde_dernet/http x86_64/as
erive-f8a9da973e/opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet
378038/b011/syma-unsafeptr=false erive-f8a9da973e-unreachable=false
_main.o eriv�� ache/go/1.25.8/x64/src/runtime/cgo1.25.8
CLzi/BTFciEBdHbS8DwRuCLzi x_amd64/vet
erive-f8a9da973e/opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet
erive-f8a9da973e-atomic -Wl,-Bstatic x_amd64/vet` (dns block)
> - `invalid-host-that-does-not-exist-12345.com`
> - Triggering command: `/tmp/go-build1926788072/b317/config.test
/tmp/go-build1926788072/b317/config.test
-test.testlogfile=/tmp/go-build1926788072/b317/testlog.txt
-test.paniconexit0 -test.timeout=10m0s 2c9e�� 64/src/runtime/cgo
-gnu/lib/libstd-267b04dbd87607fbgithub.com/tetratelabs/wazero/internal/platform
x_amd64/compile
-gnu/lib/libobje/opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet
378038/b009/ -gnu/lib/libaddr-unreachable=false x_amd64/compile -gnu�� ;
then \
$GOPATH/bin/golangci-lint run --timeout=5m || echo "��� Warning:
golangci-lint failed
/opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet
-gnu/lib/libstd_detect-3c01aa300-nolocalimports x_amd64/vet
-gnu/lib/librust/opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet
ry 64-REDACTED-linux-unreachable=false x_amd64/vet` (dns block)
> - `nonexistent.local`
> - Triggering command: `/tmp/go-build1926788072/b332/launcher.test
/tmp/go-build1926788072/b332/launcher.test
-test.testlogfile=/tmp/go-build1926788072/b332/testlog.txt
-test.paniconexit0 -test.timeout=10m0s
/tmp/go-build1926788072/b253/vet.cfg 64/src/runtime/cgo
erive-f8a9da973ea849b8.serde_dernet/http x86_64/as
erive-f8a9da973e/opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet
378038/b011/syma-unsafeptr=false erive-f8a9da973e-unreachable=false
_main.o eriv�� ache/go/1.25.8/x64/src/runtime/cgo1.25.8
CLzi/BTFciEBdHbS8DwRuCLzi x_amd64/vet
erive-f8a9da973e/opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet
erive-f8a9da973e-atomic -Wl,-Bstatic x_amd64/vet` (dns block)
> - `slow.example.com`
> - Triggering command: `/tmp/go-build1926788072/b332/launcher.test
/tmp/go-build1926788072/b332/launcher.test
-test.testlogfile=/tmp/go-build1926788072/b332/testlog.txt
-test.paniconexit0 -test.timeout=10m0s
/tmp/go-build1926788072/b253/vet.cfg 64/src/runtime/cgo
erive-f8a9da973ea849b8.serde_dernet/http x86_64/as
erive-f8a9da973e/opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet
378038/b011/syma-unsafeptr=false erive-f8a9da973e-unreachable=false
_main.o eriv�� ache/go/1.25.8/x64/src/runtime/cgo1.25.8
CLzi/BTFciEBdHbS8DwRuCLzi x_amd64/vet
erive-f8a9da973e/opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet
erive-f8a9da973e-atomic -Wl,-Bstatic x_amd64/vet` (dns block)
> - `this-host-does-not-exist-12345.com`
> - Triggering command: `/tmp/go-build1926788072/b341/mcp.test
/tmp/go-build1926788072/b341/mcp.test
-test.testlogfile=/tmp/go-build1926788072/b341/testlog.txt
-test.paniconexit0 -test.timeout=10m0s o_.o�� 64/src/net a/dsa.go
x_amd64/vet -p internal/runtime--version -lang=go1.25 x_amd64/vet -o
ew@v1.1.1/spew/bypass.go ew@v1.1.1/spew/common.go x_amd64/vet -p
378038/b107/_cgo-qE -lang=go1.25 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>
<!-- START COPILOT CODING AGENT TIPS -->
---
📱 Kick off Copilot coding agent tasks wherever you are with [GitHub
Mobile](https://gh.io/cca-mobile-docs), available on iOS and Android.issue_integrity + fix heap-allocating string comparison (#2152)5 files changed
Lines changed: 14 additions & 32 deletions
File tree
- guards/github-guard/rust-guard/src/labels
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
812 | 812 | | |
813 | 813 | | |
814 | 814 | | |
815 | | - | |
816 | | - | |
817 | 815 | | |
818 | 816 | | |
819 | 817 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
729 | 729 | | |
730 | 730 | | |
731 | 731 | | |
732 | | - | |
733 | | - | |
734 | 732 | | |
735 | 733 | | |
736 | 734 | | |
737 | 735 | | |
738 | 736 | | |
739 | 737 | | |
740 | | - | |
| 738 | + | |
741 | 739 | | |
742 | 740 | | |
743 | 741 | | |
| |||
746 | 744 | | |
747 | 745 | | |
748 | 746 | | |
749 | | - | |
| 747 | + | |
750 | 748 | | |
751 | 749 | | |
752 | 750 | | |
| |||
755 | 753 | | |
756 | 754 | | |
757 | 755 | | |
758 | | - | |
| 756 | + | |
759 | 757 | | |
760 | 758 | | |
761 | 759 | | |
762 | 760 | | |
763 | 761 | | |
764 | 762 | | |
765 | | - | |
| 763 | + | |
766 | 764 | | |
767 | 765 | | |
768 | 766 | | |
769 | 767 | | |
770 | 768 | | |
771 | 769 | | |
772 | | - | |
773 | | - | |
774 | | - | |
775 | | - | |
776 | | - | |
777 | | - | |
778 | | - | |
779 | | - | |
| 770 | + | |
780 | 771 | | |
781 | 772 | | |
782 | 773 | | |
| |||
857 | 848 | | |
858 | 849 | | |
859 | 850 | | |
860 | | - | |
861 | | - | |
862 | 851 | | |
863 | 852 | | |
864 | 853 | | |
| |||
867 | 856 | | |
868 | 857 | | |
869 | 858 | | |
870 | | - | |
| 859 | + | |
871 | 860 | | |
872 | 861 | | |
873 | 862 | | |
| |||
876 | 865 | | |
877 | 866 | | |
878 | 867 | | |
879 | | - | |
| 868 | + | |
880 | 869 | | |
881 | 870 | | |
882 | 871 | | |
883 | 872 | | |
884 | 873 | | |
885 | 874 | | |
886 | 875 | | |
887 | | - | |
| 876 | + | |
888 | 877 | | |
889 | 878 | | |
890 | 879 | | |
| |||
893 | 882 | | |
894 | 883 | | |
895 | 884 | | |
896 | | - | |
| 885 | + | |
897 | 886 | | |
898 | 887 | | |
899 | 888 | | |
| |||
903 | 892 | | |
904 | 893 | | |
905 | 894 | | |
906 | | - | |
| 895 | + | |
907 | 896 | | |
908 | 897 | | |
909 | 898 | | |
| |||
Lines changed: 0 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
208 | | - | |
209 | 208 | | |
210 | 209 | | |
211 | 210 | | |
212 | 211 | | |
213 | | - | |
214 | | - | |
215 | 212 | | |
216 | 213 | | |
217 | 214 | | |
| |||
Lines changed: 0 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
224 | | - | |
225 | | - | |
226 | 224 | | |
227 | 225 | | |
228 | 226 | | |
229 | 227 | | |
230 | 228 | | |
231 | 229 | | |
232 | 230 | | |
233 | | - | |
234 | | - | |
235 | 231 | | |
236 | 232 | | |
237 | 233 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
277 | 277 | | |
278 | 278 | | |
279 | 279 | | |
280 | | - | |
281 | | - | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
282 | 284 | | |
283 | 285 | | |
284 | 286 | | |
| |||
0 commit comments