https://bugzilla.wikimedia.org/show_bug.cgi?id=37570

       Web browser: ---
             Bug #: 37570
           Summary: [SF] Enable parser functions and magic words in {{{for
                    template|...}}} form parameter to allow distributed
                    template job queue management
           Product: MediaWiki extensions
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: Unprioritized
         Component: SemanticForms
        AssignedTo: yaro...@gmail.com
        ReportedBy: fastgoldf...@gmail.com
                CC: wikibugs-l@lists.wikimedia.org
    Classification: Unclassified
   Mobile Platform: ---


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.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to