Skip to content

fix(ci): unbreak pr-review-confirm workflow YAML parsing#27149

Merged
tylerbutler merged 2 commits intomicrosoft:mainfrom
tylerbutler:fix/pr-review-confirm-yaml-heredoc
Apr 23, 2026
Merged

fix(ci): unbreak pr-review-confirm workflow YAML parsing#27149
tylerbutler merged 2 commits intomicrosoft:mainfrom
tylerbutler:fix/pr-review-confirm-yaml-heredoc

Conversation

@tylerbutler
Copy link
Copy Markdown
Member

@tylerbutler tylerbutler commented Apr 23, 2026

Description

The `PR Review Confirm` workflow (introduced in #27107) fails to parse and produces zero jobs on every PR — GitHub reports "This run likely failed because of a workflow file issue" (e.g. run 24861202057). The Q&A step used three bash heredocs whose bodies were flush-left inside a `run: |` YAML block scalar; YAML terminated the scalar at the first unindented line, leaving the rest of the file unparseable.

This change:

  • Extracts the Q&A prompt into `.github/prompts/pr-review-qa.md`, sibling to the existing reviewer prompts, using the repo's `VAR` placeholder convention.
  • Adds a `render-qa-prompt` subcommand on `.github/scripts/pr_review_propose.py` that substitutes `REVIEWER_CONTEXT` and `REPLY` from environment variables (safe for multi-line values and arbitrary special characters) and opens the template as UTF-8.
  • Replaces the heredoc block in the workflow with a single call to the new subcommand, and extends the step's sparse-checkout to include `.github/prompts`.
  • Adds unit and CLI tests for the new subcommand alongside the existing `pr_review_propose.py` tests.

Reviewer Guidance

The review process is outlined on this wiki page.

The Q&A step used bash heredocs whose bodies were flush-left inside a
`run: |` YAML block scalar. YAML terminated the scalar at the first
unindented line, so the workflow failed to parse and produced 0 jobs
on every PR.

Extract the prompt to .github/prompts/pr-review-qa.md (sibling to the
reviewer prompts) and replace the heredocs with a python3 substitution
that is safe for multi-line context and special characters in replies.
🤖 Generated with [Nori](https://noriagentic.com)

Co-Authored-By: Nori <contact@tilework.tech>
Copilot AI review requested due to automatic review settings April 23, 2026 22:25
@github-actions
Copy link
Copy Markdown
Contributor

Hey! You look nice today! Want me to review this PR?

Based on the diff (51 lines, 2 files), I've queued these reviewers:

  • Correctness — logic errors, race conditions, lifecycle issues
  • Security — vulnerabilities, secret exposure, injection
  • API Compatibility — breaking changes, release tags, type design
  • Performance — algorithmic regressions, memory leaks
  • Testing — coverage gaps, hollow tests

Toggle checkboxes to adjust, then reply yes to start — or ask me anything!

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes the PR Review Confirm GitHub Actions workflow so it parses and runs correctly by moving the Q&A prompt into a dedicated prompt file and generating the final prompt safely at runtime.

Changes:

  • Expand the workflow checkout sparse list to include .github/prompts.
  • Replace the YAML-breaking heredoc construction with a Python-based placeholder substitution into a prompt template.
  • Add a new .github/prompts/pr-review-qa.md template for the Q&A prompt.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
.github/workflows/pr-review-confirm.yml Updates checkout + replaces heredoc prompt assembly with template substitution.
.github/prompts/pr-review-qa.md Adds the prompt template with __VAR__ placeholders for runtime substitution.

Comment thread .github/workflows/pr-review-confirm.yml Outdated
Comment on lines +217 to +223
python3 -c '
import os, sys
tmpl = open(sys.argv[1]).read()
tmpl = tmpl.replace("__REVIEWER_CONTEXT__", os.environ["REVIEWER_CONTEXT"])
tmpl = tmpl.replace("__REPLY__", os.environ["REPLY"])
sys.stdout.write(tmpl)
' .github/prompts/pr-review-qa.md > /tmp/qa-prompt.md
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The embedded Python passed to python3 -c is indented inside the single-quoted string. Those leading spaces become part of the Python source and will cause IndentationError: unexpected indent when this step runs. Please rewrite this so the -c code has no leading indentation (e.g., a single-line -c with semicolons, or generate/dedent the script content before execution). Also consider opening the template with an explicit encoding='utf-8' to avoid locale-dependent behavior on runners.

Suggested change
python3 -c '
import os, sys
tmpl = open(sys.argv[1]).read()
tmpl = tmpl.replace("__REVIEWER_CONTEXT__", os.environ["REVIEWER_CONTEXT"])
tmpl = tmpl.replace("__REPLY__", os.environ["REPLY"])
sys.stdout.write(tmpl)
' .github/prompts/pr-review-qa.md > /tmp/qa-prompt.md
python3 -c 'import os, sys; tmpl = open(sys.argv[1], encoding="utf-8").read(); tmpl = tmpl.replace("__REVIEWER_CONTEXT__", os.environ["REVIEWER_CONTEXT"]); tmpl = tmpl.replace("__REPLY__", os.environ["REPLY"]); sys.stdout.write(tmpl)' .github/prompts/pr-review-qa.md > /tmp/qa-prompt.md

Copilot uses AI. Check for mistakes.
Per Copilot review on 36fe858: replace the inline python3 -c block in
the workflow with a new render-qa-prompt subcommand on the existing
pr_review_propose.py helper. This removes the YAML-block-indent / python
interplay entirely, makes utf-8 encoding explicit, and lets us unit test
the substitution (multi-line context, special characters, missing env
vars, missing template).
🤖 Generated with [Nori](https://noriagentic.com)

Co-Authored-By: Nori <contact@tilework.tech>
@github-actions
Copy link
Copy Markdown
Contributor

🔗 No broken links found! ✅

Your attention to detail is admirable.

linkcheck output


> fluid-framework-docs-site@0.0.0 ci:check-links /home/runner/work/FluidFramework/FluidFramework/docs
> start-server-and-test "npm run serve -- --no-open" 3000 check-links

1: starting server using command "npm run serve -- --no-open"
and when url "[ 'http://127.0.0.1:3000' ]" is responding with HTTP status code 200
running tests using command "npm run check-links"


> fluid-framework-docs-site@0.0.0 serve
> docusaurus serve --no-open

[SUCCESS] Serving "build" directory at: http://localhost:3000/

> fluid-framework-docs-site@0.0.0 check-links
> linkcheck http://localhost:3000 --skip-file skipped-urls.txt

Crawling...

Stats:
  287071 links
    1898 destination URLs
    2148 URLs ignored
       0 warnings
       0 errors


@tylerbutler tylerbutler merged commit beac5a6 into microsoft:main Apr 23, 2026
25 checks passed
@tylerbutler tylerbutler deleted the fix/pr-review-confirm-yaml-heredoc branch April 23, 2026 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants