Skip to content

feat(ACI): Add error for unsupported condition#110025

Merged
ceorourke merged 4 commits intomasterfrom
ceorourke/ISWF-2186
Mar 9, 2026
Merged

feat(ACI): Add error for unsupported condition#110025
ceorourke merged 4 commits intomasterfrom
ceorourke/ISWF-2186

Conversation

@ceorourke
Copy link
Copy Markdown
Member

We have some conditions that exist in ACI that don't exist in the old world - if a Workflow has one / more of these we can't render it in the old UI, but we should at least let the user know they're seeing incomplete data. This PR adds the unsupported condition type to the errors in the payload which can be picked up by the front end and used to render a warning in a follow up.

@ceorourke ceorourke requested a review from a team as a code owner March 6, 2026 00:23
@linear-code
Copy link
Copy Markdown

linear-code bot commented Mar 6, 2026

@ceorourke ceorourke requested a review from a team March 6, 2026 00:24
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Mar 6, 2026

for condition in trigger_conditions:
if condition.type in UNSUPPORTED_CONDITIONS:
errors.append(f"Condition not supported: {condition.type}")
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Can someone who actually works on the front end confirm we can show a banner if this is found?

Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

if workflow.when_condition_group
else []
)
filter_conditions = list(workflow_dcg.condition_group.conditions.all())
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Duplicate condition fetching logic across two locations

Low Severity

The trigger and filter conditions are fetched identically in both _generate_rule_conditions_filters (lines 470-476 of the method body) and the new unsupported-condition check (lines 645-650). Both use the same workflow.when_condition_group.conditions.all() and workflow_dcg.condition_group.conditions.all() calls with the same null-guard pattern. This duplicated logic increases the risk of the two locations diverging if one is updated without the other. The unsupported check could be integrated into _generate_rule_conditions_filters or the conditions could be fetched once and reused.

Additional Locations (1)

Fix in Cursor Fix in Web

result[workflow]["filters"] = filters

# Check for unsupported conditions
UNSUPPORTED_CONDITIONS = [
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'd feel better with this as a top-level def with "# These conditions exist in Workflows, but are unsupported in ...; if we're trying to return these in legacy APIs, our best option is to error rather than being broken" or something.
Also, certainly doesn't matter in practice, but it'd be nice if this was a set.

@ceorourke ceorourke merged commit 01e40eb into master Mar 9, 2026
55 checks passed
@ceorourke ceorourke deleted the ceorourke/ISWF-2186 branch March 9, 2026 18:01
@github-actions github-actions bot locked and limited conversation to collaborators Mar 25, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants