|
Added a follow-up commit that improves observability when the JRE release file is missing or unreadable:
This means a broken or incomplete JRE installation will now produce a visible warning in buildpack output rather than silently proceeding with Java 17 assumptions. |
Sorry, something went wrong.
|
a quick ai review. (with my own context/skilss) 🔴 Behavioral Change: tomcat.go — version selection now runs unconditionally when JAVA_HOME is set, even if version detection fails 🔴 Bug: BaseJRE.Supply() now calls WriteEnvFile, AddBinDependencyLink, and LinkDirectoryInDepDir for ALL JREs — previously only OpenJDK did this
🟡 DetermineJavaVersion no longer handles missing release file silently 🟡 Finalize() may use empty b.version 🟡 BaseJRE.Finalize() — WriteJavaOpts with base opts now applies to ALL JREs i' am okay with the things below. i will still do a full review later on |
Sorry, something went wrong.
|
Thanks for the review! @ramonskie can you have another view? A general note on approach: we tried to match the Ruby 4.x buildpack behaviour as the baseline, only deviating where there are concrete issues or PR comments that justify it. 1. tomcat.go — version detection failure (commit 2c5754b) The Ruby buildpack has no Java-version-aware Tomcat selection — it always defers to the manifest default (9.+). I think on detection failure the safe fallback is DefaultVersion("tomcat") rather than assuming Java 17 → Tomcat 10.x (see #1155). An explicitly configured version (e.g. JBP_CONFIG_TOMCAT: '{tomcat: {version: "9.+"}}') is still always honoured. 2. WriteEnvFile / AddBinDependencyLink / LinkDirectoryInDepDir for all JREs I assume this is fine as-is. Ruby never set JAVA_HOME at all — setting it for all JREs is intentional new behaviour in the Go migration (see #1151). I don't think a per-JRE flag is needed here, but open to arguments if there's a specific case where it causes problems. 3. -XX:ActiveProcessorCount for all JREs (commit bf92b62) In Ruby open_jdk_like_jre.rb adds it for HotSpot only; ibm_jre_initializer.rb never does. Moved it out of baseOpts and into extraFinalizeOpts on each HotSpot JRE (OpenJDK, Oracle, SapMachine, Zulu, GraalVM). IBM keeps its existing opts unchanged. 4. DetermineJavaVersion returns 0 on error (commit 40e4490) Returns 17 on all error paths so callers that don't check the error still get a safe value. Also added some notes in the migration md so things that do change do not go unnoticed. |
Sorry, something went wrong.
There was a problem hiding this comment.
lgtm
Sorry, something went wrong.
|
@kiril-keranov can you have a look please for a review? thanks |
Sorry, something went wrong.
There was a problem hiding this comment.
lgtm
Sorry, something went wrong.
There was a problem hiding this comment.
lgtm, was unavailable for a couple of days so pinged Tedi to approve
Sorry, something went wrong.
Closes #1264
Summary
Reduces ~1300 lines of near-identical code in 6 JRE files to a single BaseJRE struct (243 lines) plus thin per-JRE wrappers (~11 lines each).
Design
BaseJRE uses a template method pattern with injected config/function fields so implementers never need to override Supply/Finalize, eliminating the 'forgot to call base' risk from method-override approaches.
Variation points:
ZingJRE is intentionally excluded — it has no memory calculator or jvmkill and has genuinely different Finalize behaviour.
Before / After
Tests
Added standard_jres_test.go covering all 5 non-OpenJDK standard JREs (OpenJDK already had openjdk_test.go). For each JRE:
All existing and new tests pass.