feat(forge): add Linear provider with hybrid fallback to GitHub#716
feat(forge): add Linear provider with hybrid fallback to GitHub#716timeleft-- wants to merge 3 commits intocluesmith:mainfrom
Conversation
Linear handles issue concepts (view, list, comment, recently-closed, auth-status, user-identity) while PR concepts fall through to GitHub. Key changes: - Fix buildPresetFromScripts to skip missing scripts instead of setting null, enabling hybrid providers that only implement a subset of concepts - Register linear provider in getProviderPresets - Pass forge config keys as CODEV_ env vars (e.g. linear-team → CODEV_LINEAR_TEAM) - Widen issueNumber types to accept alphanumeric identifiers (ENG-123) - Add 6 POSIX sh scripts for Linear GraphQL API Co-Authored-By: Claude Opus 4.6 <[email protected]>
|
Younes, this is a genuinely thoughtful contribution — thank you for taking this on. The insight that drives the whole PR is excellent: a "hybrid" forge model where Linear handles issues and GitHub handles PRs is exactly right, and the way you unlocked it via A few suggestions that I think would make it even stronger: 1. The DB layer needs to come along for the ride. The widening of
SQLite is flexible enough that storing 2. One spot in porch silently swallows alphanumeric IDs. 3. Two small Linear API issues in the scripts:
4. Could you add a few unit tests? The headline fix in 5. One process note: the spec/plan files are numbered The hybrid forge concept is a real contribution — once these pieces land, this opens the door to all sorts of combos (Jira+GitHub, GitHub+GitLab during migrations, etc.). Looking forward to merging. |
…ripts, tests 1. Migrate issue_number column from INTEGER to TEXT (schema, types, migration v8) so alphanumeric identifiers like "ENG-123" persist correctly through the DB layer. 2. Drop parseInt guard in porch getProjectSummary so alphanumeric project IDs route through fetchIssue instead of silently skipping. 3. Fix Linear scripts: recently-closed.sh uses updatedAt (valid enum value) instead of completedAt; issue-view.sh guards against empty result set with explicit error. 4. Add unit tests for Linear provider preset behavior (omission fallthrough, not null) and alphanumeric issue identifiers in spawn validation and mode detection. 5. Renumber spec/plan from 695 to 719 to match GitHub issue cluesmith#719. Co-Authored-By: Claude Opus 4.6 <[email protected]>
|
Beautiful work on the revisions, Younes — the migration v8, the jq guard in
Both are quick test updates. Once those go green, this is good to merge from my end. |
|
Addressed in 4938cf7: updated the stale project-summary assertions so numeric-looking project IDs are passed through as strings, and non-numeric IDs still call fetchIssue before returning null.\n\nValidation: |
Summary
buildPresetFromScriptsnow skips concepts without scripts instead of setting null, enabling hybrid providers that implement only a subset of concepts (e.g., issues only) while letting unimplemented concepts fall through to the GitHub default.linear-team) are exported asCODEV_LINEAR_TEAMto scripts.ENG-123throughout agent-farm CLI and type system.Test plan
pnpm run build)pnpm test)LINEAR_API_KEY=<key> sh scripts/forge/linear/issue-view.shwithCODEV_ISSUE_ID=ENG-123returns valid JSONafx spawn ENG-123 --protocol spirparses the identifier correctlycodev doctorshows linear as a known provider🤖 Generated with Claude Code