Repository navigation
build: make the release pipeline rehearsable and recoverable - #3443
Merged
Merged
Conversation
The release job ran the test suite before release:prepare and then deployed a build that had never been verified, its dry run executed nothing at all, and a failure after release:prepare had no way back. - Gate the release job on tests passing so a release can no longer start from red code, and keep the suite running inside release:prepare as well: its forked "clean verify" is what stops a bad release before the tag is pushed. The suite therefore runs twice by design, in the Test job and in release:prepare; the previous comment claimed once. - Give the release job the Central credentials at job level. They were set on the single release step before, and setup-java resolves them from the environment, so splitting that step must not be allowed to drop them. - Run release:prepare and release:perform as two Maven invocations inside the publish step. The plugin's arguments parameter reaches both the prepare-time verify and the perform deploy through the phase they share, so -Darguments only applies to the invocation carrying it: the prepare-time verify runs the suite and only the deploy skips it. Omitting it on the perform invocation would run the suite again inside the deploy, because the perform mojo overwrites the stored exec.additionalArguments with its own value. The split is also what lets the recovery step run at all, since it is reached only if the publish step fails. - Make dryRun a real rehearsal: run release:prepare alone with dryRun and pushChanges disabled, drop the release:perform that executed no goals, and clean up without -DdryRun (release:clean has no such parameter, so the flag would be silently ignored). Rehearsal and cleanup share one step so the cleanup always runs and no message can report a failed rehearsal as OK. - Make the preflight fail closed. It refuses a tag or a Central version that already exists before anything is pushed, and a Central request that fails stops the run rather than being read as "the version is free" - the one case where the check must not pass. The version check also applies to rehearsals, so a rehearsal needs an unused version. - Pass workflow inputs to the shell through env instead of interpolating them into the script text. - Document the procedure, the limits of a rehearsal and the recovery steps in .github/workflows/RELEASING.md. The root POM no longer declares a <distributionManagement> (springdoc#3430); the new RELEASING.md assumes that change.
bnasslahsen
added a commit
that referenced
this pull request
Nov 19, 2026
…suite once Set MAVEN_USERNAME, MAVEN_PASSWORD, MAVEN_GPG_PASSPHRASE and GITHUB_TOKEN on the git configuration and the two release-plugin steps only, as before, instead of on the whole release job. Skip the tests in release:prepare as well: the Test job that gates the release already runs the suite on the commit being released. See #3443 Signed-off-by: Badr NASS LAHSEN <badr.nasslahsen@gmail.com>
Collaborator
|
Thanks, merged, with a follow-up commit (ba89e8f) on top:
We'll rehearse it with |
bnasslahsen
added a commit
that referenced
this pull request
Nov 19, 2026
…suite once Set MAVEN_USERNAME, MAVEN_PASSWORD, MAVEN_GPG_PASSPHRASE and GITHUB_TOKEN on the git configuration and the two release-plugin steps only, as before, instead of on the whole release job. Skip the tests in release:prepare as well: the Test job that gates the release already runs the suite on the commit being released. See #3443 Signed-off-by: Badr NASS LAHSEN <badr.nasslahsen@gmail.com>
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.
Problem
The release workflow was not safe to run:
release:prepare, then deployed a build that had never been verified. A failure after the tag was pushed had no documented way back.dryRunexecutedrelease:prepare release:perform -DdryRun=...;release:perform -DdryRun=trueruns no goals, so the "rehearsal" proved nothing.release:prepare release:performinvocation with-Dargumentsskipped tests in both the prepare-timeverifyand the perform-timedeploy.Changes
testjob (same command as CI,permissions: contents: read) +needs: test; the release job keepsrelease:prepare's forkedclean verify, which is what prevents a bad tag from being pushed. The suite therefore runs twice by design: once before any version transformation, once on the release POM.dryRunnow runsrelease:prepare -DdryRun=true -DpushChanges=false, thenrelease:clean+git checkout -- .+ scratch-file cleanup in the same step, and fails if the working tree is dirty.-Dargumentsnow applies only torelease:perform, so the prepare-time verify runs the suite and only the deploy skips it.MAVEN_USERNAME/MAVEN_PASSWORD/MAVEN_GPG_PASSPHRASE/GITHUB_TOKENare set on the release job, so splitting steps cannot silently drop them..github/workflows/RELEASING.md(procedure, rehearsal limits, recovery), linked fromCONTRIBUTING.adocand the workflow header.Verification
release.ymlparses (YAML);git diff --checkclean;git range-diffagainst the previous branch state shows only the intended structural changes.git merge-base --is-ancestor main HEAD→ this PR is one commit on top ofb46782a94(currentmain, which already contains build: drop the stale distributionManagement #3430).testjob are the repository's current versions (checkout@v7,setup-java@v6,cache@v6).Notes for reviewers
release.ymlandRELEASING.md§ "What a real run does".main.spring-boot-3would need a backport ofrelease.yml/RELEASING.mdif 2.10.x releases should use it.<distributionManagement>removal (build: drop the stale distributionManagement #3430) is already merged, soRELEASING.md's statement matchesmain.CHANGELOG.mdentry: release tooling only, not the published API or behavior.