Page MenuHomePhabricator

ParserCache::getKey should not be public
Closed, ResolvedPublic

Description

ParserCache::getKey returns the key which the ParserCache uses internally to store the output. This should not be public, it exposes to much information about the internals of the ParserCache.

  • in FlaggedRevs extension to identify the PoolCounter work. I don't know enough about how stable does the PoolCounter work ID need to be to say if it's ok to just change.
  • in MobileFrontent it's used to construct the cache keys for unrelated caches that also vary on the ParserOptions used on the page. MobileFrontend should use it's own key hashing and not depend on PArserCache key hashing.
  • In PoolCounterArticleView work only for logging. Can probably stay if we just mark it as @internal and have a clear note that it shouldn't be used as a caching key.

Instead, ParserCache could expose a different method, like 'getCacheVaryingOptions' returning an array or an instance of CacheTime (perhaps, renamed to ParserCacheMetadata).

Event Timeline

Change 629482 had a related patch set uploaded (by Ppchelko; owner: Ppchelko):
[mediawiki/core@master] Deprecate ParserCache::getKey and replace it with getMetadata

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

Change 631777 had a related patch set uploaded (by Ppchelko; owner: Ppchelko):
[mediawiki/extensions/FlaggedRevs@master] Replace usages of deprecated ParserCache::getKey

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

Change 631779 had a related patch set uploaded (by Ppchelko; owner: Ppchelko):
[mediawiki/extensions/MobileFrontend@master] Remove usage of deprecated ParserCache::getKey.

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

Change 631786 had a related patch set uploaded (by Ppchelko; owner: Ppchelko):
[mediawiki/core@master] Hard-deprecate ParserCache::getKey.

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

Change 629482 merged by jenkins-bot:
[mediawiki/core@master] Deprecate ParserCache::getKey and replace it with getMetadata

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

Change 631779 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] Remove usage of deprecated ParserCache::getKey.

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

Change 631777 merged by jenkins-bot:
[mediawiki/extensions/FlaggedRevs@master] Replace usages of deprecated ParserCache::getKey

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

Change 631786 merged by jenkins-bot:
[mediawiki/core@master] Hard-deprecate ParserCache::getKey.

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