Add a test and logic to prevent automatic review of edits that change a page from an article to a redirect.
Logic:
If an edit changes a page from an article to a redirect, do not automatically review it.
Exception:
If the user is in the auto-reviewed user group and the edit is approved because of that user group membership, allow the auto-review.
Implementation Requirements:
- Detect when an edit converts an article to a redirect
- Handle localized translations of the #redirect keyword (magic words)
- Check if the user is in the auto-reviewed user group before applying the block
- Add comprehensive tests to autoreview.py
Example Edits:
- https://fi.wikipedia.org/w/index.php?title=Pekingin_tekninen_instituutti&curid=1220095&diff=23567438&oldid=22754221
- https://fi.wikipedia.org/w/index.php?title=Lyhtykalat&curid=686948&diff=23565433&oldid=20966118
- https://fi.wikipedia.org/w/index.php?title=Syvännesimput&curid=1085707&diff=23561835&oldid=22813533
Edit test Location:
- app/reviews/autoreview.py
- https://github.com/Wikimedia-Suomi/PendingChangesBot-ng/blob/main/app/reviews/autoreview.py
Magic Words API:
- Translations for redirect magic words can be fetched from:
- https://fi.wikipedia.org/w/api.php?action=query&meta=siteinfo&siprop=magicwords
Unit tests Should Cover:
- Article-to-redirect conversion (should block)
- Redirect-to-redirect edit (should not block based on this rule)
- Article-to-redirect by auto-reviewed user (should allow)
- Localized redirect keywords (e.g., Finnish #OHJAUS, #UUDELLEENOHJAUS)
- Case insensitive redirect keywords (e,g: #REDIRECT #Redirect #redirect #ReDiRecT)