fix(release-script): regenerate the knowledge surfaces with every version bump - #669
Merged
Merged
Conversation
…sion bump The surfaces embed the reactor version, so both bumps the script performs left them stale in the commit that shipped the bump: a release cut fails release.yml's tag-time --check, and the post-release SNAPSHOT bump turns develop's knowledge gate red until a follow-up regen. Step 5c (release) and Step 3c (-PostReleaseOnly) now run extract-api --from-reactor plus the claims/routing checks between the bump and its commit, and both commits stage knowledge/. A pre-bump --check gate refuses -PostReleaseOnly on a tree that cannot regenerate the surfaces, and a missing node skips the regen with a loud warning. Documented in docs/contributing/release-process.md §1.
The regeneration and the staging that carries it sit in different parts of cut-release.ps1 and neither fails without the other: a regen nothing stages leaves the surfaces in the working tree, and a staged path nothing regenerates commits the previous version's pack. Both surface as the same thing — release.yml's tag-time --check failing after the tag is pushed, or develop's "API surface is current" job red after a SNAPSHOT bump. Two cases, one per path the script takes, in the shape of the previews guard one step over: the step exists, the staging exists, and the step comes first. Removing Step 5c turns theCutRegeneratesTheKnowledgeSurfacesBeforeStagingThem red.
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.
Why
The knowledge surfaces embed the reactor version —
extract-apireads it from theroot
pom.xml— so every version bumpcut-release.ps1performs makes them stalein the very commit that ships the bump. Neither bump noticed:
-SNAPSHOT. Thetag-time gate in
release.ymlrunsextract-api --from-reactor --check(line 62), so the cut fails after the tagis already pushed.
-PostReleaseOnlybump commits a pack still naming the release, whichleaves develop's "Knowledge pack — API surface is current" job red until a
follow-up commit regenerates it.
Both happened.
2d5694aeand61d38ffcare those follow-up commits — one percycle, the second landing the day after the bump it was chasing
(
4684295c).What changed
Update-KnowledgeSurfacesrunsextract-api --from-reactorpluscheck-claims --checkandcheck-routes— the same three commands the tag-timegate runs, because the pack ships as one unit and a claim naming API no surface
has would ride the commit unchallenged.
release cut, Step 3c under
-PostReleaseOnly. Both commits stageknowledge/,so the regenerated surfaces ride with the bump they track rather than becoming
the next follow-up commit.
-SkipVerify: the surfaces must move with theversion either way, and Step 4 already installs every module the extractor reads
(
coreplusrender-pdf,render-docx,render-pptx,templates,testing).extract-api --from-reactor --check) refuses-PostReleaseOnlybefore any pom moves when the tree cannot regenerate thesurfaces. Without it Step 3c would be the first to notice missing classes, with
13 poms already rewritten and the clean-tree preflight blocking the retry.
nodeskips the regen with a loud red warning naming the command torun, rather than throwing — a cut on a machine without Node is still a valid cut,
but the operator has to know the commit ships stale surfaces.
ReleaseAssetStepGuardTestgains two cases, one per path, in the shape of thepreviews guard one step over: the regen step exists, the staging exists, and the
regen comes first. The two halves live in different parts of the script and
neither fails without the other.
Verification
./mvnw -B -ntp clean verify -pl :graph-compose-core,:graph-compose-render-pdf,:graph-compose-render-docx,:graph-compose-render-pptx,:graph-compose-templates,:graph-compose-testing,:graph-compose-qa,:graph-compose-coverage -am→ BUILD SUCCESS, 10 modules, 4m02s.
ReleaseAssetStepGuardTest6 tests, 0failures (4 existing + 2 new).
The new guard is proven fail-closed, not assumed: with
Step "5c"removed thesuite goes red on
theCutRegeneratesTheKnowledgeSurfacesBeforeStagingThem, andgreen again once restored.
The step's own commands were run against the built tree —
extract-api --from-reactor,check-claims --check,check-routesall exit 0, and the regenproduces no diff, confirming it is idempotent on a current tree and that
provenance lands in
target/knowledge/rather than in the staged directory.$repoRootis script-scope andUpdate-KnowledgeSurfacesis declared before bothcall sites;
$bumpedPomsand$nextSnapshotare assigned before the steps thatread them. Every git mutation the script performs stays inside its existing
if ($DryRun)guard.Notes
knowledge/as a directory rather than an explicit file list is adeliberate exception to the repo's staging rule: Step 0 requires a clean tree, so
the only changes under it are the ones the regen just wrote, and the add stages
nothing when the regen was skipped.
b1a3c618, the lastfix(release-script)cut, which took none."eight"; the list beside it already named eight.
Lane: build/CI + docs —
cut-release.ps1, its guard test anddocs/contributing/release-process.md; no library code is touched.