Page MenuHomePhabricator

Roll out the Toolbox link for URL Shortener in Wikimedia sites
Closed, ResolvedPublic

Description

This is a request to roll out the Toolbox link for URL Shortener (the link implemented as T107101).
The request was originally mentioned in T222360 but not implemented since that task was closed as duplicate.
It replaces [[w:zh:MediaWiki:Gadget-shortURL.js]] and [[w:ja:MediaWiki:Gadget-shortURL.js]] which are enabled by default; frwiki has a similar gadget albeit not enabled by default.

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
Urbanecm changed the task status from Open to Stalled.Nov 16 2020, 1:42 PM
Urbanecm subscribed.

Hello @patilise, thanks for creating this task! AFAICS, the sidebar link is inserted in onSidebarBeforeOutput. There's an if that short-circuits the hook, which requires $wgUrlShortenerReadOnly || !$wgUrlShortenerEnableSidebar to be false in order to insert the link. However, in Wikimedia production, wgUrlShortenerReadOnly is true at all wikis but metawiki (that is to make sure throttling works). For that reason, merely setting $wgUrlShortenerEnableSidebar to true would not help, given the sidebar link would display only at metawiki.

As such, I'm marking this task as stalled on changing UrlShortener to allow specifying the wiki that the shortener link should point to.

@Urbanecm, thank you for looking at this item! In that case I will consider the gadget solution for other wikis at this stage.
Separately, perhaps we could still enable the link for metawiki?

We could, but people having the gadget enabled globally (via global.js) would have two links, which is not easily avoidable at this point. The best thing would be to fix the issue itself, and I created T267925 for that. I can look into that later today I guess.

Beside the technical issues (that I assume are easily solvable), the sidebar link for url shortener needs a design review and rework, currently it's pretty bad. @Esanders Might be interested in working on it since he reworked its special page.

Change 715321 had a related patch set uploaded (by Ladsgroup; author: Amir Sarabadani):

[operations/mediawiki-config@master] beta: Enable sidebar for url shortener

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

Change 715321 merged by jenkins-bot:

[operations/mediawiki-config@master] beta: Enable sidebar for url shortener

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

@Ladsgroup Can you file a performance review for this as well?

Looking at the current version live in Beta (as of the previous comment), I see that the implementation is incredibly simple with just a tiny amount of wiring code to make one AJAX request, and then inline insert an <input> field with plain JavaScript.

But.. it manages to cause 175 KB (!) of minified JavaScript code to be loaded by ULS, which is responding to the appearance of a focussed input field and trying to help with IME. There's probably a way to disable that..

capture.png (1×2 px, 341 KB)

@Urbanecm, thank you for looking at this item! In that case I will consider the gadget solution for other wikis at this stage.
Separately, perhaps we could still enable the link for metawiki?

Update from this, jawiki has a ShortURL gadget enabled by default since April.

@Ladsgroup Can you file a performance review for this as well?

Looking at the current version live in Beta (as of the previous comment), I see that the implementation is incredibly simple with just a tiny amount of wiring code to make one AJAX request, and then inline insert an <input> field with plain JavaScript.

But.. it manages to cause 175 KB (!) of minified JavaScript code to be loaded by ULS, which is responding to the appearance of a focussed input field and trying to help with IME. There's probably a way to disable that..

capture.png (1×2 px, 341 KB)

wow. Sure. I was thinking we should do a design review first and then performance review because it would definitely change after design review. WDYT?

Change 715492 had a related patch set uploaded (by Ladsgroup; author: Amir Sarabadani):

[operations/mediawiki-config@master] Set permission of creating short url to everyone everywhere

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

Change 715492 merged by jenkins-bot:

[operations/mediawiki-config@master] Set permission of creating short url to everyone everywhere

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

Mentioned in SAL (#wikimedia-operations) [2021-09-06T14:17:23Z] <ladsgroup@deploy1002> Synchronized wmf-config/CommonSettings.php: Config: [[gerrit:715492|Set permission of creating short url to everyone everywhere (T267921 T267925)]], Part I (duration: 00m 59s)

Mentioned in SAL (#wikimedia-operations) [2021-09-06T14:19:14Z] <ladsgroup@deploy1002> Synchronized wmf-config/InitialiseSettings.php: Config: [[gerrit:715492|Set permission of creating short url to everyone everywhere (T267921 T267925)]], Part II (duration: 00m 57s)

Shall we enable it in wikis that have ShortUrl enabled it now?

@Ladsgroup Can you file a performance review for this as well?

Looking at the current version live in Beta (as of the previous comment), I see that the implementation is incredibly simple with just a tiny amount of wiring code to make one AJAX request, and then inline insert an <input> field with plain JavaScript.

But.. it manages to cause 175 KB (!) of minified JavaScript code to be loaded by ULS, which is responding to the appearance of a focussed input field and trying to help with IME. There's probably a way to disable that..

capture.png (1×2 px, 341 KB)

wow. Sure. I was thinking we should do a design review first and then performance review because it would definitely change after design review. WDYT?

@Krinkle is this fixed now? I'm planning to enable this in jawiki and zhwiki next week.

(A volunteer basically rewrote the whole thing)

Change 947823 had a related patch set uploaded (by Ladsgroup; author: Amir Sarabadani):

[operations/mediawiki-config@master] Enable url shortener in sidebar in testwiki

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

Change 947823 merged by jenkins-bot:

[operations/mediawiki-config@master] Enable url shortener in sidebar in testwiki

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

Mentioned in SAL (#wikimedia-operations) [2023-08-21T15:12:31Z] <ladsgroup@deploy1002> Started scap: Backport for [[gerrit:947823|Enable url shortener in sidebar in testwiki (T267921)]]

Mentioned in SAL (#wikimedia-operations) [2023-08-21T15:14:00Z] <ladsgroup@deploy1002> ladsgroup: Backport for [[gerrit:947823|Enable url shortener in sidebar in testwiki (T267921)]] synced to the testservers mwdebug1002.eqiad.wmnet, mwdebug2002.codfw.wmnet, mwdebug1001.eqiad.wmnet, mwdebug2001.codfw.wmnet, and mw-debug kubernetes deployment (accessible via k8s-experimental XWD option)

Mentioned in SAL (#wikimedia-operations) [2023-08-21T15:22:18Z] <ladsgroup@deploy1002> Finished scap: Backport for [[gerrit:947823|Enable url shortener in sidebar in testwiki (T267921)]] (duration: 09m 46s)

Change 951366 had a related patch set uploaded (by Ladsgroup; author: Amir Sarabadani):

[operations/mediawiki-config@master] Enable URL shortener in sidebar in jawiki and zhwiki

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

Change 951366 merged by jenkins-bot:

[operations/mediawiki-config@master] Enable URL shortener in sidebar in jawiki and zhwiki

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

Mentioned in SAL (#wikimedia-operations) [2023-08-22T06:37:25Z] <ladsgroup@deploy1002> Started scap: Backport for [[gerrit:951366|Enable URL shortener in sidebar in jawiki and zhwiki (T267921)]]

Mentioned in SAL (#wikimedia-operations) [2023-08-22T06:39:08Z] <ladsgroup@deploy1002> ladsgroup: Backport for [[gerrit:951366|Enable URL shortener in sidebar in jawiki and zhwiki (T267921)]] synced to the testservers mwdebug1002.eqiad.wmnet, mwdebug2001.codfw.wmnet, mwdebug2002.codfw.wmnet, mwdebug1001.eqiad.wmnet, and mw-debug kubernetes deployment (accessible via k8s-experimental XWD option)

Mentioned in SAL (#wikimedia-operations) [2023-08-22T06:47:32Z] <ladsgroup@deploy1002> Finished scap: Backport for [[gerrit:951366|Enable URL shortener in sidebar in jawiki and zhwiki (T267921)]] (duration: 10m 06s)

@Krinkle This is now enabled by default in zhwiki and jawiki, I already see that it made an improvement on size of the assets being wired over (as the gadget one would load oojs-ui unconditionally on every page view but this one lazy loads it). If you want to take a look on the performance implications of this before I move forward to non-latin wikis, here is the ping.

Hi, for Tech News, please could someone provide draft wording, and specify when exactly it needs to go out?
From a (non-dev) glance, it looks like there may be specific nuances regarding gadgets on Zhwiki and Jawiki, but if something needs to be communicated to just 2 wikis then it would be more efficient for everyone if you could notify them directly.
Thanks.

I'm planning to enable this in more wikis next week. I was aiming at non-latin wikis as they have their urls encoded to % stuff (e.g. https://fa.wikipedia.org/wiki/%D9%88%DB%8C%DA%A9%DB%8C%E2%80%8C%D9%BE%D8%AF%DB%8C%D8%A7:%D8%AA%D8%A7%D8%A8%D9%84%D9%88%DB%8C_%D8%A7%D8%B9%D9%84%D8%A7%D9%86%D8%A7%D8%AA_%D9%85%D8%AF%DB%8C%D8%B1%D8%A7%D9%86) and can be more useful there. But I haven't found any dblist that would correspond with latin or non-latin wikis. The closest we can go is rtl wikis plus Korean, Armenian, Ukrainian, Russian, and Bulgarian Wikipedias (largest non-latin Wikipedias I found).

So an announcement would be:

All RTL language wikis plus Korean, Armenian, Ukrainian, Russian, and Bulgarian Wikipedias will have a link in the sidebar that provide short url of that page. For more information see https://meta.wikimedia.org/wiki/Wikimedia_URL_Shortener

Edit mercilessly,

@Ladsgroup Thanks! That looks like a good basis. 2 followup qs... (Perhaps a single question with 2 nuances!)

  1. Do you expect that more wikis will be automatically added in the future, or would communities need to request any further changes? I.e. We could add to Tech News a sentence like, either:
    • "This feature will come to more wikis in future weeks."
    • "If your community would like this feature, then please … [request a configuration change?] or [comment on this phabricator task with a link to your community's discussion about it?]"
  2. Would it help to get a comprehensive list of non-latin wikis done in this initial change? I notice a number of large (top-30) non-latin are missing, e.g. Vietnamese, Serbian, Chechen, Tatar. And I'd guess that all non-latin wikis would appreciate the feature. Perhaps someone from the Language team could help you get a comprehensive list?

I'll postpone adding anything to Tech News until we're sure what is happening, but I hope to freeze the issue for translations in ~8 hours. Thanks again!

@Ladsgroup Thanks! That looks like a good basis. 2 followup qs... (Perhaps a single question with 2 nuances!)

  1. Do you expect that more wikis will be automatically added in the future, or would communities need to request any further changes? I.e. We could add to Tech News a sentence like, either:
    • "This feature will come to more wikis in future weeks."

That is correct.

  • "If your community would like this feature, then please … [request a configuration change?] or [comment on this phabricator task with a link to your community's discussion about it?]"

Nah

  1. Would it help to get a comprehensive list of non-latin wikis done in this initial change? I notice a number of large (top-30) non-latin are missing, e.g. Vietnamese, Serbian, Chechen, Tatar. And I'd guess that all non-latin wikis would appreciate the feature. Perhaps someone from the Language team could help you get a comprehensive list?

Fair, The problem is that I need to manually add each wiki in the config change, for me a couple more or less doesn't matter that much but I also want to make sure I don't introduce a large-scale issue to many wikis in a day (=gradual deployment). So these wikis can come the week after. Whatever you prefer here is fine with me as long as I have the list of wikis I can deploy to.

Makes sense. Thanks! I added your original list, and the additional sentence, to https://meta.wikimedia.org/wiki/Tech/News/2023/35
Maybe @Aaharoni-WMF can help you (or find someone to help you) determine the best long-term complete list of languages that would most benefit from it? Also adding @UOzurumba FYI.

Change 953279 had a related patch set uploaded (by Ladsgroup; author: Amir Sarabadani):

[operations/mediawiki-config@master] Enable url shortener in sidebar in RTL and some non-latin wikis

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

Change 953279 merged by jenkins-bot:

[operations/mediawiki-config@master] Enable url shortener in sidebar in RTL and some non-latin wikis

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

Mentioned in SAL (#wikimedia-operations) [2023-08-29T15:04:36Z] <ladsgroup@deploy1002> Started scap: Backport for [[gerrit:953279|Enable url shortener in sidebar in RTL and some non-latin wikis (T267921)]]

Mentioned in SAL (#wikimedia-operations) [2023-08-29T15:06:04Z] <ladsgroup@deploy1002> ladsgroup: Backport for [[gerrit:953279|Enable url shortener in sidebar in RTL and some non-latin wikis (T267921)]] synced to the testservers mwdebug1002.eqiad.wmnet, mwdebug1001.eqiad.wmnet, mwdebug2001.codfw.wmnet, mwdebug2002.codfw.wmnet, and mw-debug kubernetes deployment (accessible via k8s-experimental XWD option)

Mentioned in SAL (#wikimedia-operations) [2023-08-29T15:16:22Z] <ladsgroup@deploy1002> Finished scap: Backport for [[gerrit:953279|Enable url shortener in sidebar in RTL and some non-latin wikis (T267921)]] (duration: 11m 46s)

The rtl dblist doesn't work in this context. I'll find a way tomorrow.

Thanks. Merged and deployed. All rtl wikis now have url shortener in the sidebar.

Ladsgroup changed the task status from Stalled to In Progress.Sep 11 2023, 10:44 AM

Enabling it everywhere next week. I think we need a user-notice for that. Basically copy paste from the previous one.

Added to https://meta.wikimedia.org/wiki/Tech/News/2023/38 -- If any changes are needed, please edit there before Thursday. Thanks!

Change 959713 had a related patch set uploaded (by Ladsgroup; author: Amir Sarabadani):

[operations/mediawiki-config@master] Enable Url shortener in sidebar in all wikis

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

Change 959713 merged by jenkins-bot:

[operations/mediawiki-config@master] Enable Url shortener in sidebar in all wikis

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

Mentioned in SAL (#wikimedia-operations) [2023-09-21T18:33:58Z] <ladsgroup@deploy2002> Started scap: Backport for [[gerrit:959713|Enable Url shortener in sidebar in all wikis (T267921)]]

Mentioned in SAL (#wikimedia-operations) [2023-09-21T18:45:07Z] <ladsgroup@deploy2002> ladsgroup: Backport for [[gerrit:959713|Enable Url shortener in sidebar in all wikis (T267921)]] synced to the testservers mwdebug2001.codfw.wmnet, mwdebug1002.eqiad.wmnet, mwdebug2002.codfw.wmnet, mwdebug1001.eqiad.wmnet, and mw-debug kubernetes deployment (accessible via k8s-experimental XWD option)

Mentioned in SAL (#wikimedia-operations) [2023-09-21T18:54:45Z] <ladsgroup@deploy2002> Finished scap: Backport for [[gerrit:959713|Enable Url shortener in sidebar in all wikis (T267921)]] (duration: 20m 47s)

Ladsgroup claimed this task.