Problem/Motivation
Follow-up to #3339526: Automatic Updates hosting test result on Dreamhost

This image here I think is trying to show a message from \Drupal\package_manager\Validator\StagedDBUpdateValidator::checkForStagedDatabaseUpdates
but it does not show the message "Possible database updates have been detected in the following extensions." only the module that has the update. I think this is because \Drupal\automatic_updates\Form\UpdateFormBase::displayResults assumes if there is only 1 messages(the module name) then you don't need to show the summary(in this case the "Possible database updates have.." message). This is not correct.
Steps to reproduce
Proposed resolution
- \Drupal\automatic_updates\Form\UpdateFormBase::displayResults we should on always use the theme unless unless there is only 1 message and there is not summary.
In
\Drupal\package_manager\ValidationResult::__constructwe throw an error if there are more than 1 message and there is not a summary but you can create a result with only 1 message and still have a summary. - Look at the other places will display results and determine if this is problem.
at least
\Drupal\automatic_updates\Validation\StatusCheckRequirements::getRequirementsand\Drupal\automatic_updates\Validation\ValidationResultDisplayTrait::displayResults
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | 3339657-13.png | 95.1 KB | phenaproxima |
Issue fork automatic_updates-3339657
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
Comment #4
phenaproximaComment #5
tedbow@phenaproxima did you check the other place mentioned in Proposed resolution 2)?
Comment #6
tedbowLooks good but I don't the original problem documented in the screenshot has test coverage.
This is when the User is on the UpdateReady form and there is a status check warning with 1 message and summary.
the closest test coverage we have is \Drupal\Tests\automatic_updates\Functional\UpdateWarningTest but it only deals with an warning with more than 1 message, that is why it was passing.
That should be update to handle both cases. I think just setting a different `TestSubscriber::setTestResult([$warning], StatusCheckEvent::class);` and reloading the page should be ok
Comment #7
phenaproximaComment #8
phenaproximaCrediting you for review.
Comment #9
wim leers🤯 This is such a no-brainer improvement. This explains why I've gotten confused in the past by the assertions in the build tests 😄
But … there's still something that I don't quite get: why we sometimes want only the summary, and not also the non-summarized messages?
Comment #10
phenaproximaAs I understand it:
On the status report, and on the updater form, we want to show everything. Summaries and details. These areas are where the user is most concerned with the details, and could use as much information as possible to fix the problems.
On any other admin page (like /admin/structure and friends), we want only the summaries (or first message, if there is no summary). In such a context, we just want people to know that problems exist, and give people a basic idea of what those problems are. But providing the full details would be clutter.
Not seeing any other actionable feedback here, so this is back to needing review...
Comment #11
wim leersBut how do we expect people to act on problems surfaced in the status report if they literally cannot see the details? 😅
Comment #12
phenaproximaThey can see the details on the status report...? (By "status report", by the way, I'm referring specifically to /admin/reports/status.)
Comment #13
wim leersThat's not what I'm seeing in
StatusCheckTest— see https://git.drupalcode.org/project/automatic_updates/-/merge_requests/68....I verified locally by doing
immediately after that.
What am I missing? 🙈
Comment #14
phenaproximaIf I'm understanding correctly, you're missing the fact that the result you're looking at only has one message. In which case, that's the only thing that gets displayed.
If I add the following code to the end of ComposerExecutableValidator:
I get this on the status report:
Which is exactly what I would expect to see.
Comment #15
wim leersOMG — I must've missed that then in my detailed test 🙈 Sorry for the distraction!
Comment #17
tedbow