fix(git): ci-queue-wait.sh — parse the payload it was handed, not stdin (#1019) #1023
Open
mos-dt-0
wants to merge 2 commits from
fix/1019-queue-guard-stdin into main
pull from: fix/1019-queue-guard-stdin
merge into: :main
:main
:remediation/state
:feat/rm-02-gate-registry
:fix/rm-01-reproducible-checkout
:remediation/mission-setup
:fix/hygiene-inert-format-gate
:fix/1019-queue-guard-stdin
:feat/mos-ste-writing-standard
:fix/1007-suite-hermeticity
:fix/991-comment-url-scheme-normalise
:feat/push-guard-null-case-verification
:mos-comms-live
:docs/heartbeat-framework-layering-ms-lead
:feat/869-c4-version-coupling
:feat/869-c2-install-ordering-guard
:feat/869-c5-doctor-activation-check
:feat/per-agent-gitea-identity
:fix/875-belongs-case-insensitive-slug
:fix/ci-queue-wait-404-branch-absent
:feat/869-c1-activation-probe
:feat/869-c3-broker-supervisor
:fix/865-tea-cli-comment-invocation
:feat/glpi-skills
:fix/860-deflake-mutator-lease-gate
:fix/850-detect-platform-port-normalization
:fix/856-worktree-deps-preflight
:fix/835-pr-review-approve-reject-comment-flag
:fix/848-truthful-evidence
:fix/812-pr-review-comment
:fix/849-recovery-runtime-fixture-race
:docs/758-ledger-m5-001-sync
:feat/834-tc-server-side-doc
:feat/833-constrained-recovery-command
:feat/827-gate0-probe
:governance/gate0-probe3-amendment
:fix/795-codex-pr-diff
:fix/795-ci-base-jq
:fix/795-ci-base-git
:feat/791-pr3-fleet-regen
:feat/791-pr2-snapshot-restore
:fix/807-glpi-206
:fix/808-agent-send-false-sender
:feat/791-upgrade-config-protection
:feat/790-mosaic-yolo-claudex-pr2
:feat/790-mosaic-yolo-claudex
:feat/758-v1-v2-migrator
:fix/766-exact-fleet-comms
:test/758-reconciler-lifecycle-gates
:docs/771-kbn101-db-role-split
:test/758-example-profile-dispositions
:feat/758-shared-role-resolution
:feat/mos-logical-identity-fencing
:feat/769-kbn100-unified-schema
:docs/753-kbn010-threat-gate
:feat/758-roster-v2-compiler
:feat/756-official-discord-plugin
:docs/758-fleet-config-management
:fix/mos-option2-qualification-format
:docs/issue-758-m0
:docs/mos-option2-qualification
:mos-comms
:feat/tess-interaction-agent
:fix/tess-docs-format
:next
:draft/mosaic-platform-prd
:fix/installer-provider-gate-and-local-gateway-redis
:release/mosaic-cli-0.0.37
:feat/framework-constitution-alpha
:fix/git-wrapper-repo-detection
:fix/woodpecker-wrapper-legacy-mosaic
:fix/t-a292e96f-gitea-pr-metadata
:fix/gitea-pr-metadata-login-t-a292e96f
:fix/t_a292e96f-pr-metadata-gitea
:fix/t_3a368a52-gitea-usc-login
:fix/bootstrap-hotfix
:fix/populate-known-packages-list
:fix/idempotent-init
2
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
f63340802c |
merge: origin/main into fix/1019-queue-guard-stdin (union on test:framework-shell)
ci/woodpecker/pr/ci Pipeline was successful
Both sides edited the single `test:framework-shell` line additively and did not overlap: main prepended the test-enumeration guard pair (check-test-enumeration.sh, test-check-test-enumeration.sh); this branch inserted test-ci-queue-wait-parse.sh after test-ci-queue-wait-branch-absent.sh. Resolved as the union — main's line with this branch's one insertion restored. Main's new guard makes that insertion mandatory rather than cosmetic: the test file ships in this branch, so leaving it unenumerated would fail the guard. Co-authored-by: mos-dt-0 <[email protected]> |
||
|
|
505b6f799c |
fix(git): ci-queue-wait.sh — parse the payload it was handed, not stdin (#1019)
ci/woodpecker/pr/ci Pipeline was canceled
Both python sites piped a status payload into `python3 - <<'PY'`. The heredoc binds stdin to the program text, so `json.load(sys.stdin)` saw EOF, the bare `except` fired, and the parser returned "unknown" for every input — success, pending and failure alike. "unknown" then reaches a silent `exit 0` arm. Consequence: the gate-6 queue guard has never made a determination. It exits 0 on every invocation, on both the gitea and github paths (one shared parser). The pending wait loop, --require-status and the 124 timeout were all unreachable code. What it still validated was connectivity — an unresolved token, head sha, or platform could exit 1. Fix is the one already shipped in the sibling: capture the payload with `payload=$(cat)` before invoking python, pass it by environment. pr-ci-wait.sh:38 has carried a comment describing this exact bug — "yielding EOF and returning unknown every time" — along with the remedy. It was never backported to the sibling the constitution makes mandatory before every push and merge. Adds test-ci-queue-wait-parse.sh, enumerated in test:framework-shell. Every assertion is on the RETURNED STATE STRING; a suite asserting only rc=0 passes against the broken build, which is how this survived. Verified by mutation: against the pre-fix wrapper the suite fails 10 of 14, and the four that pass are the four for which passing is correct (the undecodable-input control, the unknown-vocabulary case, and both needle halves). The needle scans with heredoc semantics rather than matching text. `json.load(sys.stdin)` is correct under `python3 -c`, where the program comes from argv and stdin really is the payload — ci-queue-wait.sh uses that form legitimately in gitea_get_branch_head_sha. A flat grep flags that innocent site; the scanner names only the two defective ones. Out of scope, deliberately, and recorded on #1019: token-in-argv (ps-visible) and the hardcoded BRANCH="main". Bundling them would make a safety-critical parse fix harder to review. Refs #1019 |