feat: take advantage of Forgejo 15.0 Actions/runner changes #30
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?
Forgejo 15.0 (release notes, full changelog) introduced several runner-side changes that the operator could meaningfully exploit. Grouping by impact for triage.
High-impact opportunities
Ephemeral runners
Forgejo now supports runners that execute exactly one job and then terminate, with their registration credentials auto-deleted. The runner exposes a new
one-jobcommand for this mode, and registration accepts an"ephemeral": trueparameter.This is a near-perfect fit for a Kubernetes operator: rather than maintaining long-lived
Deployments of runners, the operator could create aJob(or pod) per queued workflow run, scale to zero when idle, and never reuse a pod across jobs. Eliminates "leaky state between jobs" classes of bugs (which is partly why we currently rebuild the storage path on every run inpr-reviewer's build-push).Worth designing for explicitly — what does a
RunnerPoolCR look like when "pool" really means "controller for ephemeral runner Jobs"? Do we keep the long-lived pool model alongside as a fallback?OIDC workload identity federation
Runners can now obtain short-lived signed JWTs to authenticate to external systems (Harbor, OpenBao, etc.) instead of relying on static secrets baked into the runner pod or pulled from OpenBao at job start. Requires Forgejo Runner v12.5.0+.
If we adopt this, the OpenBao step in
pr-reviewer'sbuild-push.yaml(and equivalents) gets a lot simpler — no more "fetch a service-account token, exchange it for a Bao token, exchange that for Harbor creds, write a docker config." The runner mints a JWT, exchanges with OpenBao directly via OIDC auth method, done. Adjacent work in OpenBao to add a JWT/OIDC auth role for the Forgejo issuer.New HTTP API for runner registration
Forgejo 15.0 adds a proper HTTP API endpoint for runner registration and deprecates the old token-acquisition endpoints. The operator currently relies on the older flow (presumably). Migrate before the deprecated endpoints are removed in a future release.
Medium-impact / hygiene
one-job. Audit current pinned versions in runner pool definitions; bump as needed.Low-impact / informational
Suggested ordering
RunnerPoolCR (alongside the existing long-lived shape).pr-reviewersince it's the one with the most secret-handling), then expose via operator config.Progress: the "plumbing" half of this landed in v0.9.0 (#55). Target is current Forgejo (16.x, what git.brooktrails.org runs) and forgejo-runner (13.x) rather than a v15 floor; no compatibility with older Forgejo is kept.
Done
POST …/actions/runners) and keeps its uuid/token in a per-runner Secret; runners start withdaemon --url --uuid --token-url. Deprecated registration-token endpoints, theregisterinit container and.runnerare gone.<pool>-n) instead of a Deployment, since the operator now owns each runner's identity. Existing pools migrate on first reconcile (legacy runners named<pool>deregistered, old Deployment/Secret/PVC removed)./admin/runners, which no longer exists. Now scope-aware (admin / org / repo) for list, get, delete.--token-url; existing12-latestimages satisfy that).globalpools).ephemeral: trueVMs register a Forgejo ephemeral runner and runone-job.Remaining
one-job, registered as an ephemeral runner. Starting on the design now.ACTIONS_ID_TOKEN_REQUEST_*to jobs); the work is an OpenBao JWT/OIDC auth role for the Forgejo issuer, then a workflow proof-of-concept (probablypr-reviewer).visibleflag: not needed so far; reconciliation keys on Forgejo runner IDs recorded when the operator registers.🤖 Generated with Claude Code