Repository navigation
fix(controller): count unreadable scopes on /healthz instead of naming them - #53
Merged
Merged
Conversation
…names The endpoint is public, so naming an unreadable private repository leaks it. Fails now: the body lists the scope keys.
…g them /healthz is public, so listing an unreadable private repository in unreadable_scopes leaked its name. Status now holds only the count; the names stay in the warn and cycle-failed log lines and in the failing alert. The field was never released, so the CHANGELOG entries are reworded rather than marked breaking. Proved by TestHealthzCountsUnreadableScopesWithoutNamingThem (red run kept in docs/evidence).
parsilver
marked this pull request as ready for review
November 19, 2026 11:19
parsilver
commented
Nov 19, 2026
parsilver
left a comment
Contributor
Author
There was a problem hiding this comment.
No Blocker. Status no longer holds the names, so no handler can leak them later. The new test fails against main and checks the raw body for any trace of the scope. Logs and the failing alert still name the scopes for the operator. I also read the rest of /healthz: error is a bool, not the message, and services holds Railway service names. So the last error, which carries scope keys, never reaches the public body either.
Suggestion: github_rate_limits is keyed by installation login, an org or user name and never a repo. That's fine for this issue, but a private org's login would still show there. If it matters, publish only the lowest remaining count or key it by an index. Merging.
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.
Closes #51
Replaces #52, which closed without merging when #50 merged and its base branch was deleted. These are the same two commits, rebased onto
main(7969a10)./healthzis public, andunreadable_scopeslisted every scope the last cycle could not read by name. If a private repository inRUNNER_SCOPESfailed to read, anyone who called the endpoint learned its name.What changed
controller:Status.UnreadableScopesis now anint, and/healthzwrites it asunreadable_scopes: <n>.Statusno longer holds the names at all, so a later handler can't leak them by accident.unreadableScopes()still returns, by name, the scopes stuck forALERT_FAILED_CYCLEScycles, because the failing alert needs them.scope not found on GitHub; skippedwithscope=<key>. Any other read error still logscycle failedwith the scope key in the error. The failing alert and the missing-scope alert still name scopes, and only the operator sees them./healthzparagraph now says the field is a count and where to find the names. The two troubleshooting rows say "unreadable_scopesabove 0" and point at the log lines. CHANGELOG[Unreleased]: both entries that mentionunreadable_scopesdescribe it as a count. The field was never released (it is not inv0.1.0), so the entry doesn't call it breaking.Acceptance criteria
/healthzshows the count and no repository name.TestHealthzCountsUnreadableScopesWithoutNamingThemsets up a repo scope that answers 404 and an org scope that fails with another error, then runsALERT_FAILED_CYCLEScycles. It checks that the raw body contains noacmeanywhere and thatunreadable_scopesis2.main'scontroller.goon the rebased branch and it fails there:docs/evidence/red-51-healthz-names.txt.scope not found on GitHub; skippedcarriesscope=repo:acme/appand that the failing alert namesorg:acme.The tests that used to compare
unreadable_scopesto a list of names now compare the count (health_test.go,notfound_test.go).Checks (on the rebased branch)
Quality gates on the changed functions. The repo has no
.quality/gate.py, so I ran the tools locally:unreadableScopes5.0 andHealthHandler6.0, both at 100% coverage.recordis 8.0 and wasn't changed.Cycleis 15.2, the same as onmain, and this PR doesn't touch it.controller.goand the new test: no candidates.unreadableScopes, 1 inHealthHandler), no survivors. It ran with--no-coveragebecause the tool can't map Go's module-path coverage profile.unreadable++on the changed line has no mutation site.Risks
unreadable_scopesas a list from an unreleased build will now get a number. The field isn't in any tag yet.github_rate_limitsis still keyed by installation account, which is an org or user login and never a repository name. That is outside this issue. Hiding logins too would be a separate change.Not verified