Fix heredoc tests and production code to use GenerateHeredocDelimiter#14993
Fix heredoc tests and production code to use GenerateHeredocDelimiter#14993
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot Keep working |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done! All test files have been updated to use Fixed files:
All heredoc-related tests now pass. The |
🔍 PR Triage ResultsCategory: bug | Risk: medium | Priority: 72/100 Scores Breakdown
📋 Recommended Action: fast_trackCritical CI fix affecting 30 files including test infrastructure and all workflow lock files. Well-documented with clear root cause. Needs fast-track review to unblock CI. Triaged by PR Triage Agent on 2026-02-11T18:30:00Z - Run #21917749368
|
There was a problem hiding this comment.
Pull request overview
Updates heredoc delimiter usage across tests and compiled workflow lockfiles to align with the newer GenerateHeredocDelimiter("PROMPT") output (e.g., prefixed GH_AW_PROMPT_EOF), fixing CI failures caused by stale hardcoded PROMPT_EOF literals.
Changes:
- Replaced hardcoded heredoc delimiter literals in multiple Go tests with
GenerateHeredocDelimiter("PROMPT"). - Updated compiled workflow
.lock.ymlfiles to use the prefixed heredoc delimiter in generated shell steps.
Reviewed changes
Copilot reviewed 154 out of 154 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/xml_comments_test.go | Derives the heredoc delimiter dynamically when counting heredoc blocks. |
| pkg/workflow/unified_prompt_creation_test.go | Uses generated delimiter for marker counting and heredoc detection assertions. |
| pkg/workflow/template_expression_integration_test.go | Searches for heredoc start/end markers using generated delimiter. |
| pkg/workflow/secure_markdown_rendering_test.go | Uses generated delimiter when locating heredoc boundaries in compiled YAML. |
| .github/workflows/*.lock.yml | Recompiled lockfiles to use the prefixed heredoc delimiter in emitted cat << '…' blocks. |
Comments suppressed due to low confidence (2)
pkg/workflow/unified_prompt_creation_test.go:1
- The comment hardcodes the current delimiter format (
GH_AW_PROMPT_EOF), but the test intentionally derives it viaGenerateHeredocDelimiter. To avoid the comment becoming stale if the delimiter format changes again, update the wording to something format-agnostic (e.g., 'Count heredoc delimiter markers').
pkg/workflow/unified_prompt_creation_test.go:1 - The comment hardcodes the current delimiter format (
GH_AW_PROMPT_EOF), but the test intentionally derives it viaGenerateHeredocDelimiter. To avoid the comment becoming stale if the delimiter format changes again, update the wording to something format-agnostic (e.g., 'Count heredoc delimiter markers').
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Fixes CI test failures caused by hardcoded
PROMPT_EOFstring literals in tests and production code after the template injection validator introduced prefixed heredoc delimiters (GH_AW_PROMPT_EOF).Changes Made
sh_test.go(5 test functions),unified_prompt_creation_test.go,xml_comments_test.go,secure_markdown_rendering_test.go, andtemplate_expression_integration_test.goto useGenerateHeredocDelimiter("PROMPT")instead of hardcoded"PROMPT_EOF"string literalsunified_prompt_step.goto useGenerateHeredocDelimiter("PROMPT")in bothgenerateUnifiedPromptStepandgenerateUnifiedPromptCreationStepfunctions (13 locations total).lock.ymlfiles automatically recompiled with the newGH_AW_PROMPT_EOFdelimiter formatRoot Cause
After commit 10699a3 introduced prefixed heredoc delimiters via
GenerateHeredocDelimiter, tests continued asserting on the old unprefixedPROMPT_EOFformat. This causedTestWritePromptTextToYAML_EmptyTextand other tests to fail because they couldn't find the expected delimiter strings.Testing
TestWritePromptTextToYAML*tests (5 functions) - all passingTestUnifiedPromptCreation*tests - all passingTestXMLComments,TestSecureMarkdownRendering,TestTemplateExpressiontests - all passingPrevention
Tests now dynamically derive delimiter strings from
GenerateHeredocDelimiter("PROMPT"), ensuring they automatically stay synchronized with any future delimiter format changes.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.