Page MenuHomePhabricator

Issues with gadgets adding tools to VisualEditor "Page options" dropdown (ve.init.Target.actionGroups[1] is undefined)
Closed, ResolvedPublic

Description

VE has been switched to direct mode on all wikis as of 13:20 UTC. So far, all metrics look good.

I am curious if the phab metrics are affected by the Country protection list - there is ruwiki (one of top-10 of projects) - thus silently disregarded.

Because ever since the event - a mass problem reported at the local techforum, see (in Russian) Википедия:Форум/Технический#Визред - with VE stopped to load completely.

It look like besides other changes ve.init.Target.actionGroups stopped to work.

Or your metrics are fine and it is just a fraction of ruwiki VE users (represented at the techforum) who are affected.

Event Timeline

Change 930544 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/VisualEditor@master] Revert "Targets: Use align:'after' instead of actionGroups"

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

Change 930545 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/VisualEditor@wmf/1.41.0-wmf.13] Revert "Targets: Use align:'after' instead of actionGroups"

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

For the record: https://ru.wikipedia.org/wiki/MediaWiki:Gadget-registerTool.js used some VE interfaces, something in VE code was changed, and now it stopped working. @DonRumata has attempted to make it work again, but I have not looked into whether their edits are all good. registerTool gadget implements a common interface for adding toolbar buttons to WikiEditor, VE and NWE2017.

Hmm, I'm not sure if I should continue with the revert then? I don't want to break things again if you've already fixed it…

According to T320529#8936670 the usse may be fiend in the offending gadget now, so the revert may not be needed.

These are the changes: https://ru.wikipedia.org/?diff=131067341&oldid=119322533
I have no idea whether they are correct or not, @Jack_who_built_the_house might comment on it if they have the time. But they seem to have stopped the VE errors from happening. No idea if tools still work under NWE or not (the main use case for this) since I do not use it.

Looks like there are other gadgets etc. on other wikis that would be affected: https://global-search.toolforge.org/?q=%5C.actionGroups%5C%5B&regex=1&namespaces=&title=

So I think we should revert the VE change for now, and if that breaks the ru.wp gadget here, then I'll make whatever changes are needed on-wiki.

What happened here: previously the VE toolbar definition was split in two properties, .toolbarGroups for the left half of the toolbar, and .actionGroups for the right half. We've wanted to merge them, so that .toolbarGroups would include all toolbar groups, However, it turns out there are gadgets that assume that .actionGroups[1] always exists, and that it is the "Page options" dropdown.

Instead, the gadgets should look through the toolbar groups to find the "Page options" dropdown by name, like in this patch, where we made a similar change for the "Syntax highlighting" tool: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/CodeMirror/+/889286/1/resources/modules/ve-cm/ve.ui.CodeMirror.init.js

So, I'm reverting the change for now. We'll reach out to people to make these changes to gadgets, and then we'll revert the revert once it's safe to do. Sorry we missed that.

Change 930544 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Revert "Targets: Use align:'after' instead of actionGroups"

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

These are the changes: https://ru.wikipedia.org/?diff=131067341&oldid=119322533
I have no idea whether they are correct or not, @Jack_who_built_the_house might comment on it if they have the time. But they seem to have stopped the VE errors from happening. No idea if tools still work under NWE or not (the main use case for this) since I do not use it.

Thanks for the link. That looks like it will fix the exceptions, and won't break after the revert, but it will add the tools in a different place than previously (instead of the "Page options" toolbar dropdown, they will appear directly on the toolbar next to "Undo"/"Redo" tools).

matmarex renamed this task from ru.wp VE issues (ve.init.Target.actionGroups) to Issues with gadgets adding tools to VisualEditor "Page options" dropdown (ve.init.Target.actionGroups[1] is undefined).Jun 15 2023, 8:48 PM

Change 930545 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@wmf/1.41.0-wmf.13] Revert "Targets: Use align:'after' instead of actionGroups"

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

Mentioned in SAL (#wikimedia-operations) [2023-06-15T20:57:21Z] <thcipriani@deploy1002> Started scap: Backport for [[gerrit:930545|Revert "Targets: Use align:'after' instead of actionGroups" (T339292)]], [[gerrit:930541|HelpCompletionTool wasn't added to extension.json (T338254)]]

Mentioned in SAL (#wikimedia-operations) [2023-06-15T20:58:45Z] <thcipriani@deploy1002> thcipriani and matmarex: Backport for [[gerrit:930545|Revert "Targets: Use align:'after' instead of actionGroups" (T339292)]], [[gerrit:930541|HelpCompletionTool wasn't added to extension.json (T338254)]] synced to the testservers: mwdebug1002.eqiad.wmnet, mwdebug2001.codfw.wmnet, mwdebug1001.eqiad.wmnet, mwdebug2002.codfw.wmnet

These are the changes: https://ru.wikipedia.org/?diff=131067341&oldid=119322533
I have no idea whether they are correct or not, @Jack_who_built_the_house might comment on it if they have the time. But they seem to have stopped the VE errors from happening. No idea if tools still work under NWE or not (the main use case for this) since I do not use it.

Thanks for the link. That looks like it will fix the exceptions, and won't break after the revert, but it will add the tools in a different place than previously (instead of the "Page options" toolbar dropdown, they will appear directly on the toolbar next to "Undo"/"Redo" tools).

I found some gadgets using that library, and they don't seem to be working for me after these changes (both when the VE patch is reverted and when it is applied), while the old version works with the VE patch reverted, so I would suggest reverting these edits as well for now.

I can revert it whenever the old version arrives to the servers, so we don’t break VE again.

Mentioned in SAL (#wikimedia-operations) [2023-06-15T21:13:30Z] <thcipriani@deploy1002> Finished scap: Backport for [[gerrit:930545|Revert "Targets: Use align:'after' instead of actionGroups" (T339292)]], [[gerrit:930541|HelpCompletionTool wasn't added to extension.json (T338254)]] (duration: 16m 09s)

I can revert it whenever the old version arrives to the servers, so we don’t break VE again.

It's live now.

I reverted the change. I’ll have to look how to implement it properly with the new code.

Aftter https://gerrit.wikimedia.org/r/c/mediawiki/extensions/VisualEditor/+/930726, all tools in the "utility" group will automatically appear in the page option menu.

Change 930689 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[mediawiki/extensions/GrowthExperiments@master] Revert "Structured tasks: Fix toolbar rewriting"

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

Change 930692 had a related patch set uploaded (by Hashar; author: Kosta Harlan):

[mediawiki/extensions/GrowthExperiments@wmf/1.41.0-wmf.13] Revert "Structured tasks: Fix toolbar rewriting"

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

Change 930689 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Revert "Structured tasks: Fix toolbar rewriting"

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

Change 930692 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@wmf/1.41.0-wmf.13] Revert "Structured tasks: Fix toolbar rewriting"

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

Mentioned in SAL (#wikimedia-operations) [2023-06-16T07:58:41Z] <hashar@deploy1002> Started scap: Backport for [[gerrit:930692|Revert "Structured tasks: Fix toolbar rewriting" (T339292 T338934)]]

Mentioned in SAL (#wikimedia-operations) [2023-06-16T08:00:05Z] <hashar@deploy1002> hashar: Backport for [[gerrit:930692|Revert "Structured tasks: Fix toolbar rewriting" (T339292 T338934)]] synced to the testservers: mwdebug2002.codfw.wmnet, mwdebug2001.codfw.wmnet, mwdebug1001.eqiad.wmnet, mwdebug1002.eqiad.wmnet

Mentioned in SAL (#wikimedia-operations) [2023-06-16T08:19:49Z] <hashar@deploy1002> Finished scap: Backport for [[gerrit:930692|Revert "Structured tasks: Fix toolbar rewriting" (T339292 T338934)]] (duration: 21m 08s)

I've fixed almost all the gadgets using actionTools[...
https://global-search.toolforge.org/?q=actionGroups%5C%5B&regex=1&namespaces=2%2C4%2C8&title=%28Gadgets-definition%7C.*%5C.%28js%7Ccss%7Cjson%29%29

Only left is a gadget with compressed output, and a more complex use case by @Schnark.

For now I have just replaced the use numerical access with an iterator looking for the group. In the near future most of these could be replaced by just using the tool group.