fix(openjdk): preserve ea version aliases#473
Conversation
|
Warning Review limit reached
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 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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
Comment |
Greptile SummaryThis PR fixes a regression where
Confidence Score: 5/5The 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
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)?); |
There was a problem hiding this comment.
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.
| 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!
| @@ -1,4 +1,4 @@ | |||
| use std::{fs::File, path::PathBuf}; | |||
| use std::{collections::HashMap, fs::File, path::PathBuf}; | |||
There was a problem hiding this comment.
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.
| 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!
Summary
28.0.0-eaalias rows alongside28.0.0-ea+1in checked-in API dataWhy
jdx/miserelease CI now detects JDK 28 fromjdk.java.netand installsjava[release_type=ea]@openjdk-28.0.0-ea. The generated mise-java data only retained28.0.0-ea+1, so mise failed withno 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 -- --checkgit diff --checkcargo test --allNote
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+buildsuffix from versions like28.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 matching28.0.0-eaJDK 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.