Scale Woodpecker agent replicas and auto-cancel superseded pipelines #62
Loading…
Add table
Add a link
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?
Type
Feature
Lineage
Standalone — discovered while monitoring pipeline #128/#131/#135. Stale PR/branch pipelines hog the single worker, blocking prod deploys.
Repo
ldraney/pal-e-platform(Terraform CI module)User Story
As a developer
I want CI pipelines to run without queuing behind stale builds
So that prod deploys aren't blocked by already-merged branch pipelines
Context
Woodpecker agent is configured with
replicaCount = 1interraform/modules/ci/main.tf. Every merge triggers 2-3 pipelines (branch push, PR event, main push) that all compete for that single agent. We had to manually cancel stale pipelines three times during PR #56 deployment. Two fixes needed:Auto-cancel implementation note
WOODPECKER_PIPELINE_CANCEL_PREVIOUSis a server-level env var (not agent config). This affects ALL repos on the Woodpecker instance globally. Alternative: per-repo setting via Woodpecker API (cancel_previous_pipeline_events), which limits blast radius.Recommendation: Use per-repo API setting for landscaping-assistant first. If it works well, consider enabling globally via server env var later.
File Targets
Files the agent should modify or create:
terraform/modules/ci/main.tf-- bump agent replicaCount from 1 to 2terraform/modules/ci/variables.tf-- add variable for replica count if parameterizedAcceptance Criteria
Test Expectations
Constraints
tofu plan/tofu apply(Lucas approval)Checklist
Related
landscaping-assistant-- project affectedTicket #62 Scope Review
SUMMARY
Ticket requests two changes to the Woodpecker CI module in
ldraney/pal-e-platform: (1) scale agent replicas from 1 to 2-3, and (2) enable auto-cancellation of superseded pipelines on the same branch.FILE TARGET VERIFICATION
terraform/modules/ci/main.tf-- EXISTS. Confirmed agent block withreplicaCount = 1and no cancellation config. Correct target.terraform/modules/ci/variables.tf-- EXISTS. Currently has no replica-count variable. Correct target if parameterizing.ACCEPTANCE CRITERIA REVIEW
All three criteria are testable:
tofu planoutput andkubectl get deploymentISSUES FOUND
1. Wrong environment variable name (medium)
The ticket references
WOODPECKER_PIPELINE_CANCEL_PREVIOUS-- this env var does not exist in Woodpecker. The correct server-level env var is:WOODPECKER_DEFAULT_CANCEL_PREVIOUS_PIPELINE_EVENTSDefault value:
pull_request, push(which means it may already be enabled by default on the server side).Additionally, auto-cancel can be toggled per-repo in Woodpecker project settings ("Cancel previous pipelines"). The implementing agent needs to know which mechanism to use:
main.tfserver env blockRecommendation: update the ticket to reference the correct env var name and clarify which approach is intended. If the default is already
pull_request, push, this may already be working and the issue may be solely about replica count.2. Cross-repo ticket (low, acceptable)
The ticket is filed on
landscaping-assistantbut targetspal-e-platform. The ticket correctly documents this in the "Repo" and "Constraints" sections. The PR should be opened onpal-e-platform, notlandscaping-assistant. This is clear enough for an agent to follow.3. Resource limit consideration is vague (low)
The constraints mention "consider cluster resource limits when scaling replicas" but don't specify what those limits are. The current agent resource config is 50m CPU request / 256Mi memory limit per replica. Scaling to 2-3 replicas means 100-150m CPU / 512-768Mi memory. An implementing agent may not know the cluster's total capacity. Consider adding a concrete recommendation (e.g., "2 replicas" vs "2-3").
DEPENDENCY CHECK
SOP COMPLIANCE
VERDICT: REQUEST_CHANGES
The ticket is well-structured and mostly ready, but the incorrect env var name (
WOODPECKER_PIPELINE_CANCEL_PREVIOUSvs actualWOODPECKER_DEFAULT_CANCEL_PREVIOUS_PIPELINE_EVENTS) risks sending an implementing agent down a dead end. Before moving to todo:WOODPECKER_DEFAULT_CANCEL_PREVIOUS_PIPELINE_EVENTS, or clarify that the per-repo project setting approach should be used instead.pull_request, push) is already active -- if so, the auto-cancel may already work and the ticket scope simplifies to replica scaling only.Ticket #62 Scope Review
Template Completeness
All required sections present: Type, Lineage, Repo, User Story, Context, File Targets, Acceptance Criteria, Test Expectations, Constraints, Checklist, Related. No gaps.
Findings Requiring Revision
1. Auto-cancel config location is wrong (BLOCKER)
WOODPECKER_PIPELINE_CANCEL_PREVIOUSis a server-level env var, not an agent setting. The file targets only list agent-side files (ci/main.tffor agent replicaCount). The ticket must identify where the Woodpecker server helm values or Terraform config lives and target that file for the auto-cancel setting. Without this, an implementing agent will put the env var in the wrong place or fail entirely.2. Cross-repo blast radius unacknowledged (BLOCKER)
This is filed on landscaping-assistant but targets
pal-e-platform. More critically, scaling agents and enabling auto-cancel affects every repo on the Woodpecker instance. The ticket does not acknowledge this blast radius or specify whether auto-cancel should be global (server env var) or per-repo (API setting). This decision materially changes the implementation.3. Replica count not specified
"replicaCount >= 2" is vague. Should be a concrete number (2 or 3) with justification based on cluster resource headroom. The Constraints section says "consider cluster resource limits" but provides no data. The implementing agent cannot make this tradeoff.
What Passes
VERDICT: REVISION NEEDED
Required fixes before implementation: