Skip to content
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

feat(recipes): Add ModernizeJenkinsfile Recipe and UpgradeNextMajorParentVersion Dependency #336

Merged
merged 5 commits into from
Oct 17, 2024

Conversation

gounthar
Copy link
Collaborator

@gounthar gounthar commented Oct 16, 2024

This PR introduces two key enhancements to our recipe collection:

  1. Integration of the OpenRewrite recipe org.openrewrite.jenkins.ModernizeJenkinsfile into a new modernizer recipe called AddOrModernizeJenkinsFile.
  2. Addition of the UpgradeNextMajorParentVersion as a dependency for the new recipe.

Rationale for Dependency

The inclusion of UpgradeNextMajorParentVersion as a dependency is based on ModernizeJenkinsfile's latest version, which produces a Jenkinsfile that:

  • Tests with JDK 17 on Windows
  • Tests with JDK 21 on Linux

This dependency ensures our modernization efforts align with current testing practices across different environments.

Testing Performed

To verify the functionality of the new recipe, the following command was executed:

rm -fr ~/.cache/jenkins-plugin-modernizer-cli/vagrant/ && java -jar plugin-modernizer-cli/target/jenkins-plugin-modernizer-999999-SNAPSHOT.jar --plugins vagrant --recipes MinimalBuildJava8,AddOrModernizeJenkinsFile --debug

This test resulted in the creation of a pull request: jenkinsci/vagrant-plugin#13.

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

@gounthar gounthar marked this pull request as ready for review October 16, 2024 17:29
@gounthar gounthar requested a review from a team as a code owner October 16, 2024 17:29
@jonesbusy jonesbusy added the enhancement For changelog: Minor enhancement. use `major-rfe` for changes to be highlighted label Oct 17, 2024
@gounthar
Copy link
Collaborator Author

Thanks.
This recipe will then update the plugin to JDK11, while allowing it to be compiled with JDK17 and 21.

@gounthar gounthar merged commit 7195169 into jenkins-infra:main Oct 17, 2024
15 checks passed
@gounthar gounthar deleted the add-jenkinsfile-recipe branch October 17, 2024 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement For changelog: Minor enhancement. use `major-rfe` for changes to be highlighted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants