Skip to content

Enhance kanban workflow with multi-stage validation and fixes#39

Merged
LukasWodka merged 6 commits into
mainfrom
develop
May 6, 2026
Merged

Enhance kanban workflow with multi-stage validation and fixes#39
LukasWodka merged 6 commits into
mainfrom
develop

Conversation

@saadqbal

@saadqbal saadqbal commented May 4, 2026

Copy link
Copy Markdown
Contributor

Note

Medium Risk
Adds new required-check workflow logic that can block promotions to staging/main if kanban statuses are mis-set, and changes how Status is auto-advanced on deploy/closure. Risk is mainly operational (workflow misconfiguration or missing project options) rather than code/runtime impact.

Overview
Updates the kanban automation to a multi-stage validation flow, setting Status to FR on dev/FR on staging/Prod based on deploy branch pushes (via advance-deploy-env.yml) and updating closure routing defaults from Done/Functional review to the new statuses.

Adds two new reusable workflows plus per-repo callers: an FR gate that blocks promotion PR merges unless all included items are in Ready for staging/Ready for prod (with an explicit skip-fr-gate label override), and a /fr-pass comment handler that advances items from FR on devReady for staging and FR on stagingReady for prod with reaction feedback.

Minor: removes unneeded pull-requests: write permissions from wip-limit-check.yml.

Reviewed by Cursor Bugbot for commit 6558ebd. Bugbot is set up for automated code reviews on this repo. Configure here.

LukasWodka and others added 5 commits April 30, 2026 16:07
…yPullRequestsReferences

The previous PR's promotion accidentally pushed an empty file. Restoring full
workflow content + applying the intended issue-completed → mirror closing PR
status fix using closedByPullRequestsReferences (handles 'Closes #N' auto-closes
where ClosedEvent.closer returns Commit, not PullRequest).
#38)

* feat(kanban): split Functional review into multi-stage validation flow

Replaces the single "Functional review" column with four distinct states
that mirror the actual deploy pipeline:

  Code review → FR on dev → Ready for staging → FR on staging
              → Ready for prod → Done

Changes:
- advance-deploy-env.yml: now flips Status on develop/staging pushes too
  (previously only on main/master). develop → "FR on dev",
  staging → "FR on staging", main/master → "Done".
- kanban-closure-router.yml: routes merged PRs to the matching FR column
  by base branch (develop/staging/main).
- fr-pass-comment.yml (new): listens for "/fr-pass" PR comments from repo
  collaborators and advances FR-on-dev → Ready-for-staging or
  FR-on-staging → Ready-for-prod. Reacts 👍/👎 on the comment.
- fr-pass-comment-caller.yml (new): per-repo template for adoption.

The two "Ready for …" columns make deploy-cadence delays visible —
cards stuck there mean the next promotion (develop → staging or
staging → prod) is overdue.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(kanban): rename Done→Prod and gate promotions on Ready-for-X

Two changes layered on top of the multi-stage FR flow:

1. Rename "Done" column → "Prod" — option ID preserved (98236657),
   so existing items already on it stay put.

2. New fr-gate.yml workflow (with caller template):
   - PR target = staging  → all contained items must be in "Ready for staging"
   - PR target = main/master → all contained items must be in "Ready for prod"

   Item discovery uses the same commit-subject scan as advance-deploy-env
   (squash-merge "(#NNN)" + "Merge pull request #NNN") so we check every
   PR rolled into the promotion, not just the promotion PR itself.

   Failure mode: status check exits 1 with a clear "how to unblock"
   message. Override with the "skip-fr-gate" label for emergencies — the
   label is deliberately visible so we can audit overrides.

   Configured as a required status check via branch protection on
   staging + main/master so the merge button stays grey until the gate
   passes.

Workflow text updates: advance-deploy-env.yml + kanban-closure-router.yml
now use "Prod" everywhere they previously referenced "Done".

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…#37)

The reusable workflow declared `permissions: pull-requests: write` on
its job. Callers (e.g. tracebloc-py-package) don't grant that, and
GitHub forbids called workflows from elevating GITHUB_TOKEN scope, so
the workflow short-circuited to `startup_failure` before any step ran.

The block is also unnecessary: this workflow doesn't use GITHUB_TOKEN
at all — `gh pr comment` runs under `secrets.PROJECTS_KANBAN_TOKEN`
(a PAT). Removing the block restores startup parity with the other
reusable workflows in this repo, none of which declare a permissions
block.

Verified locally that py-package PR #117 hit startup_failure with the
old YAML; all sibling reusables (set-pr-status, add-to-kanban, etc.)
have no permissions block and run fine.
Comment thread .github/workflows/fr-gate.yml Outdated
Cursor Bugbot caught (high severity): the trailing
  [ -n "$MISSING" ] && echo "..."
fails the workflow step when MISSING is empty (the success path)
because `[ -n "" ]` returns exit 1 under `set -e`, short-circuiting
the && chain and becoming the script's exit code.

Replace with an explicit `if`. Empty MISSING (everything found on
kanban) now correctly exits 0.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

@LukasWodka LukasWodka left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving — this PR clears the critical Done→Prod mismatch on main (closure-router and advance-deploy-env have been failing for ~24h on every merge to main) and includes the Bugbot fix for fr-gate.yml. Verified the develop branch contents and column alignment on the project board.

@LukasWodka LukasWodka merged commit 5dfc9b3 into main May 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants