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

[Core] delete obsolete ".m2/.cache/m2e/" directory and old logback logs #964

Merged
merged 1 commit into from
Oct 15, 2022

Conversation

HannesWell
Copy link
Contributor

Similar to #606 the M2E-cache at <user-home>/.m2/.cache/m2e/ is not used anymore and can be deleted, since we don't sue the indexer anymore.
Anyone can check the size of that folder. This usually removes a few GB of unused files that where created by m2e in the past.
Furthermore the old logs in the state location of the now renamed o.e.m2e.lockback.configuration can be deleted, which removes up to another GB of useless data.

@github-actions
Copy link

github-actions bot commented Oct 2, 2022

Unit Test Results

596 tests   590 ✔️  9m 46s ⏱️
  94 suites      6 💤
  94 files        0

Results for commit 62a4f2d.

♻️ This comment has been updated with latest results.

@fbricon
Copy link
Contributor

fbricon commented Oct 3, 2022

-1 you might have users still using older versions of eclipse/m2e, that are simply evaluating a newer version of m2e. That'd be really bad.

You should show a popup asking users whether they want to delete something on their machine, that goes beyond the scope of a given eclipse instance.

@HannesWell
Copy link
Contributor Author

-1 you might have users still using older versions of eclipse/m2e, that are simply evaluating a newer version of m2e. That'd be really bad.

You should show a popup asking users whether they want to delete something on their machine, that goes beyond the scope of a given eclipse instance.

Good point.
I added a pop-up as you suggested. It is not very nice, but does the job and should not be visible very often.

grafik

@HannesWell
Copy link
Contributor Author

@fbricon, are you fine with this now?
Or does anybody else has more remarks?

@fbricon
Copy link
Contributor

fbricon commented Oct 4, 2022

How about :

A cache directory used by previous M2E versions was detected: <user-home>/.m2/.cache/m2e/ 
It's no longer used by newer M2E versions and, unless older Eclipse installations need it, can be safely deleted.
 
                                        Delete Cache / Keep Cache

@HannesWell
Copy link
Contributor Author

HannesWell commented Oct 5, 2022

How about :

Sounds good. Thank you.
I just swapped the Delete and Keep Buttons so that Keep is the default:

grafik

"Delete obsolete M2E cache?",
"A cache directory used by previous M2E versions was detected:\n" + m2eCache + "\n\n"
+ "It's no longer used by newer M2E versions and, unless older Eclipse installations need it, can be safely deleted.",
SWT.NONE, "Keep Cache", "Delete Cache");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you probably need a don't ask again choice as well, else it'll nag users who decide to keep the cache on every start

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also suggest storing the result globally for the user, so that they won't be asked for every new eclipse installation again.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's really a huge effort just for users switching back-and.forth between old and new m2e ... So probably simply let them waste theri disk-space than wasting development and maintenance effort here... @mickaelistria

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's really a huge effort just for users switching back-and.forth between old and new m2e ... So probably simply let them waste theri disk-space than wasting development and maintenance effort here... @mickaelistria

It was indeed not the intended to end up with that much code. :/

I would also suggest storing the result globally for the user, so that they won't be asked for every new eclipse installation again.

They should at least be ask for each Eclipse installation, because otherwise it will probably forgotten if the last installation started to use M2E 2.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, IMHO that's still too much in certain environments, where people deploy new eclipse installations weekly rather than yearly. With oomph, things are set up automatically, and that popup would interrupt the automatic installation process (git clone, project import, etc.). These modal dialogs on startup (takari stats, jboss usage and now this) are not helpful in that regard.

There could be a system property to disable the popup. Or make it a passive notification instead of a modal dialog.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. I actually never wanted to make it that complicated, but before we get many complaints and since I had started it ...
You can now set the Java-system property m2e.keep.legacy.cache to true to just keep the cache.
Furthermore you can set a check-box to be not asked again.
In that case a marker file DELETE_ME.txt is created in the directory that explains why/when this can be deleted and that prevents the dialog from popping up subsequently.

If that is not sufficient I will just add the file to the directory so one can delete it manually if stumbling upon it.
This way maybe gigabytes of storage are kept unnecessarily occupied but at least no pop-up shows up.

@HannesWell
Copy link
Contributor Author

HannesWell commented Oct 15, 2022

I consider your absent of objections as silent consent.
Thank you for the suggestions and help.

If you think more has to be done, it can be done in a follow up PR.
But as it was said it was never the intend to make it that complex, so if this is not fine as it is, the clean up of ~/.m2/cache/m2e probably should be down-graded to just add a information file to the repo, which does not bother any workflow.

@HannesWell HannesWell merged commit e7fd915 into eclipse-m2e:master Oct 15, 2022
@HannesWell HannesWell deleted the deleteObsoletM2Caches branch October 15, 2022 07:44
@HannesWell HannesWell added this to the 2.1.0 milestone Oct 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants