Skip to content

Fix composer open#152

Merged
tbouron merged 2 commits intoapache:masterfrom
ahgittin:fix-composer-open
Dec 12, 2019
Merged

Fix composer open#152
tbouron merged 2 commits intoapache:masterfrom
ahgittin:fix-composer-open

Conversation

@ahgittin
Copy link
Copy Markdown
Contributor

@ahgittin ahgittin commented Dec 6, 2019

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).

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
Copy link
Copy Markdown
Member

@tbouron tbouron left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @ahgittin

@tbouron tbouron merged commit c2443d6 into apache:master Dec 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants