Fix pointing exact version with BP_JAVA_VERSION#1358
Open
kiril-keranov wants to merge 2 commits into
Open
Conversation
stokpop
requested changes
Jul 13, 2026
stokpop
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the PR! Have made some notes.
| } | ||
| // Exact patch version (e.g. "17.0.13") — already fully specified, don't append ".*" | ||
| // which would produce an unmatchable pattern like "17.0.13.*". | ||
| exactVersionRegex := regexp.MustCompile(`^\d+\.\d+\.\d+$`) |
Contributor
There was a problem hiding this comment.
Although this code is probably not on a hot path, you can also hoist regexes so its no compiled for each call, e.g.
var threePartVersionPattern = regexp.MustCompile(`^\d+\.\d+\.\d+$`)
func isValidVersion(version string) bool {
return threePartVersionPattern.MatchString(version)
}
| }) | ||
|
|
||
| It("resolves exact patch version", func() { | ||
| os.Setenv("BP_JAVA_VERSION", "17.0.13") |
Contributor
There was a problem hiding this comment.
The basic fix probably works as far as I can tell, but the actual versions of JRE are like: X.Y.Z+W format (17.0.19+11). Consider adding a test where BP_JAVA_VERSION resolves against a manifest entry 17.0.19+11.
I also thought we use "JBP_CONFIG_OPEN_JDK_JRE: '{ jre: { version: "25.0.3" } }'", I assume the fix also works for those cases, but maybe also add test case to be sure.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1338
When specifying an exact version for
BP_JAVA_VERSION, staging fails: