Skip to content

feat: multi-project/team support for Linear, Jira, and ADO#2806

Closed
harry-miller-trimble wants to merge 1 commit intosteveyegge:mainfrom
harry-miller-trimble:feat/multi-project-all
Closed

feat: multi-project/team support for Linear, Jira, and ADO#2806
harry-miller-trimble wants to merge 1 commit intosteveyegge:mainfrom
harry-miller-trimble:feat/multi-project-all

Conversation

@harry-miller-trimble
Copy link
Copy Markdown
Contributor

Summary

Adds multi-project/team support to all three tracker integrations (Linear, Jira, ADO) with shared infrastructure to keep the logic DRY.

Closes #2791

Supersedes #2804 and #2805.

Shared Infrastructure (internal/tracker/multiproject.go)

Reusable helpers all trackers compose:

  • ParseCommaSeparated(s) — splits comma-separated config, trims whitespace
  • DeduplicateStrings(ss) — removes duplicates preserving order
  • ResolveProjectIDs(cli, plural, singular) — config precedence: CLI flag > plural key > singular key

Used by Linear's Init(), Jira's Init(), ADO's getADOConfig(), and all three CLI layers.

Linear Changes

Aspect Before After
Struct client *Client clients map[string]*Client
Config linear.team_id + linear.team_ids / LINEAR_TEAM_IDS
CLI --team ID1,ID2 flag
FetchIssues Single team Iterates all teams, deduplicates
UpdateIssue Single client Routes to owning team
Push Implicit Requires --team when multiple teams

Jira Changes

Aspect Before After
Struct projectKey string projectKeys []string
Config jira.project + jira.projects / JIRA_PROJECTS
CLI --project KEY1,KEY2 flag
FetchIssues project = "PROJ" project IN ("PROJ1", "PROJ2") — single query
CreateIssue Single project Targets primary (first) project

ADO Changes

Aspect Before After
Struct project string projects []string
Config ado.project + ado.projects / AZURE_DEVOPS_PROJECTS
CLI --project PROJ1,PROJ2 flag
FetchIssues TeamProject = 'X' TeamProject IN ('X','Y') — single query
CreateIssue Single project Targets primary (first) project

Tests

  • internal/tracker/multiproject_test.go: ParseCommaSeparated, DeduplicateStrings, ResolveProjectIDs
  • internal/linear/tracker_test.go: Multi-team Validate, SetTeamIDs, TeamIDs, PrimaryClient
  • cmd/bd/linear_test.go: linearConfigToEnvVar (team_ids mapping)
  • Updated: ADO and Jira tests for plural struct fields

Backward Compatibility

  • All singular config keys (linear.team_id, jira.project, ado.project) still work
  • Single-project/team users see zero behavioral change
  • JSON output adds plural fields alongside existing singular fields

Add support for syncing issues across multiple projects/teams in all
three tracker integrations, with shared infrastructure to avoid
duplicating logic.

Shared infrastructure (internal/tracker/multiproject.go):
- ParseCommaSeparated: splits comma-separated config values
- DeduplicateStrings: removes duplicates preserving order
- ResolveProjectIDs: config precedence (CLI > plural > singular)

Linear (closes steveyegge#2791):
- Tracker: map[string]*Client with per-team routing
- FetchIssues iterates all teams, deduplicates by issue ID
- UpdateIssue routes to owning team via FetchIssueByIdentifier
- Config: linear.team_ids / LINEAR_TEAM_IDS + --team flag

Jira:
- projectKey string → projectKeys []string
- FetchIssues uses JQL IN clause (single query, no iteration)
- Config: jira.projects / JIRA_PROJECTS + --project flag

ADO:
- project string → projects []string
- WIQL uses TeamProject IN clause (single query)
- Config: ado.projects / AZURE_DEVOPS_PROJECTS + --project flag

All singular config keys remain supported for backward compatibility.

Co-authored-by: Copilot <[email protected]>
@steveyegge
Copy link
Copy Markdown
Owner

Fix-merged to main. Great work on multi-project support!

@steveyegge steveyegge closed this Mar 28, 2026
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.

linear sync: support multiple team IDs

2 participants