Page MenuHomePhabricator

Upstream MwHttpRequestToResponseInterfaceAdapter into core
Closed, ResolvedPublic

Description

During the work for Wikibase - Federated Properties, a MwHttpRequestToResponseInterfaceAdapter was introduced with the following reasoning

MWHttpRequest contains response information after calling execute on it. Using ResponseInterface for passing response data around gives us better compatibility with 3rd party libraries such as Guzzle and also improves the request/response ambiguity of MWHttpRequest.

Upstreaming this to MediaWiki would

  • eliminate the only direct binding to guzzle in wikibase production code (cf. T263381)
  • allow for this handy capability to be used by others

Alternative (to the simple moving the adapter) approach leading to the same end result (binding to PSR standard not a particular third party library) are considered equally valid in the scope of this task (e.g. making MwHttpRequest implement PSR 7 interfaces)

Tech notes

  • This could be introduced into core with a @unstable tag or similar for one release.
    • This would immediately allow us to move the code there without blocking on getting it "perfect"

Event Timeline

Change 632251 had a related patch set uploaded (by Michael Große; owner: Michael Große):
[mediawiki/core@master] Upstream MwHttpRequestToResponseInterfaceAdapter from Wikibase

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

Change 632252 had a related patch set uploaded (by Michael Große; owner: Michael Große):
[mediawiki/extensions/Wikibase@master] Use upstreamed MwHttpRequestToResponseInterfaceAdapter from MediaWiki core

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

I looked into it and decided for the "moving the adapater"-approach to upstreaming this functionality. The reasoning is in the core patch: https://gerrit.wikimedia.org/r/c/632251

Change 632251 merged by jenkins-bot:
[mediawiki/core@master] Upstream MwHttpRequestToResponseInterfaceAdapter from Wikibase

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

Change 632252 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Use upstreamed MwHttpRequestToResponseInterfaceAdapter from MediaWiki core

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