Repository navigation
Description
Problem and observed evidence
During the non-publishing #46 rehearsal run, stamp_java() removed the closing backtick and comma after an already-correct inline Maven coordinate in the root README.
- Workflow and binding source:
45dd588e88190449ddda116251c556129efe31db. - Prepared artifact:
prepared-1, artifact ID15836782669. - Prepared commit inside
source.bundle:34889d457da91 8DF7 cbd09cbed6f185578cd3a7fa686. - Source:
.github/java_release.py:289. - The function is identical to the version at pre-fix(ci): reuse verified Java artifacts across partial reruns #45 base
cdbb50ad9ea0d99ad2778cde8b5f37b048a8dd93; this defect predates the artifact naming fix.
Before preparation:
`io.github.project-minigraf:minigraf-jvm:3.0.0-alpha`, with JNA 5.14.0 unchanged.After preparing the same 3.0.0-alpha version:
`io.github.project-minigraf:minigraf-jvm:3.0.0-alpha with JNA 5.14.0 unchanged.The version matcher excludes double quotes and whitespace, but accepts a backtick and the adjacent comma. Its match therefore includes Markdown punctuation that the replacement drops. The resulting inline-code span is unclosed. The requested Maven version and exact core Git dependency remain correct, so this finding does not invalidate #46's suffix-isolation acceptance.
Minimal fix
Stop the version match at a backtick as well as at the existing double-quote and whitespace delimiters. The comma then remains outside the match because it follows the preserved closing backtick.
--- a/.github/java_release.py
+++ b/.github/java_release.py
@@
- text, count = re.subn(r'(io\.github\.project-minigraf:minigraf-jvm:)[^"\s]+',
+ text, count = re.subn(r'(io\.github\.project-minigraf:minigraf-jvm:)[^"`\s]+',
lambda m: m[1] + plan['semver'], path.read_text())This addresses the quoted Gradle and inline Markdown forms used by the current READMEs. It does not broaden the supported version grammar or change the Maven XML matcher, release routing, or artifact policies.
One regression case
Add this behavioral case to the existing JavaArtifacts tests in .github/test_java_release.py. The existing stamping test covers double-quoted Gradle coordinates and Maven XML but has no inline Markdown coordinate.
def test_stamp_preserves_inline_markdown_punctuation(self):
text = '''implementation("io.github.project-minigraf:minigraf-jvm:3.0.0-alpha")
<dependency><artifactId>minigraf-jvm</artifactId><version>3.0.0-alpha</version></dependency>
<dependency><artifactId>jna</artifactId><version>5.14.0</version></dependency>
`io.github.project-minigraf:minigraf-jvm:3.0.0-alpha`, with JNA 5.14.0 unchanged.
'''
with tempfile.TemporaryDirectory() as tmp:
root = Path(tmp)
(root / 'java').mkdir()
paths = [root / 'README.md', root / 'java/README.md']
for path in paths:
path.write_text(text)
for version in ['3.0.0-alpha', '3.0.0-beta']:
with self.subTest(version=version):
pipeline.stamp_java(root, {'semver': version})
expected = text.replace('3.0.0-alpha', version)
for path in paths:
self.assertEqual(path.read_text(), expected)The first iteration checks that stamping an already-correct version preserves the complete document. The second checks that an actual version change preserves the backtick, comma, Gradle quoting and unrelated JNA version in both READMEs.
Suggested acceptance
- The regression fails against the current helper and passes after the delimiter change.
- Preparing the same requested version no longer changes this README sentence.
- Keep the fix scoped to stamping and its regression case; no publication or release artifact-policy changes are needed.
Related: #30, #46. This is a pre-existing preparation-formatting defect, separate from artifact suffix isolation.
Activity
fix(release): match version tokens when stamping coordinates