Skip to content

chore: build java release CLIs against Maven Central - #652

Merged
dmihalcik-virtru merged 1 commit into
mainfrom
DSPX-5177-locobuf
Oct 15, 2026
Merged

dmihalcik-virtru merged 1 commit into
mainfrom
DSPX-5177-locobuf

Conversation

@dmihalcik-virtru

@dmihalcik-virtru dmihalcik-virtru commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Summary

java-sdk releases don't attach cmdline.jar to their GitHub Releases, and cmdline isn't published to Maven Central. So every Java release that xtest uses has been built from source with a full mvn clean install. That build's sdk module runs buf generate against buf.build. With a dozen xtest jobs doing this at the same moment, BSR returns resource_exhausted: too many requests and fails the run (e.g. 38632037584 on #571). This is DSPX-5177.

Everything cmdline depends on (sdk-pom, sdk, sdk-pqc-bc, sdk-fips-bc) is on Maven Central. This PR builds just the CLI against those published jars.

Changes (otdf-sdk-mgr)

  • install_java_release: when the GitHub Release has no cmdline.jar, the installer checks Maven Central for io.opentdf.platform:sdk:<version>. If it's there, it shallow-clones the tag into a temp dir and runs mvn -pl .,cmdline package, so sdk* resolves from Central and no codegen or BSR calls happen.
    • The temp dir is outside src/ so the java Makefile doesn't rebuild it.
    • The build uses its own local repo, ~/.m2/otdf-sdk-mgr-releases. java-sdk main carries the last release's version (currently 0.19.1), so an sdk that a head build mvn installed into ~/.m2/repository would otherwise shadow the release. I hit this locally: the v0.19.1 cmdline failed to compile against main's sdk.
    • Any failure (not on Central, clone or build error) still raises InstallError, so setup-cli-tool falls back to today's full source build.
  • versions resolve java latest: no longer returns head: true when no release has a cmdline.jar asset. It's now an ordinary release row and takes the path above.
    • Behaviour change: in platform-head cells, latest is no longer rebuilt against the platform under test via PLATFORM_BRANCH. It's tested as published.
  • install stable java: drops the has_cli filter, which had made it skip Java entirely.

No workflow changes: JDK and Maven are already set up before setup-cli-tool in every job that installs Java.

Expected effect

In a run like 38632037584, each job's v0.19.1 build no longer calls BSR. Combined with opentdf/java-sdk#419 (which stops attach-sources from running codegen a second time), BSR traffic per run drops from about 96 to about 24 buf generate passes. Only real heads still build from source. Building each head once per run is a separate follow-up.

Testing

  • Maven Central has sdk for every release since 0.7.2 except 0.8.0 and 0.17.0. Those fall back to a source build.
  • mvn -pl .,cmdline package checked against an empty local repo:
    • v0.19.1 (latest): builds, zero buf calls.
    • v0.9.0 (LTS): builds, zero buf calls, with Maven 3.9.11 as on the runners. Maven 3.10 rejects that tag's sdk/pom.xml for a duplicate plugin declaration in the fuzz profile.
  • End to end: otdf-sdk-mgr install artifact --sdk java --version v0.19.1 --dist-name v0.19.1 takes the new path, and cmdline.jar --version reports {"version":"0.19.1","tdfSpecVersion":"4.3.0"}, which cli.sh supports gates on.
  • Added tests/test_installers.py and updated test_resolve.py. ruff check, ruff format, pyright and pytest (144 passed) are all clean.

Summary by CodeRabbit

  • New Features
    • Java installations now use the published command-line package when available. If it isn’t available, installation can build the CLI using the published SDK release.
    • Selecting the latest Java version now resolves to the newest stable release, whether or not it includes a prebuilt CLI package.
  • Bug Fixes
    • Installation reports an error when neither the published package nor the fallback build is available. CI can then fall back to a full source build.

@dmihalcik-virtru
dmihalcik-virtru requested review from a team as code owners October 15, 2026 17:18
@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 48 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3e650f67-ae46-4be2-a615-85a616fed4e0
📥 Commits

Reviewing files that changed from the base of the PR and between 7639a94 and e7dcb36.

📒 Files selected for processing: 7
  • .github/workflows/xtest.yml
  • otdf-sdk-mgr/README.md
  • otdf-sdk-mgr/src/otdf_sdk_mgr/installers.py
  • otdf-sdk-mgr/src/otdf_sdk_mgr/resolve.py
  • otdf-sdk-mgr/tests/test_installers.py
  • otdf-sdk-mgr/tests/test_resolve.py
  • xtest/setup-cli-tool/action.yaml

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 73543a76-c01c-497b-850c-0234518c8e5d
📥 Commits

Reviewing files that changed from the base of the PR and between b9f9652 and 7639a94.

📒 Files selected for processing: 5
  • otdf-sdk-mgr/README.md
  • otdf-sdk-mgr/src/otdf_sdk_mgr/installers.py
  • otdf-sdk-mgr/src/otdf_sdk_mgr/resolve.py
  • otdf-sdk-mgr/tests/test_installers.py
  • otdf-sdk-mgr/tests/test_resolve.py

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Walkthrough

Java release resolution now selects the newest stable tag. Installation tries the GitHub CLI asset first, then builds the CLI from the tagged source against the published SDK artifact if needed.

Changes: Java release installation

Layer / File(s) Summary
Select the stable Java release
otdf-sdk-mgr/src/otdf_sdk_mgr/resolve.py, otdf-sdk-mgr/src/otdf_sdk_mgr/installers.py, otdf-sdk-mgr/tests/test_resolve.py
Java latest resolution and stable-version selection use the newest stable tag without requiring a GitHub CLI asset. The test expects the newest stable tag as a release, without a head marker.
Install the CLI from a release or Maven Central
otdf-sdk-mgr/src/otdf_sdk_mgr/installers.py, otdf-sdk-mgr/tests/test_installers.py, otdf-sdk-mgr/README.md
Installation tries the GitHub CLI asset first. If it is unavailable, the installer checks for the tagged SDK POM on Maven Central, clones the tag, and builds the CLI with a dedicated Maven repository. Tests cover asset download, Maven lookup, build failures, and cleanup. The README describes the fallback and the CI full-source-build fallback.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant Installer
  participant GitHub_Releases
  participant Maven_Central
  participant Git
  participant Maven
  Installer->>GitHub_Releases: Check and download CLI asset
  GitHub_Releases-->>Installer: Asset available or installation error
  Installer->>Maven_Central: Check for tagged SDK POM
  Maven_Central-->>Installer: POM availability
  Installer->>Git: Clone Java SDK tag
  Git-->>Installer: Tagged source
  Installer->>Maven: Build parent and cmdline projects
  Maven-->>Installer: CLI wrapper and JAR
Loading

Suggested reviewers: abarabash-virtru

Merge Risk: ⚪ Minimal · up to 7639a

No actionable merge-blocking issue remains; the documented source-build fallback remains available if release installation fails.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 38.89% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 18 functions across 4 files. (1 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
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.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: building Java release CLIs against Maven Central when needed.
Full details: Docstring Coverage

Explanation

Docstring coverage is 38.89% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 18 functions across 4 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches: 💡 2
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit checked the tag at dawn
Then fetched the CLI, neat and drawn
When GitHub’s jar was out of sight
Maven built the tool just right
The bunny hopped away with cheer

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

@dmihalcik-virtru dmihalcik-virtru changed the title fix(otdf-sdk-mgr): build java release CLIs against Maven Central chore: build java release CLIs against Maven Central Oct 15, 2026
java-sdk releases don't attach cmdline.jar to their GitHub Releases, so
every java release xtest used fell back to a full source build, whose
sdk module runs `buf generate` against buf.build. With a dozen xtest
jobs doing that at once, BSR rate limits fail the run.

When a release has no cmdline.jar asset, install_java_release now
checks Maven Central for io.opentdf.platform:sdk at that version and,
if present, builds only the parent pom and the cmdline module of the
tag (mvn -pl .,cmdline), resolving sdk* from Central. No codegen, no
BSR calls. It uses its own local Maven repo so a same-versioned head
installed into ~/.m2 can't shadow the release. Any failure still raises
InstallError, so setup-cli-tool falls back to the full source build.

java `latest` no longer resolves to head:true when no release has a
cmdline.jar asset; it is a normal release row, so it takes the path
above and is tested as published rather than rebuilt against the
platform under test.

setup-cli-tool gains a needs-build output (any head, or any release
whose artifact install failed), and the java make steps gate on it
instead of on heads. Previously a run whose only java versions were
releases checked out the fallback source but never built it.

DSPX-5177

Signed-off-by: Dave Mihalcik <dmihalcik@virtru.com>
@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

X-Test Failure Report

@dmihalcik-virtru
dmihalcik-virtru merged commit e17816b into main Oct 15, 2026
31 checks passed
@dmihalcik-virtru
dmihalcik-virtru deleted the DSPX-5177-locobuf branch October 15, 2026 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants