Conversation
Agent-Logs-Url: https://github.com/github/gh-aw-mcpg/sessions/7ab311b0-8ace-4ecc-bb17-83fa8b9b00d8 Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github/gh-aw-mcpg/sessions/7ab311b0-8ace-4ecc-bb17-83fa8b9b00d8 Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix owner's commits integrity on non-default branch
[gateway] Correct commit integrity elevation for personal repos on non-default refs
Apr 21, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes commit integrity elevation on non-default refs for public personal repositories where commit payloads often omit author_association, preventing valid owner-authored commits from being labeled none:* and filtered under min-integrity=approved.
Changes:
- Generalize
elevate_via_collaborator_permissionto run for public repos regardless of org ownership. - Add a public-repo owner-login fast-path in
commit_integrityto ensure owner-authored commits reach at least writer integrity when association is missing. - Add/adjust unit tests to cover owner-authored commits without
author_associationand updated collaborator-permission fallback semantics.
Show a summary per file
| File | Description |
|---|---|
guards/github-guard/rust-guard/src/labels/helpers.rs |
Removes org-only gating for collaborator-permission elevation and adds owner-login fast-path in commit_integrity. |
guards/github-guard/rust-guard/src/labels/mod.rs |
Adds targeted regression test for owner-authored commits without author_association and updates collaborator-permission fallback test expectation. |
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: 1
Comment on lines
1308
to
1314
| /// Elevate integrity via collaborator permission fallback for org repos. | ||
| /// | ||
| /// Rank threshold for writer-level integrity (none=1, reader=2, writer=3, merged=4). | ||
| const WRITER_RANK: u8 = 3; | ||
|
|
||
| /// Attempt to elevate integrity for an author in an org-owned repository | ||
| /// Attempt to elevate integrity for an author in a public repository | ||
| /// by checking their effective collaborator permission. |
There was a problem hiding this comment.
The doc comment still says this collaborator-permission fallback is "for org repos", but the org-only short-circuit was removed and the function now applies to any public repo. Please update the header comment to match the new behavior (or reintroduce a guard if org-only is still intended).
This was referenced Apr 21, 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.
list_commits/get_commiton non-default refs could label owner-authored commits in public personal repos asnone:*because commit payloads often lackauthor_association, and collaborator-permission elevation was org-gated. This caused valid commits to be filtered whenmin-integritywasapproved.Integrity elevation path
elevate_via_collaborator_permission, so public personal repos can use collaborator-permission fallback the same as org repos.NONEassociation handling, not org-specific).Commit owner fast-path
commit_integrity, added a public-repo owner match shortcut:author.loginmatches the repo owner segment ofowner/repo, integrity is raised to at leastwriter.list_commitsshape whereauthor_associationis absent.Targeted tests
author_association, asserting writer-level integrity.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-build2733438357/b509/launcher.test /tmp/go-build2733438357/b509/launcher.test -test.testlogfile=/tmp/go-build2733438357/b509/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true rotocol/go-sdk@v1.5.0/auth/auth.go rotocol/go-sdk@v1.5.0/auth/authorization_code.go x_amd64/vet --gdwarf-5 ternal/wasm/bina-atomic -o x_amd64/vet 6163��(dns block)/tmp/go-build2946369755/b513/launcher.test /tmp/go-build2946369755/b513/launcher.test -test.testlogfile=/tmp/go-build2946369755/b513/testlog.txt -test.paniconexit0 -test.timeout=10m0s .o .o .o .o .o .o f07e34dca1.build--stateless-rpc lib/rustlib/x86_--helper-status lib/�� lib/rustlib/x86_--verbose lib/rustlib/x86_--no-progress lib/rustlib/x86_REDACTED lib/rustlib/x86_bash lib/rustlib/x86_/usr/bin/runc lib/rustlib/x86_--version lib/rustlib/x86_64-REDACTED-linux-gnu/lib/libstd_detect-b16e5cb5eba3e0fd.rlib(dns block)invalid-host-that-does-not-exist-12345.com/tmp/go-build2733438357/b491/config.test /tmp/go-build2733438357/b491/config.test -test.testlogfile=/tmp/go-build2733438357/b491/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true @v1.1.3/cpu/arm64/arm64.go 6163950/b151/ x_amd64/vet --gdwarf-5 pproxy -o x_amd64/vet 6163�� g_.a GQCceE2Bv x_amd64/vet --gdwarf-5(dns block)/tmp/go-build2946369755/b495/config.test /tmp/go-build2946369755/b495/config.test -test.testlogfile=/tmp/go-build2946369755/b495/testlog.txt -test.paniconexit0 -test.timeout=10m0s .o .o .o .o .o .o .o .o .o .o .o .o .o .o ndor/bin/as 2R/5XmsTr43ByGyUorigin(dns block)nonexistent.local/tmp/go-build2733438357/b509/launcher.test /tmp/go-build2733438357/b509/launcher.test -test.testlogfile=/tmp/go-build2733438357/b509/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true rotocol/go-sdk@v1.5.0/auth/auth.go rotocol/go-sdk@v1.5.0/auth/authorization_code.go x_amd64/vet --gdwarf-5 ternal/wasm/bina-atomic -o x_amd64/vet 6163��(dns block)/tmp/go-build2946369755/b513/launcher.test /tmp/go-build2946369755/b513/launcher.test -test.testlogfile=/tmp/go-build2946369755/b513/testlog.txt -test.paniconexit0 -test.timeout=10m0s .o .o .o .o .o .o f07e34dca1.build--stateless-rpc lib/rustlib/x86_--helper-status lib/�� lib/rustlib/x86_--verbose lib/rustlib/x86_--no-progress lib/rustlib/x86_REDACTED lib/rustlib/x86_bash lib/rustlib/x86_/usr/bin/runc lib/rustlib/x86_--version lib/rustlib/x86_64-REDACTED-linux-gnu/lib/libstd_detect-b16e5cb5eba3e0fd.rlib(dns block)slow.example.com/tmp/go-build2733438357/b509/launcher.test /tmp/go-build2733438357/b509/launcher.test -test.testlogfile=/tmp/go-build2733438357/b509/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true rotocol/go-sdk@v1.5.0/auth/auth.go rotocol/go-sdk@v1.5.0/auth/authorization_code.go x_amd64/vet --gdwarf-5 ternal/wasm/bina-atomic -o x_amd64/vet 6163��(dns block)/tmp/go-build2946369755/b513/launcher.test /tmp/go-build2946369755/b513/launcher.test -test.testlogfile=/tmp/go-build2946369755/b513/testlog.txt -test.paniconexit0 -test.timeout=10m0s .o .o .o .o .o .o f07e34dca1.build--stateless-rpc lib/rustlib/x86_--helper-status lib/�� lib/rustlib/x86_--verbose lib/rustlib/x86_--no-progress lib/rustlib/x86_REDACTED lib/rustlib/x86_bash lib/rustlib/x86_/usr/bin/runc lib/rustlib/x86_--version lib/rustlib/x86_64-REDACTED-linux-gnu/lib/libstd_detect-b16e5cb5eba3e0fd.rlib(dns block)this-host-does-not-exist-12345.com/tmp/go-build2733438357/b518/mcp.test /tmp/go-build2733438357/b518/mcp.test -test.testlogfile=/tmp/go-build2733438357/b518/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true 1n8gjiV1M -I x_amd64/vet --gdwarf-5 --64 -o x_amd64/vet -W .cfg olang.org/grpc@v-ifaceassert x_amd64/vet . --gdwarf2 --64 x_amd64/vet(dns block)/tmp/go-build2946369755/b522/mcp.test /tmp/go-build2946369755/b522/mcp.test -test.testlogfile=/tmp/go-build2946369755/b522/testlog.txt -test.paniconexit0 -test.timeout=10m0s lib/�� lib/rustlib/x86_64-REDACTED-linux-gnu/lib/librustc_std_workspace_alloc-76b5fe9328c1063f.rlib lib/rustlib/x86_64-REDACTED-linux-gnu/lib/libminiz_oxide-2b6a8d2f6e1dc71b.rlib ache/go/1.25.9/x64/pkg/tool/linux_amd64/vet 64/src/runtime/cbash sql/driver/drive/usr/bin/runc cal/bin/as ache/go/1.25.9/x64/pkg/tool/linu/home/REDACTED/work/gh-aw-mcpg/gh-aw-mcpg/guards/github-guard/rust-guard/target/de-d -ato��(dns block)If you need me to access, download, or install something from one of these locations, you can either: