Skip to content

[frontend/backend] Use filter interface for conditions (#15067)#15350

Merged
delemaf merged 10 commits into
issue/2484-draft-workflow-featurefrom
issue/15067-conditions-filters
Apr 22, 2026
Merged

[frontend/backend] Use filter interface for conditions (#15067)#15350
delemaf merged 10 commits into
issue/2484-draft-workflow-featurefrom
issue/15067-conditions-filters

Conversation

@delemaf
Copy link
Copy Markdown
Member

@delemaf delemaf commented Apr 2, 2026

Proposed changes

  • Use filter interface for conditions
  • Handle Group, User, Orga, Draft name
image

Related issues

Checklist

  • I consider the submitted work as finished
  • I tested the code for its functionality
  • I wrote test cases for the relevant uses case (coverage and e2e)
  • I added/update the relevant documentation (either on github or on notion)
  • Where necessary I refactored code to improve the overall quality

Further comments

@delemaf delemaf self-assigned this Apr 2, 2026
@github-actions github-actions Bot added the filigran team use to identify PR from the Filigran team label Apr 2, 2026
@delemaf delemaf linked an issue Apr 2, 2026 that may be closed by this pull request
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 2, 2026

Codecov Report

❌ Patch coverage is 52.82051% with 92 lines in your changes missing coverage. Please review.
✅ Project coverage is 33.71%. Comparing base (bbdb2b9) to head (570cd7f).
⚠️ Report is 1 commits behind head on issue/2484-draft-workflow-feature.

Files with missing lines Patch % Lines
...rc/private/components/common/lists/ListFilters.tsx 4.54% 21 Missing ⚠️
...ql/src/modules/workflow/engine/workflow-factory.ts 73.68% 20 Missing ⚠️
.../settings/sub_types/workflow/WorkflowFieldItem.tsx 0.00% 14 Missing ⚠️
...gs/sub_types/workflow/WorkflowConditionFilters.tsx 0.00% 11 Missing ⚠️
...gs/sub_types/workflow/NodeTypes/TransitionNode.tsx 0.00% 10 Missing ⚠️
...ncti-front/src/utils/filters/useSearchEntities.tsx 0.00% 9 Missing ⚠️
.../settings/sub_types/workflow/WorkflowFieldList.tsx 0.00% 6 Missing ⚠️
...te/components/settings/sub_types/workflow/utils.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@                          Coverage Diff                          @@
##           issue/2484-draft-workflow-feature   #15350      +/-   ##
=====================================================================
+ Coverage                              33.70%   33.71%   +0.01%     
=====================================================================
  Files                                   3204     3204              
  Lines                                 215912   216033     +121     
  Branches                               39681    39710      +29     
=====================================================================
+ Hits                                   72773    72839      +66     
- Misses                                143139   143194      +55     
Flag Coverage Δ
opencti-client-python 45.60% <ø> (ø)
opencti-front 3.08% <8.86%> (+<0.01%) ⬆️
opencti-graphql 69.98% <82.75%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@delemaf delemaf force-pushed the issue/2484-draft-workflow-feature branch from d2b7c30 to d178952 Compare April 3, 2026 13:31
@delemaf delemaf force-pushed the issue/15067-conditions-filters branch from d068862 to 319747c Compare April 3, 2026 13:53
@delemaf delemaf force-pushed the issue/2484-draft-workflow-feature branch from d178952 to 7a9d88d Compare April 10, 2026 09:12
@delemaf delemaf force-pushed the issue/15067-conditions-filters branch from 5fd4c80 to 050d64a Compare April 10, 2026 09:15
@delemaf delemaf force-pushed the issue/2484-draft-workflow-feature branch from 7a9d88d to 7f48efd Compare April 10, 2026 09:28
@delemaf delemaf force-pushed the issue/15067-conditions-filters branch from 050d64a to 51f773d Compare April 10, 2026 09:29
@delemaf delemaf marked this pull request as ready for review April 14, 2026 13:18
@delemaf delemaf force-pushed the issue/15067-conditions-filters branch from 70b49a4 to bf0fc59 Compare April 14, 2026 16:03
@delemaf delemaf force-pushed the issue/2484-draft-workflow-feature branch from 7f48efd to bbdb2b9 Compare April 15, 2026 14:13
@delemaf delemaf force-pushed the issue/15067-conditions-filters branch from bf0fc59 to eb9020f Compare April 15, 2026 14:23
@delemaf delemaf force-pushed the issue/15067-conditions-filters branch from eb9020f to 906b6d8 Compare April 15, 2026 14:27
@delemaf delemaf requested a review from Copilot April 15, 2026 14:42
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates OpenCTI’s workflow transition conditions to use the platform’s filter interface end-to-end (GraphQL/API, backend workflow engine, and frontend workflow editor), adding dedicated workflow-related filter keys for user/group/organization and adjusting UI grouping/labels.

Changes:

  • Backend: switch workflow transition conditions to a filter-group-based structure and add workflow-specific filter keys (workflow_user, workflow_group, workflow_organization) into filtering infrastructure.
  • Frontend: update workflow editor to edit/store transition conditions as filters; add entity search support for the new workflow filter keys; improve filter key grouping in UI.
  • Tests/translations: update/add tests for the new conditions structure and add i18n strings for new filter group labels and keys.

Reviewed changes

Copilot reviewed 36 out of 37 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
opencti-platform/opencti-graphql/tests/03-integration/02-resolvers/workflow-test.ts Adds integration coverage for workflow conditions using filter groups and special workflow keys.
opencti-platform/opencti-graphql/tests/03-integration/02-resolvers/workflow-conditions-test.ts Migrates existing workflow-conditions integration tests to the new filter-group conditions format.
opencti-platform/opencti-graphql/src/utils/filtering/filtering-utils.ts Maps new workflow filter keys to internal fields for special-key conversion.
opencti-platform/opencti-graphql/src/utils/filtering/filtering-constants.ts Defines and registers new workflow filter key constants.
opencti-platform/opencti-graphql/src/utils/filtering/filtering-activity-event/activity-event-testers.ts Adds activity-event testers for workflow_* keys by reusing members_* testers.
opencti-platform/opencti-graphql/src/modules/workflow/types/workflow-types.ts Updates workflow transition serialized typings to reference filter group types.
opencti-platform/opencti-graphql/src/modules/workflow/engine/workflow-schema.ts Changes serialized transition schema to use filter-group-based conditions.
opencti-platform/opencti-graphql/src/modules/workflow/engine/workflow-factory.ts Implements filter-group evaluation for workflow transition guards.
opencti-platform/opencti-graphql/src/modules/workflow/api/workflow.graphql Changes transition conditions GraphQL field to JSON.
opencti-platform/opencti-graphql/src/generated/graphql.ts Updates generated types to reflect GraphQL schema changes.
opencti-platform/opencti-graphql/src/domain/filterKeysSchema.ts Exposes workflow_* filter definitions in the filter keys schema for UI usage.
opencti-platform/opencti-front/src/utils/filters/useSearchEntities.tsx Adds entity search option builders for workflow_* filter keys.
opencti-platform/opencti-front/src/schema/relay.schema.graphql Updates Relay schema for workflow transition conditions JSON field.
opencti-platform/opencti-front/src/private/components/settings/sub_types/workflow/utils.ts Updates workflow transition typing and serialization paths for conditions changes.
opencti-platform/opencti-front/src/private/components/settings/sub_types/workflow/hooks/useWorkflowInitialElements.ts Sets default transition conditions shape when building initial graph nodes.
opencti-platform/opencti-front/src/private/components/settings/sub_types/workflow/hooks/useWorkflowInitialElements.test.ts Updates tests to reflect new default conditions structure.
opencti-platform/opencti-front/src/private/components/settings/sub_types/workflow/hooks/useWorkflowForm.ts Updates form “add condition” behavior to create an empty filter group.
opencti-platform/opencti-front/src/private/components/settings/sub_types/workflow/hooks/useWorkflowForm.test.ts Updates tests for the new condition object created by the form hook.
opencti-platform/opencti-front/src/private/components/settings/sub_types/workflow/hooks/useStatusConnection.ts Updates new transition node default conditions shape.
opencti-platform/opencti-front/src/private/components/settings/sub_types/workflow/hooks/useAddStatus.ts Updates created transition nodes to use the new default conditions shape.
opencti-platform/opencti-front/src/private/components/settings/sub_types/workflow/WorkflowFieldList.tsx Adjusts rendering logic for conditions vs actions in the editor UI.
opencti-platform/opencti-front/src/private/components/settings/sub_types/workflow/WorkflowFieldItem.tsx Switches condition editing UI from raw fields to filter UI component.
opencti-platform/opencti-front/src/private/components/settings/sub_types/workflow/WorkflowEditionDrawer.tsx Minor formatting update.
opencti-platform/opencti-front/src/private/components/settings/sub_types/workflow/WorkflowConditionFilters.tsx New component to edit workflow transition conditions via the shared Filters UI.
opencti-platform/opencti-front/src/private/components/settings/sub_types/workflow/Workflow.tsx Updates placeholder node default conditions shape.
opencti-platform/opencti-front/src/private/components/settings/sub_types/workflow/NodeTypes/TransitionNode.tsx Updates condition count display to the new conditions structure.
opencti-platform/opencti-front/src/private/components/settings/sub_types/SubTypeWorkflow.tsx Updates Relay query to fetch transition conditions as JSON.
opencti-platform/opencti-front/src/private/components/common/lists/ListFilters.tsx Adds grouping logic/labels for workflow and draft-related filters.
opencti-platform/opencti-front/lang/front/zh.json Adds i18n strings for new filter group labels and workflow_* keys.
opencti-platform/opencti-front/lang/front/ru.json Adds i18n strings for new filter group labels and workflow_* keys.
opencti-platform/opencti-front/lang/front/ko.json Adds i18n strings for new filter group labels and workflow_* keys.
opencti-platform/opencti-front/lang/front/ja.json Adds i18n strings for new filter group labels and workflow_* keys.
opencti-platform/opencti-front/lang/front/it.json Adds i18n strings for new filter group labels and workflow_* keys.
opencti-platform/opencti-front/lang/front/fr.json Adds i18n strings for new filter group labels and workflow_* keys.
opencti-platform/opencti-front/lang/front/es.json Adds i18n strings for new filter group labels and workflow_* keys.
opencti-platform/opencti-front/lang/front/en.json Adds i18n strings for new filter group labels and workflow_* keys.
opencti-platform/opencti-front/lang/front/de.json Adds i18n strings for new filter group labels and workflow_* keys.

Comment thread opencti-platform/opencti-graphql/src/modules/workflow/engine/workflow-factory.ts Outdated
Comment thread opencti-platform/opencti-graphql/src/modules/workflow/api/workflow.graphql Outdated
Copy link
Copy Markdown
Contributor

@OctaveLaventure OctaveLaventure left a comment

Choose a reason for hiding this comment

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

amazing work 👏🏻 🚀

Comment thread opencti-platform/opencti-front/lang/back/en.json Outdated
@delemaf delemaf merged commit 0569193 into issue/2484-draft-workflow-feature Apr 22, 2026
38 checks passed
@delemaf delemaf deleted the issue/15067-conditions-filters branch April 22, 2026 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

filigran team use to identify PR from the Filigran team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Workflow: use filter interface for conditions

3 participants