Skip to content

Conversation

diox
Copy link
Member

@diox diox commented May 16, 2025

Fixes mozilla/addons#15495

Context

While Cinder consolidates multiple reports into the same job, we can still have multiple jobs for a given add-on because of escalations. When that happens, reviewers can resolve them all at the same time, but we don't want to duplicate activities or emails.

Testing

  • Report an add-on for policy violation on the website (leave your email as the reporter)
  • In Cinder, escalate that to reviewers
  • Report an add-on for policy violation on the website again (leave a different email as the reporter)
  • In Cinder, escalate that to reviewers again
  • In the review page, that add-on should now have 2 jobs to resolve when selecting an action
  • Disable the add-on while checking the checkboxes to resolve those 2 jobs
  • The developer should get a single email, each reporter should get one too. A single activity log should have been recorded and made visible in the review page

Repeat with a different add-on, this time rejecting multiple versions instead of disabling the add-on.

@diox diox force-pushed the reviewer-action-dont-duplicate-activities-or-notifications branch from 359fccb to bd62d47 Compare May 19, 2025 15:37
@diox diox requested a review from eviljeff May 19, 2025 16:14
@diox diox marked this pull request as ready for review May 19, 2025 16:14
Copy link
Member

@eviljeff eviljeff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I overall agree with the strategy, just some questions about the changes in record_decision.

And record_decision could really do with some refactoring - it's become a very complex chunk of code.

for version in self.target_versions:
now = datetime.now()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you intend to move this out of the loop? It doesn't change anything here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, minor detail but I wanted to guarantee all the versions got the same datestatuschanged to make tracking any issues easier.

# executed completely and log an activity, the rest are no-op that
# we just need for record-keeping purposes. We will only notify the
# owners for that "complete" one.
notify_owners = action_completed
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the thinking about defaulting notify_owners to action_completed? I don't understand the connection - it would mean all actions that aren't migrated over to ContentAction currently would send multiple emails.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't guarantee non-migrated actions behave like the ContentAction ones and don't do anything/don't log anything when not necessary. In fact I know this isn't the case. I did this to ensure those actions would have the exact same behavior as before out of caution.

@diox diox merged commit b9122e1 into mozilla:master May 21, 2025
42 checks passed
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]: Closing multiple abuse reports during a review rejection resulted in multiple rejections being sent
2 participants