feat(config): routing as a named-project file, and push rights minted per Run #28
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "agent/config-and-tier2"
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?
Two things asked for directly, plus the ADR the second needed.
Configuration moves out of environment variables
PLOEG_TARGET_MAP,PLOEG_TEAM_MAPandPLOEG_TEAM_PLANSwere three hand-rolled DSLs with no schema, no comments and no reviewable diff. They become one YAML file, rendered from Helm values into a ConfigMap and mounted at/etc/ploeg/ploeg.yaml. A typo'd key now fails the boot instead of silently taking a default.The sharper half is the magic numbers.
11/bronze=webgrip/ploeg@developmentput a Vikunja project ID into cluster config, where a bare11says nothing about which board it is, cannot be reviewed, and silently routes work to the wrong repository the day that project is rebuilt. Projects are named now — ploegd asks the tracker for the id at boot, logs what it resolved, and refuses to start if the name matches nothing, with the available names in the error.id:remains as an escape hatch.Renders to the same wire format
pkg/targetalready parses, so there is one routing resolver, not two that drift. Env vars still work when the file is absent.Push rights are minted per Run (ADR-0013 tier 2)
Tier 1 gave readers a weaker static token. This closes the other hole: a writer pod partitioned from ploegd keeps running after its Lease expires, and with a shared credential it can still push to a branch another Run has taken over.
A writing Run now gets a
write:repositorytoken minted for it alone, namedploeg-run-<12hex>-<repo>so a token in the Forgejo UI traces to a Run, a Shift and a ticket. Revoked on report, on lease expiry by the sweeper, and by a boot sweep — the same three-layer shape ADR-0008 uses for spend.If the mint fails, nothing runs: the Run finishes as a retryable infra failure and the pod exits empty-handed, rather than proceeding with a credential we did not intend to hand out. Readers get nothing minted.
The admin credential lives only in ploegd, never in a worker pod (R6) — a real escalation, accepted explicitly by ADR-0013 on ADR-0008's reasoning. Unset, everything falls back to the shared token, so this ships dark.
Honest limitation, recorded in the code: Forgejo scopes tokens by permission, not by repository, so the repo in the token name is audit rather than enforcement — the bot's own access still bounds it.
ADR-0017 flipped
proposed→accepted: its implementation merged in #26.Gates
gofmt,go vet,go build,go test ./...(19 packages),helm lint, three renders, and./scripts/helm-golden.sh check— all green.Pull request closed