Skip to content

When syncing policies disable unpublished in reviewer tools#24842

Open
eviljeff wants to merge 1 commit intomozilla:masterfrom
eviljeff:16190-handle-deleted-policies
Open

When syncing policies disable unpublished in reviewer tools#24842
eviljeff wants to merge 1 commit intomozilla:masterfrom
eviljeff:16190-handle-deleted-policies

Conversation

@eviljeff
Copy link
Copy Markdown
Member

@eviljeff eviljeff commented May 7, 2026

Fixes mozilla/addons#16190 and fixed mozilla/addons#16201

Description

Adds better handling for unpublished and deleted policies when the policies are synced from Cinder, by storing the status and removing them from the reviewer tools. Also prevents invalid policies from being sent to Cinder with a decision, if they are associated with a decision anyway. Finally, adds checkboxes to toggle reviewer tools, and a django admin filter to make managing easier for Operations.

Screenshot 2026-05-07 130422

Context

Policy state is synced from Cinder, plus an additional state for deleted policies (deleted but exposed in reviewer tools is seperately so we don't lose the policy on the next sync after we flip expose in reviewer tools).

Note, this patch doesn't attempt do anything with scanner rules that may use the policies - the policy would be marked as as Deleted, and the rule would still work, but a decision made using that rule would be missing the policy in Cinder. (The policy would of course be unavailable for new scanner rules, because of the qs filter to only allow expose_in_reviewer_tools=True)

Testing

  • click Sync From Cinder in django admin (or use the management command directly)
  • See policy statuses are synced over too
  • If you've not synced recently (since the prod->staging import) you'll see some of the policies you had before marked as deleted, or deleted and previously exposed; otherwise:
    • easiest way is to identify some policies that were used for decisions previously, and other policies that were exposed in reviewer tools, and tinker with their uuids in a django shell. Then run the sync again to see them marked as Deleted.

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.

@eviljeff eviljeff force-pushed the 16190-handle-deleted-policies branch from 87cf73c to a267ee4 Compare May 7, 2026 12:03
@eviljeff eviljeff marked this pull request as ready for review May 7, 2026 12:11
@eviljeff eviljeff requested a review from diox May 7, 2026 12:20
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.

[Bug]: emails are not sent after rev tool actions - on own initiative or cinder escalations [Task]: Handle draft and archived cinder policies

1 participant