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

SystemCleaner: Improve custom filter behavior and support creation via StorageAnalyzer #590

Merged
merged 13 commits into from
Aug 17, 2023

Conversation

d4rken
Copy link
Member

@d4rken d4rken commented Aug 16, 2023

This improves the BaseSieve class used by the SystemCleaner to support more complex filter config arguments.
In turn we can now create nice custom filters via StorageAnalyzer. Before this refactoring it was problematic to create a custom filter that deletes specific files, and a whole directory without accidentally including other directories that have the first directories name as prefix.

i.e. we want a FULL match of path/fileA and also match path/folderA/ without matching path/folderAB, but the only tools we had was pathContains.

This change now gives us SegmentCriteria and NameCriteria which each support different modes like START, END, CONTAIN, EQUAL so when creating custom filters we can create a SegmentCriterium with Mode.Equal for matching a specific path, while using Mode.Start to match a folder and all that is in it.

Due to the change in format, the previous custom filters are deleted. I opted for not creating migration code as this is a BETA and migration code is not great to lug around after beta.

@d4rken d4rken added enhancement New feature, request, improvement or optimization c: SystemCleaner c: StorageAnalyzer labels Aug 16, 2023
Might be a bit more dangerous but it's super frustrating.
(and if we create one via analyzer, then the user needs to navigate and extra round-trip just to enable it.
@d4rken d4rken merged commit 9934f4d into main Aug 17, 2023
9 checks passed
@d4rken d4rken deleted the analyzer_create_customfilter branch August 17, 2023 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: StorageAnalyzer c: SystemCleaner enhancement New feature, request, improvement or optimization
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant