Page MenuHomePhabricator

Change {{REVISIONID}} from number to "-" in wgMiserMode
Open, Needs TriagePublic

Description

See T137900 for the background behind this change and the migration guide for on-wiki editors.

Event Timeline

Krinkle created this task.Oct 20 2019, 2:12 AM
Restricted Application added subscribers: Liuxinyu970226, Aklapper. · View Herald TranscriptOct 20 2019, 2:12 AM

Change 294774 merged by jenkins-bot:
[mediawiki/core@master] Disable expensive {{REVISIONID}} magic word in miser mode
https://gerrit.wikimedia.org/r/294774

Change 527125 had a related patch set uploaded (by Krinkle; owner: Aaron Schulz):
[mediawiki/core@master] parser: further restrict "revisionid" by namespace in $wgMiserMode

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

Krinkle moved this task from Inbox to Radar on the Performance-Team board.Oct 20 2019, 2:13 AM
Krinkle edited projects, added Performance-Team (Radar); removed Performance-Team.
Krinkle moved this task from Limbo to Perf recommendation on the Performance-Team (Radar) board.

After investigating some weird #expr error with {{REVISIONID}} that I couldn't reproduce in my sandbox, I eventually found out about this change and updated mw:Help:Magic words and mw:Manual:$wgMiserMode to the best of my understanding.

It would have been nice if this change had been announced on Tech News, especially because of the namespace-dependent behaviour.

Thanks @Bdijkstra, changes like these should indeed be announced. I'm sorry we didn't reach you. The change was announced in Tech News (2019, week 15) (see also T137900#5087023)

I'm tagging User-notice here as well as reminder for Parsing Team to include an item in Tech News for the next phase as well.

Johan added a subscriber: Johan.Nov 24 2019, 3:57 AM

But that would be later?

My apologies, indeed it was mentioned in TN and that issue was posted on a page that I follow. I just didn't look far enough into the past. Still, I think it should have been documented on the mentioned manual pages and also in the release notes.

Johan added a comment.Nov 27 2019, 4:48 PM

@Krinkle I've been reading mw:Manual:$wgMiserMode but to make sure I don't misunderstand anything: compared to the original announcement, is there anything that should be added except "in wgMiserMode"?

@Johan Aye, that's a red-herring. The previous change we rolled out was already conditional on wgMiserMode. The "Miser mode" of MediaWiki is basically a "Big farm" mode. It is enabled on all WMF wikis.

In April 2019 this change was applied to pages in "content namespaces".

The upcoming change here will apply the change to the File and Category namespaces. (date still TBD, will let Parsing Team answer that.)

After that, a final change (likely, but not yet certain) will be to apply it to all namespaces (still only for WMF wikis / Miser mode - not MW default install configuration).

Johan added a comment.Nov 28 2019, 8:01 PM

Noted. A good example of why I always ask. (: I'll add it to the newsletter going out on Monday as on early heads-up.

ssastry added a subscriber: ssastry.Dec 6 2019, 7:23 PM

@Krinkle, is there anything more for us (parsing-team) to be aware of here beyond the fact that it is just rolling out to other namespaces? I am happy for you to roll this out whenever you are ready for it. But looks like the train is stalled now anyway and we are soon coming up to the holiday break. Does early Jan look like a good time for this? Or do you want to fold in to the next deploy?

I'll land it in January. Thanks.

Krinkle assigned this task to aaron.Dec 17 2019, 6:19 PM
Krinkle edited projects, added Performance-Team; removed Performance-Team (Radar).
Krinkle moved this task from Inbox to Backlog: Future Goals on the Performance-Team board.

Change 527125 merged by jenkins-bot:
[mediawiki/core@master] parser: further restrict "revisionid" by namespace in $wgMiserMode

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

Change 570985 had a related patch set uploaded (by Aaron Schulz; owner: Aaron Schulz):
[mediawiki/core@master] parser: apply $wgMiserMode restriction to REVISIONID for NS_USER/NS_PROJECT

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

Change 570986 had a related patch set uploaded (by Aaron Schulz; owner: Aaron Schulz):
[mediawiki/core@master] parser: apply $wgMiserMode restriction to self-referencial {{REVISIONID|}}

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

Change 570985 merged by jenkins-bot:
[mediawiki/core@master] parser: apply $wgMiserMode restriction to REVISIONID for NS_USER/NS_PROJECT

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

Pppery rescinded a token.Feb 24 2020, 4:24 AM
Pppery awarded a token.

Change 570986 merged by jenkins-bot:
[mediawiki/core@master] parser: apply $wgMiserMode restriction to self-referencial {{REVISIONID|}}

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

Wbm1058 added a subscriber: Wbm1058.EditedFeb 28 2020, 4:27 PM

Can I ask what purpose is served by {{REVISIONID}}? With the disabling of this feature, which was the ONLY useful application of this magic word, there is absolutely no practical use for {{REVISIONID}} that I can envision, so you all might just as well remove {{REVISIONID}} from large wikis entirely. No point in documenting something that has no practical use.

Oh, I see: "Preview detection"
The most common use case for {{REVISIONID}} is to detect preview mode. This will not be broken.

How do you do that? Where is it documented?

The most common use case for {{REVISIONID}} is to detect preview mode. This will not be broken.
How do you do that? Where is it documented?

Documented at mw:Help:Magic words#REVISIONID. Some templates use it, see for example Template:If preview (Q25954383).

Thanks, but this link https://en.wikipedia.org/wiki/Template:If_preview is more helpful. My understanding is that the test can only be done using a Lua module; all the template does is invoke the Lua module.

What is more helpful depends on your language skills, which I don't presume to know. Also I hadn't realised that most variations use a Lua module; I have no idea why they would do that, as it can be done with a single template expression, which the //nl// version does.

Ahecht added a subscriber: Ahecht.EditedFeb 28 2020, 6:56 PM

Why does {{REVISIONID}} now return blank when substed? Shouldn't it at least return '-'?

What is the accommodation for cases where the revision ID needs to be inserted into a URL such as in Template:Db-g12 or Template:RMassist/core?

Pppery added a subscriber: Pppery.Feb 29 2020, 7:02 PM

Thanks, but this link https://en.wikipedia.org/wiki/Template:If_preview is more helpful. My understanding is that the test can only be done using a Lua module; all the template does is invoke the Lua module.

{{#if:{{REVISIONID}}|Not preview|Preview}} appears to work without Lua.