Conversation
…string comparison Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Remove dead parameters from issue_integrity and fix string comparison
rust-guard: remove dead params from Mar 19, 2026
issue_integrity + fix heap-allocating string comparison
Contributor
There was a problem hiding this comment.
Pull request overview
This PR cleans up the GitHub Rust guard’s integrity labeling API by removing unused issue_integrity parameters (and the caller-side repo splitting they forced), and improves actions_get handling by replacing a heap-allocating JSON string comparison with an allocation-free check.
Changes:
- Remove unused
_owner/_repoparameters fromissue_integrityand update all call sites/tests accordingly. - Delete now-unnecessary
owner/repo_ownerstring splitting in response labeling paths/items. - Avoid per-call heap allocation in
tool_rules.rsby comparingmethodviaas_str().
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| guards/github-guard/rust-guard/src/labels/helpers.rs | Drops dead issue_integrity params (signature cleanup). |
| guards/github-guard/rust-guard/src/labels/response_items.rs | Removes repo-owner split that existed only for the dead args. |
| guards/github-guard/rust-guard/src/labels/response_paths.rs | Removes owner split and updates issue_integrity invocation. |
| guards/github-guard/rust-guard/src/labels/mod.rs | Updates tests to match the new issue_integrity signature. |
| guards/github-guard/rust-guard/src/labels/tool_rules.rs | Replaces allocating JSON string equality with an allocation-free as_str() comparison. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Comment on lines
808
to
817
| /// Determine integrity level for an issue | ||
| /// Rules: | ||
| /// - private repo issues => approved | ||
| /// - public repo issues => no integrity | ||
| pub fn issue_integrity( | ||
| item: &Value, | ||
| repo_full_name: &str, | ||
| _owner: &str, | ||
| _repo: &str, | ||
| repo_private: bool, | ||
| ctx: &PolicyContext, | ||
| ) -> Vec<String> { |
This was referenced Mar 19, 2026
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.
Two small cleanup items in the Rust guard:
issue_integritycarried two never-read parameters (_owner,_repo) that forced callers to perform unnecessary string splits, andtool_rules.rswas heap-allocating aStringon everyactions_getcall just to do an equality check.Changes
labels/helpers.rs— drop_owner: &strand_repo: &strfromissue_integritysignaturelabels/response_items.rs— removerepo_ownersplit (existed solely to fill the dead arg)labels/response_paths.rs— removeownersplit + stale// Extract owner from repo for owner checkcommentlabels/mod.rs— update all 10 test call sites to match new signaturelabels/tool_rules.rs— replace heap-allocating comparison with zero-allocation.as_str()idiom: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-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/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/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/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/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:
📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.