Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[YamlSourceManipulator] Tweak regex pattern for regex key #910

Merged

Conversation

lubo13
Copy link

@lubo13 lubo13 commented Jun 27, 2021

We need to tweak a regex pattern, because at the moment if you try to update yaml with following config:

services:
  _defaults:
    autowire: true
    autoconfigure: true
    bind:
      $tracer: 'something'

You will receive:
Screenshot from 2021-06-27 17-02-02

@lubo13 lubo13 changed the title Tweak regex pattern [YamlSourceManipulator] Tweak regex pattern for regex key Jun 27, 2021
Copy link
Member

@weaverryan weaverryan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! This is awesome! Could you also add a test case? These are fairly simply - there is a directory of test cases - https://github.com/symfony/maker-bundle/tree/main/tests/Util/yaml_fixtures - if you created a new file here, it would run :)

Thanks!

autowire: true
autoconfigure: true
bind:
$httpClient: '@http.client'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indentation is slightly off here, which is making the test fail (it's making the expected not match)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I miss this thank you

arguments:
- argument_1: 'something'
argument_2: 'something'
argument_3: 'something'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more thing. The bug you're fixing is related to the $httpClient above. Unfortunately, this array syntax down here (while totally legal) is, I think, not yet supported by YamlSourceManipulator. And so, the test is STILL failing. I'd recommend updating this test to not use this syntax - instead use:

  app.service:
    class: App\Services\Service
    arguments:
        argument_1: 'something'
        argument_2: 'something'
        argument_3: 'something'

If you're interested, you could open a separate PR with a failing test case for this array syntax :)

Copy link
Author

@lubo13 lubo13 Jul 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I see Thank you, I just tried somethings and changed it how you propose

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@weaverryan Can you take a look again, please

Thank you

@lubo13 lubo13 force-pushed the bugfix/yaml-source-manipulator-key-regex branch from f6e8a43 to da120f1 Compare July 2, 2021 18:52
@jrushlow
Copy link
Collaborator

@lubo13 Could you rebase this PR against the main branch. Thank you in advance!

@lubo13
Copy link
Author

lubo13 commented Sep 13, 2021

@jrushlow can you check now, please. 10x in advance

@lubo13 lubo13 closed this Sep 13, 2021
@lubo13 lubo13 reopened this Sep 13, 2021
@lubo13 lubo13 force-pushed the bugfix/yaml-source-manipulator-key-regex branch from e854ce9 to 055abf9 Compare September 13, 2021 19:59
@jrushlow jrushlow force-pushed the bugfix/yaml-source-manipulator-key-regex branch from 055abf9 to 4f54c56 Compare February 23, 2022 17:25
Copy link
Collaborator

@jrushlow jrushlow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @lubo13 for the contribution!

@jrushlow jrushlow added the Status: Reviewed Has been reviewed by a maintainer label Feb 23, 2022
@jrushlow jrushlow force-pushed the bugfix/yaml-source-manipulator-key-regex branch from 6d16253 to 85ce7c5 Compare February 23, 2022 20:51
@jrushlow jrushlow merged commit 9931208 into symfony:main Feb 23, 2022
@jrushlow jrushlow mentioned this pull request Feb 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Reviewed Has been reviewed by a maintainer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants