Last modified: 2014-02-12 23:38:27 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T39570, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 37570 - [SF] Enable parser functions and magic words in {{{for template|...}}} form parameter to allow distributed template job queue management
[SF] Enable parser functions and magic words in {{{for template|...}}} form p...
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
SemanticForms (Other open bugs)
unspecified
All All
: Unprioritized enhancement (vote)
: ---
Assigned To: Yaron Koren
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-13 22:41 UTC by badon
Modified: 2014-02-12 23:38 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description badon 2012-06-13 22:41:10 UTC
One use case for parser functions and magic words in the {{{for template|...}}} form parameter, is distributed template job queue management with automatic template selection and distribution by a Semantic Form. When a high-usage template is edited, it dominates the MediaWiki job queue for days or weeks, sometimes more. 

The simple solution to this problem is to create several identical versions of the same template, each with a different number. Then, when edits need to be made, the template changes can be rolled out gradually to all the identical templates. While the job queue is processing each numbered template, other jobs can get into the queue before the next template is edited.

This also improves testing of template changes, because errors do not affect the entire site, and repeat changes to the same template do not further clog the job queue. About 30 numbered, identical templates can be used for MediaWiki sites up to about the 100,000 page level.

For that to work in page creation with Semantic Forms, the template to be used for each page creation needs to be selected randomly, like this:

{{{for template|Some template {{#rand: 1 | 30 }} }}}

That does not work yet, so the workaround is to use a specific template number that is only used for page creation, like this:

{{{for template|Some template 0 }}}

Then, Extension:ReplaceText can find the string "Some template 0" and replace it with "Some template {{subst:#rand: 1 | 30 }}" to change all the "0" templates to random 1 to 30 templates.

Only one form is required for the creation of pages in both the enhancement request scenario, and the workaround scenario. 

However, editing of pages in the workaround scenario requires distribution of numbered forms to match the distributed numbered templates. To eliminate the need for matching distributed forms, the enhancement request form could be allowed to randomly select a template each time the page is edited. I think that would be acceptable given the overall benefits of template distribution, but I'm not sure if that is an efficient use of MediaWiki resources.

To improve it, I suspect it would be possible for Semantic Forms to be aware of the template distribution strategy, perhaps by explicitly defining the available templates with a new Semantic Forms parameter. Then, SF could detect which template is in use, and then reuse the same template without any "this page does not use this form" errors.

But that would be a convenience, not a requirement, for template distribution once the enhancement is implemented to allow parser functions in the "For template" parameter.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links