Page MenuHomePhabricator

CI on mediawiki-config should assert that the logos.php is generated by logos/manage.py
Closed, ResolvedPublic

Description

When working on T341407, I noticed that logos.php is out of sync with logos/config.yaml, running the command tox -e logos -- update thwiki generated some unrelated changes to the wordmark and tagline file, and the logos.php.
I then have to restore unintended changes manually.

Commit 5d59bd63 updated some wordmarks and taglines without svg optimizations implemented in logos/manage.py, File:Wikipedia-wordmark-th.svg and File:Wikipedia-tagline-th.svg didn't get updated while the config file listed them as the source of wordmark and tagline.

I suggest CI on the mediawiki-config repo should assert that the logos.php is generated by logos/manage.py, so unexpected changes to production can be avoided if we are updating them massively like a6a92b4f for T338162.
They should have been also running into this issue if they are using manage.py, but maybe they didn't use or restored unintended changes manually.

Event Timeline

added one more tag as T307705 did for visibility, hope this is fine.

Pppery subscribed.

This really should be done - the files have diverged again which is causing havoc for anyone wanting to set logos for new wikis.

Reedy triaged this task as High priority.Feb 28 2025, 12:12 AM

Change #1127110 had a related patch set uploaded (by Hashar; author: Hashar):

[operations/mediawiki-config@master] logos: have CI fail on uncommited logos.php changes

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

hashar subscribed.

I have send a series of patches. The important patch https://gerrit.wikimedia.org/r/c/operations/mediawiki-config/+/1127110 which introduces tox -e diff which is the equivalent of:

tox -e logos -- generate
git --no-pager diff --exit-code wmf-config/logos.php

That will be invoked by CI to generate the logos.php and if there is any difference, --exit-code causes git diff to exit 1 hich would cause a failure if there is any difference. That means CI will fail the build whenever someone forgot to tox -e logos -- update xxx or for whatever over reason.

If one commits the difference, the script no more fail, as seen in a dummy follow up patch I have made: https://gerrit.wikimedia.org/r/c/operations/mediawiki-config/+/1127142/2

:)

IMPORTANT: we need wmf-config/logos.php to be regenerated since it fails currently.

I am regenerating it with https://gerrit.wikimedia.org/r/c/operations/mediawiki-config/+/1127142 and that needs some review.

Some tox.ini refactoring patches got fixed.

@Pppery has sent two patches to fix the existing logos files https://gerrit.wikimedia.org/r/c/operations/mediawiki-config/+/1127156 and https://gerrit.wikimedia.org/r/c/operations/mediawiki-config/+/1127160. Then we can merge https://gerrit.wikimedia.org/r/c/operations/mediawiki-config/+/1127110 and CI will then enforce the logos files to be committed.

The patches are scheduled for deployment in the Thursday, March 13 UTC late backport window at 2025-03-13 20:00 UTC.

Change #1127110 merged by jenkins-bot:

[operations/mediawiki-config@master] logos: have CI fail on uncommited logos.php changes

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

Mentioned in SAL (#wikimedia-operations) [2025-03-13T20:25:34Z] <jhuneidi@deploy2002> Started scap sync-world: Backport for [[gerrit:1127160|Rebuild logo files (T387448)]], [[gerrit:1127156|Logos: Fix order of guwwikinews in yaml file (T387448)]], [[gerrit:1127110|logos: have CI fail on uncommited logos.php changes (T341412)]]

Mentioned in SAL (#wikimedia-operations) [2025-03-13T20:28:28Z] <jhuneidi@deploy2002> hashar, pppery, jhuneidi: Backport for [[gerrit:1127160|Rebuild logo files (T387448)]], [[gerrit:1127156|Logos: Fix order of guwwikinews in yaml file (T387448)]], [[gerrit:1127110|logos: have CI fail on uncommited logos.php changes (T341412)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Note that this task only asserts that the php file structure is consistent with the /static files. It doesn't assert that the /static files are consistent with the Commons files, but them not being consistent isn't as big as a deal as it doesn't interfere with other logo changes.

CI now generates wmf-config/logs.php and would bail out if there is any difference compared to what is in the branch.

Locally that can be reproduced by running tox -e diff

Mentioned in SAL (#wikimedia-operations) [2025-03-13T20:44:53Z] <jhuneidi@deploy2002> Finished scap sync-world: Backport for [[gerrit:1127160|Rebuild logo files (T387448)]], [[gerrit:1127156|Logos: Fix order of guwwikinews in yaml file (T387448)]], [[gerrit:1127110|logos: have CI fail on uncommited logos.php changes (T341412)]] (duration: 19m 18s)