Skip to content

If else node tests#16916

Merged
FelixMalfait merged 102 commits intomainfrom
if-else-node-tests
Jan 7, 2026
Merged

If else node tests#16916
FelixMalfait merged 102 commits intomainfrom
if-else-node-tests

Conversation

@abdulrahmancodes
Copy link
Copy Markdown
Contributor

No description provided.

…nition

This commit introduces a new type, WorkflowIfElseActionSettings, which extends BaseWorkflowActionSettings. It includes input properties for step filter groups, step filters, and branches. Additionally, the StepIfElseBranch type is defined in StepFilters.ts, providing structure for branching logic in workflows.
This commit introduces the workflowIfElseActionSchema and workflowIfElseActionSettingsSchema, enhancing the workflow capabilities with conditional branching logic. The new schemas define the structure for if-else actions and their associated settings, including step filters and branches.
This commit adds the WorkflowIfElseAction and its corresponding settings to the workflow action types. The WorkflowActionSettings type is updated to include the new IfElse action, enhancing the workflow capabilities with conditional logic. Additionally, the WorkflowActionType enum is updated to define the IF_ELSE action type.
This commit integrates the workflowIfElseActionSchema into the workflowActionSchema, enabling support for conditional branching logic in workflows. This addition enhances the overall functionality and flexibility of workflow actions.
This commit introduces the IfElse action to the workflow actions, including its constants and icon handling. The FlowActions constant is updated to include the new IfElse action, enhancing the workflow capabilities with conditional logic. Additionally, the getActionIcon and getActionIconColorOrThrow utility functions are updated to support the new action type.
This commit introduces a new guard function, isWorkflowIfElseAction, to validate if a given action is of type WorkflowIfElseAction. This enhancement supports the conditional logic capabilities in workflows by ensuring proper type checking for IfElse actions.
This commit adds the WorkflowIfElseAction type to the workflow action types and updates the WorkflowAction type to incorporate the new IfElse action. This enhancement supports the recently introduced conditional logic capabilities in workflows.
This commit introduces several components for the IfElse action, including WorkflowEditActionIfElse, WorkflowEditActionIfElseBody, and WorkflowIfElseBranchEditor. It also updates the WorkflowStepFilterContext to include a new optional property for firstFilterLabel, allowing for more flexible filter labeling in the UI. These changes enhance the workflow capabilities by providing a structured way to manage conditional logic and filter settings.
Move all shared filter-related files from filter-action and generic workflow-steps directories to a dedicated filters/ folder for better organization.

Moved:
- Components: WorkflowStepFilter* components and stories
- Hooks: useAddRootStepFilter, useChildStepFiltersAndChildStepFilterGroups, useRemoveStepFilter, useRemoveStepFilterGroup, useUpsertStepFilterSettings
- States: filter context and state management files
- Utils: getStepFilterOperands, isStepFilterGroupChildAStepFilterGroup
Move useFilterCounter from workflow-steps/hooks to workflow-steps/filters/hooks
as it is filter-specific functionality (only works with FILTER step type).
… filtering

This commit introduces the WorkflowDropdownStepOutputItems component, which provides a dropdown interface for selecting output items in workflow steps. It integrates various hooks and utilities for managing step filters, searching variables, and displaying metadata, enhancing the user experience in configuring workflow steps.
This commit updates the import paths for various filter-related components and contexts, moving them from the workflow-actions directory to a dedicated filters directory. This change improves the organization of the codebase and aligns with the recent restructuring of filter components, enhancing maintainability and clarity in the workflow step implementations.
…il and WorkflowStepDetail

This commit adds the WorkflowEditActionIfElse component to both WorkflowRunStepNodeDetail and WorkflowStepDetail, enabling support for conditional logic in workflow steps. The integration enhances the workflow capabilities by allowing users to define IfElse actions within the workflow step configurations.
This commit introduces the IfElseActionModule and IfElseWorkflowAction, enabling conditional logic within workflows. The IfElse action is integrated into the workflow executor, allowing for dynamic branching based on specified conditions. Additionally, utility functions for evaluating filter conditions and finding matching branches are added to support the new action's functionality.
This commit adds logic to the WorkflowExecutorWorkspaceService to process results from IfElse actions. It checks for matching branch IDs and retrieves the corresponding next step IDs, enhancing the workflow's conditional execution capabilities. This integration builds upon the previously introduced IfElse action module, further enabling dynamic branching in workflows.
…pport

This commit updates the WorkflowIfElseBranchEditor component to utilize the i18n library for branch labels, allowing for localized message handling. Additionally, a new utility function, getBranchLabel, is introduced to generate appropriate labels for branches based on their index and total count, improving the flexibility and usability of the IfElse action in workflows.
…ic and UI improvements

This commit introduces logic for creating new steps within the WorkflowEditActionIfElseBody component, allowing users to dynamically add routes in the IfElse action. It also refactors the branch label handling to utilize the new getBranchLabel utility, improving the clarity and maintainability of the code. Additionally, the UI is updated to replace the ActionButton with a Button component for better consistency in design.
…ions

This commit introduces a new type, WorkflowIfElseResult, which defines the structure for storing the matching branch ID in IfElse actions. This addition enhances type safety and clarity in handling results from conditional workflows.
…ow diagrams

This commit introduces a new utility function, generateNodesAndEdgesForIfElseNode, which handles the creation of nodes and edges for IfElse actions in workflow diagrams. It integrates branch handling and edge configuration, enhancing the workflow visualization capabilities. Additionally, the generateWorkflowDiagram function is updated to utilize this new utility, allowing for dynamic representation of IfElse nodes in the workflow structure.
…edge labels

This commit updates the WorkflowDiagramDefaultEdgeEditable and WorkflowDiagramDefaultEdgeReadonly components to include center positioning for edge labels. The centerX and centerY properties are now utilized to improve the alignment of labels on edges, enhancing the visual clarity of the workflow diagrams. Additionally, the WorkflowDiagramEdgeLabelContainer is modified to support these new properties, ensuring consistent label positioning across different edge types.
…ow step

This commit introduces a new parameter, shouldSelectNode, to the useCreateStep hook, allowing users to control whether the newly created step's node should be selected. By default, this option is set to true, maintaining existing behavior while providing flexibility for different use cases.
…tions

This commit adds functionality to create If/Else steps within the WorkflowVersionStepOperationsWorkspaceService. It introduces new constants for branch positioning and enhances the createEmptyNodesForIfElseStep method to generate empty nodes for both branches. The logic ensures that the workflow can dynamically handle conditional branching, improving the overall workflow management capabilities.
… branches dynamically

This commit enhances the WorkflowEditActionIfElseBody component by implementing logic to update step filter groups and manage branches based on the current filter settings. It introduces functionality to delete unnecessary branches while ensuring that the updated filter groups and filters are correctly set in the action's input, improving the overall workflow management and conditional branching capabilities.
…ng based on filter state

This commit updates the WorkflowStepFilterColumn component to incorporate logic for determining when to display the filter options dropdown based on the current filter state and whether the step is part of an If branch. It introduces new state management using Recoil for step filters and filter groups, improving the dynamic behavior of the workflow filtering process.
This commit introduces a new feature flag, IS_IF_ELSE_ENABLED, to control the availability of If/Else actions in workflows. It updates the WorkflowActionType enum to include the IF_ELSE action and modifies the CommandMenuWorkflowSelectAction component to conditionally render actions based on the feature flag. Additionally, the WorkflowVersionStepOperationsWorkspaceService is enhanced to check the feature flag before executing If/Else logic, ensuring proper handling of conditional workflows.
…perations

This commit removes the FeatureFlagService and related feature flag checks from the WorkflowVersionStepOperationsWorkspaceService and the workflow version step module. This change simplifies the workflow logic by eliminating the conditional checks for the If/Else feature, streamlining the execution of workflow actions.
…n component

This commit refactors the action filtering logic in the CommandMenuWorkflowSelectAction component to streamline the handling of If/Else actions. It replaces the conditional checks with a single filter that allows If/Else actions to be included based on the isIfElseEnabled flag, enhancing code clarity and maintainability.
This commit adds the IS_IF_ELSE_ENABLED feature flag to the seedFeatureFlags utility, enabling the configuration of If/Else actions in the workspace. This enhancement supports the dynamic management of feature flags within the workflow environment, aligning with recent updates to workflow action handling.
This commit updates the WorkspaceEntityManager test suite to include the IS_IF_ELSE_ENABLED feature flag in the configuration. This addition ensures that the tests accurately reflect the current state of feature flags, supporting the recent enhancements related to If/Else actions in workflows.
This commit simplifies the branch matching logic in the findMatchingBranch utility by removing unnecessary comments and ensuring clarity in the code. The changes enhance the readability of the function while maintaining its core functionality, ensuring that the workflow's conditional branching operates as intended.
…ilter Group ID

Updated the integration tests to identify 'if' and 'else' branches using filterGroupId instead of array order. This change improves the accuracy of branch identification and enhances the clarity of assertions, ensuring both branches are correctly validated against their properties. Additionally, modified the way empty node IDs are assigned to reflect the new identification logic.
Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@abdulrahmancodes abdulrahmancodes marked this pull request as draft January 6, 2026 14:24
Updated the integration tests to ensure that the 'if' branch's filterGroupId is correctly validated against the stepFilterGroups. This change improves the accuracy of branch identification and strengthens the assertions, ensuring that both 'if' and 'else' branches are properly validated based on their filterGroupId properties.
Updated console logging in the If/Else workflow integration tests to provide clearer visibility into the step structure before execution. This change improves the debugging process by outputting detailed information about the branches and their associated filterGroupIds, aiding in the identification of issues during test runs.
Enabled console logging in the findMatchingBranch utility and integration tests to enhance debugging capabilities. This change aims to provide clearer visibility into the execution flow and branch matching process, aiding in the identification of issues during test runs.
Removed console logging from the If/Else workflow integration tests to streamline the test execution process. This change enhances test clarity and performance by eliminating unnecessary debug output while maintaining the integrity of branch validation and assertions.
Eliminated console logging from the findMatchingBranch utility to streamline the branch matching process. This change enhances code clarity and performance by removing unnecessary debug output while maintaining the functionality of branch identification.
…d Remove Redundant Queries

Streamlined the If/Else workflow integration tests by removing unnecessary GraphQL queries and simplifying assertions. This change enhances test clarity and performance by directly utilizing the response from the workflow creation, ensuring accurate validation of branch execution without redundant checks.
Enhanced the If/Else workflow integration tests by implementing support for ELSE-IF branches. This update includes the creation of ELSE-IF nodes, validation of their execution, and adjustments to the branch identification logic. The changes improve the accuracy of branch execution tests and ensure comprehensive coverage of workflow scenarios, including the new ELSE-IF condition.
…kflow Retrieval

Updated the If/Else workflow integration tests to include a GraphQL query for retrieving the created workflow by its ID. This change improves the accuracy of assertions by validating the workflow's versions directly from the response, ensuring comprehensive testing of the workflow structure and its associated versions.
Refined the If/Else workflow integration tests by enhancing the validation of ELSE-IF branches. This update includes adjustments to the branch identification logic and assertions to ensure that the ELSE-IF branches are correctly recognized and validated, improving the overall accuracy of the workflow tests.
Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 3 files

@FelixMalfait FelixMalfait added this pull request to the merge queue Jan 7, 2026
Merged via the queue into main with commit 10de7ac Jan 7, 2026
62 checks passed
@FelixMalfait FelixMalfait deleted the if-else-node-tests branch January 7, 2026 10:48
@twenty-eng-sync
Copy link
Copy Markdown

Hey @FelixMalfait! After you've done the QA of your Pull Request, you can mark it as done here. Thank you!

1 similar comment
@twenty-eng-sync
Copy link
Copy Markdown

Hey @FelixMalfait! After you've done the QA of your Pull Request, you can mark it as done here. Thank you!

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 7, 2026

Thanks @abdulrahmancodes for your contribution!
This marks your 109th PR on the repo. You're top 1% of all our contributors 🎉
See contributor page - Share on LinkedIn - Share on Twitter

Contributions

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.

3 participants