Page MenuHomePhabricator

Show wikidiff2 version in Special:Version's softwareInformation
Closed, ResolvedPublic

Description

While Better-Diffs-2023 is ongoing, it might be useful to expose the version of wikidiff2 (when available) in the "Installed software" section of Special:Version.

See https://commtech.wmcloud.org/wiki/Special:Version#mw-version-software, and the below hacky snippet, for an example:

diff --git a/includes/specials/SpecialVersion.php b/includes/specials/SpecialVersion.php
index 3c929c5201..b3163210db 100644
--- a/includes/specials/SpecialVersion.php
+++ b/includes/specials/SpecialVersion.php
@@ -330,19 +330,12 @@ class SpecialVersion extends SpecialPage {
        private function getSoftwareInformation() {
                $dbr = wfGetDB( DB_REPLICA );

-               // HACK
-               // Don't even... --TheresNoTime
-               $wd2path = '/var/www/wikidiff2';
-               $wd2mod = date("Y-m-d H:i:s", filectime("/usr/lib/php/20210902/wikidiff2.so"));
-               $wd2hash = exec("git --git-dir $wd2path/.git rev-parse --short HEAD");
-               $wd2link = "https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/php/wikidiff2/+/$wd2hash";
                // Put the software in an array of form 'name' => 'version'. All messages should
                // be loaded here, so feel free to use wfMessage in the 'name'. Wikitext
                // can be used both in the name and value.
                $software = [
                        '[https://www.mediawiki.org/ MediaWiki]' => self::getVersionLinked(),
                        '[https://php.net/ PHP]' => PHP_VERSION . " (" . PHP_SAPI . ")",
-                       '[https://www.mediawiki.org/wiki/Wikidiff2 wikidiff2]' => phpversion("wikidiff2") . " ([$wd2link $wd2hash]) " . "(last built: $wd2mod)",
                        '[https://icu.unicode.org/ ICU]' => INTL_ICU_VERSION,
                        $dbr->getSoftwareLink() => $dbr->getServerInfo(),
                ];

Event Timeline

TheresNoTime renamed this task from Show wikidiff2 version in Special:Version'softwareInformation to Show wikidiff2 version in Special:Version's softwareInformation.Jun 20 2023, 11:56 AM
TheresNoTime updated the task description. (Show Details)

Change 933452 had a related patch set uploaded (by Samtar; author: Samtar):

[mediawiki/core@master] SpecialVersion: Add wikidiff2 version to SoftwareInformation

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

Change 933452 merged by jenkins-bot:

[mediawiki/core@master] SpecialVersion: Add wikidiff2 version to SoftwareInformation

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