Conversation
The sync step used 'gh pr merge --auto', which fails with 'clean status' because main has no required checks: a fresh cascade PR is immediately mergeable, so GitHub refuses to enable auto-merge and the step exits 1, stranding the PR. Merge directly (the bot bypasses branch protection), falling back to auto only when checks are still pending. The cut and sync steps now fetch the upstream structured-public-domains release body and use its added/removed domain list for the email CHANGELOG entry, GitHub release notes, and the sync PR body, instead of a generic dependency-bump line.
📝 WalkthroughWalkthroughThe workflow now propagates upstream release bodies into temporary notes files for release and PR content, updates the changelog entry with that body text, and changes sync merging to wait for a settled merge state before performing a direct merge. ChangesPSL Cascade Workflow Updates
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant Workflow
participant GitHubCLI
participant GitHubPullRequest
Workflow->>GitHubCLI: gh pr create --body-file /tmp/sync-notes.md
Workflow->>GitHubPullRequest: poll mergeStateStatus
GitHubPullRequest-->>Workflow: UNKNOWN / clean / DIRTY / CONFLICTING
Workflow->>GitHubCLI: gh pr merge --merge
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/psl-cascade.yml:
- Around line 197-207: The upstream-notes fetch and fallback logic is duplicated
in both workflow steps, so extract it into a single reusable helper such as a
small repo script invoked by the cut and sync jobs. Move the gh release view /
null fallback / printf-to-file behavior out of .github/workflows/psl-cascade.yml
and into one script that accepts the version and output target, then update both
existing steps to call that script instead of inlining the same pattern.
- Around line 197-207: The upstream release notes handling in the workflow can
write the literal null into the notes files because gh release view with --jq
'.body' does not trigger the empty-string fallback; update the release-body
extraction in this block and the duplicated sync-notes block to normalize
missing bodies to an empty string before the -z check, so the fallback message
is used instead. Keep the fix aligned with the existing UPSTREAM_NOTES
assignment and the later write to /tmp/upstream-notes.md and /tmp/sync-notes.md.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 9377c463-06c5-41d1-9f8a-b1fbfc985d6b
📒 Files selected for processing (1)
.github/workflows/psl-cascade.yml
|
gh release view --jq '.body' renders a JSON-null body as the literal string 'null', which is non-empty and slipped past the fallback guard, so a blank upstream release could publish 'null' as the email CHANGELOG entry, release notes, and the sync request body. Use '.body // ""' and guard the literal 'null' so the generic fallback line is used instead.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/workflows/psl-cascade.yml (1)
303-312: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick winAdd a short mergeability poll before merging
gh pr mergecan still race GitHub’s asyncmergeStateStatuscalculation right aftergh pr create, so this step can flake on transientUNKNOWN/clean-status transitions. Pollgh pr view --json mergeStateStatusfor a bounded window before choosing--mergevs--auto --merge.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/psl-cascade.yml around lines 303 - 312, The merge step in psl-cascade.yml can race GitHub’s asynchronous mergeability calculation right after gh pr create, causing transient clean-status or UNKNOWN failures. Update the PR merge flow around the gh pr merge call to first poll gh pr view --json mergeStateStatus for a bounded time window, then choose between --merge and --auto --merge only after mergeStateStatus is stable.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In @.github/workflows/psl-cascade.yml:
- Around line 303-312: The merge step in psl-cascade.yml can race GitHub’s
asynchronous mergeability calculation right after gh pr create, causing
transient clean-status or UNKNOWN failures. Update the PR merge flow around the
gh pr merge call to first poll gh pr view --json mergeStateStatus for a bounded
time window, then choose between --merge and --auto --merge only after
mergeStateStatus is stable.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 63792777-656d-437a-8496-6f7ed78bfd75
📒 Files selected for processing (1)
.github/workflows/psl-cascade.yml
GitHub computes mergeStateStatus asynchronously after the pull request is created, so it is briefly UNKNOWN and merging in that window can flake on a transient state. Poll a bounded time (up to ~30s) for the status to settle before choosing direct merge vs auto-merge.
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
.github/workflows/psl-cascade.yml (2)
307-322: 🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy liftAuto-merge fallback can silently mask real merge conflicts.
If
gh pr merge --merge "$BRANCH"fails for a reason other than "checks still pending" (e.g.mergeStateStatus=DIRTY/BLOCKEDdue to a genuine conflict againstmain), the fallbackgh pr merge --auto --merge "$BRANCH"still exits 0 — it only enables auto-merge, it doesn't guarantee the PR ever actually merges. The step (and the whole workflow run) then reports success even though the data release never lands onmain, defeating the stated goal ("a dispatched cascade run lands on main without manual merging").Consider branching on the polled
stateinstead of blindly falling back: attempt direct merge when clean, use--autoonly when checks are genuinely pending, and fail loudly (with the actualmergeStateStatus) whenDIRTY/CONFLICTING.♻️ Suggested refactor
- gh pr merge --merge "$BRANCH" || gh pr merge --auto --merge "$BRANCH" + case "$state" in + CLEAN|HAS_HOOKS|UNSTABLE) + gh pr merge --merge "$BRANCH" + ;; + DIRTY|BLOCKED) + echo "PR $BRANCH is $state; refusing to silently enable auto-merge." >&2 + exit 1 + ;; + *) + gh pr merge --auto --merge "$BRANCH" + ;; + esac🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/psl-cascade.yml around lines 307 - 322, The merge logic in the gh pr merge step can hide real conflicts because it always falls back to gh pr merge --auto --merge after a failed direct merge. Update the workflow around the mergeStateStatus polling and gh pr merge invocation so it branches on the actual state: merge directly only when the PR is clean, use --auto only when the state shows checks are still pending, and explicitly fail the job for DIRTY/BLOCKED/CONFLICTING states with the reported mergeStateStatus.
303-306: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winSanitize the PR body before sending upstream release notes to
main.
/tmp/sync-notes.mdis populated with the rawstructured-public-domainsrelease body and passed straight togh pr create --body-filefor a PR targetingmain. GitHub processes closing keywords in PR descriptions on the default branch, so strayfixes #.../closes #...text from upstream could close issues in this repo on merge. Escape or strip those keywords before writing the file.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/psl-cascade.yml around lines 303 - 306, The PR body passed through gh pr create in the psl-cascade workflow is using the raw upstream release notes, which can leak closing keywords into a PR targeting main. Update the release-note handling around the sync-notes generation and the gh pr create --body-file step to sanitize /tmp/sync-notes.md before use, either by stripping or escaping fixes/closes keywords from the structured-public-domains body. Keep the change localized to the workflow logic that prepares the PR body so the PR description cannot trigger issue closures on merge.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In @.github/workflows/psl-cascade.yml:
- Around line 307-322: The merge logic in the gh pr merge step can hide real
conflicts because it always falls back to gh pr merge --auto --merge after a
failed direct merge. Update the workflow around the mergeStateStatus polling and
gh pr merge invocation so it branches on the actual state: merge directly only
when the PR is clean, use --auto only when the state shows checks are still
pending, and explicitly fail the job for DIRTY/BLOCKED/CONFLICTING states with
the reported mergeStateStatus.
- Around line 303-306: The PR body passed through gh pr create in the
psl-cascade workflow is using the raw upstream release notes, which can leak
closing keywords into a PR targeting main. Update the release-note handling
around the sync-notes generation and the gh pr create --body-file step to
sanitize /tmp/sync-notes.md before use, either by stripping or escaping
fixes/closes keywords from the structured-public-domains body. Keep the change
localized to the workflow logic that prepares the PR body so the PR description
cannot trigger issue closures on merge.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 04c10f49-1902-4354-8d93-91c247dbe2f0
📒 Files selected for processing (1)
.github/workflows/psl-cascade.yml
- Branch on the polled mergeStateStatus: fail loudly on a DIRTY/CONFLICTING conflict against main instead of silently enabling auto-merge, which exits 0 without merging and would report false success while the release never lands. - Backtick-wrap issue-closing keywords in the sync description before it targets main, so stray upstream text cannot auto-close issues in this repo on merge.
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/psl-cascade.yml:
- Around line 284-296: The sync-PR body sanitization in the inline Python block
still misses colon-form issue-closing phrases like “Closes: `#10`”. Update the
re.sub pattern in the workflow script to also match an optional colon after the
closing keyword before the issue number, so all variants are wrapped in
backticks and cannot auto-close issues when the PR merges.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 710a19d7-5184-41dc-822d-d29a9d8a133f
📒 Files selected for processing (1)
.github/workflows/psl-cascade.yml
| # This text becomes the sync PR body, which targets main — GitHub | ||
| # processes issue-closing keywords in PR descriptions on the default | ||
| # branch. Wrap any "closes/fixes/resolves #N" in backticks so stray | ||
| # upstream text can never close an issue in this repo on merge. | ||
| python3 - <<'PY' | ||
| import pathlib, re | ||
| p = pathlib.Path("/tmp/sync-notes.md") | ||
| t = p.read_text(encoding="utf-8") | ||
| t = re.sub( | ||
| r'(?i)\b(clos(?:e|es|ed)|fix(?:es|ed)?|resolv(?:e|es|ed))(\s+#\d+)', | ||
| r'`\1`\2', t) | ||
| p.write_text(t, encoding="utf-8") | ||
| PY |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Locate the workflow and inspect the relevant region.
git ls-files '.github/workflows/psl-cascade.yml'
wc -l .github/workflows/psl-cascade.yml
sed -n '260,315p' .github/workflows/psl-cascade.ymlRepository: structured-world/structured-email-address
Length of output: 3172
🌐 Web query:
GitHub issue-closing keywords colon syntax PR description Closes: #10 docs
💡 Result:
Yes, the syntax Closes: #10 is fully supported by GitHub for automatically closing issues [1][2]. GitHub recognizes several closing keywords that can be used in pull request descriptions or commit messages to automatically link and close issues when the PR is merged into the repository's default branch [1][3]. The inclusion of a colon after the keyword is optional and does not affect functionality [1][2]. Key points regarding this syntax: Supported Keywords: close, closes, closed, fix, fixes, fixed, resolve, resolves, resolved [1][4]. Syntax Flexibility: Keywords can be written in uppercase or lowercase, and they can optionally be followed by a colon [1][2]. For example, Closes #10, CLOSES #10, Closes: #10, and CLOSES: #10 are all valid [1][2]. Requirement: For these keywords to automatically trigger an issue closure, the pull request must target the repository's default branch [1][2]. If the PR targets any other branch, the keywords are ignored [1][2]. Multi-Issue Support: To close multiple issues, you must use a supported keyword before each issue reference (e.g., Closes #10, closes #11) [1][3]. Cross-Repository Support: You can close issues in different repositories using the syntax KEYWORD OWNER/REPOSITORY#ISSUE-NUMBER (e.g., Fixes octo-org/octo-repo#100) [1][3]. [1] https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/linking-a-pull-request-to-an-issue [4] https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests [3] https://docs.github.com/en/enterprise/2.16/user/articles/closing-issues-using-keywords [2] https://github.com/github/docs/blob/main/content/issues/tracking-your-work-with-issues/using-issues/linking-a-pull-request-to-an-issue.md
Citations:
- 1: https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/linking-a-pull-request-to-an-issue
- 2: https://github.com/github/docs/blob/main/content/issues/tracking-your-work-with-issues/using-issues/linking-a-pull-request-to-an-issue.md
- 3: https://docs.github.com/en/enterprise/2.16/user/articles/closing-issues-using-keywords
- 4: https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests
Wrap colon-form closing keywords too. GitHub treats Closes: #10 the same as `Closes `#10, so the current \s+ pattern still leaves that form unwrapped and can auto-close an issue when the sync PR merges.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/workflows/psl-cascade.yml around lines 284 - 296, The sync-PR body
sanitization in the inline Python block still misses colon-form issue-closing
phrases like “Closes: `#10`”. Update the re.sub pattern in the workflow script to
also match an optional colon after the closing keyword before the issue number,
so all variants are wrapped in backticks and cannot auto-close issues when the
PR merges.
Summary
Fixes two defects in the PSL data cascade (
psl-cascade.yml) that left sync PRs stranded with uninformative messages (observed on #53 and #57).Problems
gh pr merge --auto --mergefailed withPull request is in clean status (enablePullRequestAutoMerge). main has no required status checks, so a fresh cascade PR is immediately mergeable and GitHub refuses to enable auto-merge on an already-clean PR; the step exited 1 and the PR was left open.bump structured-public-domains to vXline; the actual added/removed domains (already present in the upstream release body) were not propagated.Changes
gh pr merge --merge "$BRANCH" || gh pr merge --auto --merge "$BRANCH"— merge immediately (the bot bypasses branch protection), fall back to auto only when checks are still pending.structured-public-domainsrelease body and use its added/removed domain list for the email CHANGELOG entry, GitHub release notes, and the sync PR body.Testing
actionlintcleanDomain changes: +0 -1)Closes #61
Summary by CodeRabbit