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

Upgrade mongo-php-library to version 1.15.0

XMLWordPrintable

    • MOODLE_401_STABLE, MOODLE_402_STABLE
    • MOODLE_401_STABLE
    • MDL-76617_401
    • Hide

      Prerequisites

      1. This needs the tester ability to switch between php-mongo extension versions.
      2. MongoDB is installed & running.
      3. This needs to be tested with PHP 7.4, 8.0 and 8.1

      Testing MOODLE_401_STABLE

      1. Using PHP 7.4, init phpunit (php admin/tool/phpunit/cli/init.php).
      2. Verify that you are using the php-mongodb extension 1.14.x version (php --re mongodb | head -1).
      3. If needed, proceed to install it from PECL if not installed locally. I'm afraid but I don't know how to do this with Linux, with my Mac I was able to do it without too much problem with my package manager.
      4. Run vendor/bin/phpunit -v cache/stores/mongodb/tests/store_test.php
      5. Verify that there are 2 tests passed and there isn't any PHP notice/warning related with mongodb in the output or in the system logs.
      6. Using the same method followed in step #3, proceed to install from PECL the php-mongodb extension 1.15.x version
      7. Verify that you're using now the php-mongodb extension 1.15.x version (php --re mongodb | head -1).
      8. Run vendor/bin/phpunit -v cache/stores/mongodb/tests/store_test.php
      9. Verify that there are 2 tests passed and there isn't any PHP notice/warning related with mongodb in the output or in the system logs.
      10. Repeat the points 2-9 above but switching to PHP 8.0 and PHP 8.1

      Testing master

      1. Using PHP 7.4, init phpunit (php admin/tool/phpunit/cli/init.php).
      2. Verify that you are using the php-mongodb extension 1.14.x version (php --re mongodb | head -1).
      3. If needed, proceed to install it from PECL if not installed locally. I'm afraid but I don't know how to do this with Linux, with my Mac I was able to do it without too much problem with my package manager.
      4. Run vendor/bin/phpunit -v cache/stores/mongodb/tests/store_test.php
      5. Verify that there are 2 tests skipped (that's because master requires extension version 1.15.0 and we are using 1.14.x).
      6. Using the same method followed in step #3, proceed to install from PECL the php-mongodb extension 1.15.x version
      7. Verify that you're using now the php-mongodb extension 1.15.x version (php --re mongodb | head -1).
      8. Run vendor/bin/phpunit -v cache/stores/mongodb/tests/store_test.php
      9. Verify that there are 2 tests passed and there isn't any PHP notice/warning related with mongodb in the output or in the system logs.
      10. Repeat the points 2-9 above but switching to PHP 8.0 and PHP 8.1

       

      Troubleshooting

      1. If the instance error when running the PHPUnit testing, make sure you already add this line in the config.php

        define('TEST_CACHESTORE_MONGODB_TESTSERVER', 'mongodb://some-mongo:27017');

        Change this 'mongodb://some-mongo:27017' with your configuration.

      Show
      Prerequisites This needs the tester ability to switch between php-mongo extension versions. MongoDB is installed & running. This needs to be tested with PHP 7.4, 8.0 and 8.1 Testing MOODLE_401_STABLE Using PHP 7.4, init phpunit ( php admin/tool/phpunit/cli/init.php ). Verify that you are using the php-mongodb extension 1.14.x version ( php --re mongodb | head -1 ). If needed, proceed to install it from PECL if not installed locally. I'm afraid but I don't know how to do this with Linux, with my Mac I was able to do it without too much problem with my package manager. Run vendor/bin/phpunit -v cache/stores/mongodb/tests/store_test.php Verify that there are 2 tests passed and there isn't any PHP notice/warning related with mongodb in the output or in the system logs. Using the same method followed in step #3, proceed to install from PECL the php-mongodb extension 1.15.x version Verify that you're using now the php-mongodb extension 1.15.x version ( php --re mongodb | head -1 ). Run vendor/bin/phpunit -v cache/stores/mongodb/tests/store_test.php Verify that there are 2 tests passed and there isn't any PHP notice/warning related with mongodb in the output or in the system logs. Repeat the points 2-9 above but switching to PHP 8.0 and PHP 8.1 Testing master Using PHP 7.4, init phpunit ( php admin/tool/phpunit/cli/init.php ). Verify that you are using the php-mongodb extension 1.14.x version ( php --re mongodb | head -1 ). If needed, proceed to install it from PECL if not installed locally. I'm afraid but I don't know how to do this with Linux, with my Mac I was able to do it without too much problem with my package manager. Run vendor/bin/phpunit -v cache/stores/mongodb/tests/store_test.php Verify that there are 2 tests skipped (that's because master requires extension version 1.15.0 and we are using 1.14.x). Using the same method followed in step #3, proceed to install from PECL the php-mongodb extension 1.15.x version Verify that you're using now the php-mongodb extension 1.15.x version ( php --re mongodb | head -1 ). Run vendor/bin/phpunit -v cache/stores/mongodb/tests/store_test.php Verify that there are 2 tests passed and there isn't any PHP notice/warning related with mongodb in the output or in the system logs. Repeat the points 2-9 above but switching to PHP 8.0 and PHP 8.1   Troubleshooting If the instance error when running the PHPUnit testing, make sure you already add this line in the config.php define( 'TEST_CACHESTORE_MONGODB_TESTSERVER' , 'mongodb://some-mongo:27017' ); Change this 'mongodb://some-mongo:27017' with your configuration.
    • 2
    • Team Hedgehog Sprint 1.3

      The new php-mongodb extension v1.15.0 needs the mongo-php-library v1.15.0 to be used.

      Right now we are using mongo-php-library v1.13.1 (updated by MDL-75481).

      And, right now, with php81, it is emitting some warnings leading to failed tests:

      Link: https://ci.moodle.org/view/Testing/job/DEV.81%20-%20PHP%208.1%20PHPUnit%20-%20master/104/console

      1) cachestore_mongodb\store_test::test_collection_name
      This test printed output: 
      Deprecated: Return type of MongoDB\Model\IndexInput::bsonSerialize() should either be compatible with MongoDB\BSON\Serializable::bsonSerialize(): object|array, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/cache/stores/mongodb/MongoDB/Model/IndexInput.php on line 94
       
      Deprecated: Return type of MongoDB\Model\BSONArray::bsonSerialize() should either be compatible with MongoDB\BSON\Serializable::bsonSerialize(): object|array, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/cache/stores/mongodb/MongoDB/Model/BSONArray.php on line 74
      ...
      ...
      

      So this is about to upgrade mongo-php-library to v1.15.0, that works ok with the extension v1.15.0 (and also with the extension v1.14.1, maybe also with older).

      Changes need to go both to 401_STABLE and master, because 401 is getting php81 support, so we need this.

      Bonus, the v1.15.0 seems to be also ready for php82.

      Ciao

        1. 74_401_2.png
          16 kB
          Glyn (Mathew) May
        2. 74_401_5.png
          41 kB
          Glyn (Mathew) May
        3. 74_401_7.png
          16 kB
          Glyn (Mathew) May
        4. 74_401_9.png
          42 kB
          Glyn (Mathew) May
        5. 74_master_2.png
          15 kB
          Glyn (Mathew) May
        6. 74_master_5.png
          62 kB
          Glyn (Mathew) May
        7. 74_master_7.png
          15 kB
          Glyn (Mathew) May
        8. 74_master_9.png
          41 kB
          Glyn (Mathew) May
        9. 80_401_2.png
          16 kB
          Glyn (Mathew) May
        10. 80_401_5.png
          35 kB
          Glyn (Mathew) May
        11. 80_401_7.png
          16 kB
          Glyn (Mathew) May
        12. 80_401_9.png
          42 kB
          Glyn (Mathew) May
        13. 80_master_2.png
          15 kB
          Glyn (Mathew) May
        14. 80_master_5.png
          52 kB
          Glyn (Mathew) May
        15. 80_master_7.png
          15 kB
          Glyn (Mathew) May
        16. 80_master_9.png
          35 kB
          Glyn (Mathew) May
        17. 81_401_2.png
          16 kB
          Glyn (Mathew) May
        18. 81_401_5.png
          36 kB
          Glyn (Mathew) May
        19. 81_401_7.png
          16 kB
          Glyn (Mathew) May
        20. 81_401_9.png
          42 kB
          Glyn (Mathew) May
        21. 81_master_2.png
          15 kB
          Glyn (Mathew) May
        22. 81_master_5.png
          52 kB
          Glyn (Mathew) May
        23. 81_master_7.png
          15 kB
          Glyn (Mathew) May
        24. 81_master_9.png
          41 kB
          Glyn (Mathew) May

            stronk7 Eloy Lafuente (stronk7)
            stronk7 Eloy Lafuente (stronk7)
            Meirza Meirza
            Sara Arjona (@sarjona) Sara Arjona (@sarjona)
            Glyn (Mathew) May Glyn (Mathew) May
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 day, 4 hours, 30 minutes
                1d 4h 30m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.