Skip to content

fix(ci): validate and publish releases from the same commit - #2315

Merged
conor10 merged 12 commits into
mainfrom
maintenance/core-ci-release-reliability
Oct 21, 2026
Merged

conor10 merged 12 commits into
mainfrom
maintenance/core-ci-release-reliability

Conversation

@conor10

@conor10 conor10 commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Validates, stages and publishes from the same triggering commit, repairs release-version and artifact handoff, and adds a release rehearsal that runs before merging. PR runs validate GitHub’s merge commit; snapshots use the successful main-push Build’s SHA.

Release checks the version/tag and calls the reusable Build workflow before staging. Staging bypasses Gradle’s task-output cache. A separate native Gradle verifyReleaseArtifacts task requires the binary, sources and Javadoc JARs, POM and module metadata for every release module in the evaluated project/publication model. Currently that is 65 files across 13 modules; settings define the module set, and the count is descriptive.

Verification pins group, artifact ID, release version and staging directory; rejects publication on excluded root/integration-test projects; rechecks existing files on every invocation; and writes its inventory only after all modules pass. It adds no producer dependency, but runs after staging when both are requested in one invocation. It explicitly opts out of configuration caching.

Before checksums are recorded, every inventory entry must belong to the staged file set. SHA-256 checksums and source metadata accompany the uploaded artifact. A downstream job downloads the exact artifact ID and rechecks completeness and bytes, including an unterminated final inventory line. The Central command excludes Gradle’s re-staging dependency and checks recorded hashes immediately before and after deployment.

After upload, each rehearsal withholds one staged metadata file and requires verification to fail without regenerating the file or retaining an inventory. It restores the file, verifies again, and requires an identical inventory and payload checksums. Actual module/file counts and the self-test result appear in the run summary. Neither verification step receives publishing secrets.

PRs matching the build/release path filter and all manual runs are rehearsals, using unique test versions and downloadable packages/Javadocs. Central deployment, GitHub release/tag creation and Javadoc publication keep their exact release-branch-push guards, step-scoped secrets, read-only default permissions, pull_request trigger and non-persisted checkout credentials. Newer rehearsals may cancel older runs; live publication runs are never cancelled by this policy.

Tag lookup uses the tag namespace and dereferences annotated tags. Hyphenated versions become prereleases and are not marked latest. Snapshot jobs are serialized and check their completed Build SHA against remote main before setup and immediately before publication; stale runs skip cleanly.

Build runs check, including Spotless, using tracked formatter/license inputs. Push-triggered validation disables the task-output cache; PR/manual validation retains it.

Where should the reviewer start?

  • .github/workflows/release.yml: validation, artifact handoff, rehearsal self-test and publication gates.
  • gradle/release-validation.gradle and its application in build.gradle: native publication-model verification.
  • .github/workflows/build.yml and .github/workflows/publish-snapshot.yml: reusable validation and exact-commit snapshot checks.
  • .github/RELEASE.md: current behavior, local non-SNAPSHOT staging/verification, coverage limits and recovery.
  • .github/RELEASE-DESIGN.md: proposed publication redesign, Javadoc authentication and release environment; these are not active configuration.

Why is it needed?

The previous workflow dispatched Build without binding validation to the publishing checkout, referenced missing outputs and used an unrelated asset pattern. Exact-commit snapshots also need freshness checks to avoid publishing an older successful build. Rehearsals exercise packaging, verifier failure and artifact transfer before merging.

Validation — refreshed 13 October 2026

Merged current main (f138120decb3ab88f3badc7943630d0f79b9ecce) into this branch. Current head: 0317517dc49b80be34a920dd6de625d6c57d814b. The effective PR diff is eight CI/release files; the formatting baseline is already on main.

Build, CodeQL and Release rehearsal succeeded. All 12 checks on this head and all six Release jobs passed. The tested merge commit is 99d8b7f6e42ba1578af5cfc58def6785df9f9916, with parents current main and the head above. Its tree matches the locally tested checkout. Main remained unchanged at the final check.

  • 82 local tests passed again: 31 core workflow, 23 native Gradle, 15 release guardrail and 13 snapshot tests. Offline native fixtures stage only to local filesystem repositories; external publication commands in shell tests are mocked. The local Python harness remains outside this PR.
  • Both hosted formatting/unit-test jobs and both dedicated integration jobs passed. The rehearsal integration task actually executed. PR builds retain Gradle task caching; this does not claim every unit-test task was freshly executed.
  • Staging executed 108 tasks, zero from cache. Normal and restored verification each accepted 65 required files across 13 modules.
  • Test rejection of incomplete release artifacts passed: missing metadata was rejected, then restored inventory and package checksums matched.
  • Deploy to Maven Central (Portal), Publish Javadocs and Create GitHub release at the validated commit were each skipped.
  • Independent download audit verified 326 checksum entries, 65 required files, 39 JAR archives, 13 POM coordinates and 13 Gradle module coordinates, with the expected merge SHA/version/event metadata. The Javadoc index is present among 393 files.
  • Fresh test packages and generated Javadocs expire 27 October 2026 at 11:13:37 UTC, as reported by GitHub.
  • Actionlint and git diff --check main...HEAD passed. The refresh commit is DCO signed off, and both hosted DCO checks passed.

Prior targeted verification on 22 September remains historical evidence; it was not rerun as part of this refresh. The verifier, release workflow and harness inputs are unchanged. That work included the retained mutation suite (32 distinct applicable historical mutants killed, one benign survivor; all seven additional safeguard mutants killed), real 13-module retained-artifact checks, excluded-project and artifact-ID rejection, configuration-cache handling, and serial/parallel task ordering. Earlier staging and git-publish preparation smoke checks did not publish. Spotless does not cover gradle/release-validation.gradle.

Remaining live-release limitations

Central precedes downstream verification and Javadocs, with separate deployments per module. Publication across services is not transactional. The runbook distinguishes recovery after a successful Central job from unsafe retries of a partial Central deployment.

Still unverified because rehearsals do not publish:

  • Actual jreleaserDeploy -x publishMavenPublicationToLocalStagingRepository signing and uploading.
  • Whether JReleaser writes anything besides .asc into staging during deployment.
  • Actual execution behavior of the root :jreleaserDeploy task.
  • Central’s handling of duplicate coordinates and partial-deployment recovery.
  • Production credentials, GitHub release/tag creation and Javadoc authentication/push.

Javadoc authentication/identity needs the proposed follow-up. Publishing environment/reviewer/tag policies require an administrator decision. Mutable shared build fragments and action references remain; builds are not claimed reproducible. Path-filtered Release checks must not be globally required for unrelated PRs, and release branches cut from old tags execute their old workflow definitions.

This refresh merged main into the PR branch and pushed that branch, triggering automatic CI. It did not merge the PR into main, publish a release or documentation, create a tag, dispatch/rerun a workflow, or change repository settings.

Checklist

  • Contribution guidelines followed; commits DCO signed off.
  • Local workflow/verifier tests and lint pass.
  • Final-head automatic CI and non-publishing release rehearsal pass.
  • Changelog: not applicable to this CI/release change.

AI assistance

Implementation and automated validation assisted by OpenAI Codex. Additional review assisted by Claude Code.

Signed-off-by: Conor Svensson <conor10@gmail.com>
Signed-off-by: Conor Svensson <conor10@gmail.com>
Signed-off-by: Conor Svensson <conor10@gmail.com>
Signed-off-by: Conor Svensson <conor10@gmail.com>
Signed-off-by: Conor Svensson <conor10@gmail.com>
Signed-off-by: Conor Svensson <conor10@gmail.com>
Signed-off-by: Conor Svensson <conor10@gmail.com>
Signed-off-by: Conor Svensson <conor10@gmail.com>
Signed-off-by: Conor Svensson <conor10@gmail.com>
Signed-off-by: Conor Svensson <conor10@gmail.com>
Signed-off-by: Conor Svensson <conor10@gmail.com>
@conor10 conor10 mentioned this pull request Sep 27, 2026
3 tasks done
@conor10
conor10 marked this pull request as ready for review September 28, 2026 12:47
Signed-off-by: Conor Svensson <conor10@gmail.com>
@conor10

conor10 commented Oct 15, 2026

Copy link
Copy Markdown
Contributor Author

@NickSneo / @gtebrean any issues with this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants