Repository navigation
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).
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
Builds on #50 and targets its branch (
fix/49-not-found-scopes); GitHub moves the base tomainwhen #50 merges./healthzis public, andunreadable_scopeslisted every scope the last cycle could not read by name, so a private repository inRUNNER_SCOPESthat failed to read leaked its name to anyone who called the endpoint.What changed
controller:Status.UnreadableScopesis now a count (int), and/healthzwrites it asunreadable_scopes: <n>. The names are not kept inStatusat all, so a future handler can't expose them by accident.unreadableScopes()still returns the scopes stuck forALERT_FAILED_CYCLEScycles by name, for the failing alert.scope not found on GitHub; skippedwithscope=<key>, any other read error still logscycle failedwith the scope key in the error, and the failing and missing-scope alerts still name scopes. They reach only the operator./healthzparagraph says the field is a count and where the names are; the two troubleshooting rows now sayunreadable_scopesabove 0 and point at the log lines. CHANGELOG[Unreleased]: both entries that mentionunreadable_scopesdescribe it as a count. The field has never been released (not inv0.1.0), so it is not marked as breaking.Acceptance criteria
/healthzshows the count and no repository name.TestHealthzCountsUnreadableScopesWithoutNamingThemconfigures a 404 repo scope and an org scope that fails with another error, runsALERT_FAILED_CYCLEScycles, and asserts the raw body contains noacmeat all andunreadable_scopesis2.docs/evidence/red-51-healthz-names.txt:scope not found on GitHub; skippedcarriesscope=repo:acme/app, and the failing alert namesorg:acme.The existing tests that compared
unreadable_scopesto a list of names now compare the count (health_test.go,notfound_test.go).Checks
Quality gates on the changed functions (this repo has no
.quality/gate.py, so I ran the tools locally):unreadableScopes5.0,HealthHandler6.0,record8.0 (not changed itself).Cycleis 15.2, the same as on fix(controller): a 404 scope in RUNNER_SCOPES no longer fails the cycle #50's head; this PR does not touch it.controller.goand the new test: no candidates.unreadableScopes6,HealthHandler1), no survivors. It ran with--no-coveragebecause the tool can't map Go's module-path coverage profile; CRAP shows both functions at 100% coverage.Risks
unreadable_scopesfrom an unreleased build as a list will get a number. The field is not in any tag yet.github_rate_limitsis still keyed by the installation account (an org or user login, never a repository name). That is outside this issue; if logins should be hidden as well, it would be a separate change.Not verified