[Bug]: 2nd level approval: approver not recorded on "Proceed", and reviewers can release their own held decisions
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- Makefile
- スター
- 135
- フォーク
- 52
- 平均マージ
- 6日 18時間
- マージ済み PR(30日)
- 7
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
mozilla/addons のほかの issue
-
needs:info
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
[Task]: Add new confusable characters to AMO's custom mappings対応中かも @abhn が 1 日前に担当しました。 オープンneeds:info
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
-
[Task]: Add feedback form link to Pinguino対応中かも @diox が 2 日前に担当しました。 オープンcomponent:pinguino_devhub
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
[Bug]: Enterprise toggle option is shown in theme version upload対応中かも @eviljeff が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
home-assistant/app-deconz#11 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
`MaterializedChatMessage._text` is quadratic in the number of text chunks (`+=` followed by `endsWith`), driving the extension host to heap OOM対応中かも @olegius88 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
microsoft/vscode-prompt-tsx#205 ·
-
triage
難易度 1/5 1時間未満 初心者へのやさしさ 64/100
-
[Wrath][Cata][Mists] Class quests without a class restriction, and FLAG quests, show to every playerオープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信