Skip to content

Conversation

@elsamaryv
Copy link
Contributor

@elsamaryv elsamaryv commented Nov 4, 2025

  • Disable the invalid workflows from being selected in the embedded workflow component. It can be done by showing the invalid workflows in the table but greying them out and making them not selectable.

Before

Screenshot 2025-11-04 at 6 08 51 PM

After

Screenshot 2025-11-05 at 8 07 55 PM

@miq-bot add-label enhancement

@elsamaryv elsamaryv force-pushed the fix-20077-embedded-workflows branch from 9fb7738 to 15154ed Compare November 4, 2025 13:31
@elsamaryv elsamaryv marked this pull request as ready for review November 4, 2025 13:49
@elsamaryv elsamaryv requested a review from a team as a code owner November 4, 2025 13:49
@elsamaryv
Copy link
Contributor Author

@miq-bot add-reviewer @GilbertCherrie

@GilbertCherrie GilbertCherrie self-assigned this Nov 4, 2025
@Fryguy
Copy link
Member

Fryguy commented Nov 4, 2025

@agrare Please also take a look

@Fryguy
Copy link
Member

Fryguy commented Nov 4, 2025

I like the idea of greying them out - perhaps we can modify the hover text to say add-haproxy.yml (Invalid Workflow)

@Fryguy
Copy link
Member

Fryguy commented Nov 4, 2025

Weird question - if a valid workflow was chosen as an entrypoint, then the workflow becomes invalid, then we reenter this selection page, is the invalid workflow still selected?

@agrare
Copy link
Member

agrare commented Nov 4, 2025

👍 for having (Invalid Workflow) after on greyed out rows

if a valid workflow was chosen as an entrypoint, then the workflow becomes invalid, then we reenter this selection page, is the invalid workflow still selected?

I'd expect that it would be selected but you would be able to submit the form. Maybe we have some way of indicating on the parent object (service template or dialog) that there is an invalid workflow selected. This might be entirely new, I don't know what happens if you delete an automate method that was selected by a service template or dialog but it would be good to check.

@Fryguy
Copy link
Member

Fryguy commented Nov 4, 2025

Oh i like the idea of the parent service catalog item having an indicator of an invalid workflow file, or perhaps mark the service catalog item as invalid somehow.

@agrare
Copy link
Member

agrare commented Nov 4, 2025

perhaps mark the service catalog item as invalid somehow.

Yeah this was exactly what I was thinking, if we had a #valid? method and an error message we could show a red X on the service catalog item list and we could use that to check for a bunch of different conditions like an archived source template too

@Fryguy
Copy link
Member

Fryguy commented Nov 4, 2025

I don't know what happens if you delete an automate method that was selected by a service template or dialog but it would be good to check.

I'm certain it's just broken. There are a number of ways to "break" a service catalog item, such as deleting the automate entry point and the other big one is deleting the underlying VM template (or associated resource)

I've wanted a way to mark service catalog items as "orphaned" or "invalidated" or something for a while now (ref)

@agrare
Copy link
Member

agrare commented Nov 4, 2025

@elsamaryv I know you have to rebase this on @GilbertCherrie's changes but just in case these issues aren't resolved in his branch:

I marked one of my workflows as invalid, and have a valid TFE ConfigurationScriptPayload:

vmdb(dev)> ConfigurationScriptPayload.pluck(:type, :name, :payload_valid, :payload_error)
=> 
[["ManageIQ::Providers::Workflows::AutomationManager::Workflow", "email.asl", true, nil],
 ["ManageIQ::Providers::Workflows::AutomationManager::Workflow", "provision-vm-small-med-large.asl", true, nil],
 ["ManageIQ::Providers::Workflows::AutomationManager::Workflow", "provision.asl", false, "syntax error"],
 ["ManageIQ::Providers::TerraformEnterprise::AutomationManager::ConfigurationScriptPayload", "agrare/terraform-test@master", true, nil]]

In the ServiceCatalog entrypoint selection I see that I can select provision.asl, and my TFE workspace is in the list greyed out:
image

I'd expect the provision.asl to be greyed out, and the TFE workspace to not show up at all.

In the automate dialog editor I don't see the TFE workspace, but I can select an invalid workflow:
Screenshot From 2025-10-31 13-42-44

@elsamaryv elsamaryv force-pushed the fix-20077-embedded-workflows branch from 15154ed to 5d6c514 Compare November 5, 2025 13:56
@elsamaryv
Copy link
Contributor Author

In the automate dialog editor I don't see the TFE workspace, but I can select an invalid workflow:

@agrare Should the dialog editor behave the same way — by keeping invalid workflows disabled, or should it hide them entirely?

@Fryguy
Copy link
Member

Fryguy commented Nov 5, 2025

In the automate dialog editor I don't see the TFE workspace, but I can select an invalid workflow:

@agrare Should the dialog editor behave the same way — by keeping invalid workflows disabled, or should it hide them entirely?

I think it should work the same way keeping invalid workflows disabled.

@agrare
Copy link
Member

agrare commented Nov 5, 2025

@elsamaryv I thought it was the same component (@GilbertCherrie ?) so yes it should behave the same way.

@Fryguy
Copy link
Member

Fryguy commented Nov 5, 2025

Technically there are 2 components - one is a react component, the other is an angular component (I believe in the ui-components repo). Ideally they should work the same way.

@agrare
Copy link
Member

agrare commented Nov 5, 2025

Technically there are 2 components

I was going off of this comment #9670 (comment)

@GilbertCherrie
Copy link
Member

GilbertCherrie commented Nov 5, 2025

@agrare oh yeah I thought they used the same underlying code but I guess not. @Fryguy is right the dialog editor code is here: ManageIQ/ui-components#471.

Either way we can't make both components share the same code (which is what I think you initially requested) until that dialog form is converted to react. That pr is in progress by @elsamaryv: #9592.

@elsamaryv
Copy link
Contributor Author

I like the idea of greying them out - perhaps we can modify the hover text to say add-haproxy.yml (Invalid Workflow)

Done

@elsamaryv
Copy link
Contributor Author

@elsamaryv I know you have to rebase this on @GilbertCherrie's changes but just in case these issues aren't resolved in his branch:

I marked one of my workflows as invalid, and have a valid TFE ConfigurationScriptPayload:

vmdb(dev)> ConfigurationScriptPayload.pluck(:type, :name, :payload_valid, :payload_error)
=> 
[["ManageIQ::Providers::Workflows::AutomationManager::Workflow", "email.asl", true, nil],
 ["ManageIQ::Providers::Workflows::AutomationManager::Workflow", "provision-vm-small-med-large.asl", true, nil],
 ["ManageIQ::Providers::Workflows::AutomationManager::Workflow", "provision.asl", false, "syntax error"],
 ["ManageIQ::Providers::TerraformEnterprise::AutomationManager::ConfigurationScriptPayload", "agrare/terraform-test@master", true, nil]]

In the ServiceCatalog entrypoint selection I see that I can select provision.asl, and my TFE workspace is in the list greyed out: image

I'd expect the provision.asl to be greyed out, and the TFE workspace to not show up at all.

In the automate dialog editor I don't see the TFE workspace, but I can select an invalid workflow: Screenshot From 2025-10-31 13-42-44

Hi @agrare , I’ve made the updates except for the Service Dialog Editor. Could you please verify the changes on your side?

@elsamaryv
Copy link
Contributor Author

@agrare oh yeah I thought they used the same underlying code but I guess not. @Fryguy is right the dialog editor code is here: ManageIQ/ui-components#471.

Either way we can't make both components share the same code (which is what I think you initially requested) until that dialog form is converted to react. That pr is in progress by @elsamaryv: #9592.

Since the react conversion is in progress, @agrare @Fryguy do you think it makes sense to handle the invalid workflow for dialog editor in this PR?

@agrare
Copy link
Member

agrare commented Nov 5, 2025

@elsamaryv even if they are two different components for now, they definitely should behave the same way

@GilbertCherrie
Copy link
Member

@elsamaryv you can make a pr to the ui-components repo and change that component there if we need to

@elsamaryv elsamaryv force-pushed the fix-20077-embedded-workflows branch from b81a242 to c3a7ef1 Compare November 5, 2025 15:28
@elsamaryv
Copy link
Contributor Author

@elsamaryv you can make a pr to the ui-components repo and change that component there if we need to

@agrare @Fryguy @GilbertCherrie Please review this PR for the changes in angular component (Service Dialog editor)

@agrare
Copy link
Member

agrare commented Nov 6, 2025

That PR was merged and released in v1.6.1 https://github.com/ManageIQ/ui-components/releases/tag/v1.6.1

@elsamaryv
Copy link
Contributor Author

Hi @agrare @Fryguy @GilbertCherrie, Is this PR good to merge?

Copy link
Member

@agrare agrare left a comment

Choose a reason for hiding this comment

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

LGTM

image image

<span
className="bx--front-line"
title="Delete"
title="Click to delete this mapping"
Copy link
Member

Choose a reason for hiding this comment

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

hey @elsamaryv I just noticed this, this doesn't look related to the invalid embedded workflows change was this added accidentally?

Copy link
Contributor Author

@elsamaryv elsamaryv Nov 7, 2025

Choose a reason for hiding this comment

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

The tests were failing due to outdated snapshots, which were unrelated to the current task. Would it have been better to update them in a separate PR?

Copy link
Member

Choose a reason for hiding this comment

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

No, that's fine - strange they were broken though - I would have thought that would break master.

Copy link
Member

Choose a reason for hiding this comment

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

Actually - can you verify these are broken on master and maybe move into a separate PR? It makes me think something in this PR is changing these.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah I was thinking this might have been from the updated ui-components, in which case should be fixed in a separate PR.

Copy link
Member

Choose a reason for hiding this comment

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

ohhh I hadn't thought of that - good point.

<span
className="bx--front-line"
title=""
title="Enforce a Value"
Copy link
Member

Choose a reason for hiding this comment

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

Same with these

Comment on lines +28 to +30
const cellTitle = cell.data.title ? cell.data.title : cell.value;
const truncateText = (
<span title={cell.value} className={classNames('bx--front-line', wrapClass, longerTextClass)}>
<span title={cellTitle} className={classNames('bx--front-line', wrapClass, longerTextClass)}>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, so this is the change that caused the snapshot mismatch
@agrare @Fryguy

I made this change to modify the hover text for Invalid workflows
#9708 (comment)

@GilbertCherrie GilbertCherrie merged commit a60fc7e into ManageIQ:master Nov 7, 2025
19 checks passed
@elsamaryv elsamaryv deleted the fix-20077-embedded-workflows branch November 7, 2025 16:37
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.

5 participants