You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(ci): List included PRs in sync PR bodies - #26028
Follow-up to #26024. Every master-sync PR body (for feature/* branches and for release/stable/7.0) now ends with an Included PRs section listing each master PR the sync brings in, oldest first:
### Included PRs (7)-~~#25994~~ Version bump after 7.0 release branch — _excluded_-#25965 fix: Subscribe to Command.CanExecuteChanged weakly
-#25996 fix(sdk)!: Ship only the WebView2 native loader
- …
Source: master's first-parent history between the target branch and the commit being synced. This covers merge commits (Merge pull request #N, with the title from the merge message) and squash merges (Title (#N)). It needs no API calls per PR.
Excluded PRs stay in the list, struck through and labelled excluded, so the list matches the range shown above it.
Partial syncs that stop before an excluded PR list only what was actually merged in.
Safety: titles are escaped in this order: & first, so entities already in a title such as @name stay literal; then <, so generics like List<T> aren't swallowed as HTML tags; then @ is broken up with an empty HTML comment (@<!-- -->name). Listing a PR therefore never pings anyone. The list is capped at 250 entries and 50,000 characters, whichever comes first. The rest are counted in "…and N more" with a compare link, so even long-stale feature branches with long titles stay under GitHub's 65,536-character body limit. Going over it would make gh pr create fail.
Later runs on an open sync PR: any run that changes the sync branch already rebuilds the body and replaces it, so the list is recalculated against the target each time. On day 2 it shows day 1's PRs plus the new ones. A run that changes nothing leaves the PR alone, since the list would be the same. A failed body update was swallowed silently; it now shows a workflow warning.
Scratch repo: squash, merge and direct-push commits are handled (direct pushes aren't listed) ✅. @ and < render as plain text, with no mention link, checked against GitHub's /markdown API ✅. (@name turned out to still render as a mention, so it was replaced.) Simulated day 1 and day 2 runs give 2 and then 3 PRs ✅
Found while testing: in bash 5.2, & in a ${t//@/…} replacement means "the matched text", which gave @#64;. The escape now uses sed.
Size stress test: 300 PRs with 256-character titles made entirely of @ (the worst-case escape) → 38 listed plus "…and 262 more", a 49,180-character list ✅
actionlint clean. Not yet run on Actions; the next nightly run (or a manual dry_run: false dispatch) will update the open sync PRs.
The logic is sound. --first-parent --reverse "$upto" --not "origin/${FEATURE}" gives the right range. The two regexes cover merge and squash commits, and revert commits (…(#N)")) are correctly skipped.
excluded_prs is defined earlier in the script and handled safely under set -euo pipefail. pr_lines is never expanded while empty, because the _No PR merges…_ fallback fills it.
The partial-sync upper bound ($PARTIAL, a short SHA) is resolved to a full SHA through rev-parse for the compare link.
Replacing the swallowed || true with a ::warning:: is a good improvement.
Not verified: I only read the diff and did not run the workflow. As the PR notes, it hasn't run on Actions yet, so the first nightly or manual dry_run: false run is the real check.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The 250-entry cap can still exceed GitHub’s PR-body character limit, causing PR creation or description updates to fail, so escaped entries need a character budget that reserves space for the remaining body and counts all omissions.
Verdict: ship. I found 0 blocking issues and 1 minor one, which is posted inline.
Logic: The first-parent range "$upto" --not "origin/${FEATURE}" is correct. The merge-commit and squash-commit patterns are sound, and the partial-sync bound is handled.
Escaping: The sed escaping for < and @ follows the earlier review feedback. Using sed avoids the bash 5.2 & replacement problem.
Error handling: Replacing the silent || true with a ::warning:: is a good change. pr_lines is never empty, so expanding it under set -u is safe.
Not verified: I read the diff only and did not run the workflow. It hasn't run on Actions yet, so the next nightly or a manual dry_run: false dispatch is the real test.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The entry cap does not enforce GitHub’s body-length limit after title escaping, which can cause PR creation to fail or leave existing descriptions stale.
Escape encoded mentions to prevent unintended pings
.github/workflows/master-sync.yml:518
A title containing @name bypasses this replacement because it contains no literal @. GitHub renders that entity as a mention, as confirmed in the PR's validation, so the generated body can still ping someone. Escape existing ampersands before escaping < and breaking literal mentions so encoded mentions remain literal title text.
Refresh the PR body on the no-op sync path
.github/workflows/master-sync.yml:543
If a maintainer resolves a draft sync by merging newer master commits into the sync branch, the no-op guard at lines 321–343 exits before refreshing this list. The open PR then omits those newly included PRs until another ref change forces a rebuild. Share the body refresh with the no-op path so it does not depend on the bot pushing a commit.
Verdict: ship (one minor inline nit; nothing blocking).
Issues: 0 blocking, 1 minor.
The latest push adds a 50,000-character budget on top of the 250-entry cap, and omitted entries are counted in the "…and N more" total. That resolves the earlier Copilot concern about GitHub's 65,536-character body limit.
The review of the @ mention bypass is posted inline. Escaping & first fixes it.
No-op path: the PR description says a run that changes nothing leaves the PR alone. Copilot suggested refreshing the body in that case, for example after a maintainer merges master into the sync branch by hand. I did not post that as an inline finding. It is a design choice stated in the PR, and the list refreshes on the next run that changes the branch.
Not verified: I read the diff only and did not run the workflow. The first nightly or a manual dry_run: false dispatch is the real test.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Encoded PR titles can still trigger user or team mentions, and the no-op path can leave the sync PR’s included-PR list stale after conflict resolution.
No open issues 🎉
2 previously missed issues
In code that hasn't changed since last review
Escape encoded mentions to prevent unintended notifications
.github/workflows/master-sync.yml:525
A title containing @name or @name passes through this expression unchanged. GitHub can decode these into mentions—the PR's validation notes this for @—so an included title can still ping a user or team. Escape existing ampersands before replacing < and literal @ so encoded mentions remain literal text.
Refresh the PR list after conflict resolution
.github/workflows/master-sync.yml:557
If a maintainer resolves a conflicted sync by merging newer master into the sync branch, the next run can exit through the no-op guard at line 342 before refreshing this list. The open PR then omits the newly included PRs, even though its branch contains them. Share the body/list update with that path without rebuilding or pushing the branch, while preserving dry-run behavior.
Verdict: ship. 0 blocking issues, 0 minor issues, and no new inline comments.
Mention bypass: The latest push fixes the open @name finding. The sed now runs s/&/\&/g first, then <, then @, in that order. An existing entity in a title therefore stays literal text, and the empty `` comment inserted after @ can't be re-escaped. A title that contains `<!--` also becomes `<!--`, so it can't open a comment.
Size cap: The 250-entry cap and the 50,000-character budget are both checked against the escaped line. Once either is hit, pr_full stops further entries, so the list stays contiguous and oldest first. Skipped entries are counted in "…and N more", and the heading total still counts every PR.
Error handling: The ::warning:: on a failed gh pr edit replaces the silent || true. It is a good change.
Cross-cutting notes:
No-op path: The Copilot comment about refreshing the body when a run changes nothing remains a design choice that the PR describes. It is not a defect in this diff.
Not verified: I read the diff only and did not run the workflow. It hasn't run on Actions yet, so the next nightly run or a manual dry_run: false dispatch is the real test.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Human assessment is needed because multibyte PR bodies can exceed Linux’s per-argument byte limit despite fitting the character budget, blocking PR creation or leaving descriptions stale.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
area/buildCategorizes an issue or PR as relevant to build infrastructure
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GitHub Issue: closes #26027
PR Type:
🤖 Project automation
What changed? 🚀
Follow-up to #26024. Every
master-syncPR body (forfeature/*branches and forrelease/stable/7.0) now ends with an Included PRs section listing each master PR the sync brings in, oldest first:Merge pull request #N, with the title from the merge message) and squash merges (Title (#N)). It needs no API calls per PR.&first, so entities already in a title such as@namestay literal; then<, so generics likeList<T>aren't swallowed as HTML tags; then@is broken up with an empty HTML comment (@<!-- -->name). Listing a PR therefore never pings anyone. The list is capped at 250 entries and 50,000 characters, whichever comes first. The rest are counted in "…and N more" with a compare link, so even long-stale feature branches with long titles stay under GitHub's 65,536-character body limit. Going over it would makegh pr createfail.Later runs on an open sync PR: any run that changes the sync branch already rebuilds the body and replaces it, so the list is recalculated against the target each time. On day 2 it shows day 1's PRs plus the new ones. A run that changes nothing leaves the PR alone, since the list would be the same. A failed body update was swallowed silently; it now shows a workflow warning.
Validation
release/stable/7.0, Version bump after 7.0 release branch #25994 excluded) produced exactly the 7 PRs above, with Version bump after 7.0 release branch #25994 marked excluded ✅. A partial sync stopping before Version bump after 7.0 release branch #25994 produced an empty list, which is correct because 7.0 was cut right after the previous merge ✅. With the cap forced to 3, the "…and 4 more" line and compare link appeared ✅@and<render as plain text, with no mention link, checked against GitHub's/markdownAPI ✅. (@nameturned out to still render as a mention, so it was replaced.) Simulated day 1 and day 2 runs give 2 and then 3 PRs ✅&in a${t//@/…}replacement means "the matched text", which gave@#64;. The escape now usessed.@(the worst-case escape) → 38 listed plus "…and 262 more", a 49,180-character list ✅actionlintclean. Not yet run on Actions; the next nightly run (or a manualdry_run: falsedispatch) will update the open sync PRs.PR Checklist ✅
Screenshots Compare Test Runresults.🤖 Generated with Claude Code
https://claude.ai/code/session_01TXMNtxsNdxekRBBuN5UKmF