-
Notifications
You must be signed in to change notification settings - Fork 16
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
Jenkinsfile
JDK Version Check in UpgradeNextMajorParentVersion
Recipe
#628
Comments
Jenkinsfile
JDK Version Check in UpgradeNextMajorParentVersion
Recipe
Probably the best is to not do any change. At the end even if modyfing the Jenkinsfile you will get build failure until a maintainer replay the pipeline or do the update him/herself. |
That's certainly true, but in my opinion, it would be better to propose the change in the Jenkinsfile with an accompanying explanation rather than simply letting the build fail without any context. |
So when #531 is implemented it just need to be added on the list of declarative recipe. In the meanwhile do you prefer to not do any change ? But my concern is that such checks must be added on all recipes of the declarative or you will end up with partial changes (for example a parent on 5.x but the jenkins version untouched) So my opininion is to not do anything until #531 is implemented |
Or an other option is to add on the recipe
If we agree to completly override Jenkinsfile rather than just inserting the correct JDKs |
Which might cause other issue like disable docker test as mentionned #531 (comment) So I'm also not super agree with a destructive approach |
I don't know if we'll be able to parse the |
I think it's possible using rewrite-groovy and GroovyIsoVisitor. It would be similar to the Jenkinsfile visitor. First we collect what we find, then update the arguments depending on the context. Either updating the LST since it's rather simple arguments or using JavaMethodTemplate (or something similar). |
Sounds cool. 👍 |
What Feature Do You Want to See Added?
Currently, the
UpgradeNextMajorParentVersion
recipe does not verify if theJenkinsfile
is using JDK 17 or newer. This omission can lead to errors if the plugin is upgraded without updating the Jenkinsfile to the appropriate JDK version. As experienced with thedate-parameter
plugin, manual modification of the Jenkinsfile was necessary. It would be beneficial to include a check within the recipe to ensure that the Jenkinsfile specifies JDK 17 or a newer version.Proposed Solution
Enhance the UpgradeNextMajorParentVersion recipe to automatically check the Jenkinsfile for the correct JDK version. If the version is older than 17, the recipe should either update when it's possible, or add it if it's not there.
Upstream Changes
No response
Are You Interested in Contributing This Feature?
The text was updated successfully, but these errors were encountered: