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

Add soft_blocked_items to MLBF data store #22715

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

KevinMind
Copy link
Contributor

@KevinMind KevinMind commented Sep 27, 2024

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.

This PR includes #22811 that PR should land first

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.

MLBF.generate_from_db('test').data._raw

this will return the full dictionary of all three keys.

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

  • Add #ISSUENUM at the top of your PR to an existing open issue in the mozilla/addons repository.
  • Successfully verified the change locally.
  • The change is covered by automated tests, or otherwise indicated why doing so is unnecessary/impossible.
  • Add before and after screenshots (Only for changes that impact the UI).
  • Add or update relevant docs reflecting the changes made.

@KevinMind KevinMind changed the base branch from soft-block-bloomfilter to master October 30, 2024 09:25
@KevinMind KevinMind force-pushed the soft-block-bloom-filter branch 4 times, most recently from 9721754 to 211b06f Compare November 1, 2024 09:44
@KevinMind KevinMind marked this pull request as ready for review November 1, 2024 09:46
@KevinMind KevinMind changed the title Soft-block-bloom-filter Add soft_blocked_items to MLBF data store Nov 1, 2024
This patch does the following:

- Introduce `PositiveTinyIntegerField` to support `tinyint unsigned` fields
- Rename `soft` to `block_type` via 2 separate migrations (add + remove)
- Introduce `BlockType` enum and use it instead of the `soft` boolean
- Unify the string versions of enum values
@KevinMind
Copy link
Contributor Author

@eviljeff rebased on master.

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.

2 participants