rust-guard: remove org-scope clone in tool labeling and add private list_releases secrecy coverage - #10473
Conversation
list_releases secrecy coverage
There was a problem hiding this comment.
Pull request overview
Removes an unnecessary Rust allocation and expands private-repository release labeling coverage.
Changes:
- Moves
orgdirectly intoCow::Owned. - Adds private
list_releasessecrecy tests. - Adds a test-only visibility-cache hook.
Show a summary per file
| File | Description |
|---|---|
tool_rules.rs |
Removes redundant organization cloning. |
response_paths.rs |
Tests private release labels. |
backend.rs |
Adds cache priming for tests. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 3/3 changed files
- Comments generated: 1
- Review effort level: Balanced
| #[test] | ||
| fn list_releases_private_repo_gets_private_secrecy() { | ||
| let repo_id = "octocat/private-repo"; | ||
| crate::labels::backend::set_cached_repo_visibility_for_tests(repo_id, true); |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@copilot address review feedback |
Addressed in |
🔒 mcpg Read-Only Stress — defaultSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Notes:
Overall: PASS References: §30667571982
|
🔒 mcpg Read-Only Stress — gVisorSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Notes:
Overall: PASS References: §30667571839
|
🔒 mcpg Read-Only Stress — docker-sbxSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: PASS All 7 MCP write tools absent from gateway tool list (gateway enforcement via tool filtering). CLI/GraphQL writes rejected due to unauthenticated gh token. No writes leaked on docker-sbx runtime. References: §30667571933
|
Rust guard had an avoidable allocation in org-scoped secret/variable labeling (
Cow::Owned(org.clone())) and no test asserting private-repo secrecy propagation forlist_releases. This PR removes the clone-by-ordering issue and closes the private-release labeling coverage gap.Tool label ownership cleanup (
tool_rules.rs)set_secret | delete_secret | set_variable | delete_variableso borrow-only calls run before ownership transfer.Cow::Owned.Private
list_releasessecrecy coverage (response_paths.rs)list_releases_private_repo_gets_private_secrecy.private:<owner>/<repo>secrecy andmerged:<owner>/<repo>integrity.default_labels.secrecyalso carries the private repo label.Test-only visibility cache hook (
backend.rs)#[cfg(test)] pub(crate) fn set_cached_repo_visibility_for_tests(...)to prime repo visibility deterministically in response-path tests.