Problem/Motivation
The advisory_feed_test module extends and decorates the guzzle client to rewrite the request url during testing. This is a problem though because the guzzle client is marked @final so could break including possibly and actually fatal error if future versions are really final.
PHPStan correctly marks this as a problem so its in our baseline for level 0 fixes.
Steps to reproduce
This is an interaction with an annotation so it isn't causing errors but it does fix an entry in the phpstan baseline.
Proposed resolution
Replace the extended class with Middleware that can accomplish the same result.
| Comment | File | Size | Author |
|---|---|---|---|
| #18 | 3264167-18.patch | 8.64 KB | spokje |
| #18 | interdiff.15-18.txt | 878 bytes | spokje |
Comments
Comment #2
neclimdulThis achieved the same result locally and fixed the reported error.
Comment #4
neclimdulThis doesn't really make sense, sounds like a random failure. Re-queueing.
Comment #6
neclimdullots of random failures... yikes the bot was not happy last night.
Comment #7
longwaveNice fix, Guzzle middleware is the more correct way of intercepting and modifying outbound HTTP calls, so +1 from me.
Comment #8
longwaveActually, two minor nits:
Missing class docblock.
Missing method docblock.
Comment #9
heykarthikwithuComment #10
heykarthikwithuAdded missing docblock's
Comment #11
spokjePostponing on (at least) removing some
halghost, to prevent PHPStan to block the patch here: #3266535: Remove remaining references to the hal module from core/phpstan-baseline.neon.Comment #12
spokje#3266535: Remove remaining references to the hal module from core/phpstan-baseline.neon was committed already (on the phone with the Guinness Book of World Records as we speak to confirm record speed), unpostponing and restarting a new test on the latest patch.
Any "Custom Commands Failed" that will return are now directly related to that patch
Comment #13
spokjeComment #14
neclimdultouch up the docs just a tiny bit and adding though full stops. Thanks
Comment #15
spokjeComment #16
longwaveWhy do we call
->withUri()twice? Would these two lines work better as justand then fall through to the default return?
Comment #17
longwaveComment #18
spokjeI've only rerolled this one without have a decent look at it (Yep, I'll never learn...), but the above makes sense to me.
Comment #19
smustgrave commentedRan against 10.1 tests and no issue. Seems like a good test refactor.
Comment #21
smustgrave commentedSeems to be an unrelated failure.
Comment #22
rohan-sinha commentedTested the Patch #18 on D10, specifically 10.1x , worked well , no issue addressed.
Comment #25
longwaveCommitted and pushed cc21877471 to 10.1.x and fab2a8350a to 10.0.x. Thanks!
Comment #26
longwave