Stop the release script skipping version markers in wrapped calls - #3695
Merged
Conversation
The version-literal patterns anchored on the name of the enclosing function and spanned the arguments in between with '.*?', which never crosses a newline. Six calls in includes/ are wrapped across several lines, so a marker in any of them would ship as 'unreleased'. Match on the literal's argument position instead, keeping the guard that left the documented version_compare() example in class-migration.php alone, and requiring an argument ahead of the literal so a translated 'unreleased' string stays put. The patterns move to bin/version-patterns.js so the tests import what the release runs. They had already drifted: the suite was still checking the _deprecated_function pattern as it stood in #1279, not as release.js has it.
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Merged
1 task
pfefferle
approved these changes
Sep 1, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Proposed changes:
The release script's version-literal patterns anchor on the name of the function the literal belongs to and span the arguments in between with
.*?. That never crosses a newline, so a marker in a call wrapped across several lines keeps its placeholder and ships as'unreleased'.Nothing pending is affected right now, since every marker on trunk is a single-line
@since. Butincludes/has six calls written across several lines (class-options.php,class-http.php,class-event.php,class-place.php), and a marker in any of them would go out as-is. This came up in ATmosphere, which runs a copy of this script and had shipped 18 of them across five releases before anyone noticed.The patterns now match on the literal's argument position rather than the function name. Anchoring on the name can't be made to work here: the name and the version sit on different lines, and every bound wide enough to span the arguments between them also swallows a
;inside a translated message, which plenty of them have.Two things keep that off unrelated text:
version_compare()example inclass-migration.php, which is what the negative lookbehind added in Release Script: Replace@sinceversions #1221 was protecting. I kept that dedicated migration pattern in place as well.\__( 'unreleased', 'activitypub' )stays put, where the word is the thing being translated rather than a version.The patterns move to
bin/version-patterns.jsso the tests import what the release actually runs. They had already drifted apart: the suite was still checking the_deprecated_functionpattern as #1279 left it, whilerelease.jshad since widened it to the rest of the_deprecated_*family. Twodo_action_deprecatedtests were also asserting against their own inline copy rather than the shared list.Other information:
Five, covering the shapes that were slipping through: a wrapped call, a wrapped call whose message is a variable rather than a literal, a documented example inside a block comment, a commented-out call, and a translated
'unreleased'string. The 19 existing tests pass unchanged, including both migration-pattern ones. Full suite is 315 passing,npm run lint:jsclean.Testing instructions:
npm run test:unit -- bin/__tests__/release.test.js— 24 passing.Every file should end at 0 except
includes/class-migration.php, which stays at 2. Those two are the instructional comment on lines 242 and 246, and rewriting them would destroy the example that tells the next person to use the marker.includes/class-migration.phpand diff it against the original. No lines should differ.Changelog entry
Needs the "Skip Changelog" label. This is release tooling, so there's nothing for a site owner to read on the update screen.