Skip to content

fix(ci): escape heredoc << in CircleCI ios-testflight config - #440

Merged
github-actions[bot] merged 1 commit into
devfrom
fix/circleci-heredoc-template-collision
Aug 22, 2026
Merged

github-actions[bot] merged 1 commit into
devfrom
fix/circleci-heredoc-template-collision

Conversation

@libravault-xyz

Copy link
Copy Markdown
Collaborator

Summary

Live-triggering CircleCI pipeline #145 (release-build + firebase-distribution + ios-testflight together, part of verifying #379/#378 end to end) failed outright with a config compile error, before any job ran:

Error calling workflow: 'manual-ios-testflight'
Error calling job: 'ios-testflight'
Unclosed '<<' tag
('<<' must be escaped as '\<<' in config v2.1+)
cat > ExportOptions.plist << EOF

CircleCI's own config v2.1+ template engine uses <</>> for pipeline parameter interpolation — same syntax already used correctly throughout .circleci/config.yml (e.g. << pipeline.parameters.foo >>) — and it collides with a literal bash heredoc << EOF in the ios-testflight job's "Create Export Options" step. Not caught by plain YAML parsing (python3 -c "import yaml; yaml.safe_load(...)", used to validate every prior PR in this series) since CircleCI's parameter interpolation is a separate preprocessing pass, invisible to a plain YAML parser.

Fix

Escape as \<< per CircleCI's own error message. Grepped the rest of the file for every other << occurrence — all are legitimate pipeline.parameters/pipeline.number references, no other instances of this bug.

No real side effects from the failed trigger

The whole pipeline errored at compile time, before release-build/firebase-distribution/ios-testflight started — no APK was built or signed, and no real Firebase Distribution notification went to testers (the point of that trigger's custom release notes was exactly to make it obviously a test if it had gone out — it never got that far).

Also included

An earlier uncommitted .gitignore addition (.claude/settings.local.json, used for narrowly-scoped one-shot permission grants while pushing CircleCI secrets this session).

Testing

  • python3 -c "import yaml; yaml.safe_load(open('.circleci/config.yml'))" — syntax valid (as before — this bug is invisible to that check, which is exactly why it needed a live trigger to surface).
  • Real validation: re-triggering the same pipeline after this merges.

🤖 Generated with Claude Code

Live-triggering pipeline #145 (release-build + firebase-distribution +
ios-testflight together) failed outright with a config compile error
before any job ran:

  Error calling workflow: 'manual-ios-testflight'
  Unclosed '<<' tag
  ('<<' must be escaped as '\<<' in config v2.1+)
  cat > ExportOptions.plist << EOF

CircleCI's own config v2.1+ template engine uses << >> for pipeline
parameter interpolation (same syntax already used correctly throughout
this file, e.g. << pipeline.parameters.foo >>) and collides with a
literal bash heredoc `<< EOF` in the "Create Export Options" step —
not caught by plain YAML parsing (python's yaml.safe_load, used to
validate every prior PR in this series) since it's a separate
preprocessing pass CircleCI itself runs. Fixed by escaping as \<<
per CircleCI's own error message. Grepped the rest of the file for
other `<<` occurrences — everything else is a legitimate pipeline.
parameters/pipeline.number reference, no other instances of this bug.

No real side effects from the failed trigger: the whole pipeline
errored at compile time, before release-build/firebase-distribution/
ios-testflight jobs started, so no APK was built/signed and no real
Firebase Distribution notification went to testers.

Also folds in an earlier uncommitted .gitignore addition
(.claude/settings.local.json, used for narrowly-scoped one-shot
permission grants while pushing CircleCI secrets this session).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions github-actions Bot added the risk:low Principal review classified this PR as low risk label Aug 22, 2026
@libravault-pipeline-bot libravault-pipeline-bot Bot added the status:needs-review QA passed, awaiting principal-review-agent label Aug 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR was opened outside the automated pipeline (author isn't libravault-pipeline-bot[bot]) and doesn't link an issue (no Closes #N-style line in its body), so there's no acceptance criteria for qa-agent.yml to verify against — it would otherwise sit with no risk/status label and nothing downstream would pick it up (see issue #223's actual history, and issue #343 for this issue-less case specifically). This deterministic backstop (pr-intake.yml) classified its risk and applied status:needs-review to route it straight to principal review.

@github-actions

Copy link
Copy Markdown
Contributor

Principal review — auto-merge

Risk classification: risk:low confirmed current — re-ran classify_pr_risk.py origin/dev origin/fix/circleci-heredoc-template-collision myself: diff is 5 changed lines and touches no sensitive path (per the current agent-policy.yml; see caveat below). No commits landed after the label was set, so the existing label is trustworthy as-is.

Independent verification of the fix (not just the PR's stated testing plan):

The PR's own "Testing" section only claims a plain YAML-syntax check plus a promise to re-trigger the real pipeline after merge — i.e. as filed, the fix was unverified. I installed the circleci CLI locally and compiled the config myself with the same pipeline parameters the original failing trigger used:

  • Pre-fix config (git show 307a895^:.circleci/config.yml) + circleci config process --pipeline-parameters 'run_ios_testflight: true, run_release: true, run_firebase_distribution: true' → reproduces the exact reported error:
    Error calling workflow: 'manual-ios-testflight'
    Error calling job: 'ios-testflight'
    Unclosed '<<' tag ('<<' must be escaped as '\<<' in config v2.1+)
    cat > ExportOptions.plist << EOF
    
  • Post-fix config, same parameters → compiles cleanly, and the expanded output shows the backslash is correctly stripped by CircleCI's preprocessor, leaving the heredoc intact (cat > ExportOptions.plist << EOF ... EOF) with the full ExportOptions.plist body preserved verbatim.

So this isn't just a plausible reading of CircleCI's error message — the fix demonstrably resolves the actual compile error without corrupting the heredoc, using CircleCI's own config compiler rather than trusting the PR description.

Diff scope check: grepped the whole file for << myself — confirmed only the one heredoc occurrence needed escaping; every other <<...>> is a legitimate pipeline.parameters/pipeline.number reference, matching the PR's own claim.

.gitignore addition (/.claude/settings.local.json) is a harmless, correctly-scoped ignore-only change — not itself sensitive.

One thing filed separately, not blocking this PR: while sanity-checking the risk classification I noticed .github/agent-policy.yml's sensitive_paths never picked up .circleci/config.yml after the CircleCI-parity phases (#377–#379) landed, even though that file now inlines the same signing/ExportOptions.plist/TestFlight-upload logic that fastlane/**, **/*signing*, and **/ExportOptions*.plist exist specifically to gate. Today, a much larger and riskier change to that file's release/signing jobs would still classify risk:low and auto-merge. Filed as #441 with the verified repro — worth a human decision on adding .circleci/** (or at least .circleci/config.yml) to sensitive_paths, but it's a pre-existing policy gap, not something this PR introduces, so I'm not holding this fix for it.

No CONFIRMED correctness findings in the diff itself. Verdict: auto-merge.

@github-actions github-actions Bot added status:approved-auto-merge Principal review passed, risk:low — will auto-merge and removed status:needs-review QA passed, awaiting principal-review-agent labels Aug 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📱 iOS Build Status: PASSED

✅ iOS Simulator Build & Unit Tests - success
✅ Android Core Modules - success

iOS UI tests run in a separate, informational job and are not reflected above — check "iOS UI Tests (informational)" for those.

View run details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:low Principal review classified this PR as low risk status:approved-auto-merge Principal review passed, risk:low — will auto-merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant