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

Inform about newly created settings during CLI upgrades

    XMLWordPrintable

Details

    • Any
    • MOODLE_34_STABLE, MOODLE_35_STABLE
    • MOODLE_36_STABLE
    • MDL-62777-master
    • Hide

      Note: MDK would be useful for this test.

      Default CLI upgrade
      1. If you have a current installation, uninstall it.

        mdk uninstall -y

      2. Check out an old Moodle version. E.g. Moodle 3.4

        git checkout  v3.4.0

      3. Install the instance

        mdk install

      4. Checkout the codebase with this patch applied

        git checkout master

      5. Run the upgrade script:

        php admin/cli/upgrade.php --non-interactive --allow-unstable

      6. Confirm that at the end of the upgrade, you see the new settings that were set with default values.
      Verbose CLI upgrade
      1. Uninstall your instance.

        mdk uninstall -y

      2. Check out an old Moodle version. E.g. Moodle 3.4

        git checkout  v3.4.0

      3. Install the instance with some of the admin settings changed

        mdk install -r mindev

        The "mindev" script will alter developer settings such as "Debug messages"

      4. Checkout the codebase with this patch applied

        git checkout master

      5. Run the upgrade script with the "verbose-settings" option:

        php admin/cli/upgrade.php --non-interactive --allow-unstable --verbose-settings

      6. Confirm that at the end of the upgrade, you see the new settings along with the default values that were set for them.
      7. Open your Moodle instance and go to "Site administration / Development / Debugging"
      8. Confirm that the "Debug messages" setting is still set to Developer.
      Regression test: CLI install
      1. Uninstall your instance.

        mdk uninstall -y

      2. Do a fresh install

        mdk install

      3. Confirm that the installation completes successfully.
      Regression test: Web upgrade
      1. Uninstall your instance.

        mdk uninstall -y

      2. Check out an old Moodle version. E.g. Moodle 3.4

        git checkout  v3.4.0

      3. Install the instance with some of the admin settings changed

        mdk install -r mindev

      4. Checkout the codebase with this patch applied

        git checkout master

      5. Open your Moodle instance on your web browser.
      6. Log in as an admin.
      7. Run through the upgrade.
      8. Confirm that the upgrade completes successfully.
      9. Open your Moodle instance and go to "Site administration / Development / Debugging"
      10. Confirm that the "Debug messages" setting is still set to Developer.
      Show
      Note: MDK would be useful for this test. Default CLI upgrade If you have a current installation, uninstall it. mdk uninstall -y Check out an old Moodle version. E.g. Moodle 3.4 git checkout v3.4.0 Install the instance mdk install Checkout the codebase with this patch applied git checkout master Run the upgrade script: php admin/cli/upgrade.php --non-interactive --allow-unstable Confirm that at the end of the upgrade, you see the new settings that were set with default values. Verbose CLI upgrade Uninstall your instance. mdk uninstall -y Check out an old Moodle version. E.g. Moodle 3.4 git checkout v3.4.0 Install the instance with some of the admin settings changed mdk install -r mindev The " mindev " script will alter developer settings such as " Debug messages " Checkout the codebase with this patch applied git checkout master Run the upgrade script with the " verbose-settings " option: php admin/cli/upgrade.php --non-interactive --allow-unstable --verbose-settings Confirm that at the end of the upgrade, you see the new settings along with the default values that were set for them. Open your Moodle instance and go to " Site administration / Development / Debugging " Confirm that the " Debug messages " setting is still set to Developer. Regression test: CLI install Uninstall your instance. mdk uninstall -y Do a fresh install mdk install Confirm that the installation completes successfully. Regression test: Web upgrade Uninstall your instance. mdk uninstall -y Check out an old Moodle version. E.g. Moodle 3.4 git checkout v3.4.0 Install the instance with some of the admin settings changed mdk install -r mindev Checkout the codebase with this patch applied git checkout master Open your Moodle instance on your web browser. Log in as an admin. Run through the upgrade. Confirm that the upgrade completes successfully. Open your Moodle instance and go to " Site administration / Development / Debugging " Confirm that the " Debug messages " setting is still set to Developer.

    Description

      When doing a Moodle update / upgrade via CLI (/admin/cli/upgrade.php), there is an output which informs about the affected components / plugins and about the progress. Example:

      -->Sprachpakete verwalten: de
      ++ Das Sprachpaket ‘de' ist aktuell. ++
      -->Kernsystem
      ++ Fortschritt (3,02 Sekunden) ++
      -->mod_choicegroup
      ++ Fortschritt (0,12 Sekunden) ++
      -->block_quickmail
      ++ Fortschritt (0,08 Sekunden) ++
      -->local_boostnavigation
      ++ Fortschritt (0,09 Sekunden) ++
      Die Aktualisierung wurde erfolgreich beendet.
      

      (sorry for the example being in german, but you have hopefully all seen this before in english)

      Now, when there are new settings in core or in a plugin which are installed during an update / upgrade, the admin can see and modify them within the manual upgrade wizard in the browser.

      When using the CLI upgrade, the admin does not have any idea if and which new settings are installed. They are simply installed silently with their default values.

      I would propose to add an output for each newly installed setting to inform the admin about this fact and to give him the chance to review the setting later manually. Example:

      -->Sprachpakete verwalten: de
      ++ Das Sprachpaket ‘de' ist aktuell. ++
      -->Kernsystem
      ++ Fortschritt (3,02 Sekunden) ++
      -->mod_choicegroup
      ++ Fortschritt (0,12 Sekunden) ++
      -->block_quickmail
      ++ Fortschritt (0,08 Sekunden) ++
      -->local_boostnavigation
      ++ New setting "local_boostnavigation | removeprivatefilesnode" installed with default value: 0
      ++ Fortschritt (0,09 Sekunden) ++
      Die Aktualisierung wurde erfolgreich beendet.
      


      PS: The proposed patch by davosmith in MDL-41047 which unfortunately got stuck might serve as a boilerplate for this ticket.

      Attachments

        1. 1.PNG
          1.PNG
          285 kB
        2. 2.PNG
          2.PNG
          225 kB
        3. Selection_091.png
          Selection_091.png
          154 kB

        Issue Links

          Activity

            People

              mattp@catalyst-au.net Matt Porritt
              abias Alexander Bias
              Luca Bösch Luca Bösch
              Jun Pataleta Jun Pataleta
              Janelle Barcega Janelle Barcega
              David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              1 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                3/Dec/18

                Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 hour
                  1h