fix(ci): build bot fetches the forge-ci token via the ci-runner AppRole #196
No reviewers
Labels
No labels
build-dist
priority
P1
priority
P2
priority
P3
priority
P4
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Toilville/toilville-design!196
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/build-bot-vault-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?
Scope
The build bot's first live run (#195, run 936) failed at checkout with
Input required and not supplied: token, because theUDG_BUILD_BOT_TOKENsecret was never created. This PR drops thatsecret. The bot now fetches the forge-ci Forgejo token at run time from OpenBao
(
secret/forge/forgejo/ci), using the org's existing ci-runner AppRole (CI_VAULT_ROLE_ID,CI_VAULT_SECRET_ID,CI_VAULT_ADDR). That's the same path forge-opsauto-mergeand Renovateuse, so no new standing secret is needed.
Per-job containers can't reach a fixed bridge IP or
vault.forge. The step therefore triesCI_VAULT_ADDR, thenvault.forge, then the default gateway from/proc/net/route. That logic isported from forge-ops
ci-sharedand written in stdlib Python, because the slim image has nocurlorjq. The token is masked before it reaches the step output.Trade-off: forge-ci is the org-wide CI identity, not a token scoped to this repo. We accept that
to avoid managing a second secret.
Testing
test_workflow_invariants.py: 62 passed.yamllint --strict .forgejo/workflows/: clean.python:3.12-slimwith an unreachableCI_VAULT_ADDR, reads thegateway from
/proc/net/routeand stops with::error::OpenBao not reachable…. That checks thecode fails cleanly when nothing is reachable.
live.
Impact Statement
UDG_BUILD_BOT_TOKENis no longerneeded.
Docs
The workflow's header comment records the credential path and the trade-off.