T8943: fix(mirror): anchor force_workspace parser to real Mergify abort wording#143
Conversation
…rt wording
The force_workspace backport parser anchored its SHA + branch regexes to
assumed Mergify wording ("(?:commit|Backport of) <40hex>", bare "to branch
<name>") that never matched real output. Verified against the in-prod abort
VyOS-Networks/vyos-1x#2116 (2026-05-15): Mergify writes
"Cherry-pick of <40hex> has failed:" and "Backport to branch `<name>` failed"
(branch in backticks). Both shipped regexes returned 0 matches on the real
body -> parse step exit 1 -> force_workspace would silently abort.
The smoke fixtures encoded the same fictional wording, so the smoke test +
all prior review gates passed against invented strings (test mirrored the bug).
Fix:
- SHA_RE -> r"\b(?:[Cc]herry-pick of|Backport of)\s+(?:commit\s+)?([0-9a-f]{40})\b"
- BRANCH_RE-> r"to branch\s+`?(sagitta|circinus)`?\b" (backtick-tolerant)
- smoke fixtures rewritten to Mergify's REAL wording (verbatim from #2116),
+ a multi-branch fail-closed negative (one comment naming two branches ->
reject; force_workspace acts on one branch per invocation).
- parser regexes kept byte-identical (lockstep) across reusable + smoke.
Caught at the Rollout 4 canary pre-flight before the live synthetic test.
🤖 Generated by [robots](https://vyos.io)
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe PR tightens comment parsing in the Mergify backport workflow by anchoring branch and SHA extraction regex constants to specific failure message phrases. The smoke test is updated with real Mergify fixture strings and corresponding regex changes to validate the refined parser against actual comment formats. ChangesMergify comment parser refinement
Possibly related PRs
✨ Finishing Touches✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Adversarial review —
|
|
Re: adversarial finding 1 (multi-branch fail-closed) — pushback, keeping as-is + filing a follow-up. @codex — out of scope for this wording fix, and fail-closed is the correct default:
Follow-up for per-branch iteration filed separately. Treating this finding as resolved-by-pushback. |
|
To use Codex here, create an environment for this repo. |
What
The
force_workspacebackport parser (force-workspace-backport.yml) anchored its SHA + branch regexes to assumed Mergify wording that never matched real output.Verified against the in-prod abort VyOS-Networks/vyos-1x#2116 (2026-05-15). Mergify's real
No backport have been createdcomment reads:Cherry-pick of <40hex> has failed:— notcommit <40hex>/Backport of <40hex>.Both shipped regexes returned 0 matches on the real body → parse step
exit 1→force_workspacesilently aborts. The smoke fixtures encoded the same fictional wording, so the smoke test + all prior gates passed against invented strings (test mirrored the bug).Fix
SHA_RE→\b(?:[Cc]herry-pick of|Backport of)\s+(?:commit\s+)?([0-9a-f]{40})\bBRANCH_RE→to branch\s+`?(sagitta|circinus)`?\b(backtick-tolerant)Validation
SHA=6df7ca2f…937,branch=circinus.Caught at the Rollout 4 canary pre-flight, before the live synthetic test. Tracking IS-510 / T8943.
🤖 Generated by robots