Closed (fixed)
Project:
Drupal core
Version:
8.8.x-dev
Component:
rdf.module
Priority:
Critical
Category:
Task
Assigned:
Reporter:
Created:
24 Oct 2019 at 21:43 UTC
Updated:
20 Feb 2020 at 11:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
andypostThe PR to fix compatibility https://github.com/njh/easyrdf/pull/311
Comment #3
larowlanFirst step is to isolate calls to EasyRdf into a trait then we can chop from a single spot.
Here's a POC and a crack at converting CommentAttributesTest
Still to go:
Comment #4
amjad1233Comment #5
mondrakeComment #6
mondrakeComment #7
mondrakeWould be great to backport to 8.8.x to allow testing on PHP 7.4 without the workarounds @alexpott devised in #3086374-79: Make Drupal 8 & 9 compatible with PHP 7.4
Comment #8
amjad1233@larowlan I am bit confused here.
Should I paste the interdiff to your patch or I should create a whole new patch?
Meanwhile, I have knocked out the easy one for NodeAttributes. I am up to Taxonomy ones.
Comment #9
larowlan@amjad both, which you did 👍
Comment #10
larowlanI don't think we need these changes, we can just keep the local variables in this test.
The class properties already existed in the Comment test, that's why I used them.
Comment #11
amjad1233Cool. I will make that change and upload other ones as well soon. Almost finished with *Entity+Field*Attributes.
Comment #12
amjad1233Hi @larowlan,
Here are the new patches with interdiffs for each individual test. Hopefully, it will make reviewing easy for you.
Need your special attention to FieldRdfaTestBase as I was bit nervous.
Happy Reviewing :-)
Comment #13
larowlanand remove the $debug class property.
what do you think @mondrake @andypost
thinking about it more, I think the ::isBNode call here (which is from my original patch) is wrong, cause that's easyrdf specific knowledge in the test, we need to keep that internal to the trait, probably a ::rdfElementIsBlank method on the trait
because we still have an ::allOfType call here, we've still got a coupling to easyrdf - maybe we make the method ::getElementByRdfTypeCount i.e it returns 2 and does the allOfType call for us, keeping that internal to the trait - thoughts?
similar here, can we hoist the ::type call up into the trait so the test has no knowledge of easyrdf as a method - e.g. ::getElementRdfType?
which we could re-use here too and avoid the ::getRdfGraph calls
After that I think that means the trait will end up with only these four methods
- hasRdfProperty
- getElementByRdfTypeCount
- getElementRdfType
- rdfElementIsBlank
Which means we'll have to reimplement those 4 without easyrdf and we're done - thanks for moving this along @amjad
Comment #14
mondrakeI think this becomes critical as long as easyrdf
Comment #15
mondrake@larowlan re #13.1 I cannot judge, sorry
Comment #16
amjad1233Cool. Still a bit confused about #13.1, but I reckon others should be trivial I am on it.
@larowlan will wait for your decision on #13.1 meanwhile I will tackle the other four methods.
Comment #17
larowlanfor 13.1 basically we remove the debug option and just use hasRdfProperty
Comment #18
amjad1233Here are the patches as per above comment. We will update the CommnetAttributeTest after we make decisions.
Comment #20
larowlanI think this isolates all the easyrdf/easyrdf code into the trait
next step is to implement it without easyrdf
looking at the d7 code, it just uses xpath, so that seems like an approach
Comment #21
larowlanThen after that, we can follow https://www.drupal.org/node/3089540 to remove easyrdf from composer.lock and core/composer.json
Comment #22
larowlanLooking at the original issue where this was introduced, xpath was not sufficient for what we needed, so I guess we simplify and use DomDocument
Comment #23
amjad1233Sounds good. Good work for Blank Node. @larowlan. Just pasting the link we discussed https://en.wikipedia.org/wiki/Blank_node as it was a good reference to get my head around the issue. :-)
Comment #24
larowlanHere's some progress, some passing tests with the new body, but only supported
propertyattribute so farComment #25
amjad1233Adding tag for DrupalSouth 2019
Comment #26
amateescu commentedEdit: commented in the wrong issue :)
Comment #27
larowlanDiscussed with @amjad1233 and @alexpott.
Easyrdf has merged the PR to add PHP 7.4 support, but there is still merit in having all of our usages of easyrdf isolated to a trait.
As a result, we're pivoting this issue back to the patch in #20
Downgrading this to normal.
Comment #29
larowlanCrediting @alexpott for discussions around this
Comment #30
amjad1233@larowlan So should we re-upload the patch in #20 ?
And you reckon this will be backported to 8.9.0?
Thus, we can add some tests against that.
Comment #31
amjad1233Sorry, I don't know how I changed the title and priority.
Comment #32
alexpott@amjad1233 yep to going back to #20 and I agree that as a test only change we can target the 8.x branch too.
Comment #33
alexpottThis change will make the tests slower as we have to rebuild the graph for these two assertions.
I wonder if instead of a trait we could build a lightweight facade to the graph object that does the assertions we need?
Comment #34
larowlanI wonder if instead we should add it to WebAssert and then we don't need the first argument and can then keep a reference to the graph item and only regenerate if the session has changed?
Comment #35
xjmI think this is at least a major task; less dependency coupling would be good.
Comment #36
alexpottI'm withdrawing my review in #33. I don't think that we should hold this up on those concerns. This is only tests and it doesn't matter if we parse a few extra graphs - it's not making a huge difference to test performance.
Here's #27 with coding standards fixes and some docs fixes. As none of these changes is functional I consider this RTBC. I'm also making this change critical as it is blocking some of the simpler solutions for getting to PHP 7.4 compatibility - which is also more important that an couple of extra seconds spent running these tests.
The patch
Without the patch
So whilst the patch does do more parsing there are other things in the tests that cause the time to vary by bigger amounts.
As my changes are purely to documentation and automated coding standards - I think it is okay for me to rtbc
Comment #37
mondrakeComment #38
catchReviewed both the patch and the deceptively large interdiff which is mostly reducing duplicate spaces. +1 to getting this in to unblock PHP 7.4 compatibility and all looks good. I'll commit it to 9.0.x and 8.9.x when it's green, but leave it at for backport against 8.8.x until after the release packaging stuff is all resolved.
Comment #41
catchCommitted 1fa5a19 and pushed to 9.0.x, backported to 8.9.x. Thanks!
Leaving at 'to be ported' for 8.8.x, for after the packaging pipeline is happy again.
Comment #43
catchCherry-picked to 8.8.x since this is now a hard blocker for PHP 7.4 support.