-
Notifications
You must be signed in to change notification settings - Fork 142
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
Add support for YAML anchors and aliases in 'docker-compose.yml' #2367
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. 👍 Regarding the commit message, as it is, the CLI's Changelog file will have a bullet point entry that will ready only:
- Add support for YAML anchors and aliases
And users and support agents may not realise what this actually means to them. Suggestion:
- Add support for YAML anchors and aliases in 'docker-compose.yml'
People know about 'docker-compose.yml' in their projects, so this wording would help them join the dots. :-)
@dfunckt I've built this branch locally and on
|
daca3c0
to
1fe3790
Compare
@ab77 this appears to be related to Node v14 and happens with the master branch as well. |
This allows project files to define services from generic fragments by leveraging YAML's anchors and aliases. See here for an example: https://github.com/compose-spec/compose-spec/blob/43f6537b2c8f01b6d3f0e184d13a0f3cb93d38d7/spec.md#fragments Removing the FAILSAFE_SCHEMA flag is not expected to break existing project files, since the default behaviour is more liberal, or cause problems down the road given we perform validation immediately after. Docs for the flag: https://github.com/nodeca/js-yaml#load-string---options- Change-type: minor
1fe3790
to
8e712ac
Compare
@ab77, thanks for testing it! 👍
|
I think this is a good opportunity to bump |
Yep, confirmed it works with node v12. |
@balena-ci retest |
Approval reviews not allowed in Draft PRs
Just have to wait for the multibuild bump to avoid having two compose-parse versions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh wait, can we really claim to have added support for anchors and aliases in 'docker-compose.yml' while the balenaCloud builder still uses and older version of resin-compose-parse
, and therefore presumably balena push
won't have support for anchors and aliases ?
We could change the commit message to restrict this to
Or we could wait for balena-io/balena-builder/pull/904 to be deployed to production and then merge this PR with the current commit message. This second option would be a "clearer message" to end users, but could mean delaying release of this feature for |
Ah, no, support for anchors and aliases is not related to the bump in
|
The builder does not specify FAILSAFE_SCHEMA when it loads the composition so it always has supported fragments. It follows that Local push however, as well as build/deploy, locally load the composition and did not support fragments because of the FAILSAFE_SCHEMA flag. After this PR we'll have consistent support for YAML features across the CLI and builder. |
The latter hasn't been merged yet, and this PR is non-draft, so I have to careful with approving it... The commit that "adds support for anchors and aliases in 'docker-compose.yml'" is fine, including But the second commit that bumps
I gather that the Some of these may depend on multibuild. @dfunckt, how about moving the second commit ( |
004e45d
to
8e712ac
Compare
This allows project files to define services from generic fragments by leveraging YAML's anchors and aliases. See here for an example: https://github.com/compose-spec/compose-spec/blob/43f6537b2c8f01b6d3f0e184d13a0f3cb93d38d7/spec.md#fragments
Removing the FAILSAFE_SCHEMA flag is not expected to break existing project files, since the default behaviour is more liberal, or cause problems down the road given we perform validation immediately after. Docs for the flag: https://github.com/nodeca/js-yaml#load-string---options-
Change-type: minor