Bug 1550002 - [RFE] Open URL feature should also supports for other object types entities of custom button
Summary: [RFE] Open URL feature should also supports for other object types entities o...
Keywords:
Status: POST
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Automate
Version: 5.9.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: GA
: 5.11.z
Assignee: Tina Fitzgerald
QA Contact: Nikhil Dhandre
URL:
Whiteboard: custom_button
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-02-28 09:29 UTC by Yadnyawalk Tale
Modified: 2023-05-31 23:33 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-05-27 13:25:33 UTC
Category: Feature
Cloudforms Team: CFME Core
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
generic object with open_url (45.72 KB, image/png)
2019-08-14 16:39 UTC, Nikhil Dhandre
no flags Details

Comment 4 Loic Avenel 2019-01-22 08:49:46 UTC
We have two actions to make here:

1 - Removing OpenURL check box where it does not apply

2 - Add support for new entity: Provider, Service, User, Cloud Tenant, Generic Object

3- Document it

Comment 9 drew uhlmann 2019-05-07 11:12:11 UTC
I'm blocked on this until Greg decides how he wants it implemented.

Comment 11 Loic Avenel 2019-05-27 13:25:33 UTC

*** This bug has been marked as a duplicate of bug 1643331 ***

Comment 12 Greg McCullough 2019-07-30 11:39:18 UTC
Clearing needinfo flag.

Comment 14 Martin Povolny 2019-07-31 05:54:16 UTC
some documentation: https://github.com/ManageIQ/guides/blob/master/automate_url_open.md

Comment 16 Martin Povolny 2019-08-13 13:38:45 UTC
> 1. "Provider" object open_url checkbox still disabled

That part I understand. Let me fix it.


> 2. Ruby method for Objects like Service, Tenant able to simulate but not able to open "external_url"

What in particular does not work? Do you have some logs? Do you get an error message?


> In current RFE we provided support for  VM, Provider, Service, User, Group, Tenant, Cloud Tenant and Generic Object. Some objects working fine but some not.

"some..." that is not a very exact bug report. Can you be more precise?

Comment 18 Nikhil Dhandre 2019-08-14 16:39:21 UTC
Created attachment 1603855 [details]
generic object with open_url

Comment 19 Martin Povolny 2019-08-15 14:15:44 UTC
Thx for the screenshot! That is helpful.

Comment 23 CFME Bot 2019-08-16 21:16:11 UTC
New commit detected on ManageIQ/manageiq/master:

https://github.com/ManageIQ/manageiq/commit/f1a0eda819e21795d3cafa02fb57b1386fb51c34
commit f1a0eda819e21795d3cafa02fb57b1386fb51c34
Author:     Martin Povolny <mpovolny>
AuthorDate: Thu Aug 15 16:09:54 2019 -0400
Commit:     Martin Povolny <mpovolny>
CommitDate: Thu Aug 15 16:09:54 2019 -0400

    Open URL: expand to "Provider"

    To make "Provider" work one needs to modify "ExtManagementSystem".

    Partial fix for:
    https://bugzilla.redhat.com/show_bug.cgi?id=1550002

 app/models/ext_management_system.rb | 1 +
 app/models/provider.rb | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)

Comment 24 Martin Povolny 2019-08-19 10:40:41 UTC
Nikhil, all the fixes I did are now merged.

However there's still one issu (see last comments in https://github.com/ManageIQ/manageiq-ui-classic/pull/6040) whil prevents GO usecase from working.

Seems to me that the remaining issue in not directly related to the topic of this BZ and I will try to get in touch with someone who knows Automate who can take it from here or help me.

Comment 25 Martin Povolny 2019-08-21 07:07:43 UTC
This automate fix is needed to resolve the last of the issues found in this BZ: https://github.com/ManageIQ/manageiq-automation_engine/pull/352

Comment 26 Nikhil Dhandre 2019-08-23 08:18:09 UTC
Martin o/,

As per pull request; we are facing problem for generic object. I would like to verify this BZ for other objects as issue not directly related with topic.

Comment 29 CFME Bot 2019-08-23 21:06:18 UTC
New commit detected on ManageIQ/manageiq/master:

https://github.com/ManageIQ/manageiq/commit/05e308dedede3c52e5f93cf934865da990227c10
commit 05e308dedede3c52e5f93cf934865da990227c10
Author:     Lucy Fu <lufu>
AuthorDate: Thu Aug 22 17:05:43 2019 -0400
Commit:     Lucy Fu <lufu>
CommitDate: Thu Aug 22 17:05:43 2019 -0400

    Set result_format to ignore for enabled open_url.

    Automate won't return back workspace object if result_format is ignore.

    Custom button calls MiqTask.generic_action_with_callback which sets up a queue callback.
    MiqAeEngine.deliver always returns a workspace handle which references the custom button target object after processing the automate method.
    The workspace handle is returned as the result to the queue callback and got saved into miq_task.task_results by calling YAML.dump.

    When custom button's target is a generic object, YMAL.dump would fail as method encode_with is not exposed to generic object.
    Since open_url really does not care about return value from the automate method, result_format = ignore is sent to automate to not sending back the
    workspace as the return value.

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

 app/models/resource_action.rb | 6 +-
 spec/models/resource_action_spec.rb | 16 +
 2 files changed, 21 insertions(+), 1 deletion(-)

Comment 30 CFME Bot 2019-08-26 13:32:53 UTC
New commit detected on ManageIQ/manageiq-automation_engine/master:

https://github.com/ManageIQ/manageiq-automation_engine/commit/76c3c8f0f7f2883a4d16354abcf6ba809319bd17
commit 76c3c8f0f7f2883a4d16354abcf6ba809319bd17
Author:     Lucy Fu <lufu>
AuthorDate: Tue Aug 20 14:36:49 2019 -0400
Commit:     Lucy Fu <lufu>
CommitDate: Tue Aug 20 14:36:49 2019 -0400

    Add MiqAeEngine.return_result.

    Returning back workspace breaks the custom button for generic objects.
    Reported by https://github.com/ManageIQ/manageiq-ui-classic/pull/6040#issuecomment-522771465.

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

 lib/miq_automation_engine/engine/miq_ae_engine.rb | 9 +-
 spec/miq_ae_engine_spec.rb | 14 +
 2 files changed, 22 insertions(+), 1 deletion(-)

Comment 31 Martin Povolny 2019-09-03 12:31:22 UTC
I retested the GO usecase with Lucy's fixes. All is merged and all works for me now --> POST.

Comment 32 CFME Bot 2019-09-18 17:00:45 UTC
New commit detected on ManageIQ/manageiq/master:

https://github.com/ManageIQ/manageiq/commit/33295f3b35a976294c995c50f8d49fae61e233ad
commit 33295f3b35a976294c995c50f8d49fae61e233ad
Author:     Lucy Fu <lufu>
AuthorDate: Wed Sep  4 09:59:39 2019 -0400
Commit:     Lucy Fu <lufu>
CommitDate: Wed Sep  4 09:59:39 2019 -0400

    Set result_format to ignore for all custom buttons.

    Followup of https://github.com/ManageIQ/manageiq/pull/19195

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

 app/models/resource_action.rb | 2 +-
 spec/models/resource_action_spec.rb | 11 +-
 2 files changed, 4 insertions(+), 9 deletions(-)


Note You need to log in before you can comment on or make changes to this bug.