Page MenuHomePhabricator

Replace nodemw with mwbot
Closed, ResolvedPublic

Description

Status: merged in core (417848), broken in AdvancedSearch (T190307).


In T174103#3762373 (and later) I have learned that Discovery team is using mwbot for interactions with the API. Core and a few extensions are using nodemw. I think it would be good to standardize on one package.

TODO

$ ack -i nodemw
extensions/AdvancedSearch/tests/selenium/specs/defaultNamespaces.js
11:		Bot = require( 'nodemw' ), // https://github.com/macbre/nodemw

extensions/AdvancedSearch/tests/selenium/specs/paginationLinks.js
12:			Bot = require( 'nodemw' ), // https://github.com/macbre/nodemw

Related Objects

Event Timeline

zeljkofilipin raised the priority of this task from Medium to High.Dec 12 2017, 3:33 PM

@EBernhardson @Jdrewniak um, mwbot does not have a license?! 😱 Isn't that a problem in case we want to fork it? 🍴 I am mentioning forking because upstream does not look responsive. Issues and pull requests are open for months. 🌙

package.json says "license": "MIT" 😅 but there is no license file 🤔 .

Change 417848 had a related patch set uploaded (by Zfilipin; owner: Zfilipin):
[mediawiki/core@master] WIP Replace nodemw with mwbot

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

zeljkofilipin renamed this task from Investigate replacing nodemw with mwbot to Replace nodemw with mwbot.Mar 9 2018, 1:32 PM

@EBernhardson, @Jdrewniak, @dcausse: I think 417848 is ready. I already like mwbot after spending just a little time with it. 😉 In general, the same things are possible with less code.

I have left promises as they were with nodemw. I am pretty sure further simplification could be done regarding promises, but I don't have much experience with that. If anybody could provide an example of how to simplify promises, that would be great.

@WMDE-Fisch, @Ladsgroup: I guess you are not familiar with mwbot, but, your reviews are also highly appreciated!

The only remaining instances of nodemw are in AdvancedSearch:

$ ack -i nodemw
extensions/AdvancedSearch/tests/selenium/specs/defaultNamespaces.js
11:		Bot = require( 'nodemw' ), // https://github.com/macbre/nodemw

extensions/AdvancedSearch/tests/selenium/specs/paginationLinks.js
12:			Bot = require( 'nodemw' ), // https://github.com/macbre/nodemw

I will clean that up when 417848 is merged.

Change 417848 merged by jenkins-bot:
[mediawiki/core@master] Selenium: Replace nodemw with mwbot

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

I have forgot I was in the middle of updating the documentation, Selenium/Node.js/MediaWiki_API. Code for the page is hosted at github at https://github.com/zeljkofilipin/mediawiki-selenium-nodejs/blob/master/test/api.js