[Task]: Make it possible to add or edit soft-blocks in the admin
Description
Depends on https://github.com/mozilla/addons/issues/15012
Make it possible to add and edit whether a version is soft or hard-blocked in the admin, with logging about the change.
This is unlikely to be the main way to add or edit soft-blocks in production (reviewer integration should be added later), but this is needed for testing purposes and convenience for edge-cases where an admin might need to quickly add/edit a soft-block.
Acceptance Criteria
### Milestones/checkpoints
- [ ] It should be possible to add a soft-block through the admin
- [ ] It should be possible to edit whether a version is soft-blocked or not through the admin
Checks
- [X] If the issue is ready to work on, I have removed the "needs:info" label.
- [X] If I have identified that the work is specific to a repository, I have removed "repository:addons-server" or "repository:addons-frontend"
┆Issue is synchronized with this Jira Task
Note: At the moment, you can't really edit block versions. You're either deleting versions from a block (unblocking them) or adding some (blocking them). This is all done through BlocklistSubmission, which gives us a unified UX for everything, approvals etc.
Currently the code receives changed_version_ids (a list of versions) and an action (either adding or deleting) and that's all it needs, since the only changes we are making are to block or unblock versions, and you can only do one type of action at a time.
So if we want the ability to change a blocked version from soft to hard and vice-versa, that's a significant amount of refactoring, and maybe some of the UX needs to change as well, and that's the main challenge for this ticket.
Maybe we could have a classic per-version change page, but bypassing BlocklistSubmission means approvals are bypassed as well so we'd need to re-implement that somehow. Or maybe we continue relying in the BlocklistSubmission UX flow for this as well.
Re-using BlocklistSubmission flow, we could:
- Expose a new radio button in the blocklist submission for adding blocks, determining if that's a soft or a hard block submission. You wouldn't be able to have both in the same submission. We'd default to hard, and that would apply to all new blocked versions that are part of this submission.
- For switching a given blocked version from soft to hard or hard to soft, add a new action that would only do that for the specific versions the user wants to change. You wouldn't be able to switch from hard to soft some versions and from soft to hard others in the same submission.
- Deletion would be unaffected
Some mockup of what the new action to soften a block would look like on a complex set of versions:
Checkboxes would only be shown in that case for versions that are hard-blocked, nothing else. (The new "warning" yellow icon means the version is soft-blocked already)
- filed the followups after yesterday's checks on dev
- checked the dual sign-off on stage for 2 versions on https://reviewers.addons.allizom.org/en-US/reviewers/review/1004832 (confirming that at approval the block type cannot be modified)
- unblocked 2 versions on -dev -> showed up https://remote-settings-dev.allizom.org/v1/buckets/blocklists/collections/addons-bloomfilters/records
- in discussion on slack about stage and the tests made today (yesterday the blocked add-on showed up in stash) no problems with generation of bloomfilters for yesterday for {5e4f3038-b8c4-4163-84bb-7b21af1dd20a}
The ones below did not show up on https://firefox.settings.services.allizom.org/v1/buckets/blocklists/collections/addons-bloomfilters/records
https://addons.allizom.org/en-US/firefox/addon/stats-on-stage-5/versions/ https://addons.allizom.org/en-US/firefox/addon/one-blocked-one-restricted/ https://addons.allizom.org/en-US/firefox/addon/a-restricted/
Today's test results on dev
-
blocked versions showed up in stash and were blocked in the browser
-
restricted versions unblocked did not show up in stash (so far expected)
On stage
- installed and hard blocked versions showed up in stash and have been blocked in the browser
- restricted versions are not present in stash and continue to be available in about:addons
- deleted hard-blocked versions are all present in stash