Skip to content

Deploy java docs#2039

Open
aamijar wants to merge 2 commits intorapidsai:mainfrom
aamijar:deploy-java-docs
Open

Deploy java docs#2039
aamijar wants to merge 2 commits intorapidsai:mainfrom
aamijar:deploy-java-docs

Conversation

@aamijar
Copy link
Copy Markdown
Member

@aamijar aamijar commented Apr 25, 2026

Add the java-docs to the reference API.

Resolves #973
Resolves #580
Resolves #1593

@aamijar aamijar requested review from a team as code owners April 25, 2026 06:43
@aamijar aamijar requested a review from msarahan April 25, 2026 06:43
@aamijar aamijar self-assigned this Apr 25, 2026
@aamijar aamijar moved this to In Progress in Unstructured Data Processing Apr 25, 2026
@aamijar aamijar added non-breaking Introduces a non-breaking change doc Improvements or additions to documentation labels Apr 25, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 25, 2026

📝 Walkthrough

Summary by CodeRabbit

  • Documentation

    • Java API documentation is now automatically generated and integrated into the official documentation site.
    • Java API reference is now included in the main documentation navigation alongside other supported language APIs.
  • Chores

    • Updated documentation build configuration to include Java in the build process.

Walkthrough

Adds Java Javadoc generation and integration into the docs pipeline: build scripts run Maven javadoc for java/cuvs-java, generated apidocs are staged under Sphinx static assets, java is added to docs dependencies, and a Java API Sphinx page (with iframe) is included in the toctree.

Changes

Cohort / File(s) Summary
Build scripts
build.sh, ci/build_docs.sh
Invoke Maven compile and javadoc:javadoc-no-fork for java/cuvs-java (exclude com.nvidia.cuvs.internal.panama, add -Dspotless.apply.skip=true) and sync the resulting target/reports/apidocs/ into Sphinx static HTML under _static/java / ./build/dirhtml/_static/java.
Docs configuration
dependencies.yaml
Add java to the docs job includes list so Java dependency group is pulled into docs builds.
Sphinx content
docs/source/api_docs.rst, docs/source/java_api/index.rst
Add java_api/index.rst to the API toctree and create java_api/index.rst that links to and embeds the generated Javadoc HTML (iframe + sidebar CSS tweak).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Deploy java docs' directly describes the main objective of the PR: integrating and deploying Java API documentation into the cuVS docs.
Description check ✅ Passed The description 'Add the java-docs to the reference API' is concise and directly related to the changes, which add Java API docs to the Sphinx documentation.
Linked Issues check ✅ Passed The PR fully addresses all three linked issues: #973 (consolidate Java API docs into main cuVS docs), #580 (deploy Javadocs unified with docs), and #1593 (deploy cuvs-java Javadocs with cuVS documentation nightly).
Out of Scope Changes check ✅ Passed All changes (build scripts, dependencies, and Sphinx documentation files) are directly scoped to deploying Java documentation and have no unrelated modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
ci/build_docs.sh (1)

67-67: Make Java docs staging idempotent and failure-friendly.

Using mv here can create unexpected nesting if the destination already exists. Prefer explicit directory checks/copy semantics for predictable output and clearer errors.

🔧 Proposed refactor
-mv ../java/cuvs-java/target/reports/apidocs ./build/dirhtml/_static/java
+if [[ ! -d ../java/cuvs-java/target/reports/apidocs ]]; then
+  rapids-logger "Java apidocs missing at java/cuvs-java/target/reports/apidocs"
+  exit 1
+fi
+rm -rf ./build/dirhtml/_static/java
+mkdir -p ./build/dirhtml/_static/java
+cp -a ../java/cuvs-java/target/reports/apidocs/. ./build/dirhtml/_static/java/
As per coding guidelines: `ci/**/*`: Check for proper error handling and meaningful error messages.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ci/build_docs.sh` at line 67, Replace the bare mv call that moves Java
apidocs (the line invoking "mv ../java/cuvs-java/target/reports/apidocs
./build/dirhtml/_static/java") with an idempotent, failure-friendly sequence:
check whether the source directory exists and fail with a clear error if not,
create or clear the destination directory before copying to avoid nesting, use a
recursive copy/rsync semantic rather than mv to preserve predictable output, and
ensure any failure prints a meaningful message and exits non‑zero; update the
script around the mv invocation so the functions/steps that validate source
existence, prepare "./build/dirhtml/_static/java", and perform the copy/rsync
are used instead of the raw mv.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/source/java_api/index.rst`:
- Line 12: The iframe element in the docs (the <iframe ...> in the java_api
index) lacks an accessible title; update the iframe tag that currently reads
src="../_static/java/index.html" height="720px" width="100%" to include a
descriptive title attribute (e.g., title="Java API documentation" or similar) so
assistive technologies can identify the embedded content.

---

Nitpick comments:
In `@ci/build_docs.sh`:
- Line 67: Replace the bare mv call that moves Java apidocs (the line invoking
"mv ../java/cuvs-java/target/reports/apidocs ./build/dirhtml/_static/java") with
an idempotent, failure-friendly sequence: check whether the source directory
exists and fail with a clear error if not, create or clear the destination
directory before copying to avoid nesting, use a recursive copy/rsync semantic
rather than mv to preserve predictable output, and ensure any failure prints a
meaningful message and exits non‑zero; update the script around the mv
invocation so the functions/steps that validate source existence, prepare
"./build/dirhtml/_static/java", and perform the copy/rsync are used instead of
the raw mv.
🪄 Autofix (Beta)

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: d27d69c8-37a2-4b74-9c88-6d745d66bdb0

📥 Commits

Reviewing files that changed from the base of the PR and between f2bffb6 and a3308ec.

📒 Files selected for processing (5)
  • build.sh
  • ci/build_docs.sh
  • dependencies.yaml
  • docs/source/api_docs.rst
  • docs/source/java_api/index.rst

Open Java API documentation in a new tab &#8599;
</a>
</p>
<iframe src="../_static/java/index.html" height="720px" width="100%"></iframe>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Add a title to the iframe for accessibility.

The embedded iframe should include a descriptive title so assistive technologies can identify its purpose.

♿ Proposed fix
-    <iframe src="../_static/java/index.html" height="720px" width="100%"></iframe>
+    <iframe
+        src="../_static/java/index.html"
+        title="cuVS Java API documentation"
+        height="720px"
+        width="100%"></iframe>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/source/java_api/index.rst` at line 12, The iframe element in the docs
(the <iframe ...> in the java_api index) lacks an accessible title; update the
iframe tag that currently reads src="../_static/java/index.html" height="720px"
width="100%" to include a descriptive title attribute (e.g., title="Java API
documentation" or similar) so assistive technologies can identify the embedded
content.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@build.sh`:
- Around line 554-556: The mvn invocation's -DexcludePackageNames currently sets
only com.nvidia.cuvs.internal.panama which conflicts with the pom.xml
exclusions; update the -DexcludePackageNames value in the mvn command (the line
invoking mvn compile javadoc:javadoc-no-fork) to include the full exclusion list
used in the pom (for example:
com.nvidia.cuvs.examples,com.nvidia.cuvs.internal.panama) or change it to match
the actual package names in pom.xml so the Javadoc exclusions are aligned.
🪄 Autofix (Beta)

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: 53e108c1-5991-405b-87d9-d76b76df1f4f

📥 Commits

Reviewing files that changed from the base of the PR and between a3308ec and d55e9f1.

📒 Files selected for processing (2)
  • build.sh
  • ci/build_docs.sh
🚧 Files skipped from review as they are similar to previous changes (1)
  • ci/build_docs.sh

Comment thread build.sh
Comment on lines +554 to +556
mvn compile javadoc:javadoc-no-fork \
-DexcludePackageNames=com.nvidia.cuvs.internal.panama \
-Dspotless.apply.skip=true
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify the actual package structure to understand what should be excluded

echo "=== Checking for panama packages ==="
fd -t d -i "panama" java/

echo ""
echo "=== Checking for examples packages ==="
fd -t d "examples" java/

echo ""
echo "=== pom.xml excludePackageNames configuration ==="
rg -n "excludePackageNames" java/cuvs-java/pom.xml

Repository: rapidsai/cuvs

Length of output: 399


Align package exclusions with pom.xml configuration.

The -DexcludePackageNames value here only excludes com.nvidia.cuvs.internal.panama, but java/cuvs-java/pom.xml:201 excludes com.nvidia.cuvs.examples,com.nvidia.cuvs.panama. Since Maven -D properties override pom.xml entirely, building docs via this script will:

  • Include com.nvidia.cuvs.examples in public API docs (likely unintended)
  • Exclude com.nvidia.cuvs.internal.panama instead of com.nvidia.cuvs.panama

Either pass the full exclusion list (com.nvidia.cuvs.examples,com.nvidia.cuvs.internal.panama) or verify that the pom.xml package names match the actual codebase structure.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@build.sh` around lines 554 - 556, The mvn invocation's -DexcludePackageNames
currently sets only com.nvidia.cuvs.internal.panama which conflicts with the
pom.xml exclusions; update the -DexcludePackageNames value in the mvn command
(the line invoking mvn compile javadoc:javadoc-no-fork) to include the full
exclusion list used in the pom (for example:
com.nvidia.cuvs.examples,com.nvidia.cuvs.internal.panama) or change it to match
the actual package names in pom.xml so the Javadoc exclusions are aligned.

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

Labels

doc Improvements or additions to documentation non-breaking Introduces a non-breaking change

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

[DOC] Deploy cuvs-java Javadocs with cuVS documentation [DOC] [Java] Documentation for the Java API [FEA] Deploy Javadocs

1 participant