Skip to content

fix(release): release script no longer crashes mid-run updating readme.txt#3916

Merged
jasonbahl merged 3 commits into
mainfrom
fix/release-upgrade-notice-preserves-changelog
Jun 10, 2026
Merged

fix(release): release script no longer crashes mid-run updating readme.txt#3916
jasonbahl merged 3 commits into
mainfrom
fix/release-upgrade-notice-preserves-changelog

Conversation

@josephfusco

@josephfusco josephfusco commented Jun 10, 2026

Copy link
Copy Markdown
Member

Fixes the release-PR workflow that crashed mid-run on the wpgraphql-ide 5.0.0 release (#3892) and stranded the plugin headers at Version: 4.5.0 inside the wp.org /tags/5.0.0/ SVN tag. Restructures update-upgrade-notice.js to operate on the captured section body slice so its replacement cannot escape into a sibling section, and anchors the version-heading check so prose mentions don't trigger the replace path.

Also catches up the stranded IDE 5.0.0 source state by bumping Version:, WPGRAPHQL_IDE_VERSION, and Stable tag: from 4.5.0 to 5.0.0.


Merge order:

  1. fix(release): release script writes changelog entries into the right readme section #3917 — section-scope fix (must land first; prevents silent corruption this PR would otherwise expose)
  2. 👉 fix(release): release script no longer crashes mid-run updating readme.txt #3916 (this PR) — release-script crash fix
  3. fix(release): align all plugin version metadata at deploy time, not just core #3918 — deploy-time backstop

When the Upgrade Notice section already contained an entry for the
release version with no later "= <digit>" heading after it, the lazy
match in update-upgrade-notice.js ran all the way to EOF — wiping out
the "== Changelog ==" heading and everything after it. The downstream
update-readme-changelog.js then threw "Could not find '== Changelog ==' "
and update-release-pr.yml exited non-zero before committing the
Version: / Stable tag: bumps that had already been written to disk.

This is what stranded the wp-graphql-ide 5.0.0 release with Version: 4.5.0
and Stable tag: 4.5.0 inside the SVN tag the wp.org deploy created at
/tags/5.0.0/ — producing the author-only "Version header does not match
the SVN tag" warning on the plugin page.

Add the next "== " major-section heading to the existingNoticeRegex
lookahead so the match stops at "\n== " too. Add a regression test that
reproduces the PR #3892 shape (existing "= 5.0.0 =" notice immediately
followed by "== Changelog ==" with no later "= <digit>" heading) and
asserts the Changelog section survives. Also tighten the existing test 4
to assert the same.

Bump the IDE plugin's Version: header, WPGRAPHQL_IDE_VERSION constant,
and readme.txt Stable tag: from 4.5.0 to 5.0.0 — the post-state the
workflow would have left behind if it had completed — so the next
deploy ships matching metadata. The next release-please cycle will
exercise the fixed flow end-to-end.
@vercel

vercel Bot commented Jun 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
wpgraphql-com Ready Ready Preview, Comment Jun 10, 2026 9:06pm

@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

▶ Preview in WordPress Playground

Open in WordPress Playground

Boots a fresh WordPress, installs WPGraphQL + this PR's IDE build, lands you at the IDE.

Built from cd22667f2cecc8d9f5bea0761061a7cd027019a0. Auto-updates when you push.

Per code-review feedback on the initial regex tweak: the underlying
brittleness is doing the replace against the full readme.txt content.
Even with the `\n== ` lookahead, the inner lazy match could still
escape the section in pathological cases — and `==Heading==` written
without spaces (which wp.org's readme parser accepts) bypasses the
lookahead entirely and re-creates the original bug.

Restructure so the replace operates on `upgradeNoticeMatch[2]` (the
captured section body) and splices the modified body back. The outer
regex already bounds the body slice at `\n==` (no space required), so
the inner replace is structurally incapable of corrupting a sibling
section regardless of which alternative its lookahead ultimately
matches.

Anchor `versionNoticeRegex` to a line start (`(^|\n)= X.Y.Z =`) so a
prose mention like "upgraded from = 5.0.0 = to ..." can no longer
false-positive into the "replace existing notice" branch.

Add Test 8b (no-space `==Changelog==` still bounded correctly) and
Test 8c (prose mention doesn't trigger the replace path).
@josephfusco josephfusco changed the title fix(release): preserve "== Changelog ==" when upserting upgrade notice [BLOCKED ON #3917] fix(release): release script no longer crashes mid-run updating readme.txt Jun 10, 2026
@josephfusco josephfusco changed the title [BLOCKED ON #3917] fix(release): release script no longer crashes mid-run updating readme.txt fix(release): release script no longer crashes mid-run updating readme.txt Jun 10, 2026
@josephfusco josephfusco added the status: blocked Progress halted due to dependencies or issues label Jun 10, 2026
@codecov

codecov Bot commented Jun 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.0%. Comparing base (7a01c0e) to head (9a8c8a7).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##              main   #3916      +/-   ##
==========================================
- Coverage     83.5%       0   -83.5%     
==========================================
  Files          286       0     -286     
  Lines        22755       0   -22755     
==========================================
- Hits         18997       0   -18997     
+ Misses        3758       0    -3758     
Flag Coverage Δ
wp-graphql-acf-wpunit-twentytwentyfive-single ?
wp-graphql-wpunit-twentytwentyfive-single ?
wp-graphql-wpunit-twentytwentyone-multisite ?
wp-graphql-wpunit-twentytwentyone-single ?

Flags with carried forward coverage won't be shown. Click here to find out more.
see 286 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@josephfusco josephfusco marked this pull request as ready for review June 10, 2026 20:41
@josephfusco josephfusco requested a review from jasonbahl June 10, 2026 20:41
Matches the trim done on update-readme-changelog.js. Keeps only the
why-is-this-code-shaped-this-way notes; the IDE 5.0.0 incident story
and the prose-mention example live in the PR description and git log.
@jasonbahl jasonbahl merged commit 5650e62 into main Jun 10, 2026
46 checks passed
@jasonbahl jasonbahl deleted the fix/release-upgrade-notice-preserves-changelog branch June 10, 2026 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: blocked Progress halted due to dependencies or issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants