Page MenuHomePhabricator

Add back-end support for Special:MessageGroupStats for showing stats for message prefixes
Closed, ResolvedPublic8 Estimated Story Points

Description

If a user selects a message prefix, then the system should fetch the status of all messages with that prefix and display their status in the same format as the Special:MessageGroupStats currently shows for messages groups. This information will have to be computed on the fly.

The EntitySearch class can be used to identify all the messages that have that prefix. To determine the status, we would have to hit the database like MessageCollection class does to identify reviewed or translated messages.

Some other notes / thoughts on the implementation:

  • We should also enforce some limit to ensure we don't allow too slow queries to overload the server.
  • A short duration cache of the results may or or may not be useful to reduce load in case a lot of people are looking at the same thing at the same time (someone sharing a link to this stats page for example)
  • We may also need to refactor some code in MessageGroupStats to avoid code duplication when calculating the stats. This needs to be evaluated how much can be re-used sensibly.
  • One (possibly ugly, though) idea is to pass a fake group that includes just the keys provided, and run that query without storing results in the DB

Event Timeline

Nikerabbit moved this task from Backlog to Statistics on the MediaWiki-extensions-Translate board.
abi_ renamed this task from Add back-end support for Special:MessageGroupStats for showing stats for prefix to Add back-end support for Special:MessageGroupStats for showing stats for message prefixes.Feb 14 2022, 11:40 AM
abi_ raised the priority of this task from Medium to Needs Triage.
Nikerabbit triaged this task as Medium priority.Mar 29 2022, 1:14 PM
abi_ set the point value for this task to 8.

Change 878748 had a related patch set uploaded (by Abijeet Patro; author: Abijeet Patro):

[mediawiki/extensions/Translate@master] Add MessageGroupStatsOutputBuilder to build output for GroupStats

https://gerrit.wikimedia.org/r/878748

Change 879974 had a related patch set uploaded (by Abijeet Patro; author: Abijeet Patro):

[mediawiki/extensions/Translate@master] MessageGroupStats: Support fetching stats for message prefixes

https://gerrit.wikimedia.org/r/879974

Change 878748 merged by jenkins-bot:

[mediawiki/extensions/Translate@master] Add MessageGroupStatsTable to build output for GroupStats page

https://gerrit.wikimedia.org/r/878748

Change 879974 merged by jenkins-bot:

[mediawiki/extensions/Translate@master] MessageGroupStats: Support fetching stats for message prefixes

https://gerrit.wikimedia.org/r/879974

This feature is deployed on translatewiki.net. The core functionality works, but we noticed a few issues:

  1. After searching for a message prefix if user goes to the Translate tab, it shows a warning that: The indicated group does not exist. Select a different message group.

image.png (371×809 px, 46 KB)

  1. Search for tux-edit in the selector: the user can choose the exact message, or the prefix, but the results are always shown for the prefix.
  2. If the user changes the input in the selector by just typing, but not choosing an option, and then clicks show statistics, the change is ignored.

Change 888011 had a related patch set uploaded (by Abijeet Patro; author: Abijeet Patro):

[mediawiki/extensions/Translate@master] TranslateSpecialPage::tabify: Ignore empty URL parameters

https://gerrit.wikimedia.org/r/888011

Change 888243 had a related patch set uploaded (by Abijeet Patro; author: Abijeet Patro):

[mediawiki/extensions/Translate@master] MessagePrefixStats: Allow filtering for specific messages

https://gerrit.wikimedia.org/r/888243

Change 888244 had a related patch set uploaded (by Abijeet Patro; author: Abijeet Patro):

[mediawiki/extensions/Translate@master] MessageGroupStats: Do not allow users to select invalid entities

https://gerrit.wikimedia.org/r/888244

Change 888011 merged by jenkins-bot:

[mediawiki/extensions/Translate@master] TranslateSpecialPage::tabify: Ignore empty URL parameters

https://gerrit.wikimedia.org/r/888011

Change 888243 merged by jenkins-bot:

[mediawiki/extensions/Translate@master] MessagePrefixStats: Allow filtering for specific messages

https://gerrit.wikimedia.org/r/888243

Change 888244 merged by jenkins-bot:

[mediawiki/extensions/Translate@master] MessageGroupStats: Do not allow users to select invalid entities

https://gerrit.wikimedia.org/r/888244

This is available on Wikimedia wikis. Marking this as done.