Allow invalidation of All Visits only #22989
Open
+1,587
−1,125
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
This PR improves and fixes some parts of the
core:invalidate-report-data
commandAllow invalidating
All visits
segment only by providing--segment=""
This new option will only invalidate the all visits segment
Correctly invalidate all known segments when no segment is provided
Before only segments with existing archives were invalidated, causing other segments not to be re archived at all.
Fixed range invalidation of plugin archives
While "normal" periods were invalidated correctly when a plugin was provided, this was not correctly done for range archives. Instead the all visits archive was invalidated, causing more re archiving than requested.
Improved handling of provided segments
When segments were provided that did not exist for one of the provided sites, the command previously failed. Now it will invalidate the segment for all sites where it is available, while skipping it for other sites.
The code overall was a restructured and improved. A plenty of new tests for the command should ensure that the correct invalidations are created when command is executed with certain parameters.
Currently "excluded" from the testing for the command is the handling of existing archives. Those should be marked as invalidated and in certain cases also plugin and segment archives should get invalid, depending on the invalidation request.
But I didn't want to extend the scope of this change here too much, so we should consider writing some proper tests for
Model::updateArchiveAsInvalidated
method another time.fixes #19947
Review