-
-
Notifications
You must be signed in to change notification settings - Fork 9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[JENKINS-55048] Add support for plugin Java requirement metadata #3016
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally the PR looks good, added few comments.
I would also consider adding Maximum-Java-Version
as a part of this story while you are around. E.g. I barely believe that Maven Integration Plugin can be made Java9-compatible easily (CC @aheritier)
@@ -8,3 +8,6 @@ | |||
margin: 1em; | |||
text-align: right; | |||
} | |||
.compatWarning, .securityWarning { | |||
font-weight: bold; | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line break
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Misuse of java.version
, otherwise looks good.
e5d4199
to
cf723f6
Compare
Rebased to current master with no impl changes so far. |
I'm not sure what the log message is supposed to be for, but other checks also log, so apply the same behavior for Java dependency.
cf723f6
to
f55864f
Compare
…with-more-recent-jdk
Given this field is present in maven-hpi-plugin, update-center, etc. I think it does not hurt to keep the 'Minimum-Java-Version' name across various usages to help make it clear.
This way at least we know the backend methods should not be broken without noticing.
"Misuse of java.version, otherwise looks good." main reason addressed. Need another review.
"title": "Dummy", | ||
"url": "http://nowhere.net/dummy.hpi", | ||
"version": "1.0", | ||
"minimumJavaVersion": "25" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hopefully, we shouldn't get too quickly to this as a "future" baseline we're not running in during tests (?). Or maybe I should even have gone bigger. (maybe I should see to mock the runtime Java version retrieval to isolate the test from such issue in the future)
@jenkinsci/java11-support please review this pull-request. |
To test this, a simple way is the following: # Build and run a Jenkins with this patch
docker run -ti -e ID=3016 -p 8080:8080 batmat/jenkins-pr-tester Then open a browser on 8080, and change the update center URL to http://updates.jenkins.io/temporary-experimental-java11/update-center.json to check how it behaves. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comments, but anyway it LGTM
as proposed by @jglick
…s coming from the plugin's metadata
using the proposal from @jglick in https://github.com/jenkinsci/jenkins/pull/3016/files#r246146054
@jglick I believe I addressed your feedback. Can you please take another quick look? Thanks! |
BTW, anyone willing to have another look is welcome. Thanks! |
return !javaVersion.startsWith("1."); | ||
} | ||
|
||
/** | ||
* Returns the JVM's current version as a {@link VersionNumber} instance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Best to document this with examples. IIUC these would be
1.8
9
10
11
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Basically JEP-223
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, but please link to this so that people do not have to discover it by code inspection and independent research.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It causes https://issues.jenkins-ci.org/browse/JENKINS-55562 , because there is no version normalization code in this pull request. Both |
Nor should there be IMO—normalization should be performed on input, at build time.
My reading of JEP-223 is that Java version numbers in the range |
See JENKINS-55048.
Downstream of jenkinsci/maven-hpi-plugin#75 and jenkins-infra/update-center2#164.
Future enhancement might be to send the Java version with the request (or consider it already sent by the user agent header) and handle that on the server side, similar to the tiered update sites. But for now, a big red (newly bold) warning should at least get us started.
Here is how it renders:

(I used http://updates.jenkins.io/temporary-experimental-java11/ for testing.
Pipeline: Supporting APIs
, akaworkflow-support
is the only one requiring Java 11+.The others are red because they depend on it directly or transitively.
I used the following system groovy quick&dirty script to check these things:
).
Proposed changelog entries
Submitter checklist
* Use the
Internal:
prefix if the change has no user-visible impact (API, test frameworks, etc.)Desired reviewers
@jenkinsci/code-reviewers