Summary
The GitOps promotion flow and the "core is behind" chore-issue flow shell out to the gh CLI for pull-request and issue operations. These are pure GitHub REST API calls; move them to github.com/google/go-github/v89 (already a direct dependency, go.mod:22).
Lower priority than the agent-release migration (#457) because these paths run in developer/CI contexts where gh is more reliably present — but consolidating onto one client removes the last hard gh dependencies and makes error handling/rate-limit behavior consistent.
What uses gh today
Pull requests — pkg/gitops/publish.go:
gh pr list (:1208)gh pr edit (:1230)gh pr create (:1236)gh pr view — verifyPullRequest (:1250)
PR reads — pkg/gitops/observe.go:
Chore issue — cmd/status/release.go:
gh issue create (:266) — opens the "core is behind" issue.
Proposed change
Replace with go-github calls, reusing the shared client/token helper (see #457 — ideally a pkg/github with newGitHubClient + githubToken):
gh pr list → client.PullRequests.List (filter by head/base/state)gh pr create → client.PullRequests.Creategh pr edit → client.PullRequests.Editgh pr view → client.PullRequests.Getgh issue create → client.Issues.Create
Note — keep git for git
pkg/gitops/publish.go / observe.go / remote.go also push branches via the gitCommand git shell-out (clone, clone --mirror, push --porcelain). Those are genuine git operations and should stay on the git binary — this issue only covers the PR/issue API calls.
Acceptance
Part of #460.
Summary
The GitOps promotion flow and the "core is behind" chore-issue flow shell out to the
ghCLI for pull-request and issue operations. These are pure GitHub REST API calls; move them togithub.com/google/go-github/v89(already a direct dependency,go.mod:22).Lower priority than the agent-release migration (#457) because these paths run in developer/CI contexts where
ghis more reliably present — but consolidating onto one client removes the last hardghdependencies and makes error handling/rate-limit behavior consistent.What uses
ghtodayPull requests —
pkg/gitops/publish.go:gh pr list(:1208)gh pr edit(:1230)gh pr create(:1236)gh pr view—verifyPullRequest(:1250)PR reads —
pkg/gitops/observe.go:gh pr view(:726)Chore issue —
cmd/status/release.go:gh issue create(:266) — opens the "core is behind" issue.Proposed change
Replace with go-github calls, reusing the shared client/token helper (see #457 — ideally a
pkg/githubwithnewGitHubClient+githubToken):gh pr list→client.PullRequests.List(filter by head/base/state)gh pr create→client.PullRequests.Creategh pr edit→client.PullRequests.Editgh pr view→client.PullRequests.Getgh issue create→client.Issues.CreateNote — keep git for git
pkg/gitops/publish.go/observe.go/remote.goalso push branches via thegitCommandgit shell-out (clone,clone --mirror,push --porcelain). Those are genuine git operations and should stay on the git binary — this issue only covers the PR/issue API calls.Acceptance
gh pr */gh issue *shell-outs.gitCommand).Part of #460.