Page MenuHomePhabricator

Api tests: Hard deprecate ApiTestCase::doLogin, remove calls in favor of passing a user where needed
Closed, ResolvedPublic

Description

ApiTestCase::doLogin was soft deprecated in 1.31, but is still used. When called, it writes to $wgUser
Calls to this function should be removed in favor of passing a used when needed.
The function can then be hard deprecated

Deployed code:
https://codesearch.wmflabs.org/deployed/?q=%5C%24this-%3EdoLogin%5C(&i=nope&files=&repos=

  • MassMessage
  • Newsletter
  • Thanks
  • Wikibase
  • BounceHandler
  • CodeReview
  • ORES
  • TimedMediaHandler
  • TitleBlacklist

Event Timeline

DannyS712 updated the task description. (Show Details)
DannyS712 moved this task from Unsorted to Next on the User-DannyS712 board.Feb 1 2020, 1:00 AM

Change 569293 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/extensions/MassMessage@master] Remove calls to ApiTestCase::doLogin

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

DannyS712 moved this task from Next to In progress on the User-DannyS712 board.

Change 568233 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/extensions/Thanks@master] Remove use of global $wgUser

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

Change 569297 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/extensions/CodeReview@master] Remove calls to ApiTestCase::doLogin

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

Change 569297 merged by jenkins-bot:
[mediawiki/extensions/CodeReview@master] Remove calls to ApiTestCase::doLogin

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

Change 568233 merged by jenkins-bot:
[mediawiki/extensions/Thanks@master] Remove use of global $wgUser

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

Change 569293 merged by jenkins-bot:
[mediawiki/extensions/MassMessage@master] Remove calls to ApiTestCase::doLogin

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

Daimona added a subscriber: Daimona.Feb 1 2020, 1:20 PM

Change 569368 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/extensions/BounceHandler@master] Remove use of ApiTestCase::doLogin

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

Change 569392 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/extensions/TitleBlacklist@master] Remove use of ApiTestCase::doLogin

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

Change 569393 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/extensions/Newsletter@master] Remove use of ApiTestCase::doLogin

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

Change 569394 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/extensions/TimedMediaHandler@master] Remove confusing $this->doLogin() call

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

Change 569394 merged by jenkins-bot:
[mediawiki/extensions/TimedMediaHandler@master] Remove confusing $this->doLogin() call

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

Change 569393 merged by jenkins-bot:
[mediawiki/extensions/Newsletter@master] Remove use of ApiTestCase::doLogin

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

Change 569392 merged by jenkins-bot:
[mediawiki/extensions/TitleBlacklist@master] Remove use of ApiTestCase::doLogin

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

Change 569368 merged by jenkins-bot:
[mediawiki/extensions/BounceHandler@master] Remove use of ApiTestCase::doLogin

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

DannyS712 updated the task description. (Show Details)Feb 3 2020, 4:09 PM

Change 569572 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/extensions/Thanks@master] Remove use of ApiTestCase::doLogin

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

Change 570526 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/extensions/ORES@master] Remove use of ApiTestCase::doLogin

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

Change 570537 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/extensions/Wikibase@master] Remove use of ApiTestCase::doLogin

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

Usmanino set the point value for this task to 9.Feb 6 2020, 7:58 AM
Usmanino edited subscribers, added: dandavison7; removed: Daimona, Aklapper, DannyS712.
DannyS712 removed the point value for this task.Feb 6 2020, 8:04 AM
DannyS712 edited subscribers, added: Daimona, Aklapper, DannyS712; removed: dandavison7.

Change 570537 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Remove use of ApiTestCase::doLogin

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

DannyS712 updated the task description. (Show Details)Feb 6 2020, 5:27 PM
DannyS712 updated the task description. (Show Details)Feb 11 2020, 8:31 PM

All uses have been eliminated.

Change 569572 merged by jenkins-bot:
[mediawiki/extensions/Thanks@master] Remove use of ApiTestCase::doLogin

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

Change 570526 merged by jenkins-bot:
[mediawiki/extensions/ORES@master] Remove use of ApiTestCase::doLogin

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

Change 572379 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] Hard deprecate ApiTestCase::doLogin

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

DannyS712 updated the task description. (Show Details)Feb 15 2020, 2:32 AM
DannyS712 triaged this task as Medium priority.Feb 15 2020, 2:58 AM

Change 572379 merged by jenkins-bot:
[mediawiki/core@master] Hard deprecate ApiTestCase::doLogin

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

DannyS712 renamed this task from Api tests: Hard deprecate $this->doLogin, remove calls in favor of passing a user where needed to Api tests: Hard deprecate ApiTestCase::doLogin, remove calls in favor of passing a user where needed.Feb 18 2020, 8:33 PM
DannyS712 closed this task as Resolved.