Page MenuHomePhabricator

Deploy PageAssessments to French wikipedia
Closed, ResolvedPublic5 Estimated Story Points

Description

Now that CopyPatrol supports French wiki, we should deploy PageAssessments on it so we can switch to using it for fetching projects instead of scraping talk pages.

This will also be of benefit to other consumers of the PageAssessments API, such as XTools and the Programs & Events Dashboard.

Meta template: https://fr.wikipedia.org/wiki/Mod%C3%A8le:Wikiprojet -- You should be able to the parser function here, but it appears they're invoking Module:Wikiprojet, which handles the parameters. They may want to add the parser function there, if that's possible.

Example talk page: https://fr.wikipedia.org/wiki/Discussion:Liste_des_rois_de_Kent

Event Timeline

kaldari set the point value for this task to 5.Mar 8 2017, 12:57 AM

Thanks to a recent patch from @Keer25, the Programs & Events Dashboard now uses PageAssessments instead of talk page scraping to import ratings. It'd be great to be able to enable it for French too!

@kaldari Any interest in tackling this in the near-term? I'd love to help :)

Good evening, three weeks have passed, no particular comment was made regarding the message I had posted. So the deployment is ok on the community side.

By locking at T139552: Create tables for PageAssessments in enwiki database & T146679: Deploy PageAssessments to English Wikipedia it's look like new tables are needed. I can't find them on replicas :

MariaDB [enwiki_p]> show tables where Tables_in_enwiki_p LIKE 'page_assessments%';
+---------------------------+
| Tables_in_enwiki_p        |
+---------------------------+
| page_assessments          |
| page_assessments_projects |
+---------------------------+
2 rows in set (0.00 sec)

MariaDB [frwiki_p]> show tables where Tables_in_frwiki_p LIKE 'page_assessments%';
Empty set (0.00 sec)

It seems they haven't been created yet.

Yup, we'll take care of that. We're working deploying to Turkish first, then Arabic, and French will come afterwards :) So you should hear back from me in maybe a week or so.

@Framawiki French is now next in line. However, I'm not sure what the best way is to update your "meta" template. I see the template uses Module:Wikiprojet, which apparently does the "normalization". In other words, that module makes sure the parameters are valid, so you can't add avancement = foobar (because valid values are BD, B, A, etc.). This is important because we want to make sure the values are saved correctly in the database.

It seems @Od1n is the primary contributor to Module:Wikiprojet. Would you be willing to help us? I'm sure this is all very confusing... to give some background, see the on-wiki discussion at Wikipédia:Le Bistro. Basically we're trying to add a parser function to Module:Wikiprojet, that will store the "projet", "avancement" and "importance" in a database. This parser function won't render anything. It will be invisible to readers.

What I'm going to do is try this out myself at https://fr.wikipedia.org/wiki/Module:Wikiprojet/Bac_à_sable then present you with the code that I think will work. Then maybe you can code review and make the changes?

@MusikAnimal I have implemented this extension in the module.

You are right that the possible values are enforced:

  • For quality: dataAvancement.default.nom ("inconnu"), dataAvancement.adq.nom ("AdQ"), dataAvancement.ba.nom ("BA"), etc.
  • For importance: dataImportance.default.nom ("inconnue"), dataImportance.maximum.nom ("maximum"), dataImportance['élevée'].nom ("élevée"), etc.

If a template argument is missing or its value is not recognized, the value of the "default" entry is used.

Also note that on fr.wiki, a given article has only one quality rating, which is used for all projects.

@Od1n Wonderful! Thank you for setting this up. I'm not so great at Lua but I think what you have will work. Also thank you for commenting it out. Indeed, we want to deploy the extension then add the parser function.

The deployment should happen today, sometime before 23:00 UTC. After that feel free to uncomment the code :) Or, if you are OK with, I can uncomment it (which would allow me to monitor database activity, though I don't think anything will go wrong).

Also note that on fr.wiki, a given article has only one quality rating, which is used for all projects.

That is no problem, so long as for each WikiProject you pass in the quality rating to the parser function.

Change 425554 had a related patch set uploaded (by MusikAnimal; owner: MusikAnimal):
[operations/mediawiki-config@master] Enable PageAssessments on frwiki

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

Yes, please uncomment it, so you can at the very same moment check if it is running fine.

(note that, at least in current version, there are two lines to uncomment)

This comment was removed by Od1n.

Change 425554 merged by jenkins-bot:
[operations/mediawiki-config@master] Enable PageAssessments on frwiki

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

Mentioned in SAL (#wikimedia-operations) [2018-04-11T22:13:52Z] <musikanimal@tin> Synchronized wmf-config/InitialiseSettings.php: Enabling PageAssessments on frwiki (T153393) (duration: 01m 26s)

@MusikAnimal I've noticed your revert. Actually, there might be something missing in the extension implementation in MediaWiki. Compare the two following sets of Lua debug outputs:

Recognized tags:

= mw.getCurrentFrame():callParserFunction( '#tag:ref', { 'a', 'b', 'c' } )
UNIQ--ref-00000000-QINU

= mw.getCurrentFrame():callParserFunction( '#tag:nowiki', { 'a', 'b', 'c' } )
UNIQ--ref-00000003-QINU

= mw.getCurrentFrame():callParserFunction( '#tag:gallery', { 'a', 'b', 'c' } )
UNIQ--ref-00000004-QINU

Not recognized tags:

= mw.getCurrentFrame():callParserFunction( '#tag:dickbutt', { 'a', 'b', 'c' } )
<dickbutt>a</dickbutt>

= mw.getCurrentFrame():callParserFunction( '#tag:assessment', { 'a', 'b', 'c' } )
<assessment>a</assessment>

You can note assessment is apparently handled like a non-recognized tag…

@Od1n I think I figured it out... tested in Module:Wikiprojet/Bac à sable:

local assessment = frame:callParserFunction{name = '#assessment', args = {projet.nom, avancementCommun, projet.importance.nom}}

I was just about to hit save. Does the above look right to you?

I used Utilisateur:MusikAnimal (WMF)/Sandbox (mimics the WikiProject template), and Discussion:Tour du Pérou (because it has to be used in the non-userspace), and the assessment saved. So I have confidence the above will work.

@MusikAnimal I figured it out exactly at the same time ;)

Indeed, I mixed up #tag:assessment with #assessment

Up and running! :D https://fr.wikipedia.org/wiki/Spécial:PageAssessments

I will monitor database activity, so far it looks good. It will take a little while for all the articles to show up.

Thanks so much for your help... I don't know Lua very well, I just searched through Modules on enwiki until I found one that used a parser function, and went off of that :)

MusikAnimal moved this task from Ready to Done on the MediaWiki-extensions-PageAssessments board.

We're currently at around 200,000 articles saved, with another 1,100,000 to go. This will take a few hours at least.

@Od1n One friendly reminder, editing that module starts a lot of jobs, which takes a toll on the database (the spikes are our edits):

Screen Shot 2018-04-11 at 10.07.46 PM.png (605×997 px, 42 KB)

So I would be careful and try to use the "Bac à sable" to test, so that you can make all the edits to the module at once. Anyway it has calmed down, so no worries :)

Once all the articles are populated, we'll get XTools and Pageviews Analysis updated to show the assessments.

If your wiki is interested, we can also set up Popular pages bot, which shows the most-viewed pages for a given WikiProject.

I'm going to close this as resolved. Thank you again for the help, everyone!