Page MenuHomePhabricator

Stop using legacy APIs in FileImporter
Open, Needs TriagePublic

Description

As of now, the FileImporter codebase uses mostly legacy API requests:

  • We don't set formatversion=2, which means version 1 is used by default. The legacy format is the one with these weird * "main content" fields. And it returns only 1 error and discards the rest.
  • We don't set errorformat=plaintext, which means the default bc is used.
  • We don't set rvslots=main in the revisions query.

Proof-of-concept patch: https://gerrit.wikimedia.org/r/603567

Acceptance criteria:

  • Update API parameters as above.
  • Log API warnings so we catch future deprecations.

Event Timeline

Change 605218 had a related patch set uploaded (by Thiemo Kreuz (WMDE); owner: Thiemo Kreuz (WMDE)):
[mediawiki/extensions/FileImporter@master] Use formatversion=2 in ImportTitleChecker, remove unused elements

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

Change 605263 had a related patch set uploaded (by Thiemo Kreuz (WMDE); owner: Thiemo Kreuz (WMDE)):
[mediawiki/extensions/FileImporter@master] Modernize API call querying a CSRF token

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

Change 605263 merged by jenkins-bot:
[mediawiki/extensions/FileImporter@master] Modernize API call querying a CSRF token

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

Change 605218 merged by jenkins-bot:
[mediawiki/extensions/FileImporter@master] Use formatversion=2 in ImportTitleChecker, remove unused elements

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

Here's another action we could take: pass through any API warnings to the logger. This allows us to detect future deprecations, and would have caught the ones we're fixing now.

awight updated the task description. (Show Details)Jun 22 2020, 2:19 PM