Page MenuHomePhabricator

Special:Unusedtemplates filtering
Open, Needs TriagePublic

Description

Hi! I succeed to reduce this special list on wp:fr to 1 559 templates. Not only by removing obsolete templates but using it in the documentation. The problem is that it is normal that some listed templates are unused (sandbox, testcases, substituted templates, preload…). I created a category on wp:fr including all exceptions (903 templates). It will be really helpful if a filtering option using a category is added to all Wikipedias. Many thanks.

Event Timeline

@Framawiki Why did I get subscribed here?

I thought you might be interested, since a similar request was opened on one of your GH projects. I apologize if I made a mistake, don't hesitate to remove yourself from the list.

@Framawiki Ah, I missed that request. Thanks for that.

I think you need to explain better what exactly is required here and why. Is it possible to create a dummy page where these unused templates are used and that'd get them off the list?

@Niharika Hi ! First of all, sorry for answering so late but I’m really not familiar with Phabricator and this is the first time I'm posting a request.
Second, we already use this trick of using templates in a dummy page. The problem is that it cannot be used for most of the remaining templates I put in this category (sandbox, test cases, substituted templates, preload, KML code…). In addition, the advantage of using a category is that contrary to a dummy page or a whitelist it will be dynamic. No need of updating such a page.
Another trick I'm using each time it is possible is to use the template in its own documentation. Thousand of templates have been removed from this list this way.
As a workaround solution and if a category is not suitable, we could request a bot to periodically generate a whitelist from the category I created (and all sub-categories).
As a conclusion: Filtering options in all special lists would really improve all maintenance tasks.
If something is still not clear, do not hesitate to request me more information.
Regards

Thanks for more info, @FDo64. It will be hard to use categories to do this filtration on Special:UnusedTemplates because the query for UnusedTemplates runs on every project. Filtering by category would make it enwiki-specific. :(

However filtering out by category should be fairly easy to do in the bot code for BernsteinBot which generates that report on wiki. Maybe talk to its owner about it?

It would be possible to let the user specify in a form which category to excude. But as far as I know, MW should not implement recursive category querying for performance reasons. In this case, excluding a single category would be unuseful.

@Niharika, @Framawiki,@Louperivois: Hi ! I’m back today with a new idea, probably easiest to implement.
I’m currently working on Special:UnusedCategories and there is a magic word doing the same kind of job I’m requesting:

__EXPECTUNUSEDCATEGORY__

Could we envisage creating the following magic word?

__EXPECTUNUSEDTEMPLATE__

Then, all templates containing this magic word should be filtered in the Special:Unusedtemplates page.
Your thoughts?
Regards

Hi @FDo64, it seems to be a very good solution for this issue.

DannyS712 moved this task from To triage to Maintenance reports on the MediaWiki-Special-pages board.
DannyS712 subscribed.

@Niharika, @Framawiki,@Louperivois: Hi ! I’m back today with a new idea, probably easiest to implement.
I’m currently working on Special:UnusedCategories and there is a magic word doing the same kind of job I’m requesting:

__EXPECTUNUSEDCATEGORY__

Could we envisage creating the following magic word?

__EXPECTUNUSEDTEMPLATE__

Then, all templates containing this magic word should be filtered in the Special:Unusedtemplates page.
Your thoughts?
Regards

Claiming to implement suggested addition of a magic word

Change 557438 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] Add expectunusedtemplate to filter Special:UnusedTemplates

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

I @DannyS712
Do you know when this new magic word will be implemented?
On my side, I am ready to use it. All preparation task have been done.
Regards

I @DannyS712
Do you know when this new magic word will be implemented?
On my side, I am ready to use it. All preparation task have been done.
Regards

Just waiting for the patch to be reviewed

Any reason why this was never reviewed and merged? For what it's worth, I just reviewed it and added my +1, but a +2 is still needed.

Removing task assignee due to inactivity as this open task has been assigned for more than two years. See the email sent to the task assignee on August 22nd, 2022.
Please assign this task to yourself again if you still realistically [plan to] work on this task - it would be welcome!
If this task has been resolved in the meantime, or should not be worked on ("declined"), please update its task status via "Add Action… 🡒 Change Status".
Also see https://www.mediawiki.org/wiki/Bug_management/Assignee_cleanup for tips how to best manage your individual work in Phabricator. Thanks!

I think @DannyS712 has done his part, and what is missing is someone with +2 rights to (rebase and) merge the patch.

@matmarex Hi! May I inconvenience you or someone you recommend with a code review for this little useful enhancement?

@Sophivorus The change looks like a good idea and I'd be happy to merge it, but it needs significant changes to be mergeable into current MediaWiki. Would you like to do that? It shouldn't be a lot of work, but I don't want to do it all myself and then merge it, since that defeats the point of code review.