Skip to content

feat: Multi-provider issue system for Forge (GitHub Issues + Linear)#41

Draft
dasirra wants to merge 11 commits into
developfrom
build/39-feat-multi-provider-issue-system
Draft

feat: Multi-provider issue system for Forge (GitHub Issues + Linear)#41
dasirra wants to merge 11 commits into
developfrom
build/39-feat-multi-provider-issue-system

Conversation

@dasirra
Copy link
Copy Markdown
Owner

@dasirra dasirra commented Mar 25, 2026

Summary

Adds a pluggable provider abstraction to Forge so each project can pull issues from the tracker where they already live. Implements Linear alongside the existing GitHub Issues source, with PRs continuing to go to GitHub regardless of provider.

Source

Closes #39

What Changed

Provider abstraction

  • New agents/forge/providers/ directory with a 3-function interface: provider_fetch_issues, provider_get_issue, provider_has_open_pr
  • agents/forge/providers/github.sh — wraps gh CLI (extracts current inline logic)
  • agents/forge/providers/linear.sh — uses curl + Linear GraphQL API; normalizes output to match GitHub format; handles HTTP errors and GraphQL-level errors; validates LINEAR_API_KEY

Forge behavior (backwards-compatible)

  • agents/forge/AGENTS.md — issue selection now sources the correct provider script based on provider config field (defaults to "github"); validates linearProject is set before fetching; provider_has_open_pr always checks GitHub
  • agents/forge/SOUL.md — updated identity description and added providers/ path
  • agents/forge/config.example.json — shows both github and linear project examples with provider and linearProject fields

Installer

  • installer/linear.sh — collects and validates Linear API key via GraphQL viewer query
  • installer/manifest.json — adds linear as optional integration for Forge
  • install.sh — sources linear.sh, tracks INTG_STATUS_linear, adds optional Linear setup flow and summary line
  • .env.example — adds LINEAR_API_KEY entry

Tests

  • tests/github-provider.bats — 10 tests covering all 3 provider functions with mocked gh CLI
  • tests/linear-provider.bats — 8 tests covering fetch, normalization, error handling, and PR check delegation

Tasks

Task Status Notes
Provider scripts (github.sh + linear.sh) DONE
AGENTS.md + config + SOUL.md updates DONE
Installer (linear.sh + manifest + install.sh + .env.example) DONE
Tests (github-provider + linear-provider) DONE 103/103 passing
Code review fixes DONE Null project guard, GraphQL error detection, path injection fix, login field removal

Code Review

Review found and fixed:

  • Null project guard: Linear API returns {"project": null} for invalid UUIDs — added Python guard with diagnostic error message
  • GraphQL error detection: HTTP 200 with {"errors":[...]} was silently treated as empty — _linear_graphql now checks and exits with message
  • Path injection: open('$body_file') in Python -c string replaced with stdin (< "$body_file")
  • Invalid API field: login is GitHub-specific; removed from Linear viewer query (was causing always-unverified validation)
  • SOUL.md providers/ path entry added
  • AGENTS.md: linearProject validation and provider_get_issue reserved-use note added

Built autonomously by /build

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