rust-guard: make LogLevel private and deduplicate extract_repo_info call#3710
Merged
rust-guard: make LogLevel private and deduplicate extract_repo_info call#3710
Conversation
…t_repo_info call Agent-Logs-Url: https://github.com/github/gh-aw-mcpg/sessions/fbe0c479-7e12-4bf0-bd7d-50de00c23b16 Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Remove unused public LogLevel enum from Rust Guard
rust-guard: make LogLevel private and deduplicate extract_repo_info call
Apr 13, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR applies two small internal refactors to the github-guard Rust WASM guard crate to better reflect intended API visibility and remove a redundant extract_repo_info call in the response labeling logic.
Changes:
- Make
LogLevelprivate insrc/lib.rssince it’s only used by the file-local logging helpers. - Deduplicate consecutive
extract_repo_info(tool_args)calls in the"get_file_contents"arm inlabels/response_paths.rsto avoid redundant work and align with the file’s existing pattern.
Show a summary per file
| File | Description |
|---|---|
| guards/github-guard/rust-guard/src/lib.rs | Makes the internal LogLevel enum non-public to avoid signaling external API intent. |
| guards/github-guard/rust-guard/src/labels/response_paths.rs | Removes a redundant extract_repo_info call in the get_file_contents labeling path. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 0
This was referenced Apr 13, 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 code-quality fixes in the Rust guard crate identified by the automated Rust Guard Improver.
Changes
lib.rs— RemovepubfromLogLevelenum. The type is only used by the privatefn log()helper in the same file; marking it public suppressed the compiler'sdead_codelint and falsely signaled external use intent.labels/response_paths.rs— Collapse two consecutiveextract_repo_infocalls in theget_file_contentsarm into one, matching the pattern used by every other arm in the file.Eliminates a redundant JSON parse (relevant in WASM where allocations are expensive) and makes the binding origin unambiguous.
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-build3085697790/b514/launcher.test /tmp/go-build3085697790/b514/launcher.test -test.testlogfile=/tmp/go-build3085697790/b514/testlog.txt -test.paniconexit0 -test.timeout=10m0s /tmp/go-build3085697790/b460/vet.cfg g_.a ache/go/1.25.8/x64/src/net x_amd64/vet 7479662/b151/ resolver/unix(dns block)invalid-host-that-does-not-exist-12345.com/tmp/go-build3085697790/b496/config.test /tmp/go-build3085697790/b496/config.test -test.testlogfile=/tmp/go-build3085697790/b496/testlog.txt -test.paniconexit0 -test.timeout=10m0s /tmp/go-build3085697790/b398/vet.cfg @v1.1.3/cpu/x86/go1.25.8 om/tetratelabs/w-c=4 x_amd64/vet --gdwarf-5(dns block)nonexistent.local/tmp/go-build3085697790/b514/launcher.test /tmp/go-build3085697790/b514/launcher.test -test.testlogfile=/tmp/go-build3085697790/b514/testlog.txt -test.paniconexit0 -test.timeout=10m0s /tmp/go-build3085697790/b460/vet.cfg g_.a ache/go/1.25.8/x64/src/net x_amd64/vet 7479662/b151/ resolver/unix(dns block)slow.example.com/tmp/go-build3085697790/b514/launcher.test /tmp/go-build3085697790/b514/launcher.test -test.testlogfile=/tmp/go-build3085697790/b514/testlog.txt -test.paniconexit0 -test.timeout=10m0s /tmp/go-build3085697790/b460/vet.cfg g_.a ache/go/1.25.8/x64/src/net x_amd64/vet 7479662/b151/ resolver/unix(dns block)this-host-does-not-exist-12345.com/tmp/go-build3085697790/b523/mcp.test /tmp/go-build3085697790/b523/mcp.test -test.testlogfile=/tmp/go-build3085697790/b523/testlog.txt -test.paniconexit0 -test.timeout=10m0s -I .cfg om/modelcontextprotocol/go-sdk@v1.5.0/internal/jsonrpc2/frame.go x_amd64/vet --gdwarf-5 g/grpc/grpclog/i-qE -o x_amd64/vet .cfg�� 7479662/b465/_pkg_.a -trimpath x_amd64/vet -p /cobra -lang=go1.24 x_amd64/vet(dns block)If you need me to access, download, or install something from one of these locations, you can either: