fix(advance-deploy-env): monotonic Status — never demote a shipped card - #96
Merged
Conversation
A push routinely carries commits that already shipped further down the pipeline: a staging->develop back-merge re-pushes Prod PRs to develop, and a develop==main fast-forward does the same. advance-deploy-env blindly set every PR in the push to the branch's column, un-shipping those cards (seen live: .github #87/#88/#89/#92 stranded at On dev after yesterday's ff, #95 demoted from Prod today; engine#540's back-merge would demote its whole staging history next). Now the per-PR query also reads the current Status and the update is skipped unless the target rank is strictly higher. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 71ad33e. Configure here.
| if [ "$TARGET_RANK" -gt 0 ] && [ "$(rank "$CURRENT_STATUS")" -ge "$TARGET_RANK" ]; then | ||
| echo "::notice::#$prnum already at '${CURRENT_STATUS:-none}' (>= '$STATUS_NAME') -- not demoting" | ||
| continue | ||
| fi |
There was a problem hiding this comment.
Deploy env skipped on status match
High Severity
The early continue when Status is already at or beyond the target also skips the Deploy environment update. kanban-closure-router intentionally sets Status first on PR merges, so this equal-rank path will leave Deploy environment unset on ordinary develop/staging/main merges. This workflow is the only writer of that field.
Reviewed by Cursor Bugbot for commit 71ad33e. Configure here.
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.


Back-merges (staging→develop, e.g. tracebloc-engine#540) and develop==main fast-forwards re-push commits whose PRs already shipped.
advance-deploy-envset every PR in the push to the branch's column, demoting Prod cards to On dev — seen live on .github #87/#88/#89/#92 (yesterday's ff) and #95 (today's). Fix: read each item's current Status and only update when the target rank is strictly higher (rank mirrors fr-gate's). Archived-skip and per-item error isolation unchanged.Live regression test after promotion: fast-forward develop to main and verify the promo PR's card stays at Prod (pre-fix it got demoted to On dev).
🤖 Generated with Claude Code
Note
Low Risk
Scope is GitHub Actions kanban automation only; behavior change prevents incorrect demotions without touching application or deploy code.
Overview
advance-deploy-envno longer overwrites kanban Status (and skips the whole per-PR update) when a card is already at the same or a later pipeline stage than the branch’s target—fixing Prod → On dev regressions on develop pushes that only replay already-shipped commits (back-merges, develop==main fast-forwards).The workflow now loads each project item’s current Status via GraphQL, compares ranks using a
rank()helper aligned withfr-gate, and only advances when the target rank is strictly higher; otherwise it logs a notice and leaves the card unchanged. Header comments document monotonic advancement.Reviewed by Cursor Bugbot for commit 71ad33e. Bugbot is set up for automated code reviews on this repo. Configure here.