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

Store override decisions as seperate ContentDecision instances #22917

Merged
merged 2 commits into from
Dec 11, 2024

Conversation

eviljeff
Copy link
Member

@eviljeff eviljeff commented Dec 4, 2024

Fixes: mozilla/addons#15151

Description

Creates a new ContentDecision instance each time we have a decision (actually, just twice, because Cinder, afaik, doesn't support overrides of overrides.)

Context

Our current hacky practise of just reusing ContentDecision instances means we could never tell an action had changed after the request had ended - a problem for 2nd level approvals when the processing of the action was separate from the request. This means we would handle overridden decisions from Cinder correctly, but also unblocks being able to send override decisions from AMO (more correct; and something we need to accurately report a change on the back of a 2nd level approval).

Testing

To test the Cinder webhook integration you'll need to:

  • report an add-on, that goes to Cinder (e.g. other reason)
  • make a decision on that add-on abuse report job in Cinder (e.g. disable)
  • replay the webhook request locally to get the first decision
  • override that decision in Cinder to something different (e.g. approve)
  • replay the second webhook request locally
  • try to appeal with the appeal link from the first decision - should be prevented from doing so
  • reporters should get emails both times too

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.

Copy link

sentry-io bot commented Dec 4, 2024

🔍 Existing Issues For Review

Your pull request is modifying functions with the following pre-existing issues:

📄 File: src/olympia/abuse/models.py

Function Unhandled Issue
process_decision AssertionError /api/v5/abuse/response/
Event Count: 1
📄 File: src/olympia/abuse/views.py (Click to Expand)
Function Unhandled Issue
process_webhook_payload_decision AssertionError /api/v5/abuse/response/
Event Count: 1
---

Did you find this useful? React with a 👍 or 👎

@eviljeff eviljeff force-pushed the 15151-store-override-decisions branch from ffdea0b to 8137791 Compare December 4, 2024 17:26
@eviljeff eviljeff requested review from a team and diox and removed request for a team December 4, 2024 17:36
@eviljeff eviljeff marked this pull request as ready for review December 4, 2024 17:36
@eviljeff eviljeff merged commit c3e59b0 into mozilla:master Dec 11, 2024
36 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.

[Task]: Store all decisions for a job
2 participants