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

cleanup obsolete frozen rules #1407

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

maxxkia
Copy link

@maxxkia maxxkia commented Jan 19, 2025

These changes bring 2 features

  • clean up of frozen rules in stored.rules where the corresponding file does not exist in the store directory
  • clean up of files in store directory which are not referenced in stored.rules file
    Both of the above operations are enabled using default.allowStoreUpdate property. If default.allowStoreUpdate=false and obsolete entries or files are found by either of the above operations, the operation fails with an StoreUpdateFailedException.

Signed-off-by: Masoud Kiaeeha [email protected]

Resolves #1264

@maxxkia maxxkia force-pushed the cleanup-obsolete-frozen-rules branch 2 times, most recently from 7f8a0bf to 099f636 Compare January 19, 2025 21:28
@maxxkia maxxkia force-pushed the cleanup-obsolete-frozen-rules branch from 099f636 to 3a463d1 Compare January 30, 2025 21:47
* clean up of frozen rules in `stored.rules` where the corresponding file does not exist in the store directory
* clean up of files in store directory which are not referenced in `stored.rules` file
Both of the above operations are enabled using `default.allowStoreUpdate` property. If `default.allowStoreUpdate=false` and obsolete entries or files are found by either of the above operations, the operation fails with an `StoreUpdateFailedException`.

Signed-off-by: Masoud Kiaeeha <[email protected]>

Resolves TNG#1264
@maxxkia maxxkia force-pushed the cleanup-obsolete-frozen-rules branch from 3a463d1 to b0631bc Compare January 30, 2025 21:48
@maxxkia maxxkia marked this pull request as ready for review January 30, 2025 21:49
.filter(Predicates.not(ruleFiles::contains))
.collect(toList());

if (!danglingFiles.isEmpty() && !storeUpdateAllowed) {
Copy link
Author

Choose a reason for hiding this comment

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

for controlling the new features we can either reuse storeUpdateAllowed property (current implementation) or a new property. reusing the existing property would make this change not backward compatible and is probably not favored. But first I'd like to hear feedback from the maintainers.

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.

Feature suggestion: Freeze files and stored.rules validation / sanity check
1 participant