fix(fr-gate): pass items at or beyond the required stage#57
Open
aptracebloc wants to merge 1 commit into
Open
Conversation
The gate compared each item's kanban Status to the required stage with strict equality, so an item already further down the pipeline (e.g. in "Prod") was falsely BLOCKED when it reappeared in a later promotion's commit range — a staging promotion would reject a card that had already shipped to prod. Introduce a rank() for the pipeline stages and pass when the item's stage is >= the required stage. Unknown/"Cancelled" statuses return an empty rank and fall through to the original strict-equality check, preserving prior behavior (still blocked). Messages updated to "or later". Verified the comparison against the stage matrix (Prod vs Ready-for-staging → pass; FR-on-staging vs Ready-for-prod → block; Cancelled → block). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
|
👋 Heads-up — Code review queue is at 16 / 8 Above the WIP limit. The team convention is to review existing PRs before opening new work. Open PRs currently in Code review (oldest first):
Pull from review before opening new work. (This is a nudge from the kanban WIP check, not a block.) |
This was referenced Jun 16, 2026
Merged
Open
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The FR gate compared each item's kanban Status to the required stage with strict equality (
[ "$STATUS" = "$REQUIRED" ]). An item already further down the pipeline than the gate requires was therefore falsely blocked — e.g. a card inProdthat reappears in a later staging promotion's commit range fails aReady for staginggate even though it has already shipped past staging.This replaces the equality check with a pipeline rank comparison: an item passes when its stage is at or beyond the required stage.
Change
rank()helper enumerating the canonical kanban stages (Backlog … FR on dev → Ready for staging → FR on staging → Ready for prod → Prod).rank(status) >= rank(required), or on exact match.Cancelled) return an empty rank and fall through to the original strict-equality check — so they stay blocked, preserving prior behavior for anything outside the linear pipeline.Why this is safe
Test
Verified the comparison locally against the stage matrix:
YAML validated with
yaml.safe_load.Blast radius
Reusable workflow consumed by every repo's
fr-gate-callerat@main. Takes effect org-wide on merge. No input/interface changes — callers need no update.Context
Surfaced by tracebloc/averaging-service#115 (staging→main), where the prior develop→staging promotion's CI card (#98) sat in
Prodand falsely blocked the staging gate.🤖 Generated with Claude Code
Note
Medium Risk
Changes merge-blocking CI semantics org-wide for all promotion PRs; under-stage items still fail, but mis-ordered ranks in
rank()could incorrectly pass or block gates.Overview
The reusable FR gate workflow no longer requires an exact kanban Status match. Promotion PRs were failing when a linked item’s card had already moved past the gate (e.g. Prod in a staging promotion range) because the check used strict equality.
A
rank()helper maps linear pipeline stages from Backlog through Prod. An item passes whenrank(status) >= rank(required); unknown statuses (e.g. Cancelled) still use the old exact-match path so they stay blocked. Pass/fail and header comments now say “or later”, with clearer logging when an item passes because it is beyond the required stage.Blast radius: org-wide via reusable
fr-gatecallers; no workflow inputs changed.Reviewed by Cursor Bugbot for commit cbf0550. Bugbot is set up for automated code reviews on this repo. Configure here.