[Bug]: 2nd level approval: approver not recorded on "Proceed", and reviewers can release their own held decisions
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- Makefile
- Estrellas
- 135
- Forks
- 52
- Merge medio
- 6 d 18 h
- PR fusionados (30 d)
- 7
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de mozilla/addons
-
needs:info
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
[Task]: Add new confusable characters to AMO's custom mappingsPosiblemente ocupada @abhn la tomó hace 1 día. Abiertoneeds:info
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
-
[Task]: Add feedback form link to PinguinoPosiblemente ocupada @diox la tomó hace 2 días. Abiertocomponent:pinguino_devhub
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
[Bug]: Enterprise toggle option is shown in theme version uploadPosiblemente ocupada @eviljeff la tomó hace 1 día. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Todos los issues de mozilla/addons
Issues similares
-
triage
Dificultad 1/5 Menos de una hora Aptitud para principiantes 64/100
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
meetecho/juturna_nodes#43 ·
Los mantenedores suelen responder en 2 días
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
ranxianglei/billion-context#7860 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
-
`RequestHandler.build_request_kwargs` drops empty request bodies such as `{}` or `""`Posiblemente ocupada @abhirajadhikary06 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
typesense/typesense-python#170 ·
Los mantenedores suelen responder en 1 día