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

Add flag for init of defaults in fields #18061

Merged
merged 1 commit into from Oct 15, 2018

Conversation

@d-m-u
Copy link
Contributor

d-m-u commented Oct 4, 2018

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1635673

At this point if a service dialog gets ordered via the API, it will not honor defaults on static fields. To remedy this, this adds a flag to the call to also let us call load_values_into_fields(values, false), thus honoring the default values. This builds on the recent changes to #17844

Related:

ManageIQ/manageiq-api#485

@d-m-u

This comment has been minimized.

Copy link
Contributor Author

d-m-u commented Oct 4, 2018

@eclarizio can you 👀 please?

Copy link
Member

eclarizio left a comment

This option is going to need to be propagated through this, I think. https://github.com/ManageIQ/manageiq/blob/master/app/models/service_template.rb#L426

@d-m-u d-m-u force-pushed the d-m-u:bz1635673 branch from cb2c04f to a2581af Oct 4, 2018
@d-m-u d-m-u changed the title Add flag for init of defaults in fields [WIP] Add flag for init of defaults in fields Oct 4, 2018
@d-m-u d-m-u force-pushed the d-m-u:bz1635673 branch from a2581af to 0d4b2a5 Oct 4, 2018
@miq-bot miq-bot added the wip label Oct 5, 2018
Copy link
Member

eclarizio left a comment

Code changes look fine, the specs should be easy to add for resource_action_workflow since we already have a section where the different options are being enabled. service_template spec might be a bit more involved to add a spec, but I'm sure you can do it 👍

@d-m-u d-m-u force-pushed the d-m-u:bz1635673 branch 4 times, most recently from 148893f to 73e830d Oct 8, 2018
@d-m-u d-m-u changed the title [WIP] Add flag for init of defaults in fields Add flag for init of defaults in fields Oct 8, 2018
@d-m-u

This comment has been minimized.

Copy link
Contributor Author

d-m-u commented Oct 8, 2018

@miq-bot remove_label wip

@miq-bot miq-bot removed the wip label Oct 8, 2018
@d-m-u

This comment has been minimized.

Copy link
Contributor Author

d-m-u commented Oct 9, 2018

Hey @eclarizio can you please review again?

Copy link
Member

eclarizio left a comment

I think this side is good to go. The API side can be merged after this to take advantage of the new logic

👍

@d-m-u

This comment has been minimized.

Copy link
Contributor Author

d-m-u commented Oct 9, 2018

@miq-bot add_reviewer @tinaafitz

@miq-bot miq-bot requested a review from tinaafitz Oct 9, 2018
@JPrause

This comment has been minimized.

Copy link
Member

JPrause commented Oct 9, 2018

@miq-bot add_label blocker

@miq-bot miq-bot added the blocker label Oct 9, 2018
@JPrause

This comment has been minimized.

Copy link
Member

JPrause commented Oct 9, 2018

@d-m-u if this will be able to be backported, please add the gaprindashvili/yes and hammer/yes labels

@d-m-u

This comment has been minimized.

Copy link
Contributor Author

d-m-u commented Oct 9, 2018

@miq-bot add_label bug

@miq-bot miq-bot added the bug label Oct 9, 2018
@d-m-u

This comment has been minimized.

Copy link
Contributor Author

d-m-u commented Oct 9, 2018

@miq-bot add_label gaprindashvili/yes, hammer/yes

@miq-bot

This comment was marked as off-topic.

Copy link
Member

miq-bot commented Oct 9, 2018

@d-m-u Cannot apply the following label because they are not recognized: this_being_a_blocker_is_kinda_funny

@d-m-u

This comment has been minimized.

Copy link
Contributor Author

d-m-u commented Oct 10, 2018

@d-m-u

This comment has been minimized.

Copy link
Contributor Author

d-m-u commented Oct 10, 2018

@bdunne can you please 👀 for me?

@@ -427,7 +427,8 @@ def provision_workflow(user, dialog_options = nil, request_options = {})
:target => self,
:initiator => request_options[:initiator],
:submit_workflow => request_options[:submit_workflow],
:provision_workflow => request_options[:provision_workflow]
:provision_workflow => request_options[:provision_workflow],

This comment has been minimized.

Copy link
@bdunne

bdunne Oct 11, 2018

Member

ra_options = request_options.slice(:initiator, :init_defaults, ...).merge(:target => self)?

@d-m-u d-m-u force-pushed the d-m-u:bz1635673 branch from 73e830d to b7d88d7 Oct 11, 2018
@JPrause

This comment has been minimized.

Copy link
Member

JPrause commented Oct 12, 2018

@d-m-u is this ready for merge, if yes, @gmcculloug can you merge.

@d-m-u

This comment has been minimized.

Copy link
Contributor Author

d-m-u commented Oct 12, 2018

This, and the related ManageIQ/manageiq-api#485 should be both good to go

@@ -980,6 +980,7 @@
:name:
:maindb: ExtManagementSystem
:container_deployment_wizard: false
:run_automate_methods_on_service_catalog_api_submit: false

This comment has been minimized.

Copy link
@gmcculloug

gmcculloug Oct 15, 2018

Member

The only thing I would suggest is dropping the catalog from the name. Technically it is a service_template but I think run_automate_methods_on_service_api_submit is enough.

@d-m-u d-m-u force-pushed the d-m-u:bz1635673 branch from b7d88d7 to 4c4601d Oct 15, 2018
@miq-bot

This comment has been minimized.

Copy link
Member

miq-bot commented Oct 15, 2018

Checked commit d-m-u@4c4601d with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
4 files checked, 0 offenses detected
Everything looks fine. 🍪

@gmcculloug gmcculloug merged commit 2ab08ae into ManageIQ:master Oct 15, 2018
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
simaishi added a commit that referenced this pull request Oct 15, 2018
Add flag for init of defaults in fields

(cherry picked from commit 2ab08ae)

https://bugzilla.redhat.com/show_bug.cgi?id=1635673
@simaishi

This comment has been minimized.

Copy link
Contributor

simaishi commented Oct 15, 2018

Hammer backport details:

$ git log -1
commit 4b30495e2085c2e8d721d22bd5d87ed592a6662d
Author: Greg McCullough <gmccullo@redhat.com>
Date:   Mon Oct 15 09:39:38 2018 -0400

    Merge pull request #18061 from d-m-u/bz1635673
    
    Add flag for init of defaults in fields
    
    (cherry picked from commit 2ab08ae6623053f50342dcecdbd3f5f87eadd04f)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1635673
@d-m-u d-m-u deleted the d-m-u:bz1635673 branch Oct 15, 2018
@simaishi

This comment has been minimized.

Copy link
Contributor

simaishi commented Oct 15, 2018

@d-m-u service_template_spec.rb conflicts on backport to Gaprindashvili branch.... Can you create a separaete PR?

@d-m-u

This comment has been minimized.

Copy link
Contributor Author

d-m-u commented Oct 15, 2018

@simaishi sure, it's here: #18099

@simaishi

This comment has been minimized.

Copy link
Contributor

simaishi commented Oct 15, 2018

Backported to Gaprindashvili via #18099

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.