probe: gh auth on bk mac agents (do not merge)#74
probe: gh auth on bk mac agents (do not merge)#74mokagio wants to merge 2 commits intoainfra-2351-add-buildkite-pipelinefrom
Conversation
Throwaway draft PR. Adds a `gh auth status` + read-only API probe to the top of `release-cli.sh` so every BK build (incl. PR/main, where the publish path is otherwise skipped) prints whether `gh` is on the agent and authenticated for `beeper/platform-imessage`. Goal: confirm the assumption flagged in #71's description ("Assumes `gh` is on the BK Mac agents and authenticated... To be confirmed on the first run.") before stacking real publishing logic on top. Once we read the build log, this PR can be closed without merging. --- Generated with the help of Claude Code, https://claude.ai/code Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
The `repo` scope on the agent's `GITHUB_TOKEN` is necessary but not sufficient — `gh release create/upload` will still 403 unless the bot account (`wpmobilebot` per the previous probe run) is a collaborator with at least `write` on `beeper/platform-imessage`. Adds a `gh api .../collaborators/<login>/permission` call, derives the login from `/user` so it survives a future bot rename. --- Generated with the help of Claude Code, https://claude.ai/code Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Closing — probe completed, results captured in the description's Verified section. Branch left in place in case the log/diff is useful later. |
|
It looks like you're not a member of this organization on Indent. To use Indent, visit app.indent.com to get started. |
Rationale
Stacked on #71.
That PR's description flagged one assumption to confirm on the first run: "
ghis on the BK Mac agents and authenticated forbeeper/platform-imessage."Confirming this before relying on
gh release create/gh release uploadfor actual publishing is cheaper than discovering it during a real tag push.This draft adds a probe to the top of
.buildkite/commands/release-cli.shthat runs on every build (PR /main/ tag), so the next BK build for this branch will print enough to answer the question.What the probe checks
command -v ghandgh --version—ghis installed and on PATH on the agent.gh auth status --hostname github.com— there is a configured token (and which scopes / which user).gh release list --repo beeper/platform-imessage --limit 1— the token has read access against this specific repo.gh api /repos/beeper/platform-imessage— same, via the API surface the publish step will eventually hit.It is intentionally read-only.
A successful read here does not guarantee write scope (which is what
gh release createandgh release uploadneed) — that will be exercised by a realvX.Y.Z-testtag push once the read probe is green.If write scope is missing, the next iteration is to either grant it or move publishing to a different mechanism.
Tradeoffs
release-cli.shrather than a dedicated pipeline step.Saves one Mac agent boot; cost is that the diff touches the production script.
Easy to revert when this PR is closed (single commit on a throwaway branch).
Gotchas
ainfra-2351-add-buildkite-pipelinerather thanmain, since the BK pipeline files only exist on that branch.How to test
:test_tube:sections at the top — they appear before any signing / build work, so they show up even if the rest fails.ghis wired up; close this PR and proceed with #71 as-is.gh: command not found→ ask the BK agent maintainers to bakeghinto the Mac image, orbrew install ghin a pre-step.gh auth statuserrors with no token → wireGH_TOKEN(or equivalent) througha8c-secrets.Posted by Claude Code (Opus 4.7, 1M context) on behalf of @mokagio with approval.
Verified (2026-05-07)
Probe results from BK build #24 on commit
85dfbbc:gh2.88.1 is on the agents at/opt/homebrew/bin/gh.@wpmobilebotviaGITHUB_TOKEN, scopes:read:org,read:public_key,read:user,repo.beeper/platform-imessageworks (gh release listreturnedv0.21.1; the repo is public).wpmobilebotis a collaborator onbeeper/platform-imessagewithwritepermission — sufficient forgh release createandgh release upload.#71 is unblocked on the auth side.
Closing this PR unmerged; the probe served its purpose.
Edited by Claude Code (Opus 4.7, 1M context) on behalf of @mokagio with approval.