Skip to content

chore: promote dev → main (pipeline-capacity gate on PM status-changed)#1182

Merged
zbigniewsobiecki merged 1 commit intomainfrom
dev
Apr 24, 2026
Merged

chore: promote dev → main (pipeline-capacity gate on PM status-changed)#1182
zbigniewsobiecki merged 1 commit intomainfrom
dev

Conversation

@zbigniewsobiecki
Copy link
Copy Markdown
Member

Summary

Test plan

  • Dev CI green
  • Dev deploy green
  • Main CI green
  • Prod deploy green
  • Post-deploy: drop the temporary --max-concurrency 1 mitigation on ua-store implementation agent and verify a multi-card move only fires one implementation

🤖 Generated with Claude Code

…t backlog-manager) (#1181)

`maxInFlightItems` was only consulted at the two backlog-manager chain
sites (pr-merged, splitting auto-chain). PM `status-changed` triggers
fired `implementation` for every card moved into TODO with no capacity
check, so a human pushing N cards burst N parallel implementations
straight past the cap. Observed on prod ua-store with limit=1 → 3
implementations running concurrently.

This adds a shared gate (`shouldBlockForPipelineCapacity`) called from
the JIRA / Linear / Trello status-changed handlers. Only `implementation`
is gated — it's the only PM-status-reachable agent that consumes a TODO/
IN_PROGRESS/IN_REVIEW slot per `STATUS_TO_AGENT`. When the active
pipeline (excluding the just-moved card) is at the cap, the trigger
returns null and the card sits in its column until a slot frees, at
which point the existing `pr-merged → backlog-manager` chain picks it
up. Mirrors the behavior the backlog-manager gate already has.

Adds `isActivePipelineOverCapacity` next to the existing
`isPipelineAtCapacity` — same misconfigured/error fallbacks, but no
backlog-empty short-circuit (irrelevant here) and an `excludeWorkItemId`
arg so the card whose move just fired the webhook isn't double-counted.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@zbigniewsobiecki zbigniewsobiecki merged commit 27b4477 into main Apr 24, 2026
15 checks passed
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 24, 2026

Codecov Report

❌ Patch coverage is 96.26168% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/triggers/jira/status-changed.ts 90.90% 1 Missing ⚠️
src/triggers/linear/status-changed.ts 90.90% 1 Missing ⚠️
src/triggers/shared/backlog-check.ts 97.43% 0 Missing and 1 partial ⚠️
src/triggers/trello/status-changed.ts 90.90% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

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.

1 participant