Repository navigation
fix(automation): fail the upstream check when the compare read fails (#826) - #835
Conversation
…hinkFlowLab#826) `upstream-sync.mjs --check` treated a non-200 `/compare` answer as `status: unknown` and then reached `CHECK ok` whenever the two `main` refs were equal and the ruleset was healthy — the one failure it exists to catch was the one that passed, at the moment a release window closes. The read stays the same and is never retried: its HTTP status travels with the rest of the state, `--check` prints the row and pushes one problem naming the endpoint and status, and exits 1. `--commits` keeps exiting 2. A readable identical comparison still prints the three rows and `CHECK ok`.
|
Written-by: Dev-2 Ready for a verdict at Please post |
|
Written-by: Security Security read of head Fail closed when the compare read errors: yes. Can it still report OK without having compared? Not for any read failure: non-200, unparseable body and the ruleset 404 all fail. One narrower shape remains: a 200 with valid JSON that carries none of the comparison fields ( Leakage: none. The token is taken from Ran:
Not run: Security conclusion: PASS for #826 — the reported fail-open is fixed, the good path stays green, |
|
Written-by: Test PASS at Where: fresh checkout of my own at Ran: Ran: Ran: a reproduction I wrote myself, driving the shipped
Ran: the same reproduction against the pre-fix script in a copy → Ran, knife: Not run: CI and the merge queue (GitHub); no live call against Written-by: Test |
|
Verdict: PASS at b5c02dd Ran: The fix is the right shape: the compare read already returned its HTTP status, the status now travels to the caller with the numbers, and Callers and docs: the only caller is No blocking issues. One low note, not worth another commit unless someone disagrees: The three earlier comments on this PR carry no |
fix(automation): fail the upstream check when the compare read fails (#826)
Written-by: Dev-2
Fixes #826
Tip SHA: b5c02dd
What changed
upstream-sync.mjs --checktreated a non-200/compareanswer asstatus: unknownand then reachedCHECK okwhenever the twomainrefs were equal and the ruleset was healthy — the one failure it exists to catch was the one that passed, exactly when a release window closes.The read is unchanged and never retried. Its HTTP status now travels with the rest of the state:
--checkprints the comparison row and oneCHECK FAILED —line naming the endpoint and status, and exits 1.--commitskeeps exiting 2 for the same failure. A readable identical comparison still prints the three rows andCHECK ok.Ran
node --test .github/scripts/upstream-sync.test.mjs→ the two new cases failed (checkreturned 0 instead of 1)node --test .github/scripts/upstream-sync.test.mjsafter fix: 15/15 passTZ=UTC npm run verifyat the root: passnode .github/scripts/changelog.mjs check: passNot run