Fix composer open#152
Merged
tbouron merged 2 commits intoapache:masterfrom Dec 12, 2019
Merged
Conversation
previously if there was a name set on the app and one set in the ui (and if there was a name set on the app the ui always inferred one!), or any other duplicated keys etc, the yaml generated would duplicate the key and thus fail to load. now the code tries to dedupe those fields. it prefers the supplied yaml, in case there are comments etc, and is smart about where/what it updates. if errors are detected, the original yaml is preserved and any new fields prepended, with a warning, and yaml text editor mode is targeted in the composer. this helps with the case where the template deliberately contains comments or errors to be addressed.
eg if yaml mode is requested, or the yaml has errors and can't be parsed, then the user switches to yaml mode
tbouron
approved these changes
Dec 12, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In a lot of edge cases, the "Open in Composer" button from quick launch generated errors.
This fixes many of the errors, and in cases where there are errors the composer responds sensibly (logging warning, and if yaml mode requested, preserving the input yaml).