Skip to content

Conversation

@agoujot
Copy link
Member

@agoujot agoujot commented Jun 27, 2025

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

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

@codecov
Copy link

codecov bot commented Jun 27, 2025

Codecov Report

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

Files with missing lines Patch % Lines
src/Model/UserRights.php 94.73% 1 Missing ⚠️
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     

☔ 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 added a commit that referenced this pull request Jul 23, 2025
This would also have been solved by a merge of #532 or #551 ; as these implement a cleaner separation between the raw data and the counts we're making. Until we get around to doing that, this is a simpler and smaller fix.
@agoujot agoujot marked this pull request as draft August 6, 2025 23:48
@agoujot agoujot changed the title EditCounter: add ProofreadPage quality changes pie chart in generalstats EditCounter, PagesCreated, TopEdits: add ProofreadPage quality support Aug 19, 2025
@agoujot agoujot changed the title EditCounter, PagesCreated, TopEdits: add ProofreadPage quality support Add ProofreadPage quality support and add code coverage Aug 20, 2025
@agoujot agoujot changed the title Add ProofreadPage quality support and add code coverage Add ProofreadPage quality support and cover all Model Aug 25, 2025
@agoujot agoujot marked this pull request as ready for review August 25, 2025 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant