Page MenuHomePhabricator

Update quibble jobs to run maintenance scripts via maintenance/run.php
Closed, ResolvedPublic

Description

Since the merge of https://gerrit.wikimedia.org/r/c/mediawiki/core/+/874922 all runs for master in CI showing a big note:

16:34:07 *******************************************************************************
16:34:07 NOTE: Do not run maintenance scripts directly, use maintenance/run.php instead!
16:34:07       Running scripts directly has been deprecated in MediaWiki 1.40.
16:34:07       It may not work for some (or any) scripts in the future.
16:34:07 *****************************************************************************

Needs some update to quibble or the CI infrastructure in the future

(That was done as part of T99268)

Event Timeline

The biggest complexity is that run.php is not in older versions of mw. Maybe we should backport the chain?

The biggest complexity is that run.php is not in older versions of mw. Maybe we should backport the chain?

Might be simple enough to just do an existence check for the file, and use the existing logic for branches where it doesn't yet exist?

The biggest complexity is that run.php is not in older versions of mw. Maybe we should backport the chain?

One can introduce a method which forge the maintenance script command line by checking whether maintenance/run.php exists. The maintenance script should all be called from quibble/mediawiki/maintenance.py.

Something such as:

def getMaintenanceScript(script):
  if os.path.exists('maintenance/run.php'):
    return ['php', 'maintenance/run.php', os.path.splitext(script)[0]]
  else:
    return ['php', 'maintenance/%s' % script]

Then one can:

cmd = getMaintenanceScript('rebuildLocalisationCache.php')
cmd.extend(['--lang', 'fr'])

Which would yield either:

maintenance/rebuildLocalisationCache.php --lang fr

Or

  1. run.php with script stripped from the .php extension maintenance/run.php rebuildLocalisationCache --lang fr

Quibble currently invokes the following maintenance script:

update.php
install.php
rebuildLocalisationCache.php
addSite.php

Change 875981 had a related patch set uploaded (by Jforrester; author: Jforrester):

[integration/quibble@master] maintenance: Use run.php if it exists (MW 1.40+)

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

Additionally, maintenance/run.php could be made to hide the banner when MW_QUIBBLE_CI is defined (it is set by Quibble in LocalSettings.php and supersedes the old $wgWikimediaJenkinsCI global variable). Then I guess it would not apply to install.php ;)

The biggest complexity is that run.php is not in older versions of mw. Maybe we should backport the chain?

One can introduce a method which forge the maintenance script command line by checking whether maintenance/run.php exists. The maintenance script should all be called from quibble/mediawiki/maintenance.py.

Something such as:

def getMaintenanceScript(script):
  if os.path.exists('maintenance/run.php'):
    return ['php', 'maintenance/run.php', os.path.splitext(script)[0]]
  else:
    return ['php', 'maintenance/%s' % script]

Then one can:

cmd = getMaintenanceScript('rebuildLocalisationCache.php')
cmd.extend(['--lang', 'fr'])

Which would yield either:

maintenance/rebuildLocalisationCache.php --lang fr

Or

  1. run.php with script stripped from the .php extension maintenance/run.php rebuildLocalisationCache --lang fr

Quibble currently invokes the following maintenance script:

update.php
install.php
rebuildLocalisationCache.php
addSite.php

Your model is nicer. :-) Feel free to hijack/ignore my quick hack version.

Change 875981 merged by jenkins-bot:

[integration/quibble@master] maintenance: Use run.php if it exists (MW 1.40+)

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

Change 890809 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[integration/quibble@master] release: Quibble 1.5.0

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

Change 890809 merged by jenkins-bot:

[integration/quibble@master] release: Quibble 1.5.0

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

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

[integration/config@master] dockerfiles: update to Quibble 1.5.0

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

Change 890817 merged by jenkins-bot:

[integration/config@master] dockerfiles: update to Quibble 1.5.0

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

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

[integration/config@master] jjb: switch jobs to Quibble 1.5.0

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

Change 891548 merged by jenkins-bot:

[integration/config@master] jjb: switch jobs to Quibble 1.5.0

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

Quibble 1.5.0 uses maintenance/run.php when it exists (else fallback to directly invoke the requested PHP script). It has been deployed for all CI jobs.