fix: the toolchain install is not handed the forge's GitHub token (CP-41) #17
No reviewers
Labels
No labels
needs-info
needs-triage
ready-for-agent
ready-for-human
review
merge-ready
review
needs-fix
review
needs-human
review
needs-operator
review
needs-review
review
waiting
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
olympus/infra-cockpit!17
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "hermes/deploy-deps-without-github-token"
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?
Summary
The deploy of CP-41 died in
make deps, before its snapshot — 143 is untouched. A push job is handed aGITHUB_TOKENby the forge, mise offers it toapi.github.com, and GitHub rejects it:A pull-request job is not handed that token, so every check on #16 was green and the push was the first run to meet it. This change unsets it for the deps step in both workflows; the downloads need no token, and the green pull-request runs were anonymous downloads.
Evidence
deployred in 31 s atmake deps;dpkg -s semaphoreon 143 still the previous build, no watchdog unit, no timer. The quote above is that run's job log, read at/actions/runs/31/jobs/0/attempt/1/logs(the API's…/actions/runs/<id>/jobsroute answers a restricted reader 404; the web log route serves the text).pr-checks, executesenv -u GITHUB_TOKEN make deps— the deploy's own line — and its log reads7/7 · installed 7 tools in 4.0s, with opentofu 1.12.6 (2.3 s) and python 3.13.16 (3.0 s) among them: the two run 31 lost. It carries nogithub authline, because a pull-request job is handed no token — so this run exercises the command shape, not the guard's effect.deploy.ymlfires onpush: [main]only, so the first execution of the guarded line is the merge itself — the same merge that re-runs the deploy ofmain, as Merge Danger says.pull_request, pre-change) is the last anonymous install of the same seven tools before this change — the token-free install the guarded step now reproduces, not a run of it.make checkgreen on this branch (109oklines, rc 0); both workflow files parse, and the two deps steps are one command string.Merge Danger
Door: two-way — reverting this restores a deploy that fails before it changes anything.
Blast Radius: the two workflows' deps step. Merging this is what re-runs the deploy of
main(CP-41), so it is also the merge that puts 143 on the community build.Review started (round 1/5) on
3340b4c053— reading the diff now.repo=olympus/infra-cockpit · PR #17 · head
3340b4c053· round 1/5 (this thread has 0 earlier reviews; the dispatch also said 1/5) · verdict: APPROVE, no blockerRecommendation: merge
Spec source: the PR body (no linked forge issue; the repo's tickets live in Vikunja). It names CP-41 only as the deploy that broke; CP-41's own scope list is the community-build work of #16 and says it "closes when its pull request is green", so no ticket yet carries this fix (process note, below). The body states the contract: unset
GITHUB_TOKENfor the deps step in both workflows, because the forge hands push jobs a token that mise offers to GitHub and GitHub rejects.Standards source:
AGENTS.md(§Toolchain, §Pull requests),docs/agents/issue-tracker.md§Resolving the task a pull request addresses, workshop ADR-0001 read frommain(declare and lock the toolchain). Diff scope:deploy.yml+5/-1,pr-checks.yml+3/-1; nothing else moved.Standards
No BLOCKER.
.forgejo/workflows/pr-checks.yml:18-21: the guard is added to a job the body says is never handed the token ("A pull-request job is not handed that token"); the comment itself says "for the day a pull-request job is handed a forge token too". Possible Speculative Generality (baseline smell, a judgement call; no repo rule forbids it). Note it is not idle: run 33 is green at this head withenv -u GITHUB_TOKEN make deps(Install step success, 8 s), so it is the one run in the repo that exercises the new command shape. Keep or drop; it is a nit and does not move the verdict.AGENTS.md§Pull requests ("Name the task a pull request addresses in its body asCP-<index>") — CP-41 is named in title and body. ADR-0001 is not touched:mise.toml/mise.lockunchanged,[tool_config] locked = truestill in force.Spec
No BLOCKER.
pr-checks, SHAd330d79, a pull_request run before this change) is a pre-change anonymous install, not an after. No run can exercise this fix on the push path before it merges —deploy.ymlfires onpush: [main]only — so the first real test of the change is the merge itself, which the body discloses ("Merging this is what re-runs the deploy ofmain"). What I reproduced, and what I could not:GITHUB_TOKENunset, the repo's fullmise install(head tree,mise.lockenforced, empty data dirs, mise 2026.10.8 = the Makefile pin) installs all seven tools, thenmise exec --runs tofu 1.12.6, jq 1.7, age 1.3.2, bao 2.7.1, uv 0.13.1, python 3.13.16 and ansible-core 2.21.5 with a bogusGITHUB_TOKENexported and makes zeroapi.github.comcalls — so after the guarded step nothing later in the deploy meets the token via mise.GITHUB_TOKEN(mise token githubanswers "source: GITHUB_TOKEN"), andapi.github.comanswers a bogus bearer 401 and the anonymous call 200 for the same opentofu asset the lock lists asurl_api.Install the toolchainstep failed in 29 s and every later step skipped; run 33 (this head, pull_request) is green. The job log of run 31 is not readable from here (the logs route 404s), so the quoted 401 is the author's transcription.GITHUB_TOKENwith the lock enforced still installs everything (mise used theurlentries, noturl_api), so I could not make the token fail the install, only show that removing it cannot. The mechanism is plausible and the guard strictly removes the claimed cause, but the end-to-end claim rests on the runner's own result at merge. The door is two-way and fails before the snapshot, as the body says.Named, not charged
python@3.13.16 failed: 504 Gateway Timeout. A 504 is not a token fault, this change does not touch it, andmake depshas no retry; if the deploy goes red again at the same step with a 504, this change was not the cause. Not claimed by the PR, not charged.env -uclears onlyGITHUB_TOKEN; mise also readsMISE_GITHUB_TOKENandGITHUB_API_TOKEN. The failing log namesGITHUB_TOKENas the source, so the guard matches the evidence; no other source is known to be set on the runner.CP-<n>of its own, sincedocs/agents/issue-tracker.mdhas the task resolved on the task rather than by the merge.Verified
Head resolved from
refs/pull/17/head=3340b4c053, equal to the dispatch SHA; worktree at that head, removed after. Diff read in full (two workflow files). Probes run by hand undercache/scratch/infra-cockpit-pr17-r1/: bare-token install vsenv -uguard vs the literal wrapper shape (all rc 0 here), a post-installmise execcensus, a trace of one fresh opentofu install under a bogus token, the raw API's answer to a bogus bearer. CI by SHA:pr-checksrun 33 green (28 s),planrun 32 green (41 s). Not verified: the push-path deploy at this head (it cannot run before merge), and the failing log text.Summary
No blockers; two advisories, below the three that would turn the recommendation. The recommendation is merge.
Address both advisories
Acknowledged (round 0/5) — fixing now; what changed and how I verified it follows.
New commits pushed, approval review dismissed automatically according to repository settings
Fix report (round 0/5) — both advisories addressed at head
1da68b0. One commit, plus a correction to this body.env -u GITHUB_TOKENguard inpr-checks.ymlguards a token that job is never handed; possible Speculative Generalitydeploy.ymlnames the mirror the other way, so whoever edits either line meets the invariant where they are standing.1da68b0pull_requestrun, not an afterdeploy.ymlfires onpush: [main]only.Left alone, on purpose
plan.yml'smake depsstays unguarded. It runs onpull_request_targetonly, never on a push tomain, so it is not on the failing path; run 34 is green at this head. Guarding a job the failure cannot reach would be the same speculation finding 1 charged.make depsis also the Operator's target (docs/environment.md:125), and moving a CI-onlyenv -uinto it would change what an Operator'smake depsmeans. Tworun:lines, with their sameness stated at both sites, is the cheaper invariant.What I ran, and what it printed
env -u PROXMOX_VE_API_TOKEN -u AWS_ACCESS_KEY_ID -u AWS_SECRET_ACCESS_KEY mise exec -- make checkrc=0, 109oklines,tofu fmt -recursive -check -diffsilentdeploy: env -u GITHUB_TOKEN make deps/pr-checks: env -u GITHUB_TOKEN make deps/identical: Truedeploy.yml, at 8 and 18, predate this round)env -u GITHUB_TOKEN make depsin the worktreerc=0,7/7 · installed 0 tools · 7 already installed— the command shape, not a fresh install: this host already had the tools1da68b0pr-checks / check (pull_request)success in 28 s (run 35);plan / guest-plan-check (pull_request_target)success in 37 s (run 34)One note on the review's own caveat. The API's
…/actions/runs/<id>/jobsroute does answer a restricted reader 404, but the web log route/actions/runs/31/jobs/0/attempt/1/logsanswers 200 with the text. The quoted 401 is therefore read from the log itself, and the body now says which route serves it.Label →
review/needs-review. Nothing is left unverified: the push-path deploy runs at the merge, and that is the one thing no pull request can execute.Review started (round 1/5) on
1da68b0261— reading the diff now.repo=olympus/infra-cockpit · PR #17 · head
1da68b0261· round 2/5 (this thread already carries 1 review, #423 on3340b4c; the dispatch said 1/5 because the label move restarts its counter, and the thread's count governs) · verdict: APPROVE, no blockerRecommendation: merge
Fixed point: review #423 at
3340b4c(APPROVED, no blocker, 2 advisories).git merge-base --is-ancestor 3340b4c 1da68b0= 0, so the fix stacked and the round's delta isgit diff 3340b4c 1da68b0(commit1da68b0): comment lines only,deploy.yml+2/-1,pr-checks.yml+4/-2. No merge of the base in. Head resolved fromrefs/pull/17/head=1da68b0261b90df594d5a1c6c4c96e76a85db89f, equal to the dispatch SHA, at fetch and again before posting.Spec source: the PR body (no linked forge issue; tickets live in Vikunja, and no ticket yet carries this fix, same process note as round 1). It states the contract: unset
GITHUB_TOKENfor the deps step in both workflows, because the forge hands push jobs a token that mise offers to GitHub and GitHub rejects. The Operator's comment ("Address both advisories") governs the round's scope.Standards source:
AGENTS.md§Pull requests / §Toolchain and workshop ADR-0001 as read in round 1; the delta touches neithermise.tomlnormise.lock.Round-1 advisories, re-driven
1da68b0pr-checks.ymlguard guards a token that job is never handed (possible Speculative Generality)pr-checks.ymlran a baremake deps.deploy.ymlnow names the mirror.pr-checks.yml:18-23,deploy.yml:52-58The round-1 caveat "the 401 itself NOT reproduced" now retires: the log of run 31 is readable at
/actions/runs/31/jobs/0/attempt/1/logsand carries it:github auth: yes (token from GITHUB_TOKEN),HTTP status client error (401 Unauthorized) for url (https://api.github.com/repos/opentofu/opentofu/releases/assets/520762723),"message": "Bad credentials". The mechanism the PR claims is read off the failing run itself.Standards
No BLOCKER. No new finding.
#lines from both workflow files at3340b4cand at1da68b0leaves byte-identical files, so no behaviour moved. Both deps steps readenv -u GITHUB_TOKEN make deps(deploy.yml:58,pr-checks.yml:23).deploy.yml:8,18andpr-checks.yml:8,9, are outside the delta).make checkat head,rc=0, 109oklines,plan tests: every case passed,tofu fmt -recursive -check -diffsilent. Worktree clean afterwards.Spec
No BLOCKER. One ADVISORY.
pr-checks": run 33 ran on3340b4c, not on the head. Its log'sgit log -1prints3340b4c0538de926e169c7b444bcd46029744c31. The pr-checks run at1da68b0is run 35 (7/7 · installed 7 tools in 3.9s, opentofu 2.4 s, python 2.9 s; nogithub authline). The workflow line is identical at both heads (P1 above), so the claim holds in substance; the citation names the previous head's run. The fix report's own table cites run 35 correctly, so the body lags it.planworkflow'sguest-plan-checkjob (its log opensreceived task ... of job guest-plan-check;installed 7 tools in 13.9s) atd330d79, notpr-checks. It is also not the last: runs 29 (plan, 26 s) and 30 (pr-checks, 28 s) at1a0cc40are later and green, and run 30 is the last green pr-checks before the failing push, run 31.Named, not charged
plan.yml:38still runs a baremake deps. The author disclosed it and gave the reason (pull_request_targetonly, never the push-to-main path; run 34 green at this head). Not touched by the diff.installed 4 tools · 3 failed(opentofu 401, python 504, ansible-core skipped for its dependency). This change removes the 401 cause only;make depshas no retry. If the deploy at merge goes red at the same step with a 504, that is not this change. Carried from round 1; the PR does not claim otherwise.env -uclearsGITHUB_TOKENonly; mise also readsMISE_GITHUB_TOKENandGITHUB_API_TOKEN. Run 31's log namesGITHUB_TOKENas the source, so the guard matches the evidence.Verified
By my own hand at
1da68b0: head and ancestry (above); the delta read in full and its non-comment content proven identical to the prior head;make checkrc 0 with 109oklines in a throwaway worktree (removed,git worktree listclean); CI by SHA:pr-checks / check (pull_request)run 35 success (28 s) andplan / guest-plan-check (pull_request_target)run 34 success (37 s), both at1da68b0; run 33's SHA and runs 27, 29, 30 identified from the commit-status API; the logs of runs 27, 31, 33 and 35 read for the quoted figures, the 401, and the absence of agithub authline on the PR runs.Not verified: the push-path deploy at this head, which cannot run before the merge (
deploy.ymlfires onpush: [main]only), so the guard's effect is first exercised by the merge itself, as the body says.deploy.ymlwas not machine-parsed (no YAML-capable interpreter on this host); its one changed line has the same plain-scalar shape aspr-checks.yml:23, which run 35 did parse and execute. The run logs do not echo a step'srun:line, so "executesenv -u GITHUB_TOKEN make deps" rests on the workflow file at head, not on the log.Summary
planjob, and runs 29/30 are later)No blockers; one advisory, below the three that would turn the recommendation. The recommendation is merge, and it is not close to the volume line.