Skip to content

feat: Linear integration for issue import and sync#4

Merged
Ghvstcode merged 1 commit intomainfrom
linear-integration
Mar 22, 2026
Merged

feat: Linear integration for issue import and sync#4
Ghvstcode merged 1 commit intomainfrom
linear-integration

Conversation

@Ghvstcode
Copy link
Copy Markdown
Owner

Summary

  • Adds a full Linear integration that imports issues as SUSTN tasks, syncs them on a configurable schedule, and links PRs back to Linear when work completes
  • New Integrations settings tab for API key management and connection testing
  • Per-project Linear sync config with team/project selection and schedule picker (manual, on launch, every 6h/12h/daily)
  • Linear-sourced tasks show identifier badges (e.g., SYN-460) that link back to Linear, sort to the top of the task list, and use Linear-style branch names (sustn/syn-460-improve-accounts-table)
  • Claude-based augmentation command (engine_augment_tasks) for enriching imported issues with codebase context
  • PR link-back: automatically posts a comment on the Linear issue when a PR is created

Changes

New files (6):

  • src/core/types/linear.ts — Types for Linear API + sync config
  • src/core/services/linear.ts — GraphQL API client
  • src/core/services/linear-sync.ts — Sync orchestration
  • src/core/db/linear-sync.ts — Sync config CRUD
  • src/core/api/useLinear.ts — TanStack Query hooks + auto-sync
  • src/ui/components/settings/sections/IntegrationsSection.tsx — Settings UI

Modified files (18):

  • Migrations 13 & 14, type extensions, DB layer updates, settings wiring, task UI badges, branch name generation, PR link-back in useEngine + TaskDetailView

Test plan

  • Go to Settings → Integrations, add a Linear API key, click "Test" → should show connected user name
  • Enable Linear, go to a project's settings → "Linear Sync" section appears
  • Select a team, optionally a project, click "Add" → sync config card appears
  • Click sync button → toast shows imported count, tasks appear at top of task list
  • Linear tasks show identifier badge (e.g., SYN-460), clicking opens Linear
  • Set schedule to "On launch" → restart app → auto-syncs on start
  • Start work on a Linear task → branch name uses Linear identifier style
  • Create PR for Linear task → comment appears on the Linear issue

Import issues from Linear as SUSTN tasks, with full lifecycle support
from sync through execution to PR link-back.

Core integration:
- Linear GraphQL API client (teams, projects, issues, comments)
- Sync orchestration with dedup by Linear issue ID
- Category inference from labels, effort from priority
- Configurable auto-sync schedule (manual, on launch, 6h/12h/daily)
- Auto-sync hook mounted in AppShell with interval checking

Data model:
- Migration 13: linear_issue_id, linear_identifier, linear_url on tasks
  + linear_sync_config table
- Migration 14: sync_schedule column on linear_sync_config
- TaskSource extended with "linear", GlobalSettings with Linear fields
- LinearSyncConfig, LinearSyncSchedule types

Settings UI:
- New "Integrations" tab with Linear API key input, test connection,
  enable/disable toggle
- Per-project Linear sync config: team/project selection, sync now
  button, schedule picker (pill-button style)

Task UI:
- Linear identifier badge (e.g., "SYN-460") on TaskRow and
  TaskDetailHeader, clickable to open in Linear
- Linear tasks sort to top of task list (lower sort_order)
- Linear-style branch names: "sustn/syn-460-improve-accounts-table"

Engine:
- engine_augment_tasks Rust command for Claude-based issue enrichment
- extract_json_array_raw public helper in scanner
- PR link-back: posts comment on Linear issue when PR is created
  (both auto-PR and manual)

New files:
- src/core/types/linear.ts
- src/core/services/linear.ts
- src/core/services/linear-sync.ts
- src/core/db/linear-sync.ts
- src/core/api/useLinear.ts
- src/ui/components/settings/sections/IntegrationsSection.tsx
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 22, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sustn Ready Ready Preview, Comment Mar 22, 2026 8:44pm

@Ghvstcode Ghvstcode merged commit 26a71e2 into main Mar 22, 2026
3 checks passed
@Ghvstcode Ghvstcode mentioned this pull request Mar 23, 2026
3 tasks
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