Skip to content

Commit b3863ca

Browse files
committed
fix(ci): flip <graphcompose.version> in examples/benchmarks POMs
The new examples-generation CI job introduced in 6e436a8 went red on its first run with: Could not find artifact io.github.demchaav:graphcompose:jar:1.6.0-beta.1 in central (https://repo.maven.apache.org/maven2) Root cause: cut-release.ps1's Update-PomVersion flipped only the first <version> tag in each POM (the project's own version), leaving the <graphcompose.version> *property* in examples/pom.xml and benchmarks/pom.xml at the in-flight 1.6.0-beta.1 value. That property is what the dependency declaration resolves through, so on a fresh CI agent without a populated local m2 the build couldn't find the artifact. Fix forward, in three parts: 1. Subordinate POMs (examples/, benchmarks/) — flip the property from 1.6.0-beta.1 to 1.6.0 manually. v1.6.0 jar is already on JitPack, so once the property points there, dependency resolution succeeds against the JitPack repo declared in the parent. 2. cut-release.ps1 — Update-PomVersion now flips both the first <version> tag AND a <graphcompose.version> property if present, in the same call. Next release won't need a manual hotfix. 3. docs/release-process.md — capture the v1.6.0 lesson alongside the v1.5.0 / v1.6.0-prep ones so a future agent reading the runbook understands why the script grew this second regex.
1 parent 6e436a8 commit b3863ca

4 files changed

Lines changed: 37 additions & 12 deletions

File tree

benchmarks/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
</description>
1717

1818
<properties>
19-
<graphcompose.version>1.6.0-beta.1</graphcompose.version>
19+
<graphcompose.version>1.6.0</graphcompose.version>
2020
<maven.compiler.release>21</maven.compiler.release>
2121

2222
<junit.bom.version>5.12.2</junit.bom.version>

docs/release-process.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ Each learning maps to a check above.
134134
- **v1.5.0**`Fixed column 0 width 90 is smaller than required natural width 92.44` only surfaced on `exec:java`, not `mvn test`. *Mitigation*: section B mandates a full `GenerateAllExamples` regen before every release.
135135
- **v1.5.0** — 8 zero-byte junk files (`examples/p,`, `{,`, `[Help`, etc.) crept into the working tree from accidental shell-output expansions. *Mitigation*: section A hard-gates on `git status --short` cleanliness, not just on the script's pre-flight.
136136
- **v1.6.0 prep** — slimming the README to a marketing landing renamed the canonical `DocumentSession document = …` example variable to `doc`, which silently broke `DocumentationCoverageTest.readmeShouldUseCanonicalDslAndAvoidLegacyApis` because the test asserts the literal string `document.pageFlow(` is present. *Mitigation*: any rewrite of the README "Hello world" snippet must keep `DocumentSession document` as the variable name and `document.pageFlow(`, `document.buildPdf()`, `GraphCompose.document(` as the literal canonical fingerprints the guard scans for. Renaming the variable is a guard-test break, not a stylistic preference.
137+
- **v1.6.0 post-release** — the `examples-generation` CI job introduced after v1.6.0 went red on the first run because `examples/pom.xml` and `benchmarks/pom.xml` declare a `<graphcompose.version>` property used by their `graphcompose` dependency, and `cut-release.ps1` was only flipping the project's own `<version>` tag (the first `<version>` in each file). The subordinate POMs kept `<graphcompose.version>1.6.0-beta.1</graphcompose.version>` after the release commit; CI couldn't resolve a `1.6.0-beta.1` artifact (it never existed on any registry), so `mvnw -f examples/pom.xml clean compile` failed at dependency resolution. *Mitigation*: `Update-PomVersion` in `cut-release.ps1` now flips both the first `<version>` tag *and* a `<graphcompose.version>...</graphcompose.version>` property if present, in the same call. Future agents need not touch this — running the script handles both.
137138

138139
---
139140

examples/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<description>Runnable file-render examples for GraphCompose templates.</description>
1212

1313
<properties>
14-
<graphcompose.version>1.6.0-beta.1</graphcompose.version>
14+
<graphcompose.version>1.6.0</graphcompose.version>
1515
<logback.version>1.5.18</logback.version>
1616
<maven.compiler.release>21</maven.compiler.release>
1717

scripts/cut-release.ps1

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -108,21 +108,45 @@ function Update-PomVersion($pomPath, $newVersion) {
108108
return
109109
}
110110
$content = Get-Content $pomPath -Raw
111-
# Match the FIRST <version> tag in the file — that's the project's
112-
# own version, before <parent> or any dependency entries.
113-
$regex = [regex]'<version>[\w\.\-]+</version>'
114-
$newLine = "<version>$newVersion</version>"
115-
$newContent = $regex.Replace($content, $newLine, 1)
116-
if ($content -eq $newContent) {
111+
$changed = $false
112+
113+
# 1. Project's own <version> tag (the FIRST <version> in the file,
114+
# before <parent> or any dependency entries).
115+
$projectRegex = [regex]'<version>[\w\.\-]+</version>'
116+
$projectNew = "<version>$newVersion</version>"
117+
$afterProject = $projectRegex.Replace($content, $projectNew, 1)
118+
if ($content -ne $afterProject) {
119+
$content = $afterProject
120+
$changed = $true
121+
Note "bumped <version>: $pomPath -> $projectNew"
122+
}
123+
124+
# 2. <graphcompose.version> property (if present). Subordinate POMs
125+
# (examples/, benchmarks/) declare this property and depend on
126+
# "io.github.demchaav:graphcompose:${graphcompose.version}". The
127+
# property must track the project version so the published tag
128+
# actually resolves on a fresh CI agent without a populated
129+
# local m2. Bug surfaced in v1.6.0 release CI: the property
130+
# stayed at 1.6.0-beta.1 while the project version flipped to
131+
# 1.6.0 and CI failed at "Could not find artifact ...:1.6.0-beta.1".
132+
$propertyRegex = [regex]'<graphcompose\.version>[\w\.\-]+</graphcompose\.version>'
133+
$propertyNew = "<graphcompose.version>$newVersion</graphcompose.version>"
134+
$afterProperty = $propertyRegex.Replace($content, $propertyNew, 1)
135+
if ($content -ne $afterProperty) {
136+
$content = $afterProperty
137+
$changed = $true
138+
Note "bumped <graphcompose.version>: $pomPath -> $propertyNew"
139+
}
140+
141+
if (-not $changed) {
117142
Note "no change: $pomPath (version already $newVersion?)"
118143
return
119144
}
145+
120146
if ($DryRun) {
121-
Write-Host " [DRY RUN] Bump $pomPath -> $newLine" -ForegroundColor Yellow
147+
Write-Host " [DRY RUN] Bump $pomPath -> $newVersion" -ForegroundColor Yellow
122148
} else {
123-
# Write without trailing newline change; preserve original ending.
124-
[System.IO.File]::WriteAllText($pomPath, $newContent)
125-
Note "bumped: $pomPath -> $newLine"
149+
[System.IO.File]::WriteAllText($pomPath, $content)
126150
}
127151
}
128152

0 commit comments

Comments
 (0)