Better support for multi-module plugins#1459
Conversation
|
@jonesbusy @gounthar, I have used a simple logic for detection & adding of correct team as |
…com/PratikMane0112/plugin-modernizer-tool into feature/enhance-addcodeowner-recipe
|
Some comments to address. Also an integration test would be useful (CommandLineIT) |
|
Thanks for the fixes. It will require still few more days before I can continue the review |
Sure, I respect your time & difficulty of this issue. I'm open for further changes as per your suggestion after review. That's the way I can improve myself & understand the codebase better. |
Co-authored-by: jonesbusy <825750+jonesbusy@users.noreply.github.com>
Co-authored-by: jonesbusy <825750+jonesbusy@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This pull request adds support for multi-module Maven plugins in the Jenkins plugin modernizer tool. Previously, the tool assumed all plugins had a single-module structure with the plugin pom.xml at the root. This enhancement enables the tool to detect multi-module projects (with packaging=pom at the root) and automatically locate the actual plugin module (with packaging=hpi) to ensure OpenRewrite recipes operate on the correct pom.xml with the correct artifactId.
Changes:
- Added
adjustForMultiModule()method to detect and adjust the repository path for multi-module plugins - Enhanced
PluginPathConverterto handle multi-module plugins specified via--plugin-path - Added comprehensive test coverage including unit tests and integration tests
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| plugin-modernizer-core/src/main/java/io/jenkins/tools/pluginmodernizer/core/model/Plugin.java | Added adjustForMultiModule() and findJenkinsPluginModule() methods to detect multi-module projects and adjust the local repository path to the plugin module |
| plugin-modernizer-core/src/main/java/io/jenkins/tools/pluginmodernizer/core/impl/PluginModernizer.java | Integrated the multi-module adjustment logic to be called after plugin fetching |
| plugin-modernizer-cli/src/main/java/io/jenkins/tools/pluginmodernizer/cli/converter/PluginPathConverter.java | Enhanced to detect multi-module plugins and extract the correct plugin module when using --plugin-path option |
| plugin-modernizer-core/src/test/java/io/jenkins/tools/pluginmodernizer/core/model/PluginTest.java | Added comprehensive unit tests covering single-module, multi-module, edge cases, and error scenarios |
| plugin-modernizer-cli/src/test/java/io/jenkins/tools/pluginmodernizer/cli/converter/PluginPathConverterTest.java | Added unit tests for PluginPathConverter with multi-module plugin scenarios |
| plugin-modernizer-cli/src/test/java/io/jenkins/tools/pluginmodernizer/cli/CommandLineITCase.java | Added integration tests validating multi-module plugins work with AddCodeOwner and FetchMetadata recipes |
| plugin-modernizer-cli/src/test/resources/multi-module-plugin/* | Added test fixture with realistic multi-module plugin structure for testing |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@jonesbusy, I will do the changes suggested soon ... |
|
Thanks for your contribution. LGTM |
|
@jonesbusy, If may I allowed to ask, Is plugin modernizer going to take part in gsoc 26 ? |
|
Yes if the project is selected. We also still need to draft the project idea with other mentors |
Okay, thanks. Was just curious that now I am familiar with codebase but it is not present in current draft project ideas list |
|
Yea it's matter of day before it's published |
Fix issue #1029
Used logic -
packaging=hpi, will refer root directorypackaging=hpiTesting done
With this logic I tried with below plugins & was able to add correct teams
dry-run recipe over other plugins: badge, git plugins (single module) & workflow-cps (multi-module)
The content added to
.github/CODEOWNERSw.r.t plugins -* @jenkinsci/openstack-cloud-plugin-developers* @jenkinsci/badge-plugin-developers* @jenkinsci/git-plugin-developers* @jenkinsci/workflow-cps-plugin-developersSubmitter checklist