agentci: activate repos in Woodpecker via API (agents have no Woodpecker token) #6
Reference in New Issue
Block a user
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?
Problem
terraform-git no longer auto-activates repos in Woodpecker (its woodpecker_repository module was removed with destroy=false). Every newly-created Gitea repo must be enabled in Woodpecker by hand before any pipeline runs. Agents cannot: Woodpecker auth is Gitea-OAuth/UI only and there is no Vault-issued Woodpecker token for the agent (unlike gitea/creds/unkin-agent). Symptom: watchpr shows ci_status=pending forever because the repo is not active, indistinguishable from a running build.
Proposal
Add a deterministic Go subcommand (agentci enable /, or extend agentpr) that activates a repo in Woodpecker via POST /api/repos?forge_remote_id=<gitea_repo_id>, idempotently. Prerequisite: a Vault path issuing a scoped Woodpecker token for the agent, mirroring the gitea/creds/unkin-agent pattern. Bonus: agentci status / so the orchestrator can distinguish not-activated from pending.
Acceptance
No longer required, have provided token for agents