-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Show yaml comments when possible on launch prompt #3359
Merged
softwarefactory-project-zuul
merged 2 commits into
ansible:devel
from
mabashian:yaml-comments
Mar 7, 2019
Merged
Show yaml comments when possible on launch prompt #3359
softwarefactory-project-zuul
merged 2 commits into
ansible:devel
from
mabashian:yaml-comments
Mar 7, 2019
Conversation
This file contains 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
Build failed.
|
Build failed.
|
jlmitch5
approved these changes
Mar 5, 2019
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.
Code looks good
recheck |
Build succeeded.
|
Build succeeded (gate pipeline).
|
This was referenced Aug 19, 2019
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.
SUMMARY
When the JT launch prompt modal was overhauled we added a Preview tab. When we added this tab, we added some logic to aggregate prompted extra vars and survey questions into a single block of
extra vars to give the user an idea of exactly what extra vars will be used during that JT run. In order to achieve this we have to convert the existing extra vars from YAML to JSON. This allows us to merge the two objects easily. When the extra vars are converted though, the comments are stripped out. We could support maintaining the comments but this would require a dependency change that I don't think we're ready to commit to at this point.
This PR ensures that YAML comments are shown to the user during launch when possible.
Scenarios (in all scenarios the JT has comments in extra vars):
This PR also impacts schedules. When the user is adding a new schedule the comments should appear in the codemirror. Once the schedule is saved the api will have stripped out all the comments and stored the extra vars as JSON so they will no longer appear in the UI. This is expected behavior.
ISSUE TYPE
COMPONENT NAME
ADDITIONAL INFORMATION
The local testing that I've done has consisted of setting up all the different permutations of job template configurations and going through the launch process to ensure that a) comments are displayed when expected and b) extra vars are passed to job correctly.
I also went over and took a look at schedules to make sure that those still behaved as expected.
Workflow node prompting is also worth looking at. The rules that apply to jt launch should apply to workflow nodes as well. The variables should be shown when possible and will be wiped out when a survey is present (as well as on save).