[Repo Assist] refactor(rust-guard): merge identical security-alert match arms and add actions_get tests#6583
Merged
lpcox merged 1 commit intoMay 27, 2026
Conversation
…nd add actions_get tests Closes #6524 - Merge three separate match arms (secret scanning, code scanning/Dependabot, job logs) into a single unified arm. All three had identical bodies calling policy_private_scope_label + writer_integrity; the only differences were section comments explaining each group's rationale. - Add two new tests for the actions_get arm: one confirming that download_workflow_run_artifact is always forced to private secrecy, and one confirming that non-artifact methods inherit repo-visibility secrecy. These pin the security-critical if/else branch against future regressions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
🤖 This PR was created by Repo Assist, an automated AI assistant.
Closes #6524
Summary
Two improvements to
guards/github-guard/rust-guard/src/labels/tool_rules.rs, as described in #6524:1. Merge three identical security-sensitive match arms
Three consecutive match arms (
list_secret_scanning_alerts/get_secret_scanning_alert,list_code_scanning_alerts/get_code_scanning_alert/list_dependabot_alerts/get_dependabot_alert, andget_job_logs) all had identical two-line bodies callingpolicy_private_scope_label+writer_integrity. They're merged into one unified arm with a consolidated comment explaining the rationale for all seven tool names.Effect: ~14 lines removed; a single canonical location to add future security-sensitive tools.
2. Add tests for
actions_getsecurity branchThe
actions_getarm has a security-criticalif/else:download_workflow_run_artifactis always forced to private secrecy, while other methods inherit repo-visibility secrecy. This had zero test coverage. Two new tests pin both branches:apply_tool_labels_actions_get_artifact_download_is_always_privateapply_tool_labels_actions_get_non_artifact_inherits_repo_visibilityTest Status
✅ All 440 Rust tests pass (
cargo testinguards/github-guard/rust-guard/).The Go build infrastructure was unavailable in this environment (Go toolchain download blocked), but no Go files were modified — only
tool_rules.rs.Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
proxy.golang.orgSee Network Configuration for more information.
Add this agentic workflows to your repo
To install this agentic workflow, run