Woodpecker plan-step quoting bug recurs on certain content patterns (#307 v2 fix incomplete) #321
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
ldraney/pal-e-platform#321
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
Bug
Lineage
Discovered scope from PR #320's CI run (pipeline 473, 2026-04-30). PR #307's v2 fix (commit
a49c1d0, merged via PR #309) successfully fixed the originalunterminated quoted stringbug for PRs #310 and #313 — both passed CI cleanly. PR #320's CI hit the SAME error class. The v2 fix's coverage is content-dependent.Repo
forgejo_admin/pal-e-platform
What Broke
PR #320 changes the SQL heredoc inside
kubernetes_job_v1.admin_app_user_provision's container args (replaces DO block with psql\gset+\if). Tofu plan ran successfully and emitted the diff. Then in the post-plan comment-posting block (the v2 3-command pattern):The error happens at the start of the second Woodpecker command (the heredoc-write pattern from v2). v2 was supposed to immunize this from quote-heavy content because the heredoc body is bytes-only via
<<'POSTEOF'(no shell substitution). Yet the error recurs.Repro Steps
\gset,\if,:'var')apk add jqsucceeds, next step (the- |heredoc-write block) fails withunterminated quoted stringfe701ad). Did NOT reproduce for PRs #310 or #313 (which had simpler plan output).Expected Behavior
v2 fix should immunize the comment-posting from any plan output content. Either:
Environment
.woodpecker.yamllines 162-195 (the v2 comment-posting block)ghcr.io/opentofu/opentofu:1.9(Alpine 3.20 + busybox sh)User Story
story:platform-stability — As a dev/operator merging infra PRs, I need the Woodpecker plan step's comment-posting to NOT false-positive on certain plan content, so that valid infra changes don't keep requiring force-merge bypasses (eroding the safety the hook is meant to enforce).
Architecture
arch:ci-pipeline
Context
Hypothesis: The plan output is captured to
/tmp/plan-output.txtBEFORE the comment-posting block runs. Thenapk add jqruns in its own command. Then the heredoc-write command starts. The heredoc body itself is static (doesn't reference plan content) — should be content-independent.But the error emerges in step 2 (heredoc write) for #320 only. What's different about #320's environment when step 2 starts?
Possible angles:
Worth: pull pipeline 473's full step boundary trace; compare against 453's (which succeeded). Diff isolates the trigger pattern.
This is the second recurrence of #307's pattern. The original bug (PR #304's plan with k8s metadata labels) was thought fixed by v1 — wasn't. v2 thought fixed it generally — also wasn't. Each force-merge bypass is a safety erosion. Worth treating as P1 once westside-admin bootstrap completes.
File Targets
.woodpecker.yamllines 162-195 — investigate + harden the v2 pattern OR move to Path C/D from #307's original ticket (separate alpine step + jq, or wget --post-data with URL-encoding)Acceptance Criteria
Test Expectations
Constraints
Checklist
Closes #THISRelated
feedback_woodpecker_quote_heavy_scripts(now needs update to reflect v2 incompleteness)