Page MenuHomePhabricator

GitInfo never creates JSON files for caching
Open, Needs TriagePublic

Description

In https://gerrit.wikimedia.org/r/#/c/130498/, @bd808 added support for caching GitInfo in JSON files. The actual method, that dumps the cache into a file - GitInfo::precomputeValues(), is never called, though, thus making a part of GitInfo actually useless.

I unfortunately lack experience with GitInfo, so it would be cool if someone else could fix this small bug.

Event Timeline

The json files are for data pre-computed at deploy time. On the WMF production cluster they are generated by scap. The PHP method is provided as a convenience for other MediaWiki deployments.

Aha, understood. Is there any documentation for using the PHP method?

It probably wouldn't be too hard to write a maintenance script that would automate creating the cache files by walking over $wgExtensionCredits, creating a new GitInfo object for core and each extension, and calling precomputeValues() on each instance to create the json cache file.

Is the gitinfo caching function still under developing?

The code exists in MediaWiki core and is used in the production Wikimedia wikis. Your bug report at T215722 seems likely to be a real bug in the implementation. Because we pre-compute the cache files as a step in each Scap deployment of MediaWiki to the Wikimedia production wiki farm the path you are seeing an error in is largely untested at least by Foundation staff.

Change 513729 had a related patch set uploaded (by Seb35; owner: Seb35):
[mediawiki/core@master] New maintenance script rebuildVersionCache

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

The proposed maintenance script implements this feature and the purge of Special:Version requested in T215722. I wrote the maintenance script such that this feature must be activated with a flag: php maintenance/rebuildVersionCache.php --save-gitinfo.

If preferred, the two features can be split.