Skip to content

fix(auto-classify): sync Deploy env from Status instead of "set if unset" - #44

Merged
LukasWodka merged 1 commit into
developfrom
fix/auto-classify-sync-deploy-from-status
May 15, 2026
Merged

fix(auto-classify): sync Deploy env from Status instead of "set if unset"#44
LukasWodka merged 1 commit into
developfrom
fix/auto-classify-sync-deploy-from-status

Conversation

@LukasWodka

Copy link
Copy Markdown
Contributor

Summary

The "Deployment environment" board view was showing hundreds of Prod cards in the dev and staging columns — because Status and Deploy environment had silently drifted apart.

Audit on 2026-05-14 found 311 of 449 Prod items (69%) with a wrong Deploy environment value. Just synced them via GraphQL — but this PR closes the leak so it doesn't recur.

Root cause

advance-deploy-env updates both fields atomically on push events, but several other paths only touch Status:

  • kanban-closure-router on issue close → sets Status, never touches Deploy
  • Manual drag-and-drop on the board → updates Status only
  • One-off backfills → updated Status only

Auto-classify was a candidate to reconcile, but its Deploy section was conservative: only fill if unset, never overwrite. So drift accumulated.

Fix

Make Deploy environment a derived field — always sync from Status:

StatusDeploy environment
Backlog / Ready / In progress / Code review / Cancellednone
FR on dev / Ready for stagingdev
FR on staging / Ready for prodstaging
Prodprod

The cron runs every 10 min and now overwrites Deploy when it doesn't match the column. advance-deploy-env still does the immediate update on push events — this cron is the safety net for everything else.

Test plan

  • After merge: kick off auto-classify via workflow_dispatch → verify zero items mutated (board is now clean)
  • Manually drag an item from FR on dev to Backlog on the board → wait 10 min → verify Deploy env flips from dev to none
  • Close an issue as completed → verify Status=Prod and Deploy env=prod within 10 min

🤖 Generated with Claude Code

…set"
Status is the source of truth for an item's location in the deploy
pipeline; Deploy environment should always track it. Previously the
cron only filled Deploy when unset and never reconciled drift, which
meant items whose Status got updated by paths other than
advance-deploy-env (closure-router on issue close, manual drag-and-
drop, one-off backfills) ended up with stale Deploy values.
Audit on 2026-05-14 found 311 of 449 Prod items pointing at the wrong
Deploy environment — the "Deployment environment" board view was
showing hundreds of Prod cards in the dev/staging columns.
Mapping (Status -> Deploy env):
Backlog / Ready / In progress / Code review / Cancelled -> none
FR on dev / Ready for staging -> dev
FR on staging / Ready for prod -> staging
Prod -> prod
advance-deploy-env still does the immediate update on push events;
this cron is the safety net for everything else.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@LukasWodka
LukasWodka merged commit 7239e57 into developMay 15, 2026
3 checks passed
@LukasWodkaLukasWodka added bug Something isn't working work-type:bug Defect or regression labels Jun 8, 2026
@LukasWodka
LukasWodka deleted the fix/auto-classify-sync-deploy-from-status branch August 1, 2026 21:45
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugSomething isn't workingwork-type:bugDefect or regression

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@LukasWodka@aptracebloc