Problem/Motivation

Right now if you install Automatic Updates won't know if your system is compatible until you go to the update form or the status report page.

Steps to reproduce

Proposed resolution

We should display a message to the use who has just installed so they would know if there is a problem that would prevent them from using it and prompt them to view the status report

We already run the the checks in `automatic_updates_modules_installed` but because cron updates are disabled
status checks aren't displayed on admin page.

But installing in automatic updates is a special case where we should always let the user know if there is a problem

Remaining tasks

User interface changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

tedbow created an issue. See original summary.

tedbow’s picture

I marked it as minor because as soon as they went to the form they would see the messages.

phenaproxima’s picture

Doesn't this, like, already happen, though? In automatic_updates_modules_installed()? Or is that merely reacting to other modules being installed?

The relevant line from ModuleInstaller would seem to suggest that it's invoked even in the modules that were installed:

      $this->moduleHandler->invokeAll('modules_installed', [$modules_installed, $sync_status]);

Maybe all we really need here is better test coverage. Thoughts?

phenaproxima’s picture

Category: Bug report » Feature request

Confirmed with manual testing that, in fact, installing Automatic Updates DOES NOT run readiness checks in the UI. So this feature request is legitimate.

tedbow’s picture

Issue summary: View changes
omkar.podey’s picture

Assigned: Unassigned » omkar.podey

omkar.podey’s picture

Status: Active » Needs review

tedbow’s picture

Issue summary: View changes

after talking with @phenaproxima we decided to just display a message that there are errors and that the user should check the status report. I updated the summary.

This new solution will mean we don't need any changes to \Drupal\automatic_updates\Validation\AdminStatusCheckMessages

tedbow’s picture

Status: Needs review » Needs work

See the summary for the new proposed solution

omkar.podey’s picture

Status: Needs work » Needs review
tedbow’s picture

Status: Needs review » Needs work

@omkar.podey sorry to change approached but see the comment https://git.drupalcode.org/project/automatic_updates/-/merge_requests/55...

Let me know if you questions or concerns about that approach

omkar.podey’s picture

Status: Needs work » Needs review
tedbow’s picture

Status: Needs review » Needs work

a couple points on the merge request. but looking good👍

tedbow’s picture

Title: Display readiness check results if any after installing Automatic Updates » Display a message if status checks fail after installing Automatic Updates
Issue tags: +Needs issue summary update

updated title, we should make sure summary matches new proposed solution

omkar.podey’s picture

Status: Needs work » Needs review
wim leers’s picture

Status: Needs review » Needs work

12 remarks on the MR 🤓

omkar.podey’s picture

Status: Needs work » Needs review
wim leers’s picture

Status: Needs review » Needs work

Last round of review from me; then the code will be clear. Then I'll RTBC and @tedbow can do the final review :)

Note: the issue summary still needs to be updated!

tedbow’s picture

Needs work based on MR comments(I think the status should have been Needs Review)

omkar.podey’s picture

We need test coverage for tests/modules/automatic_updates_test_cron to verify it's behaviour in tests when the module is disabled.

omkar.podey’s picture

We want to call displayResultSummary() from automatic_updates_modules_installed() in automatic_updates.module but the Enabler class in automatic_updates_test_cron is not called early enough to change default disabled cron update.

wim leers’s picture

A work-around for #23 is possible.

6acc61cf failed like this:

Testing Drupal\Tests\automatic_updates\Functional\StatusCheckTest
E.......                                                            8 / 8 (100%)

Time: 01:11.554, Memory: 6.00 MB

There was 1 error:

1) Drupal\Tests\automatic_updates\Functional\StatusCheckTest::testModuleFormInstallDisplay with data set "Error" (2, true)
Behat\Mink\Exception\ResponseTextException: Failed asserting that the page matches the pattern '/Your site does not pass some readiness checks for automatic updates\. It cannot be automatically updated until further action is performed\./ui' 1 time(s), 2 found.
Failed asserting that 2 is identical to 1.

i.e. it expected that Your site does not pass some readiness checks for automatic updates appeared only once, but it appeared twice.

See commit 8105c059aae1413f037a4c99d1dcadbf9c9ce8d3.

Now it should fail like this:

1) Drupal\Tests\automatic_updates\Functional\StatusCheckTest::testModuleFormInstallDisplay with data set "Error" (2, true)
Behat\Mink\Exception\ExpectationException: Link with label See status report for more details. found.

/Users/wim.leers/core/core/tests/Drupal/Tests/WebAssert.php:560
/Users/wim.leers/core/core/tests/Drupal/Tests/WebAssert.php:318
/Users/wim.leers/core/modules/contrib/automatic_updates/tests/src/Functional/StatusCheckTest.php:105
/Users/wim.leers/core/vendor/phpunit/phpunit/src/Framework/TestResult.php:703

… because the test is AFAICT wrong.

tedbow’s picture

Title: Display a message if status checks fail after installing Automatic Updates » If cron updates are disabled display a message if status checks fail after installing Automatic Updates

Adding a "If cron updates are disabled to the title." needs to reflected in summary too

tedbow’s picture

Issue tags: +sprint
tedbow’s picture

Issue tags: +core-post-mvp
omkar.podey’s picture

Now testing doesn't contain the cases when cron updater is enabled, because we now we have default cron set to disable in automatic_updates.settings.yml and I think that will be the case whenever automatic_updates is enabled.

If there is a case when we want to simulate enabling automatic_updates with cron updates enabled then it's difficult because to enable cron updates in tests we need automatic_updates.settings.yml which won't be available until we have automatic_updates enabled.

omkar.podey’s picture

Assigned: omkar.podey » Unassigned
Status: Needs work » Needs review
tedbow’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs issue summary update

  • tedbow committed 265871b0 on 8.x-2.x authored by omkar.podey
    Issue #3306283 by omkar.podey, tedbow: If cron updates are disabled...
tedbow’s picture

Status: Reviewed & tested by the community » Fixed

Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.