feat(triggers): onCreate/onMove params for pm:status-changed#1144
Closed
zbigniewsobiecki wants to merge 1 commit intofeature/pm-triggers-created-statusfrom
Closed
Conversation
Make the create-path firing (added by PR #1141) independently configurable per agent via the existing declarative YAML/CLI/dashboard pipeline. Two boolean params on pm:status-changed: - onMove (default true) — fire when an item is moved into the status - onCreate (default false) — fire when an item is created in the status Linear and JIRA: preserve pre-#1141 behavior by default; users opt in explicitly. Trello: data migration backfills onCreate=true for existing projects so fire-on-create keeps working without silent regression. Also tightens create-path matches() to require status presence, restores fromStatus in JIRA update-path log, de-dups the JIRA test helper's ternary, and extracts resolveAgentType/shouldFireOnEvent helpers to keep handler complexity in check. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
3 tasks
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
Follow-up on top of #1141. Makes the create-path firing that #1141 added for Linear/JIRA independently configurable per agent, and preserves pre-#1141 behavior as the default.
Two new boolean params on
pm:status-changedonMovetrueonCreatefalseDefaults by provider (preserved)
onCreate: false. Users who want the create-path fire agents must opt in via dashboard checkbox orcascade projects trigger-set --params '{"onCreate":true}'. This preserves pre-feat(triggers): support PM triggers for work items created directly in a triggering status #1141 behavior.0050backfills{onCreate: true, onMove: true}into every existing Trello project's enabledpm:status-changedrow. Idempotent, preserves user-set keys via JSONB||operator.Zero UI / CLI code
Rides on the existing declarative trigger-param pipeline:
TriggerParameterInputalready renderstype: booleanparams as checkboxes (web).cascade projects trigger-set --paramsalready accepts flat primitive JSON.cascade projects trigger-discoverauto-prints the new params from YAML.Review-addressed issues from PR #1141
matches()asymmetry → create path now pre-filters on status presence (Linear:data.stateId; JIRA:issue.fields.status.name), mirroring update path.fromStatuslog → restored on JIRA update path; explicitly omitted on create path (nofrom).buildCtxternary de-duplicated; the redundant manualissueoverride dropped.resolveAgentTypeandshouldFireOnEventhelpers to keep biome's cognitive-complexity warnings at bay.Shape of changes
src/agents/definitions/{splitting,planning,implementation,backlog-manager}.yaml— addonCreate+onMoveparams to eachpm:status-changedentry.src/triggers/{linear,jira,trello}/status-changed.ts— switch tocheckTriggerEnabledWithParams, gate create/move branches on params, tighten creatematches().src/db/migrations/0050_trello_status_changed_on_create_backfill.sql— backfill existing Trello projects.tests/unit/triggers/{linear,jira,status,merged}-status-changed.test.ts— matrix tests for (onCreate × onMove) × (create × move).tests/integration/db/trelloStatusChangedBackfill.test.ts— 7 tests exercising the migration (Trello backfill, Linear/JIRA untouched, idempotent, preserves user-set keys).Test run
Test plan
🤖 Generated with Claude Code