Problem/Motivation
hook_update_requirements() and hook_runtime_requirements() are now available.
Let's convert the core ones that only interact with update or runtime.
Runtime phase only
- image
- jsonapi
- locale
- mysql
- navigation
- node
- search
- update_test_schema
- update
- user
- demo_umami
Update phase only
- update_script_test
Steps to reproduce
N/A
Proposed resolution
Convert them to OOP equivalents
Remaining tasks
Fix migrate failures
User interface changes
N/A
Introduced terminology
N/A
API changes
N/A
Data model changes
N/A
Release notes snippet
N/A
| Comment | File | Size | Author |
|---|---|---|---|
| #34 | 3500632-nr-bot.txt | 91 bytes | needs-review-queue-bot |
| #30 | 3500632-nr-bot.txt | 91 bytes | needs-review-queue-bot |
Issue fork drupal-3500632
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 #2
nicxvan commentedI'm working on this.
Comment #3
nicxvan commentedComment #5
nicxvan commentedMigrate tests are failing due to update I think.
Comment #6
nicxvan commentedComment #7
nicxvan commentedWe need the constants!
Comment #8
nicxvan commentedFound a way forward from @berdir with modulehandler loadInclude.
Comment #9
nicxvan commentedI am getting navigation performance test failures in this, I'm fairly sure this is unrelated:
Comment #10
nicxvan commentedComment #11
nicxvan commentedPerformance test was fixed in #3500489: Performance tests should uninstall automated_cron
Comment #12
dwwStarted reviewing by responding to (and resolving) the open threads. Haven't yet otherwise really reviewed the MR changes, although an initial glance looks good. Hope to review this in more depth on Tuesday.
Comment #13
smustgrave commentedSo from what I can tell it's majority moving things around and adding dependency injection and string translation stuff (nice!).
I did have 2 questions on the MR that @dww addressed.
Don't see anything wrong here. +1 for RTBC but will refers to @dww review in #12
Comment #14
berdirI agree that this looks good based on earlier reviews I did.
My only uncertainty is in which order we want to proceed. We already completely break BC on modules *calling* requirements hooks. This is somewhat rare but it happens, I of course have a module that does that (https://www.drupal.org/project/monitoring, see also https://git.drupalcode.org/search?group_id=2&scope=blobs&search=%22modul..., without moduleHandler it finds a lot more, but I assume that's all D7 code).
That's OK I think, this isn't meant to be an API, and I do plan to update monitoring.
But as I mentioned in #2909472: Add value objects to represent the return of hook_requirements, the new hooks gives us a chance to considerably simplify the BC layer that the new value object for requirements definitions needs to support. we could say that the new hooks must return value objects. The it might make sense to do the other issue issue first. But that isn't close yet and there are more BC things to consider (for example usage of #type status_report, which is also used in a few projects, including again one of mine: https://git.drupalcode.org/search?group_id=2&scope=blobs&search=%22%27%2...).
Long story short, it's probably OK to get this in now and first. Might want to think again about it before we do system module though.
Comment #15
dwwNearly RTBC. I just opened a ton of threads, the majority of which are pedantic nits, an out of scope question about a possible followup, and some suggestions that might not be in scope or viable. 😅 Only a couple of points of real substance, but all trivial / easy fixes.
Thanks!
-Derek
p.s. Initial saving of credits - so far everyone contributed meaningfully.
Comment #16
nicxvan commentedI applied everything and responded to the other questions.
I'll keep an eye on tests.
Comment #17
dwwDon't love the
loadInclude()hack, but as a transitional solution, I suppose it's fine if we improve the comments about it.Almost there!
Thanks,
-Derek
Comment #18
nicxvan commentedYeah it's a weird edge case, once the constant move is complete we'll have a better solution.
Comment #19
dwwThanks for fixing that up. I see nothing else to improve. Pipeline is green. Code is clean and good. Mostly just moving things around, with a few slight improvements (direct links to evergreen docs, better comments). Title and summary are clear. No need for a CR or release note. RTBC!
Comment #20
dwwOh yeah, tagging as a 11.2 priority.
Comment #21
oily commented@dww I agree with #19 having reviewed the code. But i have added one recommendation to the MR.
Comment #22
dwwOpened the follow-up: #3502070: [PP-1] Improve wording of Navigation requirements regarding Toolbar. @oily: Please continue the discussion there.
Thanks!
-Derek
Comment #23
oily commentedThank you @dww for doing the follow-up.
Comment #25
catchphpcs failed after a rebase.
Comment #26
nicxvan commentedPHPCS fixed
Comment #27
smustgrave commentedRebase seems fine.
Comment #28
alexpottConflicts with HEAD
Comment #29
nicxvan commentedRebased, only conflict was with the helper function for update.install from this issue: #3502973: Remove UI and routes for the ability to update modules and themes via update.module and authorize.php I copied the code for that function again to ensure the update was correct since this is a conversion issue.
Comment #30
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #33
nicxvan commentedRebased and pulled in node and update requirements changes.
Comment #34
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #35
nicxvan commentedComment #36
dwwI have not completely re-reviewed the entire MR changes tab. But I reviewed the individual commits since the last time I did so and everything seems in order. The pipeline is green again. Back to RTBC.
p.s. Noticed while re-reviewing, but we really need to fix #3122231: Singular variant for plural string must contain @count and formalize that.
core/modules/node/src/Hook/NodeRequirements.phpgets this wrong, but so does the original code innode.install.Comment #37
dwwSorry to do this, but back to NR based on a new MR thread. I'm probably just confused, but I don't understand some stuff, so I want to retract my RTBC until I'm clear.
Comment #38
berdirI replied, setting back to RTBC after answering that question.
Comment #39
larowlanLeft one suggestion on the MR
Reviewed each new hook class against the .install file in HEAD and it all looks good to me.
Leaving it at RTBC, please let me know if you're happy with the suggestion on the MR.
Comment #40
nicxvan commentedApplied! Thanks
Comment #42
larowlanCommitted to 11.x - thanks!