Add reference-only edit detection and auto-approval#127
Add reference-only edit detection and auto-approval#127miraclousharshita wants to merge 10 commits intoWikimedia-Suomi:mainfrom
Conversation
|
Great work on this PR! The implementation is clean, well-structured, and has excellent test coverage (22 test cases covering all the requirements). Really impressive! 🎉 Issue to FixThere's one bug that needs to be addressed I believe: In ext_url_usage = self.site.exturlusage(
url=domain, protocol="http", namespaces=[0], total=1
)Problem: Fix: Remove the ext_url_usage = self.site.exturlusage(
url=domain, namespaces=[0], total=1
)According to the MediaWiki API docs, when protocol is omitted, it defaults to checking both HTTP and HTTPS. Once this is fixed, I think it will be good to go! 🚀 |
zache-fi
left a comment
There was a problem hiding this comment.
Hmm, i tested this. I think that coding style etc point of view and others it is very nice.
However, I noticed that there were some irregularities on how it passes and failes the changes. Here is example list for some of the changes. My guess that the checking if the edit is reference edit fails because it pics more text than expected. The test for checking if the link is new least partially fails because if the link is still in latest revision then it will beckome self-match.
Correctly detecs the ref change
- https://fi.wikipedia.org/w/index.php?diff=22215284&oldid=20901606
- https://fi.wikipedia.org/w/index.php?diff=23628641&oldid=23628634
- https://fi.wikipedia.org/w/index.php?diff=23628646&oldid=23628641
- https://fi.wikipedia.org/w/index.php?diff=23630234&oldid=23630062
Correctly detects that the domain was new
- https://fi.wikipedia.org/w/index.php?diff=23610289&oldid=23610287
- https://fi.wikipedia.org/w/index.php?diff=23610292&oldid=23610290
- https://fi.wikipedia.org/w/index.php?diff=23610325&oldid=23610323
Incorrect: Edit modifies content beyond references detection
Incorrectly detects that domain was new/old
- https://fi.wikipedia.org/w/index.php?diff=23610322&oldid=23610292 (ie. www.terveyskirjasta.fi
- https://fi.wikipedia.org/w/index.php?diff=23610323&oldid=23610322 (ie. www.terveyskirjastaa.fi )
- https://fi.wikipedia.org/w/index.php?diff=23610334&oldid=23610325 (ie. terveyskirjastoa2025a.fi)
Incorrectly detects if it is ref change
- https://fi.wikipedia.org/w/index.php?diff=23626929&oldid=23560693
- https://fi.wikipedia.org/w/index.php?diff=23627200&oldid=23608009
- https://fi.wikipedia.org/w/index.php?diff=23645085&oldid=23629025
- https://fi.wikipedia.org/w/index.php?diff=23627790&oldid=23627781
- https://fi.wikipedia.org/w/index.php?diff=23628305&oldid=23628303
- https://fi.wikipedia.org/w/index.php?diff=23628624&oldid=23628595
- https://fi.wikipedia.org/w/index.php?diff=23628737&oldid=23567180
- https://fi.wikipedia.org/w/index.php?diff=23629112&oldid=23590064
- https://fi.wikipedia.org/w/index.php?diff=23630857&oldid=23630854
- https://fi.wikipedia.org/w/index.php?diff=23630858&oldid=23630857
- https://fi.wikipedia.org/w/index.php?diff=23631098&oldid=23443685
| return False | ||
|
|
||
| try: | ||
| ext_url_usage = self.site.exturlusage(url=domain, namespaces=[0], total=1) |
There was a problem hiding this comment.
If total=1 then this will match to itself if it still exists in latest revision. You can somewhat mitigate self-references by adding total=2 and check if there is least 2 links.
|
@zache-fi can you please review it again |
|
Thanks, there is still some incorrect review results. Note. this is probably not because from your code / changes, but it already did wrong reviews which weren't notified because there werent thant many test cases. In any case I added now a management command which will run Usage The configuration page for diff tests here. Note: I have only tested management command with the |
|
@zache-fi can you please recheck, I update it to fix the abnormalities |
closes : #24
Implements automatic approval for edits that only add or modify references, reducing manual review workload for citation improvements.
Auto-approve when:
Require manual review when: