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

Preserve comments in DrupalVM config when adding multisites. #3629

Merged
merged 4 commits into from
May 16, 2019

Conversation

danepowell
Copy link
Contributor

@danepowell danepowell commented May 7, 2019

Workaround for lack of comment support in Symfony YAML parser: symfony/symfony#22516

This isn't tied to a particular ticket, just something that bothered me when refactoring the multisite command previously.

To test, run blt multisite on a BLT project using DrupalVM, and opt to let it update your DrupalVM configuration. You should see that most (not all) of the comments in box/config.yml are preserved.

Copy link
Contributor

@alexxed alexxed left a comment

Choose a reason for hiding this comment

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

Any way this can have a meaningful test? You rely on an external package to edit a very specific, but important user yaml file. If that package is upgraded and breaks it we won't know without tests.

@danepowell
Copy link
Contributor Author

We can't test DrupalVM in TravisCI or Pipelines. The best we could do is to write a unit test with a mock DrupalVM config file to make sure consolidation/comments rewrites it as expected. Of course, at that point we've basically just duplicated consolidation/comments's own tests: https://github.com/consolidation/comments/blob/master/tests/TestYamlComments.php

Seems like that would have negligible value.

@alexxed
Copy link
Contributor

alexxed commented May 14, 2019

Right, I was thinking of a test that edits a regular drupalvm yml file with comments and checks that it does not break it, e.g. only what was changed is changed.

@danepowell danepowell added the Enhancement A feature or feature request label May 14, 2019
@danepowell danepowell requested a review from alexxed May 15, 2019 00:36
Copy link

@adrianthedev adrianthedev left a comment

Choose a reason for hiding this comment

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

Looks good!

@danepowell danepowell merged commit e61b4c8 into acquia:10.x May 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement A feature or feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants