Skip to content

feat(orchestrator): add LinearIssues variant to TriggerConfig#482

Open
geoffjay wants to merge 6 commits intomainfrom
issue-473
Open

feat(orchestrator): add LinearIssues variant to TriggerConfig#482
geoffjay wants to merge 6 commits intomainfrom
issue-473

Conversation

@geoffjay
Copy link
Owner

Summary

  • Adds LinearIssues variant to TriggerConfig with five optional filter fields: team_key, project, status, labels, assignee
  • trigger_type() returns "linear_issues" (snake_case, consistent with all existing variants)
  • is_implemented() converted from matches! to an explicit match — returns false for LinearIssues until LinearIssueSource is implemented in Implement LinearIssueSource task source #475
  • Explicit LinearIssues arm added to the API validation match in scheduler/api.rs (no field-level validation yet since all fields are optional)
  • display_workflow() in the CLI prints each non-empty Linear field

Test plan

  • cargo build -p orchestrator -p cli — clean, no warnings
  • cargo clippy -p orchestrator -p cli — clean
  • 4 new unit tests: trigger_type, full serde deserialization, minimal/default serde, and roundtrip serialization
  • Existing 234 orchestrator tests all pass (3 pre-existing macOS sandbox failures in client::tests unrelated to this change)

Closes #473

🤖 Generated with Claude Code

Introduces the LinearIssues trigger backend as a foundational type for
the Linear integration epic (#472). All fields are optional so workflows
can narrow by team, project, status, labels, and assignee without
requiring every filter to be set.

Changes:
- scheduler/types.rs: new LinearIssues variant with team_key, project,
  status, labels, and assignee fields; all serde-defaulted to None/empty
- trigger_type() returns "linear_issues" (snake_case, consistent with
  existing variants)
- is_implemented() converted from matches\! to explicit match and returns
  false for LinearIssues until LinearIssueSource lands in issue #475
- scheduler/api.rs: explicit LinearIssues arm in the validation match
  (no field-level validation yet — all fields optional)
- cli/orchestrator.rs: display_workflow() arm prints each non-empty field;
  four new unit tests covering trigger_type, serde with full fields,
  serde with defaults, and roundtrip serialization

Closes #473

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@geoffjay geoffjay added the review-agent Used to invoke a review by an agent tracking this label label Mar 18, 2026
Copy link
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.

Good foundational change for the Linear integration epic. The type definition is clean, serde defaults are correct, and the explicit match in is_implemented() is a clear improvement over the old matches! macro — the compiler will now catch any future unhandled variant at compile time.

Two issues worth addressing before or alongside issue #475:

1. Stale error message in api.rs (minor, pre-existing but now misleading)

The rejection message for unimplemented trigger types reads:

"Currently supported: github_issues, github_pull_requests, cron, delay"

That list was already wrong (missing agent_lifecycle, dispatch_result, webhook, manual), but it becomes actively misleading now that linear_issues will trigger it. A caller who POSTs a linear_issues workflow will receive an error claiming only those four types are supported. The message should either enumerate all currently implemented types or be reworded generically (e.g. "check the documentation for currently supported trigger types").

2. Test placement (maintainability)

The four new tests (test_trigger_config_linear_issues_*) are in crates/cli/src/commands/orchestrator.rs but they test pure type behaviour — serde round-trips, trigger_type(), and is_implemented() — with no CLI dependency at all. They belong in crates/orchestrator/src/scheduler/types.rs alongside the existing test_trigger_config_is_implemented test. Having type-level tests in the CLI crate makes them harder to find and means a cargo test -p orchestrator run will miss them.


Everything else looks correct: no unwrap() on fallible paths, all fields properly #[serde(default)]-annotated, is_one_shot() correctly returns false for LinearIssues via the existing matches!(self, Delay {..}), and the display_workflow arm handles all optional fields safely with if let Some / !is_empty() guards.

@geoffjay geoffjay removed the review-agent Used to invoke a review by an agent tracking this label label Mar 18, 2026
@codecov
Copy link

codecov bot commented Mar 19, 2026

Codecov Report

❌ Patch coverage is 20.00000% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 55.36%. Comparing base (d5e7cc7) to head (c399df6).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
crates/cli/src/commands/orchestrator.rs 0.00% 12 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #482      +/-   ##
==========================================
- Coverage   55.39%   55.36%   -0.03%     
==========================================
  Files         126      126              
  Lines       13518    13533      +15     
==========================================
+ Hits         7488     7493       +5     
- Misses       6030     6040      +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

geoffjay and others added 5 commits March 20, 2026 10:58
- Replace stale trigger-type list in api.rs rejection message with a
  generic "see documentation" phrasing
- Move four test_trigger_config_linear_issues_* tests from cli crate to
  orchestrator/src/scheduler/types.rs where they belong alongside the
  other TriggerConfig unit tests

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Bump aws-lc-rs 1.16.1 -> 1.16.2 (and aws-lc-sys 0.38.0 -> 0.39.0) to
  fix RUSTSEC-2026-0044 (X.509 Name Constraints bypass)
- Add RUSTSEC-2026-0002 (lru IterMut unsoundness) to audit.toml ignore
  list; proper fix requires upgrading lancedb past 0.16 which is tracked
  in #543

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Bump rustls-webpki 0.103.8 -> 0.103.10 (Cargo.lock) to address
  RUSTSEC-2026-0049 (CRL matching bypass)
- Ignore RUSTSEC-2026-0049 and RUSTSEC-2026-0002 in audit.toml for the
  remaining rustls-webpki 0.101.7 and lru 0.12.5 findings; both are
  transitively locked by lancedb 0.16 and cannot be resolved without the
  lancedb upgrade tracked in #543

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

Add LinearIssues variant to TriggerConfig

1 participant