Skip to content

feat(ui): extend TriggerConfig types to match all backend trigger variants#1108

Open
geoffjay wants to merge 2 commits intoissue-1095from
issue-1096
Open

feat(ui): extend TriggerConfig types to match all backend trigger variants#1108
geoffjay wants to merge 2 commits intoissue-1095from
issue-1096

Conversation

@geoffjay
Copy link
Copy Markdown
Owner

Replace TaskSourceConfig with full TriggerConfig covering all 14 backend trigger variants, rename Workflow.source_config to trigger_config, add helpers (getTriggerLabel, getTriggerCategory, getDefaultTriggerConfig), and update all consumers and test fixtures.

Closes #1096

@geoffjay geoffjay added the review-agent Used to invoke a review by an agent tracking this label label Apr 14, 2026
Copy link
Copy Markdown
Owner Author

@geoffjay geoffjay left a comment

Choose a reason for hiding this comment

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

Review: feat(ui): extend TriggerConfig types to match all backend trigger variants

Stack position: issue-1096 (#1108) stacked on issue-1095 (#1107). Parent #1107 is being reviewed simultaneously and has no blocking issues.

Overview

This PR does two things: renames source_configtrigger_config across all consumers, and expands the TriggerConfig type from 2 variants (github_issues, github_pull_requests) to 13 comprehensive variants matching the backend's TriggerConfig enum. Adds getTriggerLabel, getTriggerCategory, and getDefaultTriggerConfig helpers. Keeps TaskSourceConfig as a deprecated alias for backward compatibility.

What looks good

  • Exhaustive helpers: getTriggerLabel and getTriggerCategory use Record<TriggerType, ...> maps — if a new variant is added to the union and the record is not updated, TypeScript will error at compile time. getDefaultTriggerConfig uses a switch with no default case for the same reason. All three patterns enforce exhaustiveness correctly.
  • Deprecated alias: export type TaskSourceConfig = TriggerConfig preserves backward compat without keeping dead code around.
  • WorkflowDetail.sourceDetail expansion: The new switch properly handles all 13 variants. The default case falls back to getTriggerLabel which ensures future variants show something sensible rather than crashing.
  • Test updates: All 3 changed test files correctly update fixture data from source_config to trigger_config. Test descriptions are updated to match.

Non-blocking note

The section comment in orchestrator.ts says "covers all 14 backend trigger variants", but counting the union members: github_issues, github_pull_requests, cron, delay, webhook, manual, linear_issues, agent_lifecycle, agent_idle, dispatch_result, composite, queue, ask_response = 13 variants. The getTriggerLabel map also has 13 entries. The getDefaultTriggerConfig switch has 13 cases. Worth correcting the comment before merge to avoid confusion in later PRs.

Verdict

Solid type expansion. The rename is handled consistently across all consumers, helpers are exhaustively typed, and backward compat is maintained. LGTM pending the comment correction.

@geoffjay geoffjay added merge-queue Approved by reviewer, queued for merge by conductor and removed review-agent Used to invoke a review by an agent tracking this label labels Apr 17, 2026
- Replace TaskSourceConfig with full TriggerConfig discriminated union
- Add all 14 trigger types: github_issues, github_pull_requests, cron,
  delay, webhook, manual, linear_issues, agent_lifecycle, agent_idle,
  dispatch_result, composite, queue, ask_response
- Rename Workflow.source_config -> trigger_config (matches backend JSON)
- Rename CreateWorkflowRequest.source_config -> trigger_config
- Add getTriggerLabel, getTriggerCategory, getDefaultTriggerConfig helpers
- Keep TaskSourceConfig as deprecated alias for backward compat
- Update WorkflowForm, WorkflowTable, WorkflowDetail consumers
- Update all test fixtures to use trigger_config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-queue Approved by reviewer, queued for merge by conductor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant