Skip to content

fix(ci): gate snapshot deploy and release on successful build - #4055

Merged
kthoms merged 2 commits into
mainfrom
ci/integration-build-deploy-gating
Nov 6, 2026
Merged

kthoms merged 2 commits into
mainfrom
ci/integration-build-deploy-gating

Conversation

@kthoms

@kthoms kthoms commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Problem

In the Integration Build workflow, Deploy Snapshots, Release and Post-Release ran even when Build failed (e.g. runs 42199441173, 42006883540, 41811628014). Their if: only checked always() && !cancelled() and never the results of the jobs they depend on. Post-Release then notified operaton-docker, and that payload had a quoting bug: the version was sent as the literal string ${NEEDS_BUILD_OUTPUTS_VERSION}.

Deploy Snapshots also ran a full ./mvnw deploy and rebuilt the whole project, even though the build job had already produced every artifact.

Changes

  • Deploy Snapshots
    • Runs only when Build, Integration Tests and Documentation all succeed (Documentation is now in needs).
    • No rebuild. It downloads the build-artifacts-17 bundle and deploys the already-staged target/staging-deploy to https://central.sonatype.com/repository/maven-snapshots/, using the new .github/scripts/deploy-staged-snapshots.sh. The script reads each version's maven-metadata.xml and makes one deploy:deploy-file call per artifact (-SNAPSHOT versions only, 4 at a time).
    • Respects dry_run.
    • The unused GPG import is removed (the snapshot profile never signed anything).
    • Uses server id central, which since chore(ci): allow Central origin for snapshot deploy credentials #4058 lists https://central.sonatype.com under repositoryOrigins, so Maven 3.10 sends the credentials there.
    • Passes -Ddeploy.skip=false. Without it, the root pom's deploy.skip=true made every deploy-file call a silent no-op.
  • Build: no longer deletes maven-metadata.*. The Release job strips them after unpacking, before JReleaser, so JReleaser gets the same input as before.
  • Release: requires Build and Documentation to succeed, and Integration Tests to succeed or be skipped.
  • Post-Release: requires Release to succeed. The Docker dispatch body is now built with jq, so the version is filled in and quoted correctly.

Verification

  • The script was run from the repo root with the Maven 3.10 wrapper against a local HTTP repo that requires basic auth. With the CI-shaped settings.xml (id central + repositoryOrigins), jar, pom, sources and snapshot metadata were all uploaded. Without repositoryOrigins, the upload fails and the script exits with an error.
  • shellcheck (script) and zizmor are clean. actionlint reports nothing new, and the SC2016 warning on the Docker payload is gone.
  • Not yet tested against Maven Central. The next workflow_dispatch nightly run is the first real test.

Notes

  • Dispatching with integration_tests=false now blocks the snapshot deploy, because Integration Tests are required to succeed.

🤖 Generated with Claude Code

Copilot AI balanced review requested due to automatic review settings November 6, 2026 14:09
@github-actions github-actions Bot added the scope:ci Changes to the CI, e.g. GitHub workflows label Nov 6, 2026
@kthoms
kthoms force-pushed the ci/integration-build-deploy-gating branch from af19b79 to 9bbe6bf Compare November 6, 2026 14:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The Maven invocation inherits deploy.skip=true, causing snapshot uploads to be skipped while the deployment workflow reports success.

1 open issue
What changed in this PR

This PR tightens the Integration Build workflow’s publishing gates and reuses staged build artifacts for snapshot deployment instead of rebuilding the project.

Changes:

  • Require successful upstream jobs before snapshot deployment, release, and post-release notification.
  • Add parallel deployment of staged snapshot artifacts, respecting dry_run and preserving metadata until release preparation.
  • Build the Docker dispatch payload with jq to correctly include the version.
File Description
.github/​workflows/​integration-build.yml Adds publishing gates, staged-artifact deployment, and corrected Docker payload generation.
.github/​scripts/​deploy-staged-snapshots.sh Reads staged Maven metadata and deploys snapshot artifacts in parallel.

Review effort: Balanced

@kthoms kthoms added the build Changes related to the build system, including Maven configurations, GitHub Actions workflows label Nov 6, 2026
kthoms and others added 2 commits November 6, 2026 22:57
Deploy Snapshots, Release and Post-Release ran even when the build
failed, because their conditions only checked always() && !cancelled().
Post-Release then notified the Docker repository with an empty version.

- Deploy Snapshots requires Build, Integration Tests and Documentation
  to succeed
- Deploy Snapshots no longer rebuilds: it deploys the artifacts the
  Java 17 build staged in target/staging-deploy via deploy:deploy-file
  (new script .github/scripts/deploy-staged-snapshots.sh)
- maven-metadata files are kept in the staged repo and stripped in the
  Release job before JReleaser
- Release requires Build and Documentation to succeed and Integration
  Tests to succeed or be skipped; Post-Release requires Release
- Snapshot deploy honours dry_run; unused GPG import removed; server id
  central-snapshots avoids the clash with the pom's central repository
- Docker dispatch payload is built with jq, so the version is expanded
  instead of being sent as a literal ${NEEDS_BUILD_OUTPUTS_VERSION}

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- pass -Ddeploy.skip=false: the root pom sets deploy.skip=true, which
  turned every deploy-file call into a silent no-op
- deploy with server id central again: since #4058 the generated
  settings.xml allows https://central.sonatype.com as repository origin
  for that id, so a separate central-snapshots id is not needed
- address Sonar findings in deploy-staged-snapshots.sh

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kthoms
kthoms force-pushed the ci/integration-build-deploy-gating branch from 9bbe6bf to fe620ac Compare November 6, 2026 21:59
@kthoms
kthoms merged commit c892b1f into main Nov 6, 2026
7 checks passed
@kthoms
kthoms deleted the ci/integration-build-deploy-gating branch November 6, 2026 22:04
kthoms added a commit that referenced this pull request Nov 6, 2026
- Deploy Snapshots, Release and Post-Release ran even when the build
failed, because their conditions only checked always() && !cancelled().
Post-Release then notified the Docker repository with an empty version.
- Deploy Snapshots requires Build, Integration Tests and Documentation
  to succeed
- Deploy Snapshots no longer rebuilds: it deploys the artifacts the
  Java 17 build staged in target/staging-deploy via deploy:deploy-file
  (new script .github/scripts/deploy-staged-snapshots.sh)
- maven-metadata files are kept in the staged repo and stripped in the
  Release job before JReleaser
- Release requires Build and Documentation to succeed and Integration
  Tests to succeed or be skipped; Post-Release requires Release
- Snapshot deploy honours dry_run; unused GPG import removed; server id
  central-snapshots avoids the clash with the pom's central repository
- Docker dispatch payload is built with jq, so the version is expanded
  instead of being sent as a literal ${NEEDS_BUILD_OUTPUTS_VERSION}

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
(cherry picked from commit c892b1f)
@sonarqubecloud

sonarqubecloud Bot commented Nov 6, 2026

Copy link
Copy Markdown

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

Labels

build Changes related to the build system, including Maven configurations, GitHub Actions workflows scope:ci Changes to the CI, e.g. GitHub workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants