Closed (fixed)
Project:
Drupal core
Version:
11.x-dev
Component:
phpunit
Priority:
Normal
Category:
Plan
Assigned:
Unassigned
Reporter:
Created:
31 Oct 2023 at 05:16 UTC
Updated:
8 Sep 2024 at 10:19 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #4
mstrelan commentedUpdated IS to mention the reason for two merge requests. This is ready for review.
Comment #5
smustgrave commentedThink it needs a rebase, showing 1000+ file changes and says to be unmergable
Comment #6
mstrelan commentedLet's just review MR !5215 for now. There are indeed over 1000 files changed in the other one.
Comment #7
mstrelan commentedComment #9
dwwOpened 6 MR threads, 3 of which are trivial suggestions, 1 FYI that can be ignored, and 2 places we probably need to continue the
sprintf()conversion. Everything else looks great! 😅Thanks
-Derek
Comment #10
mstrelan commentedThanks for the review, have fixed up those issues.
Comment #11
dww🏓 😂
Comment #12
dwwFYI, after checking out the MR branch locally, here's some grep output of remaining instances of
FormattableMarkupin any Kernel test code. Some of these are legit. Some might want to be fixed as part of this issue?p.s. Crediting @mstrelan for the work, and myself for reviews.
Comment #13
mstrelan commentedFixed issues in #11. I don't think we should do #12 here, the scope is large enough already, unless you feel strongly about any of them.
Comment #14
smustgrave commentedSeems threads have been resolved.
Will agree with #13 about expanding the scope so follow up? If not please move back to NW.
Comment #15
mstrelan commentedI've removed most of the sprintf calls in favour of string interpolation. In cases where the placeholders use expressions I've mostly stuck with sprintf, and in cases where interpolation leads to awkward escaping of slashes or quotes I've replaced with concatenation.
Comment #16
dwwcc969fb3 looks much better, thanks!
However, I found a few nits and one assertion where you changed the values being compared and lost test coverage, so back to NW.
Sadly, I ran out of steam at
core/tests/Drupal/KernelTests/Core/Entity/ContentEntityCloneTest.php. But I think we're really close, now!Thanks again,
-Derek
Comment #17
dwwp.s. Sorry, forgot to explicitly say: absolutely in favor of not expanding the scope any more than necessary in here! 😅 This is already almost too big to read. #12 can be fodder for followups, for sure, we don't need to do that here.
Comment #18
mstrelan commentedComment #19
smustgrave commentedOh wow the MR has gotten much larger then a day ago haha
Comment #20
dwwThanks for all the work in here, @mstrelan! It's entirely possible I've missed something, but I've probably spent over 3 hours trying to carefully review this monster. 😅 I spot nothing else to complain about. The only open threads are:
Neither need to be "solved" before this is committed. Testbot is still happy. GitLab claims it needs a rebase, but I just checked and the latest 5215.diff is applying cleanly to a freshly pulled 11.x core checkout (at commit 54862ffc).
Moving to RTBC to get this in front of the committers.
Thanks again!
-Derek
Comment #21
xjmNice work on this so far.
I got partway through and started thinking that maybe that comment test should get its own separate issue. Then I looked at the diffstat:
109 files, +630, −683That's a 1313 LOC change set -- way too large. In general, we should not exceed a total of 400 added and removed lines in order to make our reviews effective, unless the issue is a purely scannable 1:1 replacement that doesn't require thinking about the context. (See Derek's comments above that demonstrate the impact of having an MR that's too large.)
We should split this up into a few smaller scopes of similar change types. It should be straightforward, if a little fiddly, with
git add -p, checking out specific files from the bulk branch, or other similar gitifying. So, I'm converting this to a meta.FormattableMarkup, which should mostly be converted straight to double-quoted strings for readabillity (mostly notsprintf()). So one or more issues where we're just stripping theFormattableMarkup.FormattableMarkupcalls (like the comment tests). The comment test might merit its own dedicated issue to refactor and simplify the test.FormattableMarkupis removed.Comment #22
dwwYes, splitting this is the only way to get it done. 😅 I checked with @mstrelan and agreed I'd help by opening the newly scoped issues, and he'd continue with the git shenanigans for now. I tried to match the proposal in #21 pretty closely:
I'm hoping that by the time we handle all the "easy" conversions in 2 separate issues, that the "everything else" MR won't be that bad. 🙏 If we have to split up #3402294 even further, so be it. 😬
I put this in the remaining tasks, too. Moving to review to make sure the plan sounds okay before we proceed too much further.
Thanks!
-Derek
Comment #23
dwwAdding #3402297: Fix strict type errors in CommentFieldAccessTest since yeah, that 1 test is nearly 150 lines of diff...
Comment #24
mstrelan commentedComment #25
mstrelan commentedComment #26
mstrelan commentedComment #27
dwwAdded #3405364: Update docs to stop recommending FormattableMarkup as another child.
Comment #28
dwwComment #31
mstrelan commentedOpened a mega MR of all related issues to see what's left to fix.
Comment #32
quietone commentedAfter reviewing #3402707: Fix strict type errors in AssertContentTrait, should we have a follow up to convert remaining incorrect usages of FormattableMarkup in Kernel tests?
Comment #33
mstrelan commentedAll child issues are done, I think we can close this unless there is anything I missed.