Skip to content

controller: /healthz should not name unreadable scopes #51

Closed

Description

@parsilver

/healthz is public and lists every unreadable scope by name in unreadable_scopes. When a private repository in RUNNER_SCOPES cannot be read, anyone who calls the endpoint learns that repository's name. The same names also tend to get copied into public issues from the health body.

Change:

  • /healthz reports only the number of unreadable scopes (for example unreadable_scopes: 3), never their names.
  • The names stay in the controller's own logs and in the failing alert, which only the operator sees.
  • Update README and CHANGELOG for the new field shape.

Done when: with an unreadable scope configured, /healthz shows the count and no repository name, a test covers it, and the log line still names the scope.

Note: PR #50 also changes how 404 scopes are reported; build on top of it or after it merges.

Activity

  1. parsilver commented on Nov 19, 2026

    @parsilver
    ContributorAuthor

    Plan for this one. It builds on #50 (branch fix/49-not-found-scopes), so the PR will target that branch and move to main once #50 merges.

    Approach:

    • HealthHandler writes unreadable_scopes as a number, len(Status.UnreadableScopes), instead of the list of names. Status keeps the names in memory; nothing outside the process reads it.
    • Logs and alerts stay as they are: a 404 scope still logs scope not found on GitHub; skipped with scope=<name>, other read errors still log cycle failed with the scope in the error, and the failing and missing-scope alerts still name scopes (they go only to the operator's webhook).
    • README (/healthz paragraph and troubleshooting row) and CHANGELOG [Unreleased] describe unreadable_scopes as a count, and say the names are in the logs.

    Invariants:

    • /healthz status codes and every other field stay the same.
    • No scope or repository name appears anywhere in the /healthz body (error is already a bool, not the error text).

    Tests:

    • A 404 scope beside a readable one: /healthz has unreadable_scopes: 1, the body contains no scope name, and the warn log line still names the scope.
    • A scope failing for another reason: /healthz has the count and no name, and the failing alert still names it.
    • The existing tests that compared unreadable_scopes to a list of names change to compare the count.

    Breaking for anyone who parses unreadable_scopes as a list; CHANGELOG says so.

  2. parsilver commented on Nov 19, 2026

    @parsilver
    ContributorAuthor

    Started. The failing test is on branch fix/51-healthz-scope-count in draft PR #52 (it targets #50's branch). Next: make /healthz report the count, then update README and CHANGELOG.

  3. parsilver commented on Nov 19, 2026

    @parsilver
    ContributorAuthor

    PR #52 is ready for review. /healthz now reports unreadable_scopes as a count and never names a scope; the log lines and alerts still name them. Tests, vet and the quality gates pass locally (details in the PR). It targets #50's branch, so #50 merges first. Waiting on review.

  4. parsilver commented on Nov 19, 2026

    @parsilver
    ContributorAuthor

    PR #52 closed without merging when #50 merged and its base branch was deleted, so this is not on main. Branch fix/51-healthz-scope-count still holds the work (43e8d4a) but sits on #50's pre-squash commits. Next: rebase it onto main (7969a10) and open a new PR against main. Work has started on this.

  5. parsilver commented on Nov 19, 2026

    @parsilver
    ContributorAuthor

    Rebased the work onto main as branch fix/51-healthz-unreadable-count, now in draft PR #53 against main. Next: run the tests and quality gates again on the rebased code, then mark it ready.

  6. parsilver commented on Nov 19, 2026

    @parsilver
    ContributorAuthor

    PR #53 is ready for review. It holds the same change as #52, rebased onto main: /healthz reports unreadable_scopes as a count and never names a scope, while the log lines and alerts still name them. On the rebased code, vet, gofmt and go test -race pass. CRAP is 5 and 6 on the changed functions, dryer finds no duplicates, and the mutator killed all 7 mutants. The new test fails against main's code. Waiting on review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions