Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
#2483433: Optimize CacheableMetadata::merge() + BubbleableMetadata::merge() landed. But several significant loose ends were left here, resulting in both dead and inconsistent code:
- Dead code:
RendererInterface::mergeAttachments()
was removed, butRenderer::mergeAttachments()
was kept, despite having zero calls remaining. - Inconsistent code:
BubbleableMetadata::merge()
now usesstatic::mergeAttachments()
, butBubbleableMetadata::addAttachments()
still callsRenderer::mergeAttachments()
, despite the interface no longer guaranteeing the presence of that method.
Comment | File | Size | Author |
---|---|---|---|
#23 | follow_up_for_2483433-2505171-23.patch | 914 bytes | neclimdul |
#10 | 2505171-10.patch | 5.97 KB | Wim Leers |
Comments
Comment #1
Wim LeersComment #3
Wim LeersComment #4
damiankloip CreditAttribution: damiankloip commentedI think this is over stating things slightly.
Looks like the reroll left that in, oops. The addAttachments method has zero test coverage, I think?
Comment #5
Wim Leers#4: I see how it can be read that way. I just meant to say that those things are significant enough to actually fix in a follow-up, i.e. they're not just typos that we could just leave there. Sorry for the poor wording :(
Yep, which is probably why this was missed. And for clarity: that's definitely a bigger problem than these loose ends.
Comment #6
damiankloip CreditAttribution: damiankloip commentedSure, np. So... do you think we should add some coverage here? or just do this and have another issue for comprehensive coverage? Either way, we might need another issue to make sure BubbleableMetadata is covered?
Comment #7
Wim LeersUpdated test coverage.
IMO we should make
\Drupal\Core\Render\BubbleableMetadata::mergeAttachments()
protected, but that can happen in a follow-up.Comment #8
yched CreditAttribution: yched commented+1
Comment #9
damiankloip CreditAttribution: damiankloip commentedAlso covers setAttachments indirectly too.
Great docs.
Why do we need this? The same object will be used anyway here?
Comment #10
Wim Leers#9.3: we don't need it, but it's to make it clear that we are given an initial object, and then modify it. So I first assign it to a variable and then modify it. That's all :) If you're not convinced, happy to change it. But do you then have a suggestion for a better variable name?
Comment #11
damiankloip CreditAttribution: damiankloip commentedSelf documenting :) Fair enough.
I think this looks good in that case.
Comment #13
Wim LeersTestbotfail.
cURL error 28: See http://curl.haxx.se/libcurl/c/libcurl-errors.html
→
Comment #16
Wim LeersNow we have 2 failures. WTF is this? Testbotfail or not? IDK.
Comment #20
Wim LeersCame back green again, back to RTBC.
(Everything after #11 is due to testbot flakiness… :()
Comment #21
catchCommitted/pushed to 8.0.x, thanks!
Comment #23
neclimdulCommand line phpunit runner is failing:
Comment #24
catchThat's annoying that run-tests.sh and the web runner show what should be phpunit fails as passes - do we have an open issue for this?
RTBC pending the bot. Also critical.
Comment #25
neclimdulI've personally not seen failures like this. Generally these failures are because testbot is running phpunit tests as their own process instead of as a bulk run. This is the first failure like this I've seen.
Comment #26
catchCommitted/pushed to 8.0.x, thanks!
Comment #27
catchBack to normal. If this hadn't been patched 5 minutes after the commit I'd have reverted normally.
Comment #29
Wim LeersI've seen this problem many times before. The discrepancies between test runners is quite annoying.