Repository navigation
fix: readiness is unknown, not a failure, on HTTP 403 from the check reads - #228
Merged
Merged
Conversation
…reads In a private repository the job token (contents: read, pull-requests: write) cannot read check runs or commit statuses, so the readiness step on labeled failed with HTTP 403 (bketelsen/fleet run 42646228960). The GitHub client now carries the HTTP status in error.status (message unchanged); the readiness step reads a 403 from either check read as readiness unknown: a notice and a summary line, no label change, no comment, exit 0. Every other error still fails the step. Job permissions do not change.
bketelsen
approved these changes
Nov 9, 2026
This was referenced Nov 9, 2026
Merged
Merged
Merged
Merged
Merged
Merged
Merged
Merged
Merged
This was referenced Nov 14, 2026
Merged
Merged
Merged
Merged
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.
Summary
In a private repository, the readiness step of
pr-triage.ymlfails on everyready-for-humanlabel: the job token (contents: read,pull-requests: write) cannot read check runs or commit statuses, and GitHub answers HTTP 403 (bketelsen/fleet run 42646228960:GET /repos/bketelsen/fleet/commits/<sha>/check-runs failed: HTTP 403). This PR makes that case "readiness unknown" instead of a red run.scripts/lib/risk-paths.mjs: the GitHub client error for a non-2xx answer now carriesstatus(the HTTP status). The message is the same text as before, and no export changes, so vendored copies keep working.scripts/lib/pr-triage.mjs: onlabeled, a 403 (read fromerror.status, not from the message) on the check-run read or the commit-status read gives the outcomeunknown: a::notice::annotation, a log line and a## Readinesssummary line, no label change, no comment, exit 0. Any other HTTP status or a network error still fails the step. Thesynchronizerule (head-moved) reads no checks and works in private repositories as before..github/workflows/pr-triage.yml: both embedded copies re-synced (npm run sync:risk-paths-workflow). No permission, trigger orif:change.docs/specs/pr-triage.md: rule D (readiness unknown, only 403) and rule F (private repositories get only thehead-movedrule; a secondary rate limit, also HTTP 403, gives unknown and not a red run; the label stays in both cases).Why not ask for
checks: readandstatuses: read: a reusable workflow cannot get more than its caller grants, so every caller would need a change first. ADR-0076 required checks still gate the merge; ADR-0077 already calls this guard best effort.Risk tier
Risk tier: 3 — highest. The PR touches these paths of the base
.github/risk-paths.json(L2,risk:high):.github/workflows/pr-triage.yml: only the 2 embedded library copies change (generated;npm run check:risk-pathschecks them). Permissions staypermissions: {}at the top andcontents: read,pull-requests: writefor the job. No trigger, action orif:change.scripts/lib/pr-triage.mjs: the new path only reads and then stops. It adds no API call, and it writes nothing to GitHub. It can only keep a label that the step would otherwise not have removed either (a failed run also keeps the label), so it never weakens a removal that works today. The narrow catch is guarded: 500, 404 and a 403 in the message text only all still fail.scripts/lib/risk-paths.mjs: 1 added property on the thrown error. No new export, no changed message, no new request.Under
pull_request_target, core's local caller resolves to the base branch, so this PR's own run uses the old code. Private callers (bketelsen/fleet, frostyard/apt-publisher) take the fix with a pin bump to the merge SHA.Docs housekeeping
Verification
npm run verify: docs, organization, risk-paths (workflow in sync), 725 tests, 0 failuresnode scripts/check-corrections.mjs: 35 lines ok (1 new line,promoted_tothe test file)actionlint .github/workflows/pr-triage.ymlcleanmain): "labeled with HTTP 403 on the check runs is readiness unknown…", "…on the commit statuses…", "main on labeled with HTTP 403 on the check runs passes with a notice and makes no change" (real client andmain, fakefetch), "an HTTP error from the client carries the status and keeps its message". With a catch-all instead of the 403 check, the 4 tests "labeled with … still fails the step and changes nothing" (500 and 404 on check runs, 500 on statuses, 403 only in the message) fail.Cross-review
claude-opus-5.5). Reviewer:openai/gpt-6.1-sol, read only.17c84bf8b91e8ea76577e3b79859990a4a75ae01, head83a4a7c6b101ad7c84cc6f1b2c7f4576d3c10fcc. All 6 changed paths. Generated heredocs excluded from line-by-line review; the reviewer confirmed that both match their sources and that the workflow outside them is unchanged.node --test test/pr-triage.test.mjs): "labeled with HTTP 403 on the check runs is readiness unknown…", "labeled with HTTP 403 on the commit statuses is readiness unknown…", "main on labeled with HTTP 403 on the check runs passes with a notice and makes no change" and "an HTTP error from the client carries the status and keeps its message" fail on their assertions. CI green at the head.