-
Notifications
You must be signed in to change notification settings - Fork 141
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
Union edit service_dialog API call with other calls #285
Conversation
@simaishi I cannot add labels. So please do it yourself. Only bot can do it according to the PR name, and i do not think it is a nice way to do it. |
@paulslaby Added the labels. Once this PR is merged, I'll backport to Gaprindashvili and Fine branches. |
service_dialog.update_tabs(data['content']['dialog_tabs']) if data['content'] | ||
service_dialog.update!(data.except('content')) | ||
service_dialog.update!(data.except('dialog_tabs', 'content')) | ||
service_dialog.update_tabs(data['dialog_tabs'] || data['content']['dialog_tabs']) if data['dialog_tabs'] || data['content'] |
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.
What if both are specified, what is the expectation.
specs needed to test both signatures.
/cc @jntullo
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.
If both are specified, the one without 'content' takes precendence.
Maybe warning about it?
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.
I think we should log a warning, maybe mentioning something like "Both 'dialog_tabs' and 'content' : 'dialog_tabs' were specified. 'content' : 'dialog_tabs' will be ignored."
7827127
to
6bb6aa5
Compare
@@ -30,8 +30,9 @@ def create_resource(_type, _id, data) | |||
def edit_resource(type, id, data) | |||
service_dialog = resource_search(id, type, Dialog) | |||
begin | |||
service_dialog.update_tabs(data['content']['dialog_tabs']) if data['content'] | |||
service_dialog.update!(data.except('content')) | |||
api_log_warn("Both 'dialog_tabs':[...] and 'content':{'dialog_tabs':[...]} were specified. 'content':{'dialog_tabs':[...]} will be ignored.") |
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.
$api_log.warn
As this PR is for a blocker issue, is this close to being merged? |
PR causes travis failure, code needs to be updated as noted above calling the log warn method. |
Checked commits paulslaby/manageiq-api@906258b~...69ec56b with ruby 2.3.3, rubocop 0.52.0, haml-lint 0.20.0, and yamllint 1.10.0 |
@abellotti looks like it may be ready for merge. Fingers crossed. |
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.
LGTM 👍
@@ -30,8 +30,9 @@ def create_resource(_type, _id, data) | |||
def edit_resource(type, id, data) | |||
service_dialog = resource_search(id, type, Dialog) | |||
begin | |||
service_dialog.update_tabs(data['content']['dialog_tabs']) if data['content'] | |||
service_dialog.update!(data.except('content')) | |||
$api_log.warn("Both 'dialog_tabs':[...] and 'content':{'dialog_tabs':[...]} were specified. 'content':{'dialog_tabs':[...]} will be ignored.") |
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.
aren't we missing if data['dialog_tags'] && data['content']
on that $api_log.warn line ?
/cc @jntullo
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.
It just leaves out the data
part, which I don't think it necessary? It still specifies the 'dialog_tabs'
and 'content'
part
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.
@abellotti oh, I see what you mean. Good catch. Yes @paulslaby, please add in a condition for this line. Then it should be good to go.
Union edit service_dialog API call with other calls (cherry picked from commit f304c85) Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1543119
Gaprindashvili backport details:
|
@paulslaby @jntullo after all, it looks we do need a separate PR for Fine branch. Both files changed in this PR are conflicting on cherry-pick as it depends on other changes not in Fine branch. Can either one of you create a PR for Fine branch? And it's probably easier to include the follow up PR #314 as well. |
@simaishi I will work on getting that in today |
@jntullo You were quicker than me, thank you very much. And all other involved people too 👍 |
and thanks for your help as well @paulslaby |
Backported to Fine via ManageIQ/manageiq#16971 |
This change is communicated with @simaishi at ManageIQ/manageiq#16747.
This change should be backported to fine. Follow the same link as above to find the change.
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1532200