-
-
Notifications
You must be signed in to change notification settings - Fork 301
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
Repository Browser: Add context menu action "Update Revisions :: To higher MICRO / MINOR / MAJOR revision" #6104
Conversation
this basically does what the MbrCommand does, but in the UI. You can update a central.mvn index file with this action. There is a DryRun option, which just copies the result to clipboard without touching the index file. you can use that to simulate it and check the result upfront. Signed-off-by: Christoph Rueger <[email protected]>
and add options for scope MICRO, MINOR and MAJOR Signed-off-by: Christoph Rueger <[email protected]>
Signed-off-by: Christoph Rueger <[email protected]>
now it looks like MbrCommand#_check which is a string table showing the current and new version - basically a preview e.g. ## Updates available com.fasterxml.jackson.core:jackson-core:2.16.1 2.16.2 Signed-off-by: Christoph Rueger <[email protected]>
@pkriens Do you have any thoughts? Would this be a useful feature? How would you go about the code re-use between I first thought about reusing |
I agree that the shared code should be shared. This seems a good place. I would also be ok to make it methods on the MavenBndRepository. But I can go either way. nice work! |
Signed-off-by: Christoph Rueger <[email protected]>
Signed-off-by: Christoph Rueger <[email protected]>
Thanks for the feedback @pkriens I added some commits trying to share as much code as I could. One question about something I am not sure: But there were some other calls to I was wondering: since both are basically writing to |
Signed-off-by: Christoph Rueger <[email protected]>
We can use the logger for tracing etc. Maybe it should use Result for the methods instead of outputing information? In general you do not want to do any output in a component like this. |
TODO investigate into suggestion of using Result instead of outputing Signed-off-by: Christoph Rueger <[email protected]>
Since MbrUpdater should not print out directly any logging statements, I tried to do it outside in MbrCommand. Because MbrCommand also did the logging before, so I tried do it in a similar way, to preserve existing behavior. Signed-off-by: Christoph Rueger <[email protected]>
Thanks for the suggestion. unfortunately I did not see how Thus I decided a different approach. I pulled out all logging from the new class The logging output is the same, but the place is obviously a bit different than before, e.g. because now I am logging after I have all the results - while before logging happened on the go during iteration in the loop. Question: Is this an ok way to check for "updated" versions? |
Update: Forget the above. I added a new commit. I introduced a new record object in fc97d92 which allows to write the log output the same way as it was before in MbrCommand. The only difference now is that it gets written a bit later after the Map has been built (previously logging happened on the go in the loop). |
the new container obj allows to better track when we got a version from the mavencentral-fetch, and this in turn allows us to write the logging output the same way as it was before in MbrCommand Signed-off-by: Christoph Rueger <[email protected]>
Signed-off-by: Christoph Rueger <[email protected]>
Some notes about how to test bnd mbr from the cli
Expected example output:
|
LGTM, want to merge it? |
Yes |
This PR is a suggestion for bnd's MbrCommand e.g.
bnd mbr update -s micro
but making it available in bndtools' UI.This adds a context menu when you Right-Click on a MavenBndRepo like this:
This allows to increase versions of a full
central.mvn
maven index file.Similar functionality already exists if you right-click on a single RepoBundle-Revision. This suggestion here basically does it for the whole repository.
I added a Dry-Run-Option which does not modify the .mvn file, but instead copies the result to the Clipboard.
I am not sure if this is a good idea, since it can take some time depending on the size of the repo and the user might not notice it... UX isn't great. I kept it for now, since it helped during debugging, but I am fine with removal too... or suggestions how it could be improved. Better wording suggestions welcome too.
Also: I basically copy pasted and adjusted the code from MbrCommand. There is room for better re-use, but I just wanted to prototype this first.
Dry-Run
The output of the Dry-Run is similar to
MbrCommand#_check
e.g.: