feat: make GitHub Issues a first-class task source#28
feat: make GitHub Issues a first-class task source#28SiyuQian merged 3 commits intoSiyuQian:mainfrom
Conversation
The GitHub Issues backend was already fully implemented in the taskrunner package (GitHubSource, TaskSource interface, --source flag), but it was essentially invisible: the README didn't document it for 'devpilot run', Trello was listed as a hard prerequisite, and 'devpilot init' had no awareness of it. This commit closes that gap so developers who already use GitHub can start using DevPilot without signing up for Trello. Changes: - README: rewrite tagline, How It Works, and Prerequisites to present GitHub Issues alongside Trello; add a GitHub Issues Quick Start section; fix 'devpilot run' flags table which was missing --source entirely; update Task Runner Workflow and Architecture sections to reflect the TaskSource abstraction. - initcmd/detect.go: populate Status.Source from .devpilot.yaml so the rest of the wizard can be source-aware. - initcmd/generate.go: add ConfigureGitHubSource() which writes source=github to .devpilot.yaml and runs 'gh label create --force' for all required labels (devpilot, in-progress, failed, P0-critical, P1-high, P2-normal). - initcmd/commands.go: update the init wizard to ask "Task source (trello/github)" before the board step; update formatStatus() and allConfigured() to be source-aware so GitHub-configured projects don't show spurious Trello warnings. - initcmd/commands_test.go: add TestFormatStatusGitHub and expand TestAllConfigured to cover the github source path; all existing tests continue to pass.
GitHub Issues have no native queue order, which makes automated scheduling non-deterministic. Fix with a two-key sort: 1. Priority (P0 > P1 > P2; default P2) 2. CreatedAt (older issue runs first — FIFO within same priority) Changes: - taskrunner/source.go: add CreatedAt int64 field to Task - taskrunner/github_source.go: fetch createdAt from GitHub API; pass --search 'sort:created-asc' so the API returns issues oldest-first before client-side sorting applies - taskrunner/priority.go: upgrade SortByPriority to use CreatedAt as a secondary sort key; zero value (Trello tasks) falls back to stable-sort-preserved original order — no behaviour change for existing Trello users - taskrunner/priority_test.go: add four new test cases covering the tiebreaker, priority-beats-age, and zero-CreatedAt cases - taskrunner/github_source_test.go: verify CreatedAt is propagated from ghIssue to Task - README: document the two-key sort under the GitHub Issues workflow
- README: use 'gh issue create --body-file' instead of '--body "$(cat ...)"' to avoid shell quoting issues with special characters in plan files - initcmd/commands.go: tighten source-selection logic — only ask 'Task source?' when source is truly unset in config; if source is already set to 'trello' respect it and go straight to board setup; 'github' branch unchanged (still skipped via early guard) - initcmd/detect_test.go: add TestDetectSource covering the new Status.Source field for empty config, github, and trello cases
|
Hey @SiyuQian 👋 — would love your review on this when you have a moment! This PR makes GitHub Issues a proper first-class citizen alongside Trello. The backend was already there ( No changes to the runner core or any existing Trello behaviour — should be safe to merge. Happy to iterate on anything you'd like to change! 🙏 |
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
Summary
The GitHub Issues backend was already fully implemented in the
taskrunnerpackage (GitHubSource,TaskSourceinterface,--sourceflag ondevpilot run), but it was essentially invisible to users:--sourcefordevpilot runat all (onlydevpilot syncshowed it)devpilot inithad no awareness of the GitHub source — it always walked users through Trello setup and flagged missing Trello credentials even if they had chosen GitHubThis PR closes all four gaps.
Changes
1. Documentation (README)
devpilot runflags table —--sourcewas completely absent; now the first rowTaskSourceabstraction2. Deterministic GitHub Issues ordering (
taskrunner)GitHub Issues have no native queue order, which makes automated scheduling unpredictable. Fixed with a two-key sort:
Implementation:
source.go: addCreatedAt int64toTaskgithub_source.go: fetchcreatedAtfrom GitHub API; pass--search 'sort:created-asc'so the API returns issues oldest-first before client-side sortingpriority.go:SortByPrioritynow usesCreatedAtas a tiebreaker; whenCreatedAtis zero (Trello tasks), stable-sort order is preserved — no behaviour change for existing Trello usersTestSortByPriority_CreatedAtTiebreaker,TestSortByPriority_CreatedAtWithPriority,TestSortByPriority_ZeroCreatedAtPreservesOrder,TestGitHubSource_CreatedAtPropagated3.
devpilot initGitHub Issues support (initcmd)ConfigureGitHubSource(): writessource: githubto.devpilot.yamland runsgh label create --forcefor all required labels (devpilot,in-progress,failed,P0-critical,P1-high,P2-normal)formatStatus(): shows "Task source: GitHub Issues" instead of Trello warnings when source isgithuballConfigured(): a GitHub-configured project is fully set up without Trello credentialsTestFormatStatusGitHub, expandedTestAllConfiguredTest results
No logic changes to the runner itself —
GitHubSource, theTaskSourceinterface, and the--sourcerouting incommands.goare untouched beyond the ordering fix.Happy to adjust anything — thanks for building DevPilot! 🙏