[Bug]: 2nd level approval: approver not recorded on "Proceed", and reviewers can release their own held decisions
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
Research direction
Start with reviewers/views.py (decision_review), reviewers/forms.py (HeldDecisionReviewForm.clean), and reviewers/utils.py for the held-decision queue; trace how released actions record their actor and how pending rejections retain attribution. Add coverage for both self-release prevention and recording the resolving user on each resolution path. Done means the approver is auditable and a reviewer cannot silently release their own held decision.
Written by the indexing model from the issue text.
Description
Is there an existing issue for this?
- I have searched the existing issues
What happened?
Two problems with 2nd level approval (held decisions, reviewers.decision_review):
- The user who resolves a held decision is not recorded in all cases. When the original decision has a
reviewer_user, choosing "Proceed with action" records nothing that identifies the approver. All resulting activity is attributed to the original reviewer. - Nothing prevents the reviewer who created a held decision from releasing it themselves, as long as they have
ADDONS_HIGH_IMPACT_APPROVE.
Together, these mean that for reviewer-initiated holds it is impossible to tell from AMO data who approved the action, or whether a second person reviewed it at all.
1. Approver attribution, by resolution path
| 2nd level choice | What is created | Approver recorded? |
|---|---|---|
| Approve content instead | New ContentDecision (AMO_APPROVE) with reviewer_user=request.user, override_of=<held decision> |
Yes |
| Cancel and enqueue in Reviewer Tools | New ContentDecision (AMO_REQUEUE) with reviewer_user=request.user, plus a "Flagged for human review" activity log by the approver |
Yes |
Proceed with action, held decision has no reviewer_user (Cinder/TaskUs-initiated) |
No new decision. execute_action(release_hold=True) logs with no explicit user, so ActivityLogManager.create falls back to core.get_user() (the approver) |
Yes, indirectly |
Proceed with action, held decision has a reviewer_user (reviewer- or automation-initiated) |
No new decision. ContentAction.log_action passes user=self.decision.reviewer_user, so every resulting activity log is attributed to the original reviewer |
No |
The last row also affects downstream data:
ContentActionRejectVersionDelayed.process_actionsetsVersionReviewerFlags.pending_rejection_by = self.decision.reviewer_useron release, so the later automatic rejection is also attributed to the original reviewer.- The add-on's review history page shows the released action (e.g. "Rejection scheduled") as performed by the original reviewer, at the time of the 2nd level release.
No other record of the approver exists: no override decision, no activity log entry by the approver, no field on ContentDecision. A check of activity logs on affected add-ons around the release time found only entries by the original reviewer or the task user.
2. No self-approval guard
decision_review(reviewers/views.py) only requiresADDONS_HIGH_IMPACT_APPROVE.HeldDecisionReviewForm.clean(reviewers/forms.py) only checks the decision is still held (ContentDecision.objects.awaiting_action()).- The held decisions queue (
reviewers/utils.py) lists allawaiting_action()decisions, including the viewer's own.
None of these compare request.user with decision.reviewer_user.
Steps to reproduce
- As a reviewer with
ADDONS_HIGH_IMPACT_APPROVE, take an action on a high-profile promoted add-on that gets held (e.g. reject versions). - As the same user, open the held decisions queue (
/reviewers/queue/held_decisions) and choose "Proceed with action" on that decision.- Expected: blocked, or at least recorded as a self-approval.
- Actual: allowed.
- Repeat step 2 as a different 2nd level approver.
- Expected: the approver is recorded somewhere (activity log, decision field).
- Actual: the review history and activity log show only the original reviewer. Nothing identifies who approved.
What did you expect to happen?
Expected behavior
- Every 2nd level resolution records the user who made it, including "Proceed with action". Options: an activity log entry by
request.userwhen a hold is released, and/or an approver field onContentDecision(e.g.released_by). - A reviewer cannot release a held decision they created (
request.user != decision.reviewer_user), or such releases are explicitly flagged if self-release is intentionally allowed.
Impact
- No audit trail for who approved high-impact actions on promoted add-ons.
- The 2nd level "second pair of eyes" control can be bypassed by the original reviewer without any trace.
- Reporting on 2nd level approval cannot attribute most "Proceed" outcomes.
┆Issue is synchronized with this Jira Task
- Dominant language
- Makefile
- Stars
- 135
- Forks
- 52
- Avg merge
- 6d 18h
- Merged PRs (30d)
- 7
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from mozilla/addons
-
needs:info
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
[Task]: Add new confusable characters to AMO's custom mappingsPossibly taken @abhn claimed this 1 day ago. Openneeds:info
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
-
[Task]: Add feedback form link to PinguinoPossibly taken @diox claimed this 2 days ago. Opencomponent:pinguino_devhub
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
[Bug]: Enterprise toggle option is shown in theme version uploadPossibly taken @eviljeff claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Similar issues
-
triage
Difficulty 1/5 Under an hour Newbie friendliness 64/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
meetecho/juturna_nodes#43 ·
Maintainers usually reply within 2 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
ranxianglei/billion-context#7860 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
-
`RequestHandler.build_request_kwargs` drops empty request bodies such as `{}` or `""`Possibly taken @abhirajadhikary06 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
typesense/typesense-python#170 ·
Maintainers usually reply within 1 day