Fill Java CI gaps for Maven Central publication - #23447
Conversation
* 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.
|
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. |
|
/ok to test ecf8bde |
|
/ok to test e7d81cd |
|
/ok to test c3ddf15 |
|
/ok to test bdb4da6 |
|
/ok to test 4bfd057 |
1 similar comment
|
/ok to test 4bfd057 |
|
/ok to test 279c4b3 |
|
/ok to test b202563 |
|
/ok to test 91b532a |
|
/ok to test 50ddf52 |
This reverts commit c047a47.
|
End-to-end workflow validation (using temporary commits c047a47 and f04d57d) ran successfully (see https://github.com/rapidsai/cudf/actions/runs/30878321777/job/91917570115?pr=23447). Generated Maven Central bundle: https://github.com/rapidsai/cudf/actions/runs/30878321777/artifacts/8883424017 |
📝 WalkthroughSummary by CodeRabbit
WalkthroughThis PR adds tagged Java artifact publication through a shared Maven workflow. It updates Java builds to use ChangesJava release build and publish
Estimated code review effort: 2 (Simple) | ~12 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (3)
java/ci/README.md (2)
83-91: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd 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
textor 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 winUse 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 winLog 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 differentcuda12jar. 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-dirper 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
📒 Files selected for processing (6)
.github/workflows/build.yamljava/ci/README.mdjava/ci/assemble_maven_repo.shjava/ci/build_cudf_java_jar.shjava/ci/build_cudf_java_jar_in_container.shjava/ci/test_java_build_local.sh
|
re-targeting this to main |
|
@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. |
|
/ok to test 69bc5ef |
|
/ok to test 79be8de |
|
/ok to test 2f41ae5 |
|
Published artifact for 26.08: https://github.com/rapidsai/cudf/actions/runs/31146897853/artifacts/8984957232 |
|
Closing in favor of a new PR/branch that targets the |
Description
Add a
java-publishjob tobuild.yamlthat hands the assembledcudf_java_maven_repoartifact to the sharedmaven-publish.yamlworkflow.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 dependon
ai.rapids:cudfwithout a classifier.Detect release-tag builds via
rapids-is-release-build. Strip-SNAPSHOTand rewrite the POM before packaging so release artifacts carry the release
version. All other builds keep
-SNAPSHOT.Require
GITHUB_REFinbuild_cudf_java_jar.shand forward it into thecontainer, so the release-vs-snapshot decision is made from the same ref CI
uses.
Default
GITHUB_REFto the current branch intest_java_build_local.shsolocal runs stay on the SNAPSHOT path.
Document release-tag vs SNAPSHOT versioning in java/ci/README.md.
Checklist