Page MenuHomePhabricator

Update mediawiki vagrant for composer 2.0
Closed, ResolvedPublic

Description

[21:02:32] <Dzienny> The "vagrant up" ended with: The SSH command responded with a non-zero exit status. Vagrant
[21:03:46] <Dzienny> Then I grep'ed the output for errors and found: ==> default: Error: /usr/local/bin/composer install --optimize-autoloader --prefer-dist returned 2 instead of one of [0]
[21:03:46] <Dzienny> /usr/local/bin/composer install --optimize-autoloader --prefer-dist returned 2 instead of one of [0]

Some composer calls will possibly need updating in vagrant


Changes to force 1.x:

https://gerrit.wikimedia.org/r/c/mediawiki/vagrant/+/636209
https://gerrit.wikimedia.org/r/c/mediawiki/vagrant/+/636212

Event Timeline

Reedy changed the task status from Open to Stalled.Oct 26 2020, 12:05 AM
Reedy created this task.
Reedy renamed this task from Update mediawiki-vendor for composer 2.0 to Update mediawiki vagrant for composer 2.0.Oct 26 2020, 12:08 AM

Change 636214 had a related patch set uploaded (by Reedy; owner: Reedy):
[mediawiki/vagrant@master] Use composer 2.x

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

I'm guessing minimal changes will actually be needed (see the patch above), but mostly blocked on T248908 causing the errors

Curiously... When/where is update_composer in composer.pp actually called? Or is it code that was added but never actually actually wired in to do anything?

diff --git a/puppet/modules/php/manifests/composer.pp b/puppet/modules/php/manifests/composer.pp
index 48c8cd7f..055d1d7f 100644
--- a/puppet/modules/php/manifests/composer.pp
+++ b/puppet/modules/php/manifests/composer.pp
@@ -36,7 +36,7 @@ class php::composer (
     }
 
     exec { 'update_composer':
-        command     => '/usr/local/bin/composer self-update --1',
+        command     => '/usr/local/bin/composer self-update --2',
         environment => [
           "COMPOSER_HOME=${home}",
           "COMPOSER_CACHE_DIR=${cache_dir}",

Running vagrant git-update/vagrant provision doesn't seem to result in composer being upgraded/updated

So, if not, where should we wire it in? I don't think it should be a seperate command... Would re-using git-update make sense because it's updating the code.... Else wire it into provision somehow?

Curiously... When/where is update_composer in composer.pp actually called?

exec { 'update_composer':
    command     => '/usr/local/bin/composer self-update --1',
    environment => [
      "COMPOSER_HOME=${home}",
      "COMPOSER_CACHE_DIR=${cache_dir}",
      'COMPOSER_NO_INTERACTION=1',
    ],
    require     => [
        File['/usr/local/bin/composer'],
        Class['php::package'],
    ],
    schedule    => 'weekly',
}

Just noticed schedule => 'weekly', - so it's in a cron/similar type update

Just noticed schedule => 'weekly', - so it's in a cron/similar type update

Yeah, sort of. That config means that once per week when puppet runs the exec will fire. In MediaWiki-Vagrant puppet only runs when the user calls vagrant provision, so really this config is designed to limit how often in the worst case self-update is run rather than being an automatic update via cron.

Reedy changed the task status from Stalled to Open.Mar 11 2021, 2:19 AM

Change 727006 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/vagrant@master] Use composer 2.x

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

Change 636214 abandoned by Reedy:

[mediawiki/vagrant@master] Use composer 2.x

Reason:

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

Change 727006 merged by jenkins-bot:

[mediawiki/vagrant@master] Use composer 2.x

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

Reedy claimed this task.