Repository navigation
Commit aded16e
Back T6 and T12 with tests; read ruleset-only branch rules (#183)
* Test T6 check reruns and rule refreshes; read ruleset-only branches
T6: a job reruns `cmd:` checks on a collaborator head once the person
re-attributes and re-approves it (base unchanged), and a fresh merge
inspection reads both rule sources again when base and head match.
Recording real gh output for T12 showed two bugs in #rules, which made
every ruleset-only branch (this repository's main among them) read as
"Required branch checks could not be read.":
- GitHub omits `integration_id` for a required check any app may
report; that now reads as no app pin.
- `branches/<b>.protected` is true when only a ruleset applies, and
`/protection` then answers 404 "Branch not protected"; that answer
now means no classic protection. Other 404s still fail closed.
scripts/record-merge-gh.ts records the gateway's real gh calls.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Replay recorded gh answers for T12 and tick T6 and T12
test/merge-recorded.test.ts drives the real parser and the merge job
with GitHub's recorded answers: zero required checks (PR 104), and
PR 183's two required checks pending, then passing at the same head.
The job waits and merges, blocks at the time limit, and stops at once
against the repository's real non-strict ruleset. Fail-closed tests
cover every other 404 on a protected branch.
The design plan ticks T6 and T12 with evidence; ci.md says how to
record the gh fixtures again.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Address review round 1: stronger non-strict test, real 404 shapes
- The non-strict ruleset job test answers with pending checks, so a job
that waited before reading the guard would fail it.
- The hand-written gh 404 answers are built as runWithInput reports
them; the "Not Found" case is the answer a token without admin rights
gets on a protected branch (checked on cli/cli trunk).
- T6 evidence cites the test that shows the review recomputed.
- Drop a test that repeated the classic missing app_id case.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Address review round 2: name the recordings test and the bug's scope exactly
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Address review round 3: zero checks pass a job only with a merge queue
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Address review round 4: show the check reruns after an earlier pass
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Address review round 5: keep only branch protection in recordings
Branch reads in the gh recordings keep only name and protected (the
gateway reads only protected), dropping commit authors' emails; the
recorder does the same. Test titles state each 404 row's outcome, and
the rule-refresh fake sends ruleset checks as GitHub does.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Address review round 6: test that required reviews are ignored
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Address review round 7: require a 404 status; refuse partial recordings
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Address review round 8: assert every gh call had a recorded answer
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Address review round 9: state that the ruleset-only fix needs an admin token
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Address review round 10: say what the review-rules fake leaves out
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Address review round 11: require classic protection off; real breaking base
- A "Branch not protected" 404 counts as no classic protection only
when the same branch read shows protection.enabled false. The
recordings keep `protection` again, from the original answers.
- A new job test fails the command check only on a head holding the
moved base's new file, so the base itself breaks it.
- The pr merge fakes say what they leave out.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Address review round 12: scope the non-admin claim, name #176's place
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Word the pr merge fake's version note as what it stands for
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Address review round 13: one accurate note for the hand-written gh answers
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Address review round 14: say the hand-written answers may carry ignored fields
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Address review round 15: give the rule-refresh fake's branch its name
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Address review round 16: pin #176's fail-closed reading with a test
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Address review round 17: cite the job test for a missing check's block
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>1 parent 42abf4a commit aded16e
13 files changed
Lines changed: 709 additions & 28 deletions
File tree
- docs
- designs
- implementation
- github
- scripts
- test
- fixtures/gh
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
410 | 410 | | |
411 | 411 | | |
412 | 412 | | |
413 | | - | |
| 413 | + | |
414 | 414 | | |
415 | 415 | | |
416 | 416 | | |
| |||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
93 | | - | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
94 | 96 | | |
95 | 97 | | |
96 | 98 | | |
| |||
195 | 197 | | |
196 | 198 | | |
197 | 199 | | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
198 | 220 | | |
199 | 221 | | |
200 | 222 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
0 commit comments