Page MenuHomePhabricator

Add FlaggedRevs API:Review support to Pywikibot
Open, Needs TriagePublic

Description

Currently there is no FlaggedRevs review API support in Pywikibot so it would be useful to add it there and not implement it to PendingChangesBot code.

Proposed Solution:
Add new function review() to pywikibot/site/ _apisite.py with following parameters. Add also unit tests for the new function.

  • revid: The revision ID for which to set the flags
  • summary: Comment for the review (optional, default "")
  • flag_accuracy: Set the flag named "accuracy" to the specified value; (replace "accuracy" with the flag name to set another flag)
  • unapprove : If set, revision will be unapproved rather than approved (optional, default: None)

Notes

  • Test if flag-parameter is mandatory? If it is not then leave it out as unsupported parameter.
  • Pywikibot uses summary in function call parameters, FlaggedRews API uses comment as parameter name
  • use Pywikibots simple_request() for calling mediawiki API (see _apisite:protect() as example)

Review user right
You can ask to be added to reviewer user group in fiwiki for developing by commenting on this phabricator ticket

Test pages
Do not review/unreview other pages than these for testing

Documentation:

Examples:

Code Review Requirements:
For the patch to pass Pywikibot code review, please ensure:

  1. Follow Gerrit guidelines:
  2. Code quality:
  3. Patch must follow the Pywikibot style guide
  4. No flake8 errors or warnings
    • Commit message must follow style guidelines
  5. Testing:
  6. Added error handling must include unit tests
  7. Tests should verify proper error detection and messaging for OAuth/BotPassword scenarios

Event Timeline

@Xqt Is the pywikibot/site/_apisite.py correct place for adding flaggedrevs review() and stabilize() functons?

Second question is that should the flagged revs functions to be prefixed in someway ? ie. flaggedrews_review() , flaggedrews_stabilize(), flaggedrews_get_stable_revision(), flaggedrews_get_stable_revision_id() , flaggedrews_get_stable_revision(), flaggedrevs_get_state() etc.

Zache updated the task description. (Show Details)
Zache updated the task description. (Show Details)
Zache updated the task description. (Show Details)
Zache renamed this task from Add FlaggedRevs review API support to Pywikibot to Add FlaggedRevs API:Review support to Pywikibot.Oct 27 2025, 1:02 PM
Zache updated the task description. (Show Details)

Change #1203490 had a related patch set uploaded (by Ezra yendau; author: Ezra yendau):

[pywikibot/core@master] Add new function review() to pywikibot/site/ _apisite.py

https://gerrit.wikimedia.org/r/1203490