Skip to content
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

Merged
merged 2 commits into from
Feb 7, 2018

Conversation

paulslaby
Copy link
Contributor

@paulslaby paulslaby commented Jan 16, 2018

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

@paulslaby
Copy link
Contributor Author

@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 paulslaby changed the title Union edit service_dialog API call with other calls WIP: Union edit service_dialog API call with other calls Jan 16, 2018
@paulslaby paulslaby changed the title WIP: Union edit service_dialog API call with other calls [WIP] Union edit service_dialog API call with other calls Jan 16, 2018
@miq-bot miq-bot added the wip label Jan 16, 2018
@simaishi simaishi requested a review from abellotti January 16, 2018 14:42
@simaishi
Copy link
Contributor

@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']
Copy link
Member

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

Copy link
Contributor Author

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?

Copy link
Member

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

@paulslaby paulslaby force-pushed the master branch 2 times, most recently from 7827127 to 6bb6aa5 Compare January 16, 2018 15:55
@paulslaby paulslaby changed the title [WIP] Union edit service_dialog API call with other calls Union edit service_dialog API call with other calls Jan 18, 2018
@miq-bot miq-bot removed the wip label Jan 18, 2018
@@ -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.")
Copy link
Member

Choose a reason for hiding this comment

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

$api_log.warn

@JPrause
Copy link
Member

JPrause commented Feb 2, 2018

As this PR is for a blocker issue, is this close to being merged?

@abellotti
Copy link
Member

PR causes travis failure, code needs to be updated as noted above calling the log warn method.

@miq-bot
Copy link
Member

miq-bot commented Feb 3, 2018

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
2 files checked, 0 offenses detected
Everything looks fine. 👍

@JPrause
Copy link
Member

JPrause commented Feb 5, 2018

@abellotti looks like it may be ready for merge. Fingers crossed.

Copy link

@jntullo jntullo left a 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.")
Copy link
Member

@abellotti abellotti Feb 6, 2018

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

Copy link

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

Copy link

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.

@jntullo jntullo merged commit f304c85 into ManageIQ:master Feb 7, 2018
simaishi pushed a commit that referenced this pull request Feb 7, 2018
Union edit service_dialog API call with other calls
(cherry picked from commit f304c85)

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1543119
@simaishi
Copy link
Contributor

simaishi commented Feb 7, 2018

Gaprindashvili backport details:

$ git log -1
commit f3a5403842990ce68bbe14a4d9780136096cfe98
Author: Jillian Tullo <jntullo@bu.edu>
Date:   Wed Feb 7 11:09:33 2018 -0500

    Merge pull request #285 from paulslaby/master
    
    Union edit service_dialog API call with other calls
    (cherry picked from commit f304c851f63c2ef18cbe4ade72d4d1452eba4952)
    
    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1543119

@simaishi
Copy link
Contributor

simaishi commented Feb 7, 2018

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

@jntullo
Copy link

jntullo commented Feb 8, 2018

@simaishi I will work on getting that in today

@paulslaby
Copy link
Contributor Author

@jntullo You were quicker than me, thank you very much. And all other involved people too 👍

@JPrause
Copy link
Member

JPrause commented Feb 8, 2018

and thanks for your help as well @paulslaby

@simaishi
Copy link
Contributor

simaishi commented Feb 8, 2018

Backported to Fine via ManageIQ/manageiq#16971

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants