fix(java): include shorthand vendor in lock identity#9989
Conversation
Greptile SummaryThis PR fixes stale lock invalidation for shorthand Java version requests (e.g.
Confidence Score: 5/5Safe to merge — the change is narrowly scoped to lock key generation and does not affect download, install, or resolution logic. The fix is straightforward: shorthand_vendor is now written into lock options for any version string that lacks a hyphen, which correctly captures numeric shorthands (17, 21) and named aliases (lts) while leaving vendor-qualified strings (temurin-17) untouched. The heuristic is consistent with how tv_to_java_version already treats digit-prefixed versions. The vendor is sourced from the live settings value rather than a hard-coded literal. Unit tests cover all four distinct cases explicitly, including the previously-unguarded lts alias. No files require special attention. Important Files Changed
Reviews (8): Last reviewed commit: "fix(java): keep shorthand vendor default..." | Re-trigger Greptile |
There was a problem hiding this comment.
Code Review
This pull request introduces InstallManifest as a new ToolOptionSource, allowing tool options to be persisted and retrieved from the installation manifest. Key changes include updating BackendArg to track option sources, ensuring manifest options are correctly applied during resolution while being excluded from explicit CLI representations. The Java plugin was also updated to include shorthand_vendor in lockfile identities for shorthand versions. Feedback suggests expanding the Java shorthand detection to include "latest" and "lts" and ensuring that version resolution consistently respects tool-specific configurations over global settings.
|
CI note: This comment was generated by an AI coding assistant. |
7396ae1 to
6438d69
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis change makes Java lockfile options version-aware. The ChangesJava Lockfile Options Version Awareness
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Summary
shorthand_vendorin Java lockfile options for shorthand Java requeststemurin-17Details
For shorthand Java requests like
java@17orjava@lts, mise resolves the vendor throughsettings.java.shorthand_vendor. This PR records that resolved vendor in the lockfile identity so changing the shorthand vendor changes the lock key and cannot reuse a lock entry created for a different vendor.Because the setting's default is
openjdk, a default shorthand request such asjava@17now includesshorthand_vendor = "openjdk"in the lockfile options. Fully-qualified requests such asjava@openjdk-17orjava@temurin-17do not addshorthand_vendor, because the vendor is already part of the requested version string.Verification
mise run rendermise run formatcargo fmt --all -- --checkgit diff --checkcargo test shorthand_vendorcargo test java_options_reads_release_type --bin miseSummary by CodeRabbit