Skip to content

Fill Java CI gaps for Maven Central publication - #23447

Closed
paul-aiyedun wants to merge 33 commits into
NVIDIA:release/26.08from
paul-aiyedun:paul/fix_maven_publication_gaps
Closed

Fill Java CI gaps for Maven Central publication#23447
paul-aiyedun wants to merge 33 commits into
NVIDIA:release/26.08from
paul-aiyedun:paul/fix_maven_publication_gaps

Conversation

@paul-aiyedun

@paul-aiyedun paul-aiyedun commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Description

  • Add a java-publish job to build.yaml that hands the assembled
    cudf_java_maven_repo artifact to the shared maven-publish.yaml workflow.
    It runs only on release tag builds and stages the bundle as PENDING in the
    Sonatype Central Publisher Portal, leaving the final release to a human in
    the Portal UI.

  • Seed the unclassified primary JAR from the cuda12 classifier in
    assemble_maven_repo.sh. Maven Central serves this to consumers that depend
    on ai.rapids:cudf without a classifier.

  • Detect release-tag builds via rapids-is-release-build. Strip -SNAPSHOT
    and rewrite the POM before packaging so release artifacts carry the release
    version. All other builds keep -SNAPSHOT.

  • Require GITHUB_REF in build_cudf_java_jar.sh and forward it into the
    container, so the release-vs-snapshot decision is made from the same ref CI
    uses.

  • Default GITHUB_REF to the current branch in test_java_build_local.sh so
    local runs stay on the SNAPSHOT path.

  • Document release-tag vs SNAPSHOT versioning in java/ci/README.md.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

* Seed unclassified primary JAR from the cuda12 classifier in
  assemble_maven_repo.sh.

* Detect release-tag builds via rapids-is-release-build. Strip -SNAPSHOT
  and rewrite the POM before packaging.

* Require GITHUB_REF in build_cudf_java_jar.sh and forward it into the
  container.

* Default GITHUB_REF to the current branch in test_java_build_local.sh
  so local runs stay on the SNAPSHOT path.

* Document release-tag vs SNAPSHOT versioning in java/ci/README.md.
@copy-pr-bot

copy-pr-bot Bot commented Jul 27, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@github-actions github-actions Bot added the Java Affects Java cuDF API. label Jul 27, 2026
@paul-aiyedun paul-aiyedun added non-breaking Non-breaking change ci bug Something isn't working labels Jul 27, 2026
@paul-aiyedun

Copy link
Copy Markdown
Contributor Author

/ok to test ecf8bde

@paul-aiyedun

Copy link
Copy Markdown
Contributor Author

/ok to test e7d81cd

@paul-aiyedun

Copy link
Copy Markdown
Contributor Author

/ok to test c3ddf15

@paul-aiyedun

Copy link
Copy Markdown
Contributor Author

/ok to test bdb4da6

@paul-aiyedun

Copy link
Copy Markdown
Contributor Author

/ok to test 4bfd057

1 similar comment
@paul-aiyedun

Copy link
Copy Markdown
Contributor Author

/ok to test 4bfd057

@paul-aiyedun

Copy link
Copy Markdown
Contributor Author

/ok to test 279c4b3

@paul-aiyedun

Copy link
Copy Markdown
Contributor Author

/ok to test b202563

@paul-aiyedun

Copy link
Copy Markdown
Contributor Author

/ok to test 91b532a

@paul-aiyedun

Copy link
Copy Markdown
Contributor Author

/ok to test 50ddf52

@paul-aiyedun

Copy link
Copy Markdown
Contributor Author

@paul-aiyedun
paul-aiyedun marked this pull request as ready for review August 4, 2026 14:59
@paul-aiyedun
paul-aiyedun requested review from a team as code owners August 4, 2026 14:59
@paul-aiyedun
paul-aiyedun requested a review from jameslamb August 4, 2026 14:59
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added automated publishing for tagged Java release candidates, including Maven Central staging.
    • Release builds now produce unclassified Maven artifacts alongside CUDA-specific variants.
  • Bug Fixes

    • Prevented artifact assembly when required CUDA 12 output is unavailable.
    • Preserved snapshot versions for non-release builds while removing snapshot suffixes from releases.
    • Improved local build handling by automatically detecting the current Git reference when needed.
  • Documentation

    • Added guidance for release-tag versioning and locally rehearsing release builds.

Walkthrough

This PR adds tagged Java artifact publication through a shared Maven workflow. It updates Java builds to use GITHUB_REF for release versioning and creates an unclassified Maven JAR from the CUDA 12 artifact. Documentation covers the updated release and local build flow.

Changes

Java release build and publish

Layer / File(s) Summary
GITHUB_REF-based release versioning
java/ci/build_cudf_java_jar.sh, java/ci/build_cudf_java_jar_in_container.sh, java/ci/test_java_build_local.sh, java/ci/README.md
The build requires and propagates GITHUB_REF. Release builds remove -SNAPSHOT and update Maven versions. Local builds derive GITHUB_REF when it is unset. The README documents this behavior and the local release flow.
Unclassified primary JAR assembly
java/ci/assemble_maven_repo.sh, java/ci/README.md
The assembly script copies the CUDA 12 classifier JAR to create the unclassified primary JAR. It fails when the CUDA 12 artifact is missing. The README documents the resulting repository layout.
java-publish workflow job
.github/workflows/build.yaml
Adds a tagged release-candidate publication job that uses the shared Maven publishing workflow, deployment secrets, source SHA metadata, and Maven Central staging.

Estimated code review effort: 2 (Simple) | ~12 minutes

Possibly related PRs

  • rapidsai/cudf#23261: Extends the Java build and gather pipeline with release versioning, artifact assembly, and Maven publication.
  • rapidsai/cudf#23382: Overlaps in the Java build workflow and release-versioning scripts.
  • rapidsai/cudf#23389: Overlaps in Java Maven packaging and repository assembly scripts.

Suggested labels: feature request

Suggested reviewers: jameslamb, msarahan, nvtimliu

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the PR's primary change: addressing Java CI gaps for Maven Central publication.
Description check ✅ Passed The description directly explains the Java CI, Maven Central publication, release versioning, artifact, and documentation changes.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (3)
java/ci/README.md (2)

83-91: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add a language to the fenced code block.

The fenced code block at Line 83 has no language specified. Static analysis flags this as MD040. Add text or an appropriate language identifier.

📝 Proposed fix
-```
+```text
 /tmp/maven-repo/ai/rapids/cudf/26.08.0-SNAPSHOT/
     cudf-26.08.0-SNAPSHOT.jar
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@java/ci/README.md` around lines 83 - 91, Update the fenced code block in the
README around the Maven repository listing to specify the text language
identifier, preserving the existing listing content unchanged.

Source: Linters/SAST tools


108-111: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use a fenced code block instead of an indented block.

Line 110 uses an indented code block. Static analysis flags this as MD046. Convert it to a fenced code block for consistency with the rest of the document.

📝 Proposed fix
 To rehearse the release path locally:

-    GITHUB_REF=refs/tags/vYY.MM.PP ./java/ci/test_java_build_local.sh
+```bash
+GITHUB_REF=refs/tags/vYY.MM.PP ./java/ci/test_java_build_local.sh
+```
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@java/ci/README.md` around lines 108 - 111, Update the “To rehearse the
release path locally” example in the README to use a fenced bash code block
instead of indentation, preserving the existing GITHUB_REF command unchanged.

Source: Linters/SAST tools

java/ci/assemble_maven_repo.sh (1)

178-182: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Log the skip case and consider verifying staleness before reuse.

The copy branch logs a message. The skip branch does not. Add a log message when the unclassified JAR already exists, so CI output clearly shows whether the file was copied or already present.

Also consider whether ${OUTPUT_DIR} can be reused across runs with a different cuda12 jar. If it can, the pre-existing ${UNCLASSIFIED} file could be stale and this check keeps it instead of refreshing it from the current ${PRIMARY_SOURCE}. Confirm the caller (per .github/workflows/build.yaml) always provides a fresh --output-dir per run before relying on the presence check alone.

♻️ Proposed fix to add a skip log message
 UNCLASSIFIED="${DEST_DIR}/cudf-${FIRST_VERSION}.jar"
 if [[ ! -f "${UNCLASSIFIED}" ]]; then
   cp -f "${PRIMARY_SOURCE}" "${UNCLASSIFIED}"
   echo "  + cudf-${FIRST_VERSION}.jar (unclassified primary, copy of cuda12)"
+else
+  echo "  = cudf-${FIRST_VERSION}.jar (unclassified primary already present, skipped)"
 fi
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@java/ci/assemble_maven_repo.sh` around lines 178 - 182, Add a log message in
the else branch or after the if block checking for UNCLASSIFIED to indicate when
the unclassified JAR file already exists and is being reused, mirroring the
logging pattern used in the copy branch. This ensures CI output clearly shows
whether the file was copied or skipped as already present, maintaining
visibility into the build process.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/build.yaml:
- Around line 553-557: Replace the mutable `@release/26.08` reference in the
shared publishing workflow invocation with the reviewed commit SHA for that ref,
preserving the existing secrets and workflow configuration. Verify the SHA
resolves to the intended rapidsai/shared-workflows release/26.08 ref before
merging.

In `@java/ci/test_java_build_local.sh`:
- Around line 146-150: The current logic at line 148 uses git symbolic-ref HEAD
with || true, which silently produces an empty GITHUB_REF when HEAD is detached
(at a tag or commit), breaking downstream consumers like build_cudf_java_jar.sh.
Replace the silent fallback with explicit handling for detached HEAD: attempt
git symbolic-ref HEAD first for branch checkouts, and if that fails, try to
derive the ref (such as using git describe --exact-match --tags for tag
checkouts, or git rev-parse HEAD for commit checkouts), or exit with a clear
error message explaining that a detached HEAD requires either a tag or branch
checkout to proceed.

---

Nitpick comments:
In `@java/ci/assemble_maven_repo.sh`:
- Around line 178-182: Add a log message in the else branch or after the if
block checking for UNCLASSIFIED to indicate when the unclassified JAR file
already exists and is being reused, mirroring the logging pattern used in the
copy branch. This ensures CI output clearly shows whether the file was copied or
skipped as already present, maintaining visibility into the build process.

In `@java/ci/README.md`:
- Around line 83-91: Update the fenced code block in the README around the Maven
repository listing to specify the text language identifier, preserving the
existing listing content unchanged.
- Around line 108-111: Update the “To rehearse the release path locally” example
in the README to use a fenced bash code block instead of indentation, preserving
the existing GITHUB_REF command unchanged.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 11f2daca-396f-4d03-8133-f195f79a0fd8

📥 Commits

Reviewing files that changed from the base of the PR and between 132eaef and 4b2b800.

📒 Files selected for processing (6)
  • .github/workflows/build.yaml
  • java/ci/README.md
  • java/ci/assemble_maven_repo.sh
  • java/ci/build_cudf_java_jar.sh
  • java/ci/build_cudf_java_jar_in_container.sh
  • java/ci/test_java_build_local.sh

Comment thread .github/workflows/build.yaml
Comment thread java/ci/test_java_build_local.sh
@paul-aiyedun paul-aiyedun added the DO NOT MERGE Hold off on merging; see PR for details label Aug 5, 2026
@paul-aiyedun
paul-aiyedun marked this pull request as draft August 5, 2026 06:10
@msarahan

msarahan commented Aug 5, 2026

Copy link
Copy Markdown
Member

re-targeting this to main

@msarahan
msarahan changed the base branch from release/26.08 to main August 5, 2026 20:55
@msarahan
msarahan changed the base branch from main to release/26.08 August 5, 2026 22:13
@msarahan

msarahan commented Aug 5, 2026

Copy link
Copy Markdown
Member

@paul-aiyedun told me that this PR has to target release/26.08 for his manual release process to run. This PR will not be merged. Instead, Paul will create a new PR targeting main after this release process for 26.08 is finished.

@paul-aiyedun

Copy link
Copy Markdown
Contributor Author

@paul-aiyedun told me that this PR has to target release/26.08 for his manual release process to run. This PR will not be merged. Instead, Paul will create a new PR targeting main after this release process for 26.08 is finished.

That is correct.

@paul-aiyedun

Copy link
Copy Markdown
Contributor Author

/ok to test 69bc5ef

@paul-aiyedun

Copy link
Copy Markdown
Contributor Author

/ok to test 79be8de

@paul-aiyedun

Copy link
Copy Markdown
Contributor Author

/ok to test 2f41ae5

@paul-aiyedun

Copy link
Copy Markdown
Contributor Author

@paul-aiyedun

Copy link
Copy Markdown
Contributor Author

Closing in favor of a new PR/branch that targets the main branch.

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

Labels

bug Something isn't working ci DO NOT MERGE Hold off on merging; see PR for details Java Affects Java cuDF API. non-breaking Non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants