Page MenuHomePhabricator

Deprecate WebRequest::getRequestId()
Open, LowPublic

Description

In T320559 we introduced a new MediaWiki/Http/Telemetry class which took the responsibility of handling Telemetry data - including the X-Request-Id handling.
WebRequest::getRequestId and WebRequest::overrideRequestId() became deprecated in 1.41 and should be removed in future releases.

Definition of done:

  • WebRequest::getRequestId() is not used
  • WebRequest::overrideRequestId() is not used
  • Methods are removed from the WebRequest class
  • update docs/Injection.md document on how to inject the X-Request-Id header.

Event Timeline

The majority uses of reqId in MediaWiki are not strictly Telmetry related (i.e. no headers or other HTTP subcalls). I wouldn't mind keeping WebRequest::getRequestId()` in its current form as widely used stable API and having it internally use Telemetry indeed as today.

Either way, I suggest we at least wait with that until the Telemetry singleton has stabilized a bit. For example, if we can make it a simple class that requires no configuration or MW integration, then we can move callers to that instead of having to a second round of deprecations and replacements. In particular, the human side of feeling a shift in the ecosystem I'd like to reduce given how much of a bad rap MW already has as constantly breaking-change everything (which is interesting, since the same code also as a bad rap for not changing much, which is polar opposite).

It seems that WebRequest::getRequestId() has been deprecated in the latest version of the MediaWiki core repository, based on what I observed in the code.

Change 998485 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/core@master] WebRequest: Remove 'deprecated' mark from unstable Telemetry pointer

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

Change 998485 merged by jenkins-bot:

[mediawiki/core@master] WebRequest: Remove 'deprecated' mark from unstable Telemetry pointer

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

Jdforrester-WMF subscribed.

Given that the first attempt was reverted, I'm un-tagging "good first task"; it's not kind to subject newbies to political squabbles.