Page MenuHomePhabricator

[SPIKE 1hr] How can we create the same page across all wikis?
Closed, ResolvedPublic

Description

Background

  • We would like to make a pre-filled form. For that, a page with the content of the form needs to exist on all wikis. We don't know if that's possible

User story

  • As a template editor, I want to receive reports of what templates don't work in dark mode so I can fix them

Requirements

Answer the following questions:

  • How could we do this?

Event Timeline

ovasileva triaged this task as High priority.

Random anecdote from ancient history: StructuredDiscussions created several templates on all wikis in T111098: Run FlowCreateTemplates.php on all Flow-enabled wikis in production. Then StructuredDiscussions was undeployed from most wikis, leaving behind a tide of unused templates across the entire farm that are still slowly being created to this day.

While obviously dark mode won't be abandoned in the way Flow was I would strongly suggest not doing what they did.

thanks for that context @Pppery, we're currently exploring the feasibility and risks associated with this.

The use-case for this scenario is to provide some structure for reporting dark-mode issues. This type of prefilled edit form would use the preload parameter. According to the docs:

preload specifies a page, of which the wikitext is used as the initial value of the textarea in the edit form if the page or section to be edited does not exist.

The end goal of this effort would be to give users some direction when submitting dark-mode issues like in the screenshot below, instead of a blank, freeform textfield.

Screenshot 2024-06-26 at 2.50.55 PM.png (1×2 px, 163 KB)

Unfortunately, the preload parameter doesn't accept freeform wikitext, it has to be the title of a page that exists on-wiki.

Right now my questions are:

  • Can this title be a special page? That would allow us to centrally control (and remove) it once it's no longer necessary.
  • Would it be enough if we customize the title and leave the textarea blank? The subject/headline of the edit (?preloadtitle=) can be freeform wikitext, so we could include just the title of the page in the subject, i.e. ?preloadtitle=Dark mode issue [[Page title]] without creating dedicated template pages.

So I dug through PreloadContentBuilder.php, and it looks like the preload param doesn't really work with special pages. It does however, work with the MediaWiki namespace. The pages in the mediawiki namespace are actually translation messages, which serve as a way for editors to override translation message through on-wiki edits.

This means that although we can't use special pages for preloaded content, we can use translation messages, which is perfectly fine, and we don't have to mass edit wikis or create templates page. 👏

example:

The following URL uses the page MediaWiki:Vector-night-mode-gadget-warning as preload content.

https://en.wikipedia.org/wiki/User:JDrewniak_(WMF)/sandbox?&action=submit&section=new&preloadtitle=Dark-mode%20issue&preload=MediaWiki:Vector-night-mode-gadget-warning

ovasileva renamed this task from [SPIKE] How can we create the same page across all wikis? to [SPIKE 1hr] How can we create the same page across all wikis?.Thu, Jun 27, 5:17 PM
ovasileva claimed this task.
ovasileva added a subscriber: Jdrewniak.

All done here, thanks @Jdrewniak! Implementation will continue in T368707: Set up reporting system for dark mode