Page MenuHomePhabricator

rename "cli" directory to "maintenance"
Open, Needs TriagePublic

Description

What

Why

  • so commands such as docker compose exec mediawiki php maintenance/run.php SecurePoll:migrateTallies work correctly and don't give the following error: Script 'SecurePoll:migrateTallies' not found (tried path '/var/www/html/w/extensions/SecurePoll/maintenance/migrateTallies.php' and class 'MediaWiki\Extension\SecurePoll\Maintenance\migrateTallies').

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Might I suggest leaving the cli folder with deprecated aliases.

That would be useful because I think the purging script is run on a schedule using the current name. Therefore, we need to avoid moving without deprecation of the old name.

If you need an example, I'd suggest looking at AbuseFilter where I recently renamed a script leaving a deprecated alias (the script which purges private data from abuse_filter_log.

Might I suggest leaving the cli folder with deprecated aliases.

That would be useful because I think the purging script is run on a schedule using the current name. Therefore, we need to avoid moving without deprecation of the old name.

If you need an example, I'd suggest looking at AbuseFilter where I recently renamed a script leaving a deprecated alias (the script which purges private data from abuse_filter_log.

Can't we just patch the cron job to point at maintenance/*? Looks like a one line patch: https://gerrit.wikimedia.org/g/operations/puppet/+/a1bd6b74947e6bc13cc85c52bc6e23a5a3ed5e3f/modules/profile/manifests/mediawiki/maintenance/purge_securepoll.pp#7

That doesn't work if some wikis are on the new version and some use the old version, then you need to have both names working.

Plus third party wikis which have similar scripts.

Seems a bit complicated, but OK. I imagine this is the example one you're talking about in the AbuseFilter repo:

https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/AbuseFilter/+/refs/heads/master/maintenance/PurgeOldLogIPData.php

Think it'd be OK to only make one alias for the one cron job purgePrivateVoteData.php, and just move the rest without aliases?

If we're doing this, I suggest also renaming the few files whose names don't match the class names (delete.php -> deletePoll.php, dump.php -> dumpElection.php, import -> importElectionConfiguration.php, tally -> tallyElection.php). Doing it together with directory rename avoids having to update all references twice.

Change #1166017 had a related patch set uploaded (by Novem Linguae; author: Novem Linguae):

[mediawiki/extensions/SecurePoll@master] rename "cli" folder to "maintenance"

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

Change #1166952 had a related patch set uploaded (by Novem Linguae; author: Novem Linguae):

[mediawiki/extensions/SecurePoll@master] recreate cli/purgePrivateVoteData.php

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

Change #1166017 merged by jenkins-bot:

[mediawiki/extensions/SecurePoll@master] rename "cli" folder to "maintenance"

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

Change #1166952 merged by jenkins-bot:

[mediawiki/extensions/SecurePoll@master] recreate cli/purgePrivateVoteData.php

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