Replace gh with octokit in os-backlog #857
Labels
No labels
P0
P1
P2
P3
bug
category/code-change
category/cross-repo
category/eval-run
category/investigation
category/no-test-target
category/owner-ruling
category/prose-artifact
category/recurring-chore
category/structure
category/umbrella
crc-refactor
create
delete
enhancement
filed-by/agent
filed-by/user
frozen
lint-rule
needs-info
needs-triage
next
plugin/cc-architect
plugin/os
plugin/os-adr
plugin/os-aidd-lint
plugin/os-backlog
plugin/os-context
plugin/os-doc-hygiene
plugin/os-sdlc
plugin/os-vault
project/cc-os
ready-for-agent
ready-for-human
recurring
review
rule-proposal
update
waiting
wayfinder:grilling
wayfinder:map
wayfinder:map
wayfinder:research
wayfinder:task
wayfinder:task
wontfix
worklist/deviations
worklist/lint-rule
worklist/new-implement-build
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jared/cc-os#857
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
os-backlog runs the
ghCLI for every GitHub operation. Ticket text goes through argv, andgh issue createoutput is parsed with a regex. ADR-0256 replaces gh with the octokit gem.Reproduce
n/a: design change from ADR-0256.
Approach
A new
Backlog::GithubBackendkeepsGhBackend's public interface and delegates each call to anOctokit::Clientbuilt withaccess_token: ENV.fetch("GITHUB_TOKEN"). The octokit methods arecreate_issue,issue,list_issues,labels,add_comment,issue_comments,close_issue,add_labels_to_an_issue,remove_label, andupdate_issue.IssueShow,InspectCommand#gh_issues, andbin/wakeup-pollread through the same backend.GhBackendand its argv builders are deleted.Required work:
octokitin os-backlog with the same dependency method as the git gem (session f531ed01).Rejected: keep gh and read
gh auth token— that is a shell call again (ADR-0256).Acceptance criteria
github:tracker, whenissue-createruns with a body that starts with--label, then the created issue stores that body unchanged and the command prints the new number and URL.github:tracker, whenissue-show,comment,close,issue-edit, and label add/remove run, then each one sends the matching GitHub API request and noghprocess starts.GITHUB_TOKENis not set, when any GitHub command runs, then it exits non-zero with a message that namesGITHUB_TOKEN.wakeup-pollruns for agithub:project, when open issues exist, then it lists them as it does today.issue-commentsruns, then the failure reaches the caller (inventory defect 5).Owner sketch
Current paths
The
ghcalls now sit inplugins/os-backlog/lib/backlog/issues/gh_backend.rb,issues/gh_issue.rb,issue_show/github_view.rb, andinspector/gh_issues.rb.activemodelset the dependency method: the Gemfile. This ticket runs before port slice #1616, which wraps the new backend inHost::GitHub.Non-goals
ghcall. It is in the os-sdlc adoption ticket.Blocked by
GITHUB_TOKENmust be set in~/.credentialsbefore a live check. The acceptance tests stub the API.Origin
Blocked by #866 (Forgejo dependency recorded).
Jared confirmed on 2026-11-06 (session 1a5b2630) that the move from the gh CLI to the octokit gem is certain. Current files differ from the paths in the body: the gh calls are in plugins/os-backlog/lib/backlog/issues/gh_backend.rb (gh issue create, list, comment, close, label list), issues/gh_issue.rb, and issue_show/github_view.rb. os-sdlc already uses octokit in plugins/os-sdlc/lib/os_sdlc/tracker/issue_source/github.rb; reuse its shape. This work is separate from the os-git git-command work (see the os-git orchestrator ticket); it covers GitHub API calls only. Re-read the body before implementation, because the file paths in it are stale.
Port slice #1616 does this work through the GitHub host. Close this ticket when #1616 ships.
Correction to my earlier comment: this ticket runs first and stays open on its own. Port slice #1616 now waits for it and wraps GithubBackend in Host::GitHub. This ticket also takes inventory defects 5 and 13.
Work started on branch ticket-857.
Resolution
Done: GithubBackend replaces every gh call through octokit in Issues, IssueShow, Inspector, and wakeup-poll. Missing GITHUB_TOKEN names the variable. Defects 5 and 13 fixed. Old gh classes deleted.
Evidence: Merged to main in
444bb648. os-backlog suite on seed 19992 and 3 random seeds: 425 runs, 0 failures. A real read of rails/thor returned 117 issues and 9 labels. Design audit findings fixed or answered.Follow-ups: Route skill gh text: #1621 (commented). os-sdlc activemodel removal: #1623 (commented). Forgejo network call in a test: #1620 (commented).
Removed the native Forgejo dependency on #866. This ticket shares no work with #866. To restore it, add the dependency again.