Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-68705

Consider making composer self-update non blocking or optional

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      PHPUnit

      No options
      1. Remove composer and vendor directory:

        rm -rf vendor composer.phar
        

      2. Set up phpunit:

        php admin/tool/phpunit/cli/init.php
        

        1. *Confirm that the output included notes lots of "Installing ..." lines
        2. Confirm that the vendor directory was re-recreated
        3. Confirm that composer.phar was re-recreated

          ls -l vendor
          ls -l composer.phar
          

      Disable all
      1. Remove composer and vendor directory:

        rm -rf vendor composer.phar
        

      2. Set up phpunit and request that composer not be updated:

        php admin/tool/phpunit/cli/init.php --disable-composer
        

        1. *Confirm that the output included notes lots of "Installing ..." lines
        2. Confirm that the vendor directory was re-recreated
        3. Confirm that composer.phar was re-recreated

          ls -l vendor
          ls -l composer.phar
          

      vendor only
      1. Remove vendor directory:

        rm -rf vendor
        

      2. Set up phpunit and request that composer not be updated:

        php admin/tool/phpunit/cli/init.php --disable-composer
        

        1. *Confirm that the output included notes lots of "Installing ..." lines
        2. Confirm that the vendor directory was re-recreated

          ls -l vendor
          ls -l composer.phar
          

        3. Confirm that the none of the following (or similar) are seen:

          Updating to version 1.10.10 (stable channel).
          Use composer self-update --rollback to return to version 1.10.9
          You are already using composer version 1.10.10 (stable channel).
          

      composer.phar only
      1. Remove composer.phar directory:

        rm -rf composer.phar
        

      2. Set up phpunit and request that composer not be updated:

        php admin/tool/phpunit/cli/init.php --disable-composer
        

        1. Confirm that the output does not include the following:

          Installing dependencies (including require-dev) from lock file
          

        2. Confirm that the composer.phar files has been recreated:

          ls -l composer.phar
          

      Individual no self-update
      1. Set up phpunit and request that composer not be self-updated:

        php admin/tool/phpunit/cli/init.php --no-composer-self-update
        

        1. Confirm that the none of the following (or similar) are seen:

          Updating to version 1.10.10 (stable channel).
          Use composer self-update --rollback to return to version 1.10.9
          You are already using composer version 1.10.10 (stable channel).
          

        2. Confirm that the output includes the following:

          Installing dependencies (including require-dev) from lock file
          

      Individual no dependency upgrade
      1. Set up phpunit and request that composer not be self-updated:

        php admin/tool/phpunit/cli/init.php --no-composer-upgrade
        

        1. Confirm that the output does not include the following:

          Installing dependencies (including require-dev) from lock file
          

        2. Confirm that the includes one or more of the following (or similar) lines:

          Updating to version 1.10.10 (stable channel).
          Use composer self-update --rollback to return to version 1.10.9
          You are already using composer version 1.10.10 (stable channel).
          

      Behat

      No options
      1. Remove composer and vendor directory:

        rm -rf vendor composer.phar
        

      2. Set up behat:

        php admin/tool/behat/cli/init.php
        

        1. *Confirm that the output included notes lots of "Installing ..." lines
        2. Confirm that the vendor directory was re-recreated
        3. Confirm that composer.phar was re-recreated

          ls -l vendor
          ls -l composer.phar
          

      Disable all
      1. Remove composer and vendor directory:

        rm -rf vendor composer.phar
        

      2. Set up behat and request that composer not be updated:

        php admin/tool/behat/cli/init.php --disable-composer
        

        1. *Confirm that the output included notes lots of "Installing ..." lines
        2. Confirm that the vendor directory was re-recreated
        3. Confirm that composer.phar was re-recreated

          ls -l vendor
          ls -l composer.phar
          

      vendor only
      1. Remove vendor directory:

        rm -rf vendor
        

      2. Set up behat and request that composer not be updated:

        php admin/tool/behat/cli/init.php --disable-composer
        

        1. *Confirm that the output included notes lots of "Installing ..." lines
        2. Confirm that the vendor directory was re-recreated

          ls -l vendor
          ls -l composer.phar
          

        3. Confirm that the none of the following (or similar) are seen:

          Updating to version 1.10.10 (stable channel).
          Use composer self-update --rollback to return to version 1.10.9
          You are already using composer version 1.10.10 (stable channel).
          

      composer.phar only
      1. Remove composer.phar directory:

        rm -rf composer.phar
        

      2. Set up behat and request that composer not be updated:

        php admin/tool/behat/cli/init.php --disable-composer
        

        1. Confirm that the output does not include the following:

          Installing dependencies (including require-dev) from lock file
          

        2. Confirm that the composer.phar files has been recreated:

          ls -l composer.phar
          

      Individual no self-update
      1. Set up behat and request that composer not be self-updated:

        php admin/tool/behat/cli/init.php --no-composer-self-update
        

        1. Confirm that the none of the following (or similar) are seen:

          Updating to version 1.10.10 (stable channel).
          Use composer self-update --rollback to return to version 1.10.9
          You are already using composer version 1.10.10 (stable channel).
          

        2. Confirm that the output includes the following:

          Installing dependencies (including require-dev) from lock file
          

      Individual no dependency upgrade
      1. Set up behat and request that composer not be self-updated:

        php admin/tool/behat/cli/init.php --no-composer-upgrade
        

        1. Confirm that the output does not include the following:

          Installing dependencies (including require-dev) from lock file
          

        2. Confirm that the includes one or more of the following (or similar) lines:

          Updating to version 1.10.10 (stable channel).
          Use composer self-update --rollback to return to version 1.10.9
          You are already using composer version 1.10.10 (stable channel).
          

      Show
      PHPUnit No options Remove composer and vendor directory: rm -rf vendor composer.phar Set up phpunit: php admin/tool/phpunit/cli/init.php *Confirm that the output included notes lots of "Installing ..." lines Confirm that the vendor directory was re-recreated Confirm that composer.phar was re-recreated ls -l vendor ls -l composer.phar Disable all Remove composer and vendor directory: rm -rf vendor composer.phar Set up phpunit and request that composer not be updated: php admin/tool/phpunit/cli/init.php --disable-composer *Confirm that the output included notes lots of "Installing ..." lines Confirm that the vendor directory was re-recreated Confirm that composer.phar was re-recreated ls -l vendor ls -l composer.phar vendor only Remove vendor directory: rm -rf vendor Set up phpunit and request that composer not be updated: php admin/tool/phpunit/cli/init.php --disable-composer *Confirm that the output included notes lots of "Installing ..." lines Confirm that the vendor directory was re-recreated ls -l vendor ls -l composer.phar Confirm that the none of the following (or similar) are seen: Updating to version 1.10.10 (stable channel). Use composer self-update --rollback to return to version 1.10.9 You are already using composer version 1.10.10 (stable channel). composer.phar only Remove composer.phar directory: rm -rf composer.phar Set up phpunit and request that composer not be updated: php admin/tool/phpunit/cli/init.php --disable-composer Confirm that the output does not include the following : Installing dependencies (including require-dev) from lock file Confirm that the composer.phar files has been recreated : ls -l composer.phar Individual no self-update Set up phpunit and request that composer not be self-updated: php admin/tool/phpunit/cli/init.php --no-composer-self-update Confirm that the none of the following (or similar) are seen: Updating to version 1.10.10 (stable channel). Use composer self-update --rollback to return to version 1.10.9 You are already using composer version 1.10.10 (stable channel). Confirm that the output includes the following : Installing dependencies (including require-dev) from lock file Individual no dependency upgrade Set up phpunit and request that composer not be self-updated: php admin/tool/phpunit/cli/init.php --no-composer-upgrade Confirm that the output does not include the following : Installing dependencies (including require-dev) from lock file Confirm that the includes one or more of the following (or similar) lines: Updating to version 1.10.10 (stable channel). Use composer self-update --rollback to return to version 1.10.9 You are already using composer version 1.10.10 (stable channel). Behat No options Remove composer and vendor directory: rm -rf vendor composer.phar Set up behat: php admin/tool/behat/cli/init.php *Confirm that the output included notes lots of "Installing ..." lines Confirm that the vendor directory was re-recreated Confirm that composer.phar was re-recreated ls -l vendor ls -l composer.phar Disable all Remove composer and vendor directory: rm -rf vendor composer.phar Set up behat and request that composer not be updated: php admin/tool/behat/cli/init.php --disable-composer *Confirm that the output included notes lots of "Installing ..." lines Confirm that the vendor directory was re-recreated Confirm that composer.phar was re-recreated ls -l vendor ls -l composer.phar vendor only Remove vendor directory: rm -rf vendor Set up behat and request that composer not be updated: php admin/tool/behat/cli/init.php --disable-composer *Confirm that the output included notes lots of "Installing ..." lines Confirm that the vendor directory was re-recreated ls -l vendor ls -l composer.phar Confirm that the none of the following (or similar) are seen: Updating to version 1.10.10 (stable channel). Use composer self-update --rollback to return to version 1.10.9 You are already using composer version 1.10.10 (stable channel). composer.phar only Remove composer.phar directory: rm -rf composer.phar Set up behat and request that composer not be updated: php admin/tool/behat/cli/init.php --disable-composer Confirm that the output does not include the following : Installing dependencies (including require-dev) from lock file Confirm that the composer.phar files has been recreated : ls -l composer.phar Individual no self-update Set up behat and request that composer not be self-updated: php admin/tool/behat/cli/init.php --no-composer-self-update Confirm that the none of the following (or similar) are seen: Updating to version 1.10.10 (stable channel). Use composer self-update --rollback to return to version 1.10.9 You are already using composer version 1.10.10 (stable channel). Confirm that the output includes the following : Installing dependencies (including require-dev) from lock file Individual no dependency upgrade Set up behat and request that composer not be self-updated: php admin/tool/behat/cli/init.php --no-composer-upgrade Confirm that the output does not include the following : Installing dependencies (including require-dev) from lock file Confirm that the includes one or more of the following (or similar) lines: Updating to version 1.10.10 (stable channel). Use composer self-update --rollback to return to version 1.10.9 You are already using composer version 1.10.10 (stable channel).
    • Affected Branches:
      MOODLE_35_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE
    • Pull Master Branch:
      MDL-68705-master
    • Story Points:
      1
    • Sprint:
      International 4.0 - Sprint 1, International 4.0 - Sprint 2, International 4.0 - Sprint 3, International 4.0 - Sprint 4

      Description

      Right now, every behat or phpunit init.php executions does check if composer.phar is available @ dirroot.

      A) If it's not available, it's downloaded.
      B) if it's available, a self-update is executed.

      Any error, kills the init.php execution, exiting with error.

      That's ok 90% of times, but there are some cases where it can lead to unnecessary problems/processing:

      1) Developer working offline. Impossible to run tests.
      2) Problems @ getcomposer.org, irrespectively of already being updated.
      3) composer.phar maintained by any other method.

      In all those cases... it may be interesting to allow the self-update to be (one of):

      a) make its execution optional (adding a --no-composer-update switch.
      b) avoid problems to exit with error (adding a --no-error-on-composer-update switch.

      Note that this doesn't affect A) (download the phar if missing), only updates.

      So this issue is about to decide if it's worth adding some of those options, decide which one and implement it. Both for phpunit and behat init.php scripts. Then we may start adding them here and there.

      Ciao

        Attachments

          Activity

            People

            Assignee:
            dobedobedoh Andrew Nicols
            Reporter:
            stronk7 Eloy Lafuente (stronk7)
            Peer reviewer:
            Jun Pataleta
            Participants:
            Component watchers:
            Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 35 minutes
                2h 35m