fix(git-tools): ci-queue-wait — Gitea statuses:null no longer malformed; CI-less repos pushable again #1129

Open
mos-dt-0 wants to merge 1 commits from fix/ci-queue-wait-no-status into next
Collaborator

Fixes #1128.

The fault (hit twice by velma on independent clones; reproduced live): Gitea returns "statuses": null + synthetic "state": "pending" for a commit with zero status contexts. The bash parser called that malformedASSERTED_NOT_READY exit 3 → every push to a repo without CI is blocked (jarvis-brain comms pushes).

Changes (both twins, .sh and .ps1):

  • statuses: null → treated as empty list
  • zero contexts classified no-status before consulting the synthetic aggregate state (honoring it would poll to timeout)
  • .sh only: no-status on --purpose push without --require-status = queue-clear exit 0, mirroring record_cannot_assert's disposition table (push=degraded-pass, merge=hold). --purpose merge and --require-status remain fail-closed exit 3. (.ps1 already proceeded on no-status; untouched there.)
  • red-first harness test-ci-queue-wait-no-status.sh: 5 cases — (a) the verbatim live Gitea payload on push → 0, (b) same on merge → 3, (c) push+--require-status → 3, (d) statuses:[] → 0, (e) a genuinely pending context still blocks (124). Pre-fix: (a) and (d) red. Post-fix: 5/5. test-ci-queue-wait-branch-absent.sh still 3/3.
  • Live validation: the exact failing invocation (--purpose push -B main on jarvis-brain) now exits 0 with a truthful queue-clear line.

Not touched: the .ps1's broader drift (it exits 0 on terminal-failure/unknown — pre-existing divergence from .sh, noted for a separate parity pass).

🤖 Generated with Claude Code

https://claude.ai/code/session_013SAYFkRhQfhguY7AHfiUC8

Fixes #1128. **The fault (hit twice by velma on independent clones; reproduced live):** Gitea returns `"statuses": null` + synthetic `"state": "pending"` for a commit with zero status contexts. The bash parser called that `malformed` → `ASSERTED_NOT_READY` exit 3 → **every push to a repo without CI is blocked** (jarvis-brain comms pushes). **Changes (both twins, .sh and .ps1):** - `statuses: null` → treated as empty list - zero contexts classified `no-status` **before** consulting the synthetic aggregate state (honoring it would poll to timeout) - `.sh` only: `no-status` on `--purpose push` **without** `--require-status` = queue-clear exit 0, mirroring `record_cannot_assert`'s disposition table (push=degraded-pass, merge=hold). `--purpose merge` and `--require-status` remain fail-closed exit 3. (`.ps1` already proceeded on no-status; untouched there.) - red-first harness `test-ci-queue-wait-no-status.sh`: 5 cases — (a) the **verbatim live Gitea payload** on push → 0, (b) same on merge → 3, (c) push+`--require-status` → 3, (d) `statuses:[]` → 0, (e) a genuinely pending context still blocks (124). Pre-fix: (a) and (d) red. Post-fix: 5/5. `test-ci-queue-wait-branch-absent.sh` still 3/3. - **Live validation:** the exact failing invocation (`--purpose push -B main` on jarvis-brain) now exits 0 with a truthful queue-clear line. **Not touched:** the .ps1's broader drift (it exits 0 on terminal-failure/unknown — pre-existing divergence from .sh, noted for a separate parity pass). 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_013SAYFkRhQfhguY7AHfiUC8
mos-dt-0 added 1 commit 2026-08-09 08:03:20 +00:00
Gitea's combined-status endpoint returns statuses:null (not []) plus a
synthetic aggregate state of "pending" for a commit with zero status
contexts (captured live 2026-08-09). The bash parser called that payload
malformed -> ASSERTED_NOT_READY exit 3, blocking every push to a CI-less
repo; hit twice by velma on two independent clones (shared checkout +
fresh sparse clone), proving it environment-independent.

- treat statuses:null as empty (both .sh and .ps1)
- classify zero contexts as no-status BEFORE consulting the synthetic
  aggregate state (both twins; honoring it would poll to timeout)
- no-status on --purpose push without --require-status is now queue-clear
  exit 0 (a repo with no CI has no queue), mirroring record_cannot_assert
  dispositions (push=degraded-pass, merge=hold); merge + --require-status
  stay fail-closed at exit 3
- red-first regression harness test-ci-queue-wait-no-status.sh (5 cases,
  incl. the verbatim live Gitea payload and a genuine-pending guard);
  branch-absent harness still green

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013SAYFkRhQfhguY7AHfiUC8
Some required checks failed
ci/woodpecker/pr/ci Pipeline failed
You are not authorized to merge this pull request.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin fix/ci-queue-wait-no-status:fix/ci-queue-wait-no-status
git checkout fix/ci-queue-wait-no-status
Sign in to join this conversation.