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

Add modified files to the plugin repository #47

Open
gounthar opened this issue Jun 25, 2024 · 3 comments
Open

Add modified files to the plugin repository #47

gounthar opened this issue Jun 25, 2024 · 3 comments
Labels
enhancement For changelog: Minor enhancement. use `major-rfe` for changes to be highlighted

Comments

@gounthar
Copy link
Collaborator

What feature do you want to see added?

I know we still have a long way to go before creating a pull request, but I wanted to share a thought with you.

I've used the tool on one of the plugins I maintain. Here's the command I entered:

java -jar plugin-modernizer-cli/target/jenkins-plugin-modernizer-999999-SNAPSHOT.jar --plugins android-emulator-plugin --recipes AddPluginsBom,AddCodeOwner

The output was:

Starting Plugin Modernizer
Plugins: [android-emulator-plugin]
Recipes: [AddPluginsBom, AddCodeOwner]
Invoking clean phase for plugin: android-emulator-plugin
Invoking rewrite plugin for plugin: android-emulator-plugin

My plugin didn't have a CODEOWNERS file, so the recipe created one for me (which is great!).

Looking ahead, when we integrate jgit or any other Git tool, should we consider, as a first step, adding new files to the Git repository? This could be an excellent initial step to familiarize ourselves with whichever Git tool we choose.

What are your thoughts on this approach?

Upstream changes

No response

Are you interested in contributing this feature?

No response

@gounthar gounthar added the enhancement For changelog: Minor enhancement. use `major-rfe` for changes to be highlighted label Jun 25, 2024
@jonesbusy
Copy link
Collaborator

I agree, let's keep it simple for the moment. The advantage of the AddCodeOwner is that it doesn't have any dependency. Plugin can be refreshed or not, it will always have the same behavior.

@jonesbusy
Copy link
Collaborator

First step on #230

What we miss (not sure about the implementation yet)

  • Comparting the 2 PluginMetaData` on the print summary at the end of the plugin (We can track: Added files (tracked ArchetypeCommonFile). Removed ArchetypeCommonFile. We can also track version changes on parent, bom and JDK versions
  • Using the "git status" or "git show" command via JGit to get the summary of changes
  • Having a way to mark content of `ArchetypeCommonFile as modified (probably the previous point is more generic and we can detect such common file)

jonesbusy pushed a commit that referenced this issue Oct 18, 2024
@jonesbusy
Copy link
Collaborator

JsonUtils will be enhanced in #496

  • Merge 2 JSON document
  • Compare 2 JSON document (semantic) and return the diff as a new document

The later could be also reused to compute the PR body: #425 (right now only the title is set as a user friendly title for some recipes)

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

No branches or pull requests

2 participants