Declare the secret's pull event the way Woodpecker spells it #68
No reviewers
Labels
No labels
blocked
bug
duplicate
effort
high
effort
low
effort
medium
effort
minimal
enhancement
help wanted
invalid
pr
feedback
pr
reviewing
question
status
backlog
status
document
status
done
status
implement
status
pending
status
planning
status
reviewing
waiting
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
tepichord/milner!68
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/woodpecker-secret-events"
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?
Description
Merging the secret extension (#67) wired the path up, and the first pipeline to
use it proved the path works end to end — the signed request arrived, Vault
answered, the value came back — and then Woodpecker refused it at pipeline
creation:
Pipeline #6 in
tepichord/annia-infrais stored aserrorwith zero steps,so nothing in a step log explained it. The cause is two programs reading an
event list in two vocabularies:
eventsagainst the raw pipeline event(
internal/rules/rules.go), sopull_request_closedis correct there and isthe closed-only gate;
compiler.Secret.Match,which rewrites every pull event to
pull_requestbefore comparing — sopull_request_closedthere is refused on the one event it was written for.The secret entry now says
pull_request. The rule is unchanged, so the token isstill only served to
pull_request_closedpipelines, and any other pull eventfails as an unresolvable secret reference (
secret "FORGEJO_TOKEN" not found)rather than as a leak.
Changes
apps/woodpecker/secret-extension.yaml: secret-levelevents: ["pull_request"]with a comment recording why the two lists cannot hold the same string.
tests/test_gitops.py: tripwire that mirrors Woodpecker'sEvent.IsPullandfails if a pull-event rule's secret omits
pull_request. Verified to fail withthe bug reintroduced.
OPERATIONS.md§9k: the failure shape (a pipelineerrorwith no steps), thefact that the config file is read only at start-up (so a rule change needs
rollout restart), and thePOST /repos/1/pipelines/<n>call that re-runs apipeline so a rule change can be tested without another merge.
Testing
kustomize buildof both layers (12 / 8 objects),conftest48 + 32 tests,kubeconform -strict12 valid,python3 -m pytest tests/173 passed / 31skipped.
pull_request_closedis put back.Follow-up (not in this PR)
After this merges, the extension needs a restart to pick the rule up, then
pipeline #6 can be re-run to confirm a green
pull_request_closedrun:kubectl -n woodpecker rollout restart deploy/woodpecker-secret-extension,then
POST /api/repos/1/pipelines/6.