Skip to content

fix(openjdk): preserve ea version aliases#473

Merged
jdx merged 1 commit into
mainfrom
codex/openjdk-ea-alias
Jun 11, 2026
Merged

fix(openjdk): preserve ea version aliases#473
jdx merged 1 commit into
mainfrom
codex/openjdk-ea-alias

Conversation

@jdx

@jdx jdx commented Jun 11, 2026

Copy link
Copy Markdown
Owner

Summary

  • preserve buildless OpenJDK EA aliases during release-type export
  • add the current 28.0.0-ea alias rows alongside 28.0.0-ea+1 in checked-in API data
  • cover alias generation with focused unit tests

Why

jdx/mise release CI now detects JDK 28 from jdk.java.net and installs java[release_type=ea]@openjdk-28.0.0-ea. The generated mise-java data only retained 28.0.0-ea+1, so mise failed with no metadata found for version openjdk-28.0.0-ea.

The DB still deduplicates by URL, so aliases cannot live there. This adds compatibility aliases during export instead, where duplicate URLs are valid JSON API rows.

Validation

  • cargo fmt --all -- --check
  • git diff --check
  • cargo test --all

Note

Low Risk
Export-only compatibility layer plus static API catalog updates; no auth or DB schema changes, with behavior covered by unit tests.

Overview
Fixes mise-style installs that request buildless OpenJDK EA versions (e.g. openjdk-28.0.0-ea) when the catalog only had build-tagged rows (28.0.0-ea+1).

During release-type export, exported rows are passed through with_openjdk_ea_aliases, which synthesizes extra OpenJDK EA entries by stripping the +build suffix from versions like 28.0.0-ea+N, keeps the highest build when several exist, and skips aliases already present. The DB still deduplicates by URL; duplicates are only in the exported JSON API.

Checked-in public/api/jvm/ea/** files gain matching 28.0.0-ea JDK rows for linux (aarch64/x86_64), macOS aarch64, and Windows x86_64, with array closing newlines normalized. Unit tests cover alias creation, deduplication, and highest-build selection.

Reviewed by Cursor Bugbot for commit 7d18973. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@jdx, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 5 minutes and 7 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: fcad2ff1-4a02-4ffc-b77f-cb5bf6a2999f

📥 Commits

Reviewing files that changed from the base of the PR and between d2df8bf and 7d18973.

📒 Files selected for processing (5)
  • public/api/jvm/ea/linux/aarch64.json
  • public/api/jvm/ea/linux/x86_64.json
  • public/api/jvm/ea/macosx/aarch64.json
  • public/api/jvm/ea/windows/x86_64.json
  • src/cli/export/release_type.rs

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

@jdx jdx merged commit 255b687 into main Jun 11, 2026
4 checks passed
@jdx jdx deleted the codex/openjdk-ea-alias branch June 11, 2026 19:54
@greptile-apps

greptile-apps Bot commented Jun 11, 2026

Copy link
Copy Markdown

Greptile Summary

This PR fixes a regression where mise failed to resolve openjdk-28.0.0-ea because the exported API data only carried the build-qualified form 28.0.0-ea+1. The fix introduces with_openjdk_ea_aliases, which post-processes each EA export batch to synthesise bare -ea alias rows (picking the highest +N build when several exist), and seeds the four checked-in JSON files with the corresponding 28.0.0-ea entries.

  • with_openjdk_ea_aliases scans for OpenJDK EA entries whose version contains +, builds an alias keyed on the bare -ea stem, and deduplicates by keeping the highest build number before appending the aliases to the export slice.
  • Three unit tests cover alias creation, no-duplicate promotion, and highest-build selection.
  • The four platform JSON files each gain one new object with version/java_version set to 28.0.0-ea while the download URL still points to the ea+1 artifact.

Confidence Score: 5/5

The change is narrow and additive — it appends alias rows to EA exports without touching any existing data paths — and is guarded by vendor and release-type checks that prevent accidental modification of GA or non-OpenJDK entries.

The alias logic is straightforward, the three unit tests validate the key invariants (alias creation, dedup, highest-build selection), and the checked-in JSON files directly reflect what the new code produces. No existing behaviour is altered.

No files require special attention; the only suggestions are minor style cleanups in src/cli/export/release_type.rs.

Important Files Changed

Filename Overview
src/cli/export/release_type.rs Adds with_openjdk_ea_aliases to emit bare -ea alias rows alongside versioned +N builds; guarded by release_type and vendor checks, with three unit tests covering the main scenarios
public/api/jvm/ea/linux/aarch64.json Appends a 28.0.0-ea alias row for OpenJDK on linux/aarch64, pointing to the ea+1 artifact URL
public/api/jvm/ea/linux/x86_64.json Appends a 28.0.0-ea alias row for OpenJDK on linux/x86_64, pointing to the ea+1 artifact URL
public/api/jvm/ea/macosx/aarch64.json Appends a 28.0.0-ea alias row for OpenJDK on macosx/aarch64, pointing to the ea+1 artifact URL
public/api/jvm/ea/windows/x86_64.json Appends a 28.0.0-ea alias row for OpenJDK on windows/x86_64 (zip), pointing to the ea+1 artifact URL

Fix All in Claude Code

Reviews (1): Last reviewed commit: "fix(openjdk): preserve ea version aliase..." | Re-trigger Greptile

for os in &oses {
for arch in &archs {
let data = db.export_release_type(release_type, arch, os)?;
let data = with_openjdk_ea_aliases(db.export_release_type(release_type, arch, os)?);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 with_openjdk_ea_aliases is invoked on every (release_type, os, arch) combination, including GA exports where it immediately returns the data unchanged due to the item.release_type != "ea" guard. Skipping the call for non-EA release types makes the intent explicit and avoids the redundant HashSet allocation on every GA batch.

Suggested change
let data = with_openjdk_ea_aliases(db.export_release_type(release_type, arch, os)?);
let raw = db.export_release_type(release_type, arch, os)?;
let data = if release_type == "ea" {
with_openjdk_ea_aliases(raw)
} else {
raw
};

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Claude Code

@@ -1,4 +1,4 @@
use std::{fs::File, path::PathBuf};
use std::{collections::HashMap, fs::File, path::PathBuf};

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 HashSet is used as a fully-qualified inline path while HashMap is already imported at the top of the file. Importing HashSet alongside HashMap keeps the usage consistent.

Suggested change
use std::{collections::HashMap, fs::File, path::PathBuf};
use std::{collections::{HashMap, HashSet}, fs::File, path::PathBuf};

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Claude Code

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.

1 participant