xtools icon indicating copy to clipboard operation
xtools copied to clipboard

Add ProofreadPage quality support and cover all Model

Open agoujot opened this issue 8 months ago • 1 comments

In common

(Sorry if I use WS jargon, feel free to ask.)

  • Add an API call to get the names of the PRP categories (avoids retranslation, and respects possible onwiki customisation).
  • In getMetadata, also gets the canonical names of namespaces. The best way we have at hand of checking which ID the PRP Page namespace has is that it's the one with the canonical name "Page".
  • Some styling copied from a template and adjusted for sufficient contrast (including dark mode)

EditCounter

  • Get the tags of the last 5k revisions (also done by #532).
  • Add a little pie chart at the end of general_stats. Looks like this.

PagesCreated

  • For pages in the right namespace, join on page_props with pp_propname = "proofread_page_quality_level"
  • Add a column to the table of that namespace. Looks like this.
  • In countPagesCreated count the number of pages of each status.
  • Add a pie chart next to that table. Looks like this.

TopEdits

  • For convenience, clean up the mess of getTopEditsAllNamespaces. Change from a 3-level query with custom row numbering with assignments and a random join at the end for the title (?) to a 2-level query with the built-in ROW_NUMBER (the one that caused trouble when it reserved the name recently).
  • Still for convenience, Factorise the PA conditions.
  • For pages in the right namespace, join on page_props like in PC
  • Add a column in the same way.

Don't make a chart, though, because it implies being done over all the data and we can't do that for TopEdits (I think?). At any rate, right now all we do is count 'em; whereas for PC we already make some other stats.

Tests

I'm also adding many, many tests. 100% on all of Model! (That has led me to refactorise some code and fix a few bugs here and there.)

Bug: T173012

agoujot avatar Jun 27 '25 07:06 agoujot

Codecov Report

:x: Patch coverage is 99.37107% with 1 line in your changes missing coverage. Please review. :white_check_mark: Project coverage is 85.69%. Comparing base (4b8eb28) to head (003fba8). :warning: Report is 185 commits behind head on main.

Files with missing lines Patch % Lines
src/Model/UserRights.php 94.73% 1 Missing :warning:
Additional details and impacted files
@@              Coverage Diff              @@
##               main     #551       +/-   ##
=============================================
+ Coverage     71.30%   85.69%   +14.39%     
- Complexity     1275     1330       +55     
=============================================
  Files            46       45        -1     
  Lines          3792     3937      +145     
=============================================
+ Hits           2704     3374      +670     
+ Misses         1088      563      -525     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

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

codecov[bot] avatar Jun 27 '25 07:06 codecov[bot]