link the activity log to the ContentDecision so we can backtrack it #22936
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes: mozilla/addons#15228
Description
Adds an intermediary ActivityLog model that allows us to track ContentDecision that are linked to a reviewer/moderator activity.
Most of the change here is to enable all actions from Cinder to generate an ActivityLog and link the decision to it. The change in
notify_reviewer_decision
, that is called from the reviewer tools, is more of an intermediate hack because the activity log was already created - it's going to need more refactoring to create the ContentDecision earlier that will be addressed in other issues.Context
Having a link between the
ContentDecision
and the connected activity will unlock more accurate appeal handling (we can flag the exact version that was rejected, rather than guessing at the add-on level); and the 2nd level approvals for reviewer tools actions. (And potentially dropCinderJobLog
and/orCinderPolicyLog
as theContentDecision
already links to jobs and policies)Testing
Difficult to test functionally because it's a dependency for further work, (on top of the usual fun for testing Cinder integration).
To test Cinder actions:
.contentdecisionlog_set
manager with 1ContentDecisionLog
instance, where the.decision
points to the created CinderDecision.Bonus testing with appeals:
.contentdecisionlog_set
manager with 1ContentDecisionLog
instance, where the.decision
points to the created CinderDecision.Checklist
#ISSUENUM
at the top of your PR to an existing open issue in the mozilla/addons repository.