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

  • in getPagesCreatedInnerSql, remove the DISTINCT as I'm having trouble seeing why it's there and it makes the query significantly slower (when you add in the PRP stuff)
  • 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. That has led me to refactorise some code, fix a few bugs here and there, make a few private methods public, etc. Feel free to ask for the reason behind specific changes. Goal would be 100% on model and some other stuff.

Bug: T173012

@codecov
Copy link

codecov bot commented Jun 27, 2025

Codecov Report

❌ Patch coverage is 99.14530% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 74.57%. Comparing base (4b8eb28) to head (cf4a78c).
⚠️ Report is 236 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%   74.57%   +3.26%     
- Complexity     1275     1411     +136     
============================================
  Files            46       45       -1     
  Lines          3792     4323     +531     
============================================
+ Hits           2704     3224     +520     
- Misses         1088     1099      +11     

☔ 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
@agoujot
Copy link
Member Author

agoujot commented Jan 10, 2026

Phew, now mergeable with main. The changes in the last few months mean we're not at 100% model anymore; I'll try and put Model & Helper (& maybe Repository &/| EventSuscriber) to 100%. It's only 46 (not counting repo & events) lines to cover.

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