Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion public/api/jvm/ea/linux/aarch64.json
Original file line number Diff line number Diff line change
Expand Up @@ -25159,5 +25159,17 @@
"url": "https://cdn.azul.com/zulu/bin/zulu19.0.23-ea-jdk19.0.0-ea.7-linux_aarch64.tar.gz",
"vendor": "zulu",
"version": "19.0.23.0"
},
{
"checksum": "sha256:642cdb07549c099010edf29631c3ceea1b96000fcd1c15d23598eb99bcb16042",
"created_at": "2026-06-10T21:19:20.321295",
"features": [],
"file_type": "tar.gz",
"image_type": "jdk",
"java_version": "28.0.0-ea",
"jvm_impl": "hotspot",
"url": "https://download.java.net/java/early_access/jdk28/1/GPL/openjdk-28-ea+1_linux-aarch64_bin.tar.gz",
"vendor": "openjdk",
"version": "28.0.0-ea"
}
]
]
14 changes: 13 additions & 1 deletion public/api/jvm/ea/linux/x86_64.json
Original file line number Diff line number Diff line change
Expand Up @@ -52091,5 +52091,17 @@
"url": "https://github.com/SAP/SapMachine/releases/download/sapmachine-13.0.2%2B1/sapmachine-jre-13.0.2-ea.1_linux-x64_bin.tar.gz",
"vendor": "sapmachine",
"version": "13.0.2-ea.1"
},
{
"checksum": "sha256:d9b2b25f13a93424625f129bc9725ded401725e36ac819b9f4951f02bc8fc91c",
"created_at": "2026-06-10T21:19:20.321295",
"features": [],
"file_type": "tar.gz",
"image_type": "jdk",
"java_version": "28.0.0-ea",
"jvm_impl": "hotspot",
"url": "https://download.java.net/java/early_access/jdk28/1/GPL/openjdk-28-ea+1_linux-x64_bin.tar.gz",
"vendor": "openjdk",
"version": "28.0.0-ea"
}
]
]
14 changes: 13 additions & 1 deletion public/api/jvm/ea/macosx/aarch64.json
Original file line number Diff line number Diff line change
Expand Up @@ -22384,5 +22384,17 @@
"url": "https://github.com/bell-sw/Liberica/releases/download/26%2B29-ea/bellsoft-jre26%2B29-ea-macos-aarch64.zip",
"vendor": "liberica",
"version": "26.0.0+29-ea"
},
{
"checksum": "sha256:bd5590d508540ee5211ee742cd55a4b060651da545ef6073517f9d6d85c5b9d1",
"created_at": "2026-06-10T21:19:20.321295",
"features": [],
"file_type": "tar.gz",
"image_type": "jdk",
"java_version": "28.0.0-ea",
"jvm_impl": "hotspot",
"url": "https://download.java.net/java/early_access/jdk28/1/GPL/openjdk-28-ea+1_macos-aarch64_bin.tar.gz",
"vendor": "openjdk",
"version": "28.0.0-ea"
}
]
]
14 changes: 13 additions & 1 deletion public/api/jvm/ea/windows/x86_64.json
Original file line number Diff line number Diff line change
Expand Up @@ -30219,5 +30219,17 @@
"url": "https://github.com/bell-sw/Liberica/releases/download/26%2B29-ea/bellsoft-jre26%2B29-ea-windows-amd64.zip",
"vendor": "liberica",
"version": "26.0.0+29-ea"
},
{
"checksum": "sha256:4aaad6cb26305877733b973a209216ad1ed529c381dd88c56e3ab87f579f96cc",
"created_at": "2026-06-10T21:19:20.321295",
"features": [],
"file_type": "zip",
"image_type": "jdk",
"java_version": "28.0.0-ea",
"jvm_impl": "hotspot",
"url": "https://download.java.net/java/early_access/jdk28/1/GPL/openjdk-28-ea+1_windows-x64_bin.zip",
"vendor": "openjdk",
"version": "28.0.0-ea"
}
]
]
91 changes: 89 additions & 2 deletions src/cli/export/release_type.rs
Original file line number Diff line number Diff line change
@@ -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


use eyre::Result;
use log::info;
Expand Down Expand Up @@ -76,7 +76,7 @@ impl ReleaseType {
for release_type in &release_types {
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


let export_data = data
.into_par_iter()
Expand Down Expand Up @@ -105,3 +105,90 @@ impl ReleaseType {
Ok(())
}
}

fn with_openjdk_ea_aliases(mut data: Vec<JvmData>) -> Vec<JvmData> {
let existing = data
.iter()
.filter(|item| item.vendor == "openjdk")
.map(|item| item.version.as_str())
.collect::<std::collections::HashSet<&str>>();
let mut aliases: HashMap<String, (u64, JvmData)> = HashMap::new();

for item in &data {
if item.vendor != "openjdk" || item.release_type != "ea" {
continue;
}
let Some((alias, build)) = item.version.split_once('+') else {
continue;
};
if !alias.ends_with("-ea") || existing.contains(alias) {
continue;
}
let Ok(build) = build.parse::<u64>() else {
continue;
};

let mut alias_item = item.clone();
alias_item.java_version = alias.to_string();
alias_item.version = alias.to_string();
aliases
.entry(alias.to_string())
.and_modify(|(existing_build, existing_item)| {
if build > *existing_build {
*existing_build = build;
*existing_item = alias_item.clone();
}
})
.or_insert((build, alias_item));
}

data.extend(aliases.into_values().map(|(_, item)| item));
data
}

#[cfg(test)]
mod tests {
use super::*;
use std::collections::HashSet;

fn openjdk(version: &str) -> JvmData {
JvmData {
architecture: "x86_64".to_string(),
file_type: "tar.gz".to_string(),
image_type: "jdk".to_string(),
java_version: version.to_string(),
jvm_impl: "hotspot".to_string(),
os: "linux".to_string(),
release_type: "ea".to_string(),
url: format!("https://example.com/openjdk-{version}.tar.gz"),
vendor: "openjdk".to_string(),
version: version.to_string(),
..Default::default()
}
}

#[test]
fn test_with_openjdk_ea_aliases() {
let data = with_openjdk_ea_aliases(vec![openjdk("28.0.0-ea+1")]);
let versions = data.iter().map(|item| item.version.as_str()).collect::<HashSet<_>>();

assert!(versions.contains("28.0.0-ea+1"));
assert!(versions.contains("28.0.0-ea"));
}

#[test]
fn test_with_openjdk_ea_aliases_keeps_existing_alias() {
let data = with_openjdk_ea_aliases(vec![openjdk("28.0.0-ea+1"), openjdk("28.0.0-ea")]);
let aliases = data.iter().filter(|item| item.version == "28.0.0-ea").count();

assert_eq!(aliases, 1);
}

#[test]
fn test_with_openjdk_ea_aliases_uses_highest_build() {
let data = with_openjdk_ea_aliases(vec![openjdk("28.0.0-ea+1"), openjdk("28.0.0-ea+2")]);
let alias = data.iter().find(|item| item.version == "28.0.0-ea").unwrap();

assert_eq!(alias.url, "https://example.com/openjdk-28.0.0-ea+2.tar.gz");
}
}