Add soft_blocked_items to MLBF data store #22715
Open
+326
−198
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.
Relates to: mozilla/addons#15014
Description
This PR introduces
soft_blocked_items
to the mlbf data store. It does not yet include a new filter for them but just introduces the queries and data handling to have them. A follow up PR will introduce the new filter.Context
In order to add a bloom filter or stashes for hard/soft blocked versions we need first to query also for soft blocked items and store them in the MLBF class data storage.
This PR achieves that unblocking stashing and filter creation.
Testing
Auto testing should cover it but you could create a hard and soft blocked version and create an MLBF instance and verify the data store contains both the soft and hard blocked entities. Further if you modify a block type soft <-> hard, then regenerate the filter you should see the version move to the other store. Further, you could test what happens if you have no soft/hard blocked entries. In this case you expect an empty array.
You should NOT expect soft blocked versions to be included in any actual filters or stashes at this point. All soft blocked versions would be in not blocked for now still.
Checklist
#ISSUENUM
at the top of your PR to an existing open issue in the mozilla/addons repository.