-
Notifications
You must be signed in to change notification settings - Fork 897
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
Save newly created dialog_id in options #14254
Conversation
@miq-bot add_label providers/ansible_tower |
@syncrou please review |
Checked commit bzwei@192045c with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
Dialog::AnsiblePlaybookServiceDialog.create_dialog(dialog_name, job_template) | ||
new_dialog = Dialog::AnsiblePlaybookServiceDialog.create_dialog(dialog_name, job_template) | ||
enhanced_config[action][:dialog] = new_dialog | ||
service_template.options[:config_info][action][:dialog_id] = new_dialog.id | ||
end |
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.
Does it make sense to extract the logic from Line 47 - 49 into a separate method? I think it may make what is happening in the transaction
easier to read.
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.
@syncrou I have given it a lot of thoughts but still prefer the way as is. Line 48 and 49 use the result from Line 47. They are two very different hashes. If we pass them into a method as arguments and modify the hash content, it will be even harder to read or realize the hash content has been modified after the method call.
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.
@bzwei - Makes sense. I was picturing a single method name detailing actions required for creating the dialog - I can get behind the code where it is at after reading your response.
👍 Looks good to me.
https://www.pivotaltracker.com/story/show/140972071
The dialog_id allows the UI to show the newly created dialog in the list of existing ones.