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

Bump nodejs from v14.15.0 to current v14.18.0

    XMLWordPrintable

Details

    • MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE
    • MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_39_STABLE
    • MDL-72623_311
    • Hide

      A) Automated, just manually verify that:

      1. npm install
      2. grunt
      3. travis
      4. cibot
      5. phpunit and behat tests

      are all them passing for the target branches (39, 310, 311 & master).

      B) Verify that the NodeJSVersion and NodeJSExactVersion templates in the Docs have been updated to point to this issue and nodejs versions match the work done here (see issue's title).

      C) Quick manual exploratory test
      Optional. Really all these should be covered by behat tests, and some exploratory testing has been already performed so, for your consideration...

      1. Open a terminal and go to your moodle instance's root folder.
      2. Delete node_modules folder if it exists. "rm -rf node_modules"
      3. Run "nvm install". If you don't have nvm, check out the installation instructions.
      4. Confirm that it found the .nvmrc file with version v14.18.0
      5. Confirm that the installation was successful and is now using node v14.18.0
      6. Run "npm install"
      7. Confirm that the installation is successful.
      8. Run "grunt". If grunt is not found, run "npm install -g grunt-cli".
      9. Confirm that grunt completes without any errors.
      10. Check for modified files with "git status"
      11. Confirm that there are no modified files.
      12. With your browser's dev tools/JS console open, visit various pages having javascript modules (e.g. auto-completion, inline-editable, templates, ajax, menu-bar, etc.). The course homepage with editing mode on, the course participants page, and the messaging panel might be good candidates for this test.
      13. Confirm that these are all working ok.
      14. Confirm that there are no javascript console errors as well.
      Show
      A) Automated, just manually verify that: npm install grunt travis cibot phpunit and behat tests are all them passing for the target branches (39, 310, 311 & master). B) Verify that the NodeJSVersion  and NodeJSExactVersion templates in the Docs have been updated to point to this issue and nodejs versions match the work done here (see issue's title). C) Quick manual exploratory test Optional. Really all these should be covered by behat tests, and some exploratory testing has been already performed so, for your consideration... Open a terminal and go to your moodle instance's root folder. Delete node_modules folder if it exists. " rm -rf node_modules " Run " nvm install ". If you don't have nvm, check out the installation instructions . Confirm that it found the .nvmrc file with version v14.18.0 Confirm that the installation was successful and is now using node v14.18.0 Run " npm install " Confirm that the installation is successful. Run " grunt ". If grunt is not found, run " npm install -g grunt-cli ". Confirm that grunt completes without any errors. Check for modified files with " git status " Confirm that there are no modified files. With your browser's dev tools/JS console open, visit various pages having javascript modules (e.g. auto-completion, inline-editable, templates, ajax, menu-bar, etc.). The course homepage with editing mode on, the course participants page, and the messaging panel might be good candidates for this test. Confirm that these are all working ok. Confirm that there are no javascript console errors as well.

    Description

      Policy: Keeping us on top of nodejs/npm LTS versions (including jumps to next LTS)

      Since September 2018 (MDL-63346):

      1. This policy will be applied to ALL supported branches, normal and security-only.
      2. This policy won't update any tool per se, unless strictly needed by nodejs/npm own dependencies/changes. It won't include npm audit changes either. Those are handled apart. So, normally, only changes to .nvmrc and package.json will happen. That will be achieved by:
        1. update .nvmrc to the new version.
        2. run nvm install && nvm alias default node && nvm use to install, set it as new default and use it for the next steps.
        3. update package.json and set engines to the new restriction (>= new version and < next major).
      3. When needed to bump components or run some audit, a new issue, similar to this, will be created and these steps performed in order to get a renewed npm-shrinkwrap.json file:
        1. remove node_modules & npm-shrinkwrap.json
        2. npm cache clear --force
        3. npm install
        4. npm shrinkwrap
      4. In any case, simple update or complete components bump, run grunt and verify that all the generated css/js/map stuff remains the same. If there are differences in the generation... it will need to be analysed and decided if:
        1. accepted (so everything, shrinkwrap and generated css/js/map) lands [or]
        2. not accepted (and only change .nvmrc and package.json) instead).
      5. The resulting branches will be sent to github (or similar), making a peer-review request here so both travis and cibot will verify that all them pass ok.
      6. Changes will be normally integrated and the NodeJSVersion template and NodeJSExactVersion templates will be updated with latest information in the Docs.
      7. TODO (MDLSITE-5536): A job @ CI servers will be, daily, using latest lts/current version to detect if there are npm-shrinkwrap.json changes. It will fail when that happens and inform integrators. Jumps to lts/next will be detected manually,.

      TARGET A) As far as nodejs/npm v14 (current LTS) has been advancing over the last months (since MDL-69815) from v14.15.0 to current v14.18.0:

      TARGET B) And, because nodejs/npm v16 (next LTS) also has been advancing to v16.9.1 and it will become LTS next 26th October 2021:

      https://nodejs.org/en/about/releases/

      This is about to consider to bump to it for all our supported branches (39 and up, right now) to one of the 2 alternatives (A or B TARGETS) above. This requires:

      • with TARGET nodejs/npm installed, regenerate npm-shrinkwrap.json (see instructions above)
      • optionally (not part of the policy): look for deprecated and audit results, trying to update as many as possible.
      • apply all the changes to core.
      • review 3rd part systems: travis, CI servers, docs.moodle.org
      • share about it in all channels as possible

      This check should be performed some weeks before majors (part of the release process), hence creating it now (-6 weeks).

      Ciao

      Attachments

        1. MDL-72623_B_NodeJSExactVersion.png
          MDL-72623_B_NodeJSExactVersion.png
          62 kB
        2. MDL-72623_B_NodeJSVersion.png
          MDL-72623_B_NodeJSVersion.png
          71 kB
        3. MDL-72623_C_Step 4-5.png
          MDL-72623_C_Step 4-5.png
          87 kB
        4. MDL-72623_C_Step 7.png
          MDL-72623_C_Step 7.png
          135 kB
        5. MDL-72623_Step 11.png
          MDL-72623_Step 11.png
          17 kB
        6. MDL-72623_Step 13-14_1.png
          MDL-72623_Step 13-14_1.png
          178 kB
        7. MDL-72623_Step 13-14_2.png
          MDL-72623_Step 13-14_2.png
          206 kB
        8. MDL-72623_Step 9_1.png
          MDL-72623_Step 9_1.png
          107 kB
        9. MDL-72623_Step 9_2.png
          MDL-72623_Step 9_2.png
          55 kB

        Issue Links

          Activity

            People

              stronk7 Eloy Lafuente (stronk7)
              stronk7 Eloy Lafuente (stronk7)
              Simey Lameze Simey Lameze
              Jun Pataleta Jun Pataleta
              Angelia Dela Cruz Angelia Dela Cruz
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Sujith Haridasan, Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Huong Nguyen, Bas Brands, Mathew May
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                8/Nov/21

                Time Tracking

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