The Needs Review Queue Bot β tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.
Consult the Drupal Contributor Guide β to find step-by-step guides for working with issues.
- π¬π§United Kingdom longwave UK
Following π Support IteratorArgument in \Drupal\Component\DependencyInjection\Dumper\OptimizedPhpArrayDumper::dumpValue RTBC if we implemented this then we could also use
!tagged_iterator
and friends from Symfony. if we implemented this then we could also use !tagged_iterator and friends from Symfony.
Along this those lines, we could also use
!service_closure
to define services following this: [#3360604]. Though I have found that autowiring closures (using annotations) solves that since the arguments don't even need to be defined in YAML.- π¦πΊAustralia kim.pepper πββοΈπ¦πΊSydney, Australia
kim.pepper β made their first commit to this issueβs fork.
- Merge request !6133Issue #3108309: Support Yaml::PARSE_CUSTOM_TAGS β (Closed) created by kim.pepper
- Status changed to Needs review
11 months ago 3:00am 12 January 2024 - π¦πΊAustralia kim.pepper πββοΈπ¦πΊSydney, Australia
Created a MR from the patch in #8
- π¦πΊAustralia kim.pepper πββοΈπ¦πΊSydney, Australia
kim.pepper β changed the visibility of the branch 3108309-support-yamlparsecustomtags-in to hidden.
- Status changed to Needs work
11 months ago 8:27am 12 January 2024 - π¬π§United Kingdom longwave UK
Given we added constant parsing as well, can we add a test for that too?
What do we need to add to the PECL parser to support this?
- π¬π§United Kingdom longwave UK
Also, is there any additional overhead in adding this parsing? Is there a case where we might not want this flag to be enabled?
- π¬π§United Kingdom alexpott πͺπΊπ
@longwave I don't really think there is much overhead - given we would already be parsing the tag in Symfony and throwing an error. The question is really can we duplicate this functionality in PECL. And the problem is we cannot. Looking at the underlying PECL code (https://github.com/php/pecl-file_formats-yaml/blob/php7/parse.c#L641) there is no way to subscribe a callback to all tags. We would need to file an issue and get it into PECL yaml ... not fun. Maybe we could make it make it really simple to register new tags to a PECL yaml callback that produces TaggedValue objects.
- π¬π§United Kingdom longwave UK
@alexpott should we just force the Symfony parser in the DI YamlFileLoader, as that's currently the only place (I think) that we need this?
- π¬π§United Kingdom longwave UK
Further to #24 we already have π Allow parsing and writing PHP constants and enums in YAML files Needs work to enable PARSE_CONSTANT which also works on PECL and has tests, so let's only work on custom tags here.
- π¬π§United Kingdom alexpott πͺπΊπ
Re #27 I was tempted to suggest that. I was reticent because service.yml files are one of the thing parsed on cold cache. But the more I think about it the more I think that this is a good approach for now. The capabilities of the YAML parser and container configuration are quite closely related so this does not feel like a bad decision - also we use FileCache here so potentially this has no impact on cold cache as that can persist across a cache rebuild.
- Status changed to Needs review
11 months ago 5:12am 15 January 2024 - π¦πΊAustralia kim.pepper πββοΈπ¦πΊSydney, Australia
Created π Always use YamlSymfony for loading service yaml files Needs review
- Status changed to Needs work
11 months ago 9:32am 15 January 2024 - Status changed to Needs review
11 months ago 9:54pm 15 January 2024 - Status changed to RTBC
11 months ago 1:36pm 16 January 2024 - π¬π§United Kingdom longwave UK
Does what it says, has test coverage. Not even sure we should bother with catching the exception in the test, just let it fail if the exception is thrown, but the code is already written so let's leave it as-is.
- π¬π§United Kingdom alexpott πͺπΊπ
I don't think we should do this until we've removed support for PECL yaml in π Drop PECL YAML library support in favor of only Symfony YAML Fixed - this intentionally makes the pecl and symfony parsers different and I don't think we should do that.
- Status changed to Postponed
11 months ago 1:43pm 16 January 2024 - Status changed to Active
10 months ago 6:01pm 3 March 2024 - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
π Drop PECL YAML library support in favor of only Symfony YAML Fixed landed!
- First commit to issue fork.
- Status changed to Needs review
10 months ago 6:07pm 3 March 2024 - Status changed to RTBC
10 months ago 8:27pm 3 March 2024 - π¬π§United Kingdom longwave UK
This is just adding the flag and some tests, looks good to me.
- π¬π§United Kingdom alexpott πͺπΊπ
Committed and pushed a91f4f4e5b to 11.x and c6a3077802 to 10.3.x. Thanks!
-
alexpott β
committed c6a30778 on 10.3.x
Issue #3108309 by kim.pepper, bonrita, alexpott, andypost, longwave:...
-
alexpott β
committed c6a30778 on 10.3.x
- Status changed to Fixed
10 months ago 11:42am 4 March 2024 -
alexpott β
committed a91f4f4e on 11.x
Issue #3108309 by kim.pepper, bonrita, alexpott, andypost, longwave:...
-
alexpott β
committed a91f4f4e on 11.x
- Status changed to Needs work
10 months ago 9:47pm 4 March 2024 - π¦πΊAustralia kim.pepper πββοΈπ¦πΊSydney, Australia
Unfortunately, this commit came after π Drop PECL YAML library support in favor of only Symfony YAML Fixed which means we added the flag to the deprecated
\Drupal\Component\Serialization\YamlSymfony::decode()
method.We need to make the change to
\Drupal\Component\Serialization\Yaml::decode()
now.π Add support for tagged_iterator to YamlFileLoader Active is doing that already, so I don't know if we need a separate dedicated issue to do that.
- π¬π§United Kingdom alexpott πͺπΊπ
@kim.pepper whoops nice spot and yeah sure let's do it in that issue.
- Status changed to Fixed
10 months ago 10:36am 5 March 2024 - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Looks like @kim.pepper did that as of ~14 hours ago: https://git.drupalcode.org/project/drupal/-/merge_requests/6134/diffs?co...
Automatically closed - issue fixed for 2 weeks with no activity.
- π¦πΊAustralia kim.pepper πββοΈπ¦πΊSydney, Australia
Added a new child issue π Add support for !service_closure custom tag in YamlFileLoader Fixed