feat: add update-kustomize-tag Woodpecker step #221
No reviewers
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo_admin/pal-e-api!221
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "220-update-kustomize-tag"
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?
Summary
Adds the
update-kustomize-tagstep to the Woodpecker pipeline so that successful builds on main automatically update the kustomize overlay image tag in pal-e-deployments, eliminating manual tag bumps.Changes
.woodpecker.yaml-- addedupdate-kustomize-tagstep afterbuild-and-push, beforesmoke-test. Uses the canonical script from pal-e-platform via wget+sh pattern. Targetspal-e-docsoverlay. Depends onbuild-and-push, runs only on push to main.Test Plan
python3 -c "import yaml; yaml.safe_load(open('.woodpecker.yaml'))"pal-e-docs)build-and-pushand gates onpushtomainReview Checklist
Related Notes
forgejo_admin/pal-e-api #220-- the Forgejo issue this PR implements (Closes #220)forgejo_admin/pal-e-platform #206-- parent rollout issuepal-e-docs-- the project this work belongs toQA Review -- PR #221
Diff Summary
.woodpecker.yamlFindings
Step placement: Correctly inserted after
build-and-push, beforesmoke-test. Logical ordering -- tag updates before smoke test waits for ArgoCD rollout.Template compliance: Step matches the canonical template at
pal-e-platform/scripts/woodpecker-update-tag-step.yamlexactly:alpine/git:latestFORGEJO_TOKENfrom secret,OVERLAY,IMAGE_TAGdepends_on: build-and-pushwhen: event: push, branch: mainOverlay value:
pal-e-docsmatches the template mapping table (line 10 of template).Security: Token injected via
from_secret, not hardcoded. No secrets in diff.YAML validity: Confirmed valid via
python3 yaml.safe_load().Issue reference:
Closes #220present in PR body.Nits
None.
VERDICT: APPROVE
PR #221 Review
DOMAIN REVIEW
Tech stack: Woodpecker CI pipeline YAML, shell scripting (wget+sh pattern), kustomize/ArgoCD deployment automation.
What this PR does: Adds a single
update-kustomize-tagstep to.woodpecker.yamlthat downloads the canonicalupdate-kustomize-tag.shscript from pal-e-platform and runs it afterbuild-and-push, targeting thepal-e-docsoverlay in pal-e-deployments. The step runs only on push to main.Correctness checks performed:
Overlay name
pal-e-docs-- Verified./home/ldraney/pal-e-deployments/overlays/pal-e-docs/prod/kustomization.yamlexists and hasnewTagentries. The overlay name matches the Harbor image repo (pal-e-docs/apiin thebuild-and-pushstep). Correct.Internal cluster URL --
http://forgejo-http.forgejo.svc.cluster.local:80is the same internal URL used in the clone step. Correct.Secret handling --
FORGEJO_TOKENsourced viafrom_secret: forgejo_token, same secret already used in the clone step. No plaintext secrets. Correct.IMAGE_TAG -- Uses
${CI_COMMIT_SHA}, matching thetags: ${CI_COMMIT_SHA}inbuild-and-push. Correct.depends_on: build-and-push -- Ensures image is pushed to Harbor before attempting to update the kustomize overlay. Correct.
Canonical script -- Reviewed
/home/ldraney/pal-e-platform/scripts/update-kustomize-tag.sh. It validates required env vars (FORGEJO_TOKEN,OVERLAY,IMAGE_TAG), clones pal-e-deployments, updatesnewTagvia sed, commits with[skip ci], and pushes with retry logic. Well-structured.Scope -- Single file changed, 17 lines added, 0 deleted. Tightly scoped to the issue.
BLOCKERS
1. smoke-test may race with update-kustomize-tag (missing
depends_on)The
update-kustomize-tagstep declaresdepends_on: [build-and-push], which switches Woodpecker into dependency-graph scheduling for steps withwhenconditions matching the same event. Thesmoke-teststep has NOdepends_onfield.In Woodpecker's dependency model, a step without
depends_onhas no declared predecessors -- meaning it could run as soon as the clone completes, potentially in parallel withupdate-kustomize-tag(or at least not guaranteed to run after it).The smoke-test's purpose is to validate the ArgoCD rollout, which depends on the kustomize tag being updated first. If smoke-test runs before or concurrently with
update-kustomize-tag, it would test the OLD deployment (the 30s sleep is a heuristic that assumed sequential execution).Fix: Add
depends_on: [update-kustomize-tag]to thesmoke-teststep to ensure the tag update commits to pal-e-deployments before smoke-test begins its ArgoCD wait.Severity note: Calling this a BLOCKER because if smoke-test races ahead, it validates stale state. However, I acknowledge there is nuance: Woodpecker's actual behavior with mixed
depends_on/no-depends_onsteps may vary by version. If the team has verified that Woodpecker preserves definition order for steps withoutdepends_oneven when other steps use it, this could be downgraded to a nit. But the safe, explicit approach is to add the dependency.NITS
alpine/git:latesttag -- Using:latestis mutable and could break unexpectedly. Consider pinning to a specific version (e.g.,alpine/git:2.45.2) for reproducibility, consistent with the pinned versions used elsewhere in the pipeline (python:3.12-slim,pgvector/pgvector:pg17,woodpeckerci/plugin-kaniko:2.3.0).No
depends_onfor smoke-test on main branch today either -- This is a pre-existing concern (smoke-test already lackeddepends_on: [build-and-push]before this PR). The new step makes it more visible. Worth fixing while touching this area.SOP COMPLIANCE
220-update-kustomize-tagreferences issue #220)pal-e-platform #206)feat: add update-kustomize-tag Woodpecker step)PROCESS OBSERVATIONS
pal-e-platform #206(9 repos). Completing this for pal-e-api eliminates manual tag bumps and directly improves deployment frequency for the core API.[skip ci]commit messages. The only risk is the smoke-test ordering issue noted above.update-kustomize-tag.shscript (no other.woodpecker.yamlfiles reference it yet). Getting the pattern right here sets the template for the remaining 8 repos.VERDICT: NOT APPROVED
One blocker: the
smoke-teststep needsdepends_on: [update-kustomize-tag]to guarantee it runs after the kustomize tag is updated. Without this, the smoke-test could validate stale state, defeating its purpose. Fix this dependency and the PR is ready to merge.