Implement a function that determines the highest revision ID that can be safely approved from autorevew results, and creates a consolidated approval comment summarizing the reasons for all intermediate approvals.
Background
Currently, run_autoreview_for_page() processes all pending revisions of an article and returns approval decisions with reasons. To minimize the number of approval actions, we should approve only the latest eligible revision with a comprehensive comment explaining why all intermediate revisions were also approved.
Requirements
Input
- Results from
run_autoreview_for_page() containing approval decisions for each pending revision, with reasons such as:
- User was a bot
- No content change in last article
- User was auto-reviewed
- ORES scores (goodfaith/damaging thresholds met)
- Other approval criteria
Processing Logic
- Parse through all approved revisions from the results
- Identify the maximum (latest) revision ID that can be approved
- Collect and consolidate approval reasons for all revisions up to and including the maximum revision
- Generate a single summary comment that lists all revisions and their approval reasons
Output
rev_id = highest approved revision ID
comment = consolidated summary of all approvals
Example Output Format
rev_id 12345 approved because user was bot, rev_id 12346 approved because no content was in last article, rev_id 12347, 12348 approved because user was autoreviewed and rev_id 12349 approved by ORES score goodfaith=0.53, damaging: 0.251.
Implementation Notes
- Group consecutive revisions with identical reasons to keep the comment concise (e.g., "rev_id 12347, 12348 approved because...")
- Ensure the comment clearly attributes each revision or group of revisions to their specific approval reason
- Handle edge cases where no revisions are approved or only one revision is approved
- Consider character limits for the approval comment field
Benefits
- Reduces the number of approval actions needed
- Provides transparency by documenting all approval decisions in a single place
- Creates a clear audit trail for why multiple revisions were approved together
Acceptance Criteria
Implement a function that determines the highest revision ID that can be safely approved from autorevew results, and creates a consolidated approval comment summarizing the reasons for all intermediate approvals.
Background
Currently,
run_autoreview_for_page()processes all pending revisions of an article and returns approval decisions with reasons. To minimize the number of approval actions, we should approve only the latest eligible revision with a comprehensive comment explaining why all intermediate revisions were also approved.Requirements
Input
run_autoreview_for_page()containing approval decisions for each pending revision, with reasons such as:Processing Logic
Output
rev_id= highest approved revision IDcomment= consolidated summary of all approvalsExample Output Format
Implementation Notes
Benefits
Acceptance Criteria
approve_revision()is made with correct parameters