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

Decide Moodle 4.2 requirements and push them to environment.xml (due date: 2022-12-26)

XMLWordPrintable

    • MOODLE_402_STABLE
    • MOODLE_311_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE, MOODLE_401_STABLE
    • MDL-74905_401
    • Hide

      0 - Prerequisites

      1. Ensure that there is NOT any $CFG->moodledata/environment directory in your installation. If it exists... it contains old environment info. Remove the directory completely before continuing with the tests below.

      A - On Master, 401, 400, 311 and 39 (all supported and security supported branches):

      Note: This needs to be tested on all the databases that are affected by the changes (Check the databases mentioned on the list)

      1. Go to admin -> server -> environment
      2. One "4.2 upwards" Moodle version should be available.
      3. VERIFY that It shows the same requirements as the 4.1 version but with these differences:
        1. PHP 8.0 is required (instead of 7.4).
        2. Moodle 3.11.8 is required (instead of 3.9)
        3. Databases
          • MySQL 8.0 is required (instead of 5.7).
          • MariaDB 10.6.7 is required (instead of 10.4)
          • PostgreSQL 13 is required (instead of 12).
        4. The php-sodium extension is now required (previously recommended).
        5. 64 bits are now required (previously recommended). Note that this check doesn't appear unless your host is 32 bits, so it's also ok if this check isn't shown, we'll test it later.

      B - Verify, for all the numeric (XYZ) branches above, that the environment.xml file is 100% the same (requires git or diff use). All the commands should return NO differences (nothing should be output):

      Note: It's enough to test on one instance only (e.g. on a master instance)

      1. git diff MOODLE_XYZ_STABLE master admin/environment.xml

      C - Upgrade tests (easier with MDK):

      Note: Test on master only. No need to test on the other branches.

      C-1 Using minimum supported version

      1. Install Moodle 3.11.8
        1. Uninstall your current instance

          mdk uninstall -y
          

        2. Checkout the 3.11.8 tag

          git checkout v3.11.8
          

        3. Install

          mdk install
          

      2. Add some courses and one activity or two

        mdk run makecourse
        

      3. Attempt upgrade to master
        1. Checkout the master branch.

          git checkout master
          

        2. Upgrade either via the browser or via CLI (mdk upgrade)
      4. VERIFY: that upgrade works

      C-2 Using older, non-supported version

      1. Install Moodle 3.11.7
        1. Uninstall your current instance

          mdk uninstall -y
          

        2. Checkout the 3.11.7 tag

          git checkout v3.11.7
          

        3. Install

          mdk install
          

      2. Add some courses and one activity or two

        mdk run makecourse
        

      3. Attempt upgrade to master
        1. Checkout the master branch.

          git checkout master
          

        2. Open the moodle instance on your browser
      4. VERIFY: that upgrade is blocked

      D - Check that the 64 bits new requirements is working

      1. Note: because it's really hard to find a 32 bits environment, we are going to hack in existing code to simulate that our environment is that way.
      2. Install Moodle 4.2dev (master)
        1. Uninstall your current instance

          mdk uninstall -y
          

        2. Checkout the master branch

          git checkout master
          

        3. Install

          mdk install
          

        4. Go to the site Admin -> Server -> Environment page
        5. Verify that there isn't any "php not 64 bits" warning or error (that means that your system is 64bits).
        6. Edit the lib/upgradelib.php file.
        7. In the check_sixtyfour_bits function, apply this change (replace the "4" with "8"):

          -    if (PHP_INT_SIZE === 4) {
          +    if (PHP_INT_SIZE === 8) {
          

        8. Reload the Admin -> Server -> Environment page
        9. Verify the there is a "php not 64 bits" error (red) in the "Other checks" section. With the link "this test must pass" and a brief explanation with the text "It has been detected that your site is not...". The status column shows a "Check" pill, also in red.
        10. Verify that the "this test must pass link" sends you to a page in the (401) docs with a note that says: "Note: Since Moodle 4.2 it's required to use a 64-bit version of PHP and the underlying Operating System."
        11. Uninstall your current instance

          mdk uninstall -y
          

        12. Install again (without any git operation, so the hack applied above is still present).

          mdk install
          

        13. Verify that installation is blocked.
        14. Undo the change that was applied above (replace the "8" with the original "4"):
        15. Install again

          mdk install
          

        16. Verify that the installation happens without problem.
      Show
      0 - Prerequisites Ensure that there is NOT any $CFG->moodledata/environment directory in your installation. If it exists... it contains old environment info. Remove the directory completely before continuing with the tests below. A - On Master, 401, 400, 311 and 39 (all supported and security supported branches): Note: This needs to be tested on all the databases that are affected by the changes (Check the databases mentioned on the list) Go to admin -> server -> environment One "4.2 upwards" Moodle version should be available. VERIFY that It shows the same requirements as the 4.1 version but with these differences: PHP 8.0 is required (instead of 7.4). Moodle 3.11.8 is required (instead of 3.9) Databases MySQL 8.0 is required (instead of 5.7). MariaDB 10.6.7 is required (instead of 10.4) PostgreSQL 13 is required (instead of 12). The php-sodium extension is now required (previously recommended). 64 bits are now required (previously recommended). Note that this check doesn't appear unless your host is 32 bits, so it's also ok if this check isn't shown, we'll test it later. B - Verify, for all the numeric (XYZ) branches above, that the environment.xml file is 100% the same (requires git or diff use). All the commands should return NO differences (nothing should be output): Note: It's enough to test on one instance only (e.g. on a master instance) git diff MOODLE_XYZ_STABLE master admin/environment.xml C - Upgrade tests (easier with MDK): Note: Test on master only. No need to test on the other branches. C-1 Using minimum supported version Install Moodle 3.11.8 Uninstall your current instance mdk uninstall -y Checkout the 3.11.8 tag git checkout v3.11.8 Install mdk install Add some courses and one activity or two mdk run makecourse Attempt upgrade to master Checkout the master branch. git checkout master Upgrade either via the browser or via CLI ( mdk upgrade ) VERIFY : that upgrade works C-2 Using older, non-supported version Install Moodle 3.11.7 Uninstall your current instance mdk uninstall -y Checkout the 3.11.7 tag git checkout v3.11.7 Install mdk install Add some courses and one activity or two mdk run makecourse Attempt upgrade to master Checkout the master branch. git checkout master Open the moodle instance on your browser VERIFY : that upgrade is blocked D - Check that the 64 bits new requirements is working Note: because it's really hard to find a 32 bits environment, we are going to hack in existing code to simulate that our environment is that way. Install Moodle 4.2dev (master) Uninstall your current instance mdk uninstall -y Checkout the master branch git checkout master Install mdk install Go to the site Admin -> Server -> Environment page Verify that there isn't any "php not 64 bits" warning or error (that means that your system is 64bits). Edit the lib/upgradelib.php file. In the check_sixtyfour_bits function, apply this change (replace the "4" with "8"): - if (PHP_INT_SIZE === 4) { + if (PHP_INT_SIZE === 8) { Reload the Admin -> Server -> Environment page Verify the there is a "php not 64 bits" error (red) in the "Other checks" section. With the link "this test must pass" and a brief explanation with the text "It has been detected that your site is not...". The status column shows a "Check" pill, also in red. Verify that the "this test must pass link" sends you to a page in the (401) docs with a note that says: "Note: Since Moodle 4.2 it's required to use a 64-bit version of PHP and the underlying Operating System." Uninstall your current instance mdk uninstall -y Install again (without any git operation, so the hack applied above is still present). mdk install Verify that installation is blocked. Undo the change that was applied above (replace the "8" with the original "4"): Install again mdk install Verify that the installation happens without problem.

      Policy: PHP & Moodle supported versions

      Since Moodle 3.5 (MDL-59159), these rules apply to decide Minimum PHP and Moodle versions supported:

      1. A LTS will always require the previous LTS (or later) for upgrading.
      2. The maximum PHP version supported for a branch will be the max one achieved along the life of the branch. Usually with .0 releases but may happen later (we added support for php70 with 3.0.1, or support for php73 with 3.6.4, for example).
      3. The minimum PHP version supported for a branch will be the lower of:
        • The minimum version supported in any way by php the day of the Moodle release (so we provide slow, progressive increments).
        • The maximum PHP version supported by the previous LTS branch (so we guarantee jumping between LTS is possible without upgrading PHP at the same time).

      We need to decide ASAP about all the PHP/DB/Moodle versions requirements and put all them into the environmental tests (adding them to all supported branches).

      All the still open linked issues have been also cloned here from the 4.1 sister issue (MDL-71747).

      Usual discussions:

      Feel free to propose areas to be discussed here. A numbered list with all them will be created to vote and decide the final outcomes of this issue.

       Related Tasks (create issues/PRs whenever they apply):

      TODO-0: Recommendation. It's useful to look to the changes performed for previous versions, specially LTS ones, to see which sort of changes must be applied with this issue. Specially remember that any change to the minimum supported PHP always implies a change to the minimum upgradeable Moodle version (to the first one supporting the new PHP requirement).

      TODO-1: MDLSITE-7055 - Once the agreement is settled, if there are raised requirements (PHP/Database/Extensions...) create a MDLSITE issue to ensure that external testers environment is ready for them.

      TODO-2: Composer: To be done as part of this issue (master only):

      1. Raised lower PHP version does imply that core composer stuff need to be updated and regenerated with it.
      2. Also, check that all the php and extensions requirements and recommendations in the composer.json file match the ones specified in the admin/environment.xml file (defined by this issue).

      TODO-3: Environment and upgrade: To be done as part of this issue:

      1. Add the new version section to the admin/environment.xml files, for all the supported (security included) branches. Ensure all the new requirements are applied.
      2. If Moodle requirements have changed, remove any upgrade step (and upgradelib functions) not used anymore (master only).

      TODO-4: Travis / GHA integration: To be done as part of this issue (master only. Ensure requirements are fulfilled and there are jobs using the new versions.

      TODO-5: Once the agreement is settled, ensure that:

      • The affected php docker images fulfill all the requirements (extensions...).
      • Same for (still) non-dockered stuff, like:
        • Legacy CI server. Ensure that bot master jobs and CiBoT runs are executed with minimum supported php version.
        • Performance-comparison jobs.

      TODO-6: Once the patch is ready to peer-review, update all the configuration @ CI infrastructure:

      • MR#40 - Ensure (nightlyjobs) that every Moodle branch knows its lowest and highest PHP supported versions.
      • PR#92 - Verify that the runner (moodle-ci-runner) is using correct database versions.
      • Configure the following jobs if there is a PHP version bump:
        1. All "bulk-prelaunch" jobs (3), in the "Tracker" tab, configure master branch run using the new PHP version.
        2. All "developer requested" jobs (4), in the "Testing" tab, configure them to run by default using the new PHP version (moving it to the top of the list in the available PHP versions list).

      TODO-7: MR#21 - Once applied upstream, changes are needed @ download.moodle.org to show the new requirements there (serverscripts).

      TODO-8: Once applied upstream, ensure that both the Mac and Windows packages fulfill the requirements and work ok. See this comment for more details. And MDLSITE-7163 about the Mac ones.

      TODO-9: Once applied upstream, review the travis and/or github actions configuration for various repositories. The new core requirements may be hitting them. Also add new branches if missing. Known to need review / fix repos include:

      TODO-10: No upgrade yet, PHPUnit 10 coming in Feb 2023, will be re-evaluated then (important changes coming) - Consider if there is any PHPUnit upgrade to perform whenever there are PHP version changes.

      • Edited (Feb 2023). PHPUnit 10 has been released, but we aren't in a hurry to upgrade. More yet, it only supports PHP 8.1 and up, so we cannot update to it until that PHP version is made a requirement for Moodle.

      TODO-11: MDL-76724 - Ensure that the (clone of this) issue for next (to this) requirements issue is created and contains all the information. All the non-resolved details and issues must be dragged to the new issue.

      TODO-12: MDLSITE-7069 - Create an issue about to guarantee that all the Community sites sites running the dev version fulfil the new requirements.

      TODO-13: Warn internally (apart from the previous point) about the agreed changes, so everybody is ready in advance for the upcoming changes.

      TODO-14: Docs:

      1. PR#530 - If there is any raise to PHP requirements, document it the PHP docs page (example PR).
      2. Issue #550 - Ensure that all the requirements are shown in the corresponding docs (release and/or upgrade). Ask @ devdocs if the new version docs need to be created.
      3. Ensure that there are landing pages @ docs for all the environmental changes performed.

      TIA and ciao
       

            stronk7 Eloy Lafuente (stronk7)
            stronk7 Eloy Lafuente (stronk7)
            Andrew Lyons Andrew Lyons
            Jun Pataleta Jun Pataleta
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            1 Vote for this issue
            Watchers:
            21 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 week, 56 minutes
                1w 56m

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