Repository navigation
Fix: repair Maven merge SNAPSHOT publishing - #896
Merged
ModeSevenIndustrialSolutions merged 1 commit intoSep 1, 2026
Merged
ModeSevenIndustrialSolutions merged 1 commit into
ModeSevenIndustrialSolutions merged 1 commit into
Conversation
askb
force-pushed
the
fix/compose-maven-merge-snapshot
branch
from
September 1, 2026 13:10
10dc3e5 to
4332d8e
Compare
compose-maven-merge could not publish. Four independent defects:
1. Boolean gates never matched. PUSH_NEXUS, PUSH_ARTIFACTORY,
PUSH_CENTRAL and SIGUL_SIGN were compared with == 'true'. A typed
workflow_call boolean arrives as a real boolean, and comparing a
boolean to a string casts the string to a number, giving NaN, so
the gate was always false. Verified on a runner: with FLAG passed
as true, a job gated on inputs.FLAG == 'true' is skipped while one
gated on inputs.FLAG runs. Every publish job, and artifact signing,
was dead code.
2. ARTIFACT_DIR defaulted to the literal string ${GITHUB_WORKSPACE}/m2repo.
GitHub only expands ${{ }}, so upload-artifact, download-artifact and
sigul received a path containing an unexpanded shell variable. Now
defaults to the workspace-relative m2repo; absolute overrides still
work.
3. repository_name read ${{ env.NEXUS_REPO }}, which is never defined
in this workflow, so it resolved empty. Use vars.NEXUS_REPO.
4. SNAPSHOT buildNumber restarted at 1 on every run. maven-deploy-plugin
derives the next buildNumber from the maven-metadata.xml already in
the local repository; a clean runner has none, so each publish
clobbered the SNAPSHOT history rather than appending to it. Pre-fetch
the published metadata before the build, and publish with
repository_format maven2_upload scoped to the project group path so
the uploaded tree carries Maven coordinates.
The pre-fetch pulls every maven-metadata.xml already published for the
group, most of which a given build never touches. Uploading those back
unchanged would revert any sibling artifact published while the build
was running, so byte-identical metadata and its checksums are dropped
before publishing. This mirrors global-jjb, where maven-fetch-metadata.sh
and maven-deploy.sh have always been a pair; only the fetch half had
been carried over.
The group path is read from the project's own groupId, falling back to
the parent's per Maven's inheritance rule, matching the xmlstarlet query
in global-jjb. Grepping the first <groupId> returns the parent instead,
which silently pre-fetches the wrong project's metadata.
Also adds an ENV_VARS input so callers can expose repository variables
to the build, matching compose-maven-verify.
Verified against opendaylight/infrautils, which runs this logic inline
today and now publishes an incrementing buildNumber.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
askb
force-pushed
the
fix/compose-maven-merge-snapshot
branch
from
September 1, 2026 13:10
4332d8e to
91f287a
Compare
ModeSevenIndustrialSolutions
approved these changes
Sep 1, 2026
odl-github
pushed a commit
to opendaylight/infrautils
that referenced
this pull request
Sep 1, 2026
Replace the inline maven-merge and publish-nexus jobs with a call to lfit/releng-reusable-workflows compose-maven-merge, keeping prepare and vote local since the reusable workflow has no Gerrit integration. The SNAPSHOT metadata pre-fetch and the maven2_upload publish that were developed here have been upstreamed, so this repo no longer carries a private copy. 115 lines of workflow become 23. secrets: inherit is required because compose-maven-merge reads secrets.NEXUS_USERNAME and secrets.NEXUS_PASSWORD without declaring a secrets block of its own. Depends on lfit/releng-reusable-workflows#896, which is merged. That PR added the ENV_VARS input, repaired the publish gates, and ported the unmodified-metadata pruning from global-jjb. Note that a workflow change takes effect one merge late: Gerrit dispatches via workflow_dispatch on refs/heads/master, and GitHub resolves the workflow file before replication completes. Verify with a manual dispatch rather than from the run this change triggers. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Change-Id: If601f8579f9e45138474104da856f80d814ea018 Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
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.
compose-maven-merge could not publish. Four independent defects:
Boolean gates never matched. PUSH_NEXUS, PUSH_ARTIFACTORY,
PUSH_CENTRAL and SIGUL_SIGN were compared with == 'true'. A typed
workflow_call boolean arrives as a real boolean, and comparing a
boolean to a string casts the string to a number, giving NaN, so
the gate was always false. Verified on a runner: with FLAG passed
as true, a job gated on inputs.FLAG == 'true' is skipped while one
gated on inputs.FLAG runs. Every publish job, and artifact signing,
was dead code.
ARTIFACT_DIR defaulted to the literal string ${GITHUB_WORKSPACE}/m2repo.
GitHub only expands ${{ }}, so upload-artifact, download-artifact and
sigul received a path containing an unexpanded shell variable. Now
defaults to the workspace-relative m2repo; absolute overrides still
work.
repository_name read ${{ env.NEXUS_REPO }}, which is never defined
in this workflow, so it resolved empty. Use vars.NEXUS_REPO.
SNAPSHOT buildNumber restarted at 1 on every run. maven-deploy-plugin
derives the next buildNumber from the maven-metadata.xml already in
the local repository; a clean runner has none, so each publish
clobbered the SNAPSHOT history rather than appending to it. Pre-fetch
the published metadata before the build, and publish with
repository_format maven2_upload scoped to the project group path so
the uploaded tree carries Maven coordinates.
The pre-fetch pulls every maven-metadata.xml already published for the
group, most of which a given build never touches. Uploading those back
unchanged would revert any sibling artifact published while the build
was running, so byte-identical metadata and its checksums are dropped
before publishing. This mirrors global-jjb, where maven-fetch-metadata.sh
and maven-deploy.sh have always been a pair; only the fetch half had
been carried over.
The group path is read from the project's own groupId, falling back to
the parent's per Maven's inheritance rule, matching the xmlstarlet query
in global-jjb. Grepping the first returns the parent instead,
which silently pre-fetches the wrong project's metadata.
Also adds an ENV_VARS input so callers can expose repository variables
to the build, matching compose-maven-verify.
Verified against opendaylight/infrautils, which runs this logic inline
today and now publishes an incrementing buildNumber.
Signed-off-by: Anil Belur abelur@linuxfoundation.org