Template talk:WPBannerMeta

From Wikipedia, the free encyclopedia
Jump to: navigation, search
WikiProject Council
WikiProject icon This template relates to the WikiProject Council, a collaborative effort regarding WikiProjects in general. If you would like to participate, please visit the project discussion page.

WikiProject Essays[edit]

Can someone take a look at {{WikiProject Essays}}? The banner has an "impact" rating (basically a renamed importance) but it doesn't appear to be adding pages to any categories. PC78 (talk) 01:07, 23 July 2016 (UTC)

You would need to undo this edit from Feb 2015 to fix it. -- WOSlinker (talk) 08:44, 23 July 2016 (UTC)

Excluding categories and files from MAIN_CAT[edit]

I'm helping to set up User:HotArticlesBot/Subscriptions for WP:VG. I added the param that populates Category:WikiProject Video games articles but it appears to include categories and files but we'd like to exclude those (only want articles, e.g., stub through redirect). How can we best configure |MAIN_CAT= to work this way? czar 20:38, 26 August 2016 (UTC)

Are you aware of any other WikiProjects that make such a distinction? --Redrose64 (talk) 23:07, 26 August 2016 (UTC)
No, but I'd imagine they might want the distinction all the same (otherwise the "articles" part of the category would be technically incorrect, including files, cats, project pages, etc.) If it helps, WPVG didn't even use its MAIN_CAT until today and I imagine others are in the same boat czar 23:33, 26 August 2016 (UTC)
Not necessarily. Many WikiProjects subscribe to Article Alerts, and there are various ways for the Article Alerts system to decide if a page should be treated as belonging to a WikiProject. One of these is by the presence of the MAIN_CAT category on a talk page; if you look at Wikipedia:Article alerts/Subscription list you will see many entries with "Talk category:", such as the very first entry, that for WikiProject Abu Dhabi, which is set up to pick up pages in Category:WikiProject Abu Dhabi articles, and if any of its categories or files were sent to WP:CFD or WP:FFD, they will show up at Wikipedia:WikiProject Abu Dhabi/Article alerts. This one doesn't have any CfDs or FfDs at the moment, but several others with the same method do have, such as Wikipedia:WikiProject Adelaide/Article alerts. I don't imagine that these WikiProjects would want to have non-article XFDs hidden from them. --Redrose64 (talk) 08:34, 27 August 2016 (UTC)
Yes, the projects in those cases wouldn't be interested. But I'm not looking to change the default—I'm asking how this can be configured for an individual WikiProject that wants to exclude all cats, files, project pages from its MAIN_CAT listing, or otherwise how they can separate the firehose list of all project talk pages from the list of just article talk pages czar 15:19, 27 August 2016 (UTC)

Maybe this?

|MAIN_CAT            = {{#ifeq:{{NAMESPACE}}|Talk|WikiProject Video games articles}}

I'd try it in the sandbox first though. PC78 (talk) 15:43, 27 August 2016 (UTC)

@PC78, thanks! It appears to be working. Populating now. I am no longer watching this page—ping if you'd like a response czar 18:29, 27 August 2016 (UTC)
@PC78: I had certainly considered that: but before suggesting it, I wanted to be sure that there would be no adverse impact. Hence my q "Are you aware of any other WikiProjects that make such a distinction?" --Redrose64 (talk) 22:13, 27 August 2016 (UTC)
Sure, but I assume Czar is acting on behalf of the WikiProject so I think it's best to let them get on with it. And if it does cause any problems and needs to be undone, then it won't be the end of the world. :) PC78 (talk) 00:39, 28 August 2016 (UTC)

Adding PageAssessments parser function[edit]

The WMF Community Tech team just finished developing a small new extension called PageAssessments whose purpose is to store page assessment metadata in a database table and make that data available via an API. We would like to enable this functionality for English Wikipedia by adding the #assessment parser function into the {{WPBannerMeta}} template. This will not change anything about the output of the template and will be a completely invisible change to end users. All it will do is cause the 'project', 'class', and 'importance' parameters for each project assessment to be recorded in a database table for each page that includes this template (or subtemplates). This will improve the efficiency of pretty much any query or report that is WikiProject-related and make it easier to build WikiProject-related tools (like WikiProject X). The change would basically be adding something like {{#assessment:{{{PROJECT|}}}|{{{class|}}}|{{{importance|}}}}} to the template code. Are you guys OK with this change to the template? Do you have any questions or concerns about it? Ryan Kaldari (WMF) (talk) 00:15, 8 September 2016 (UTC)

@MSGJ, WOSlinker, Happy-melon, Harej, and Isarra: Pinging some folks who might be interested. Ryan Kaldari (WMF) (talk) 00:23, 8 September 2016 (UTC)
I strongly support this. Currently the reports bot maintains its index of WikiProjects and articles through a database table it generates anew every 24 hours. This process takes over an hour and is very inefficient because it has to do a complicated database query that accounts for all the different category names WikiProjects use. This new database table makes this process much more efficient. If you're a bot or gadget developer you will find this useful. And there are no changes to the interface in the process. Harej (talk) 02:49, 8 September 2016 (UTC)
I can't see any reason not to do this. Would you mind sandboxing the code so we can see exactly where this will be inserted? — Martin (MSGJ · talk) 08:06, 8 September 2016 (UTC)
Don't forget there's also some banner templates that don't use WPBannerMeta. A list is at Template:WPBannerMeta/Conversion. -- WOSlinker (talk) 12:43, 8 September 2016 (UTC)
Thanks for the tips. I will definitely sandbox the code first and let people take a look at it. I'm not sure exactly when we will be ready to move forward with this, but probably sometime in the next few weeks. It's already deployed on some other wikis, but there is concern about it flooding the database connections on enwiki since this template is included on so many pages. I'll let you know when we're ready to push ahead. Ryan Kaldari (WMF) (talk) 17:40, 8 September 2016 (UTC)

@WOSlinker, MSGJ, and Harej: I've added the new code to the sandbox template. Please let me know if that looks correct or if anything needs to be changed, as I'm hoping to only do this once (since it's a huge load on the servers). Kaldari (talk) 08:42, 31 October 2016 (UTC)

No not really. You seem to be imposing FQS on every project when not every project uses the full scale. A lot now have their own bespoke quality scales. It would make more sense to put your code into /core where the class and importance have already been normalised. I can have a tinker if you wish. Regards — Martin (MSGJ · talk) 08:48, 31 October 2016 (UTC)
@MSGJ: Sure, any help would be great. Ideally we want the data in PageAssessments to match what is output by the template. Kaldari (talk) 16:22, 31 October 2016 (UTC)
I assume you mean tinkering with /core/sandbox rather than /core itself. Just want to make sure we aren't making any unnecessary edits to the main templates. Kaldari (talk) 17:04, 31 October 2016 (UTC)
I assume that if a project does not use assessments then the whole tag will be omitted? What if a project uses class but not importance? Can the tag be used with just the class? What if assessments are used but class and/or importance are unassessed? Should this be passed as a blank parameter to the tag or should "Unassessed" be used? — Martin (MSGJ · talk) 21:41, 1 November 2016 (UTC)
@MSGJ: If a project doesn't use assessments, but still tags articles, we would still want to capture that information, i.e. that the WikiProject has "claimed" an article, so {{#assessment:WikiProject NoAssessments||}}. If no class or importance are given, those should just be passed as blank parameters, e.g. {{#assessment:WikiProject NoAssessments|FA|}} or {{#assessment:WikiProject NoAssessments||Low}}. Kaldari (talk) 22:46, 3 November 2016 (UTC)
Is there any distinction between an "unassessed rating" by a project that uses assessments and a "claim" by a project that doesn't use assessments? (You didn't answer the question above on whether "unassessed" or "unknown" was allowed as a class/importance rating.) — Martin (MSGJ · talk) 08:57, 4 November 2016 (UTC)
There is a distinction: some projects consciously do not have ratings, see for example Template talk:WikiProject Women#Importance. --Redrose64 (talk) 12:24, 4 November 2016 (UTC)
Indeed. My question was whether there is any distinction in the PageAssessments database. — Martin (MSGJ · talk) 12:51, 4 November 2016 (UTC)
@MSGJ: "unassessed" or "unknown" (or any value) is allowed as a class/importance rating in PageAssessments. I don't, however, see any value in an assessment of "unassessed". I would prefer that any unknown or unassessed ratings just be passed as empty parameters to PageAssessments (unless that makes things substantially more difficult). It will make things much easier to query if anything besides an actual assessment rating is recorded as null. As far as PageAssessments is concerned, there is no distinction between an empty assessment from a project that doesn't do assessments and an empty assessment from a project that does. Basically all assessment data is treated as optional for all projects. Kaldari (talk) 01:24, 6 November 2016 (UTC)
The present setup is that if a project banner is set up to recognise class and importance parameters, but in a given usage those are not set (whether the param is absent or present but blank is immaterial), then it's passed through from {{WPBannerMeta}} to {{WPBannerMeta/core}} and subtemplates as a null value - an empty string, if you like; so the page gets categorised in e.g. Category:Unassessed Computing articles or Category:Unknown-importance Computing articles. However, if a project banner is set up to not recognise class and/or importance params, then there is nothing to pass through, and the special character "¬" is used as a placeholder by {{WPBannerMeta}}. This is not interpreted as either "unknown" or "unassessed", but instead it denotes "meaningless" - as in "this concept has no meaning", like zero divided by itself is meaningless. So there is no class/importance processing, and no categorisation since there is no meaningful category in which to place the page. --Redrose64 (talk) 14:44, 6 November 2016 (UTC)
That makes sense. In the case of the assessment class being "¬" (or absent), it would be best to pass a blank parameter to PageAssessments. Perhaps in the future we could have it handle those cases differently, but right now there is no practical way to handle such a distinction in the PageAssessments data. Kaldari (talk) 20:41, 8 November 2016 (UTC)

PageAssessments: code ready[edit]

Okay I have put the code in Template:WPBannerMeta/core/sandbox and there are some tests on Template talk:WPBannerMeta/testcases. (Obviously the lower box is just for testing and will not appear on the deployed version!) A couple more questions:

  • I assume you are interested in all the extended class ratings used by various projects such as Template-class, Redirect-class and NA-class?
  • If a project has subprojects or task forces, do you want to record each task force's interest in the article as well? For example should we be calling {{#assessment:Crime task force|B|High}}?

— Martin (MSGJ · talk) 09:39, 7 November 2016 (UTC)

@MSGJ: Thanks! Yes, definitely interested in the extended class ratings. Adding assessment data for subprojects and task forces would be great, but I'm also OK with leaving these out if its too complicated. The format you suggest, {{#assessment:Crime task force|B|High}}, would be correct. Kaldari (talk) 20:34, 8 November 2016 (UTC)
Code for setting task force assessments is in Template:WPBannerMeta/taskforce/sandbox. However it can only work if the TF_n_NAME parameter is defined. (You will see that in the first example the military task force does not currently use this parameter so the assessments will not be set.) It would be possible to go through the templates filling in these missing parameters if necessary. I could even add a tracking category for it. — Martin (MSGJ · talk) 09:35, 9 November 2016 (UTC)
@MSGJ: That looks great! A tracking category for the missing parameter would also be helpful. Do you think it would be possible to put this into place in the main template late Friday night or Saturday (so that it can populate the database over the weekend). It would be good to avoid adding this during peak hours (16:00 to 04:00 UTC) since it's going to create a huge number of database queries (although they will all be low-priority in the job queue). Also, will it require editing more than 1 subtemplate? Kaldari (talk) 22:05, 10 November 2016 (UTC)
Probably won't be available Saturday but can make the change on Sunday. Yes the two affected subtemplates are /core and /taskforce. — Martin (MSGJ · talk) 22:35, 10 November 2016 (UTC)
@MSGJ: We may want to stagger the two changes to give the databases and job queue some time to breathe. Like maybe doing the /core change Sunday and the /taskforce change next weekend. At this point I'm assuming that you would prefer to make the changes yourself, but if not, let me know. Kaldari (talk) 02:07, 12 November 2016 (UTC)

I've deployed to /core and tested on a few articles by making a null edit to the talk page and then checking the API output. Seems to be working well at the moment. — Martin (MSGJ · talk) 07:45, 13 November 2016 (UTC)

The code in Template:WPBannerMeta/taskforce/sandbox is ready to deploy when needed, and there is now Category:WikiProject banners with missing task force name to track the templates which are missing the TF_n_NAME parameter. — Martin (MSGJ · talk) 09:59, 18 November 2016 (UTC)
@MSGJ: Actually, let's hold off on adding the taskforce code for now. I think I want to add a way for PageAssessments to differentiate between WikiProjects and taskforces/subprojects before we add the taskforce assessments. I'll let you know when it's ready to move forward. Thanks again for all your help with this! It's been extreme valuable. Kaldari (talk) 23:04, 19 November 2016 (UTC)
No problem — Martin (MSGJ · talk) 11:46, 20 November 2016 (UTC)
For what it's worth, the auto-updating WikiProject Directory does not distinguish between WikiProjects and task forces. Harej (talk) 21:14, 8 December 2016 (UTC)
@MSGJ: Since some project templates use PROJECT_NAME instead of PROJECT, PageAssessments is recording the project name as {{{PROJECT}}} for those. Since none of these non-WikiProject projects actually use assessments, can we just change the code to {{{PROJECT|}}} in the core {{#assessment}} code? (PageAssessments will ignore any records with blank project names.) IMO, it seems like non-WikiProject projects should use their own templates rather than piggybacking on the WikiProject meta template, but I suppose that's a separate issue. Kaldari (talk) 16:41, 6 December 2016 (UTC)
PROJECT is a required parameter so those templates should really be fixed up. Could you give me some examples so I can see if there is a sensible way of defining that parameter for those templates? — Martin (MSGJ · talk) 17:15, 6 December 2016 (UTC)
@MSGJ: It looks like the main offender is {{WikiTown banner core}}, which is a meta template for other templates such as {{Freopedia}} and {{Toodyaypedia}}. Kaldari (talk) 23:27, 6 December 2016 (UTC)
Okay I'll take a look. In the meantime there is certainly no harm in putting the pipe in — Martin (MSGJ · talk) 09:11, 7 December 2016 (UTC)
I have added the PROJECT parameter for the WikiTown projects, so these should now be recorded as Freopedia and Toodyaypedia in your database. I have also added a pipe to prevent the error happening in future, and I have added a check for this which will populate a tracking category. Any progress with the task forces? — Martin (MSGJ · talk) 09:38, 7 December 2016 (UTC)