Skip to content
This repository was archived by the owner on Mar 20, 2026. It is now read-only.

EditCounter: Use review not patrol stats for enwiki#501

Merged
MusikAnimal merged 21 commits intox-tools:mainfrom
agoujot:reviewnotpatrolenwp
Apr 23, 2025
Merged

EditCounter: Use review not patrol stats for enwiki#501
MusikAnimal merged 21 commits intox-tools:mainfrom
agoujot:reviewnotpatrolenwp

Conversation

@agoujot
Copy link
Copy Markdown
Member

@agoujot agoujot commented Apr 17, 2025

(Ignore the first five commits, it's just a commit in the wrong branch, its revert, typos in the revert, and merging the main to here. I've cleaned my main branch so this shouldn't happen again.)

Enwiki is the only wiki to use pagetriage, and they barely use patrol.

Therefore, replace the patrol stats by the pagetriage-curation reviewed stats. They have requested this a certain number of times, e.g. T366397, https://www.mediawiki.org/wiki/Topic:Xxhmzabmfwnsuwck, &c.

Which means:

  • add reviewed to the list of log types where we want 0 if it's null;
  • add a public function that just gives the reviews
  • use {% if project.databaseName == enwiki %} in twig

NL said that "Page curation" works as a label and will probably not cause too much confusion, so replace the patrol message by that. (we've already got it translated.)

Bug: T366397

agoujot added 10 commits April 16, 2025 20:07
A few things:
 - logs can only be partially revdeleted.
 - log_params is only null when revdeleted.
 - log_params is always null when ''any'' revdeleting was used
 - revdeleted values are null
From that:
A) in userrights.php: we here leave nulls instead of skipping for partially revdeleted logs. This includes added and removed.
B) in userrightsrepository.php: we use LEFT OUTER JOIN and not JOIN actors table, for revdeleted actors. Also remove the ISNULL around comment_text because null is a good signal to twig.
C) in rights_changes_table.html.twig and rights_changes_table.wikitext.twig: if users or comments are null, put a more graceful message.

Bug: T391753
this only exists on, and will only be used for, ENWP.
review not reviewed;
in the database it's reviewed
but at special:log it's review
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 17, 2025

Codecov Report

Attention: Patch coverage is 66.66667% with 3 lines in your changes missing coverage. Please review.

Project coverage is 70.95%. Comparing base (4b8eb28) to head (bac26fd).
Report is 72 commits behind head on main.

Files with missing lines Patch % Lines
src/Model/Project.php 0.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #501      +/-   ##
============================================
- Coverage     71.30%   70.95%   -0.36%     
- Complexity     1275     1298      +23     
============================================
  Files            46       46              
  Lines          3792     3901     +109     
============================================
+ Hits           2704     2768      +64     
- Misses         1088     1133      +45     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@agoujot
Copy link
Copy Markdown
Member Author

agoujot commented Apr 22, 2025

Ok, so, after testing and numbers checking:

  • corrected reviewed to pagetriage-curation-reviewed
  • added actions reviewed-article and reviewed-redirect (ah, nothing like outdated documentation. also, the above is not a superset of these. Possibly an old classification from before it said article/redirect? Anyhow the NPP folks count it separately).
  • added patrol-patrol count in that, as the enwp people count it in.(Asked confirmation, just in case.)

@agoujot
Copy link
Copy Markdown
Member Author

agoujot commented Apr 22, 2025

There we go. Should re ready.

Copy link
Copy Markdown
Member

@MusikAnimal MusikAnimal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! I'm happy to merge as-is, but would like to discourage hard-coding database names (though I know we are guilty of doing it in other parts of XTools).

added patrol-patrol count in that, as the enwp people count it in.(Asked confirmation, just in case.)

Looks like we're not including patrol-patrol now? That's good because it would double count reviews, I think. Each initial pagetriage-curation-reviewed* I believe also produces a patrol-patrol log entry.

Comment thread templates/editCounter/general_stats.html.twig Outdated
@MusikAnimal
Copy link
Copy Markdown
Member

Not required but for bonus points: update EditCounterTest::testLogCounts() accordingly :)

@agoujot
Copy link
Copy Markdown
Member Author

agoujot commented Apr 23, 2025

On double-counting: not exactly. Some do, some don't, and anyhow after I asked they told me to split the two, so I did. So right now we've got the two next to each other and they do whatever they want to do with it.

Changed the database name hardcoding.

Also added tests for reviews.

Copy link
Copy Markdown
Member

@MusikAnimal MusikAnimal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! 💯

@MusikAnimal MusikAnimal merged commit 7d6ff48 into x-tools:main Apr 23, 2025
1 of 3 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants