manageiq-api icon indicating copy to clipboard operation
manageiq-api copied to clipboard

Issue while creating a Custom Button with expression via API

Open Fryguy opened this issue 3 years ago • 14 comments

Similar to https://github.com/ManageIQ/manageiq-api/issues/1053, setting a custom button expression through the API is different than setting it on the backend (note the MiqExpression in the visibility expression below in the first part but not in the second part.


Discussed in https://github.com/ManageIQ/manageiq/discussions/21904

Originally posted by Inkompetenz20 June 3, 2022 Hello,

I want to add a custom Button via the API of ManageIQ. After my API call, the button exists in ManageIQ, but the enablement and visibility expressions are not displayed.

image

The first select statement displays the button, when added/updated via the GUI and the secound select statement displays the button, when added/updated via API.

I think it looks like a similar error as in https://github.com/ManageIQ/manageiq-api/issues/1053. Is this a known error?

Best, Paul

Fryguy avatar Jun 17 '22 13:06 Fryguy

@kbrock Can you take a look at this one?

Fryguy avatar Jun 17 '22 13:06 Fryguy

Hi @kbrock, is there an update on the issue? Is there more information we can deliver to make the problem more clear? Our manageIQ breaks regularly due to the problem with custom buttons and their visibility expression.

e.g.

1-ui-6ff548c899-dp9ln 1-ui {"@timestamp":"2022-08-16T07:43:19.122458 ","hostname":"1-ui-6ff548c899-dp9ln","pid":8,"tid":"acb48","service":"production","level":"crit","message":"Error caught: [NoMethodError] undefined method lenient_evaluate' for #<Hash:0x000055e0f0fe7d98>\n/var/www/miq/vmdb/app/models/custom_button.rb:208:in evaluate_visibility_expression_for'\n/var/www/miq/vmdb/app/models/custom_button_set.rb:87:in block (2 levels) in filter_with_visibility_expression'\n/opt/manageiq/manageiq-gemset/gems/activerecord-6.0.5.1/lib/active_record/relation/delegation.rb:88:in each'\n/opt/manageiq/manageiq-gemset/gems/activerecord-6.0.5.1/lib/active_record/relation/delegation.rb:88:in `each'\n

Thanks a lot, Thomas

btmd avatar Aug 16 '22 07:08 btmd

This issue has been automatically marked as stale because it has not been updated for at least 3 months.

If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.

Thank you for all your contributions! More information about the ManageIQ triage process can be found in the triage process documentation.

miq-bot avatar Feb 27 '23 00:02 miq-bot

This issue has been automatically marked as stale because it has not been updated for at least 3 months.

If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.

Thank you for all your contributions! More information about the ManageIQ triage process can be found in the triage process documentation.

miq-bot avatar Jul 17 '23 00:07 miq-bot

@kbrock I think this is still an issue - since you're currently in MiqExpression code, can you take a look at this one?

Fryguy avatar Jul 17 '23 19:07 Fryguy

There is a deep_symbolize_keys in there. I'll see what parts of the symbolize are necessary.

kbrock avatar Jul 18 '23 11:07 kbrock

This issue has been automatically marked as stale because it has not been updated for at least 3 months.

If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.

Thank you for all your contributions! More information about the ManageIQ triage process can be found in the triage process documentation.

miq-bot avatar Oct 23 '23 00:10 miq-bot

This issue has been automatically marked as stale because it has not been updated for at least 3 months.

If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.

miq-bot avatar Jan 29 '24 00:01 miq-bot

This issue has been automatically marked as stale because it has not been updated for at least 3 months.

If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.

miq-bot avatar May 13 '24 00:05 miq-bot

This issue has been automatically marked as stale because it has not been updated for at least 3 months.

If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.

miq-bot avatar Aug 19 '24 00:08 miq-bot