Implement approvals in ContentActions#25054
Conversation
6bb9e6f to
71bbeea
Compare
That didn't work for me. I selected Review -> Approve add-on version, selected the version, submitted, I can see This was on the listed channel, where before/with the waffle switch off we' don't let you select which version to approve. |
|
Found out when I ran out of unconfirmed auto-approved add-ons and tried to auto-approve new ones, got a bunch of |
diox
left a comment
There was a problem hiding this comment.
See comment about auto_approve breakage
Now that all the functionality has been moved into ContentActionApproveVersion I changed auto_approve.py to directly create the decision rather than take a round trip via ReviewHelper. |
Fixes mozilla/addons#16239
Description
Adds support for approving versions, confirming approval of versions, and approving the addon (i.e. listing content approval) via policies in the reviewer tools.
Context
The split into two actions between negative and positive actions is only to have a cleaner list of policies for reviewers, and to be able to filter the versions list appropriately - you can see the underlying function call is the same. If it was desirable we could have a single list of policies (like Cinder), and add some (more) javascript to filter versions based on policies selected. But I think it's fine this way, if not actually preferable.
I've made a specific Add-on version approval policy in Cinder staging for this to work - otherwise there's no way to really differentiate whether we need amo-approve or amo-approve-version. Another plus to this is more clarity, that amo-approve is addon level action, and amo-addon-version is version level action.
Part of the size of this patch is I had to transplant a lot of code from reviewers/utils to abuse/actions for this - a consequence of not quite finishing the reviewer tools -> cinder action work in 2025 (2024?). But because there's a lot of commonality between approval for listed and unlisted, and confirming and approving, the end result will be - I really hope - more DRY than before.
the other culprit for the size is test_actions.py underwent yet-another-refactoring (sorry) as the previous pattern of having everything in a single base class and disabling certain tests with
passbecame too difficult to keep track of. The refactor to have the negative tests for negative ActionClasses in one mixin, and positive in the other, makes that pattern much less necessary.Testing
Sync your Cinder policies + turn on waffle switch
Try:
Everything should work externally as a now, e.g. emails for version approval; no emails for confirmation of approval.
Checklist
#ISSUENUMat the top of your PR to an existing open issue in the mozilla/addons repository.