Description
Problem
PR #186 reads classic required checks from the branch read (GET repos/<o>/<r>/branches/<b>) when the classic protection read (branches/<b>/protection) answers 404 "Not Found". That answer was recorded only with read-only access to public repositories.
Codeboost needs write access to merge. What a token with write access but no admin rights gets was not checked:
- the protection read's answer (404 "Not Found", 403, or something else);
- the branch read's
protectionobject.
If such a token gets anything other than the recorded shapes, #rules fails closed: the rules read as unknown, and merging stays blocked. This is safe, but the change would then not help the token codeboost actually uses.
Also not checked: fine-grained tokens and GitHub App tokens without the Administration permission, private repositories, and GitHub Enterprise Server.
Done when
scripts/record-merge-gh.tshas recorded one inspection with a write-but-not-admin token, on a public repository with classic required checks, intotest/fixtures/gh/.- A test in
test/merge-recorded.test.tsreplays it and asserts the required checks it reads (or asserts fail-closed, if GitHub answers differently, and the docs say so). - docs/implementation/guarded-merge.md's "Not checked" list is updated.
Raised in the Copilot review of #186 (summary only).
Activity