Skip to content

Conversation

@jumski
Copy link
Contributor

@jumski jumski commented Jan 8, 2026

Add ifNot Condition Pattern for Step Execution Control

This PR adds a new ifNot condition pattern to complement the existing if pattern for step execution control. This enables more flexible conditional execution of workflow steps.

Key changes:

  • Added condition_not_pattern column to the pgflow.steps table
  • Updated pgflow.add_step() function to accept the new parameter
  • Enhanced condition evaluation logic in cascade_resolve_conditions() to support both patterns with AND semantics
  • Added comprehensive test coverage for the new feature

The ifNot pattern works as follows:

  • When used alone, a step executes when the input does NOT match the pattern
  • When combined with if, both conditions must pass (AND semantics)
  • Can be used to create mutually exclusive branches by using the same pattern with if on one step and ifNot on another

This feature enables more expressive workflow definitions, such as:

  • "Run this step for any user who is NOT an admin"
  • "Run this step for active admins who are NOT suspended"
  • "Branch execution based on a condition (if/else pattern)"

The TypeScript DSL has been updated to support the new ifNot option with proper type checking.

@changeset-bot
Copy link

changeset-bot bot commented Jan 8, 2026

⚠️ No Changeset found

Latest commit: 3f4ff52

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@nx-cloud
Copy link

nx-cloud bot commented Jan 8, 2026

View your CI Pipeline Execution ↗ for commit 3f4ff52

Command Status Duration Result
nx affected -t verify-exports --base=origin/mai... ✅ Succeeded 3s View ↗
nx affected -t build --configuration=production... ✅ Succeeded 3s View ↗
nx affected -t lint typecheck test --parallel -... ✅ Succeeded 27s View ↗
nx run cli:e2e ✅ Succeeded 4s View ↗
nx run edge-worker:e2e ✅ Succeeded 50s View ↗
nx run client:e2e ✅ Succeeded 1m 9s View ↗
nx run edge-worker:test:integration ✅ Succeeded 5m 14s View ↗
nx run core:pgtap ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2026-01-11 19:38:53 UTC

@jumski jumski force-pushed the 01-08-implement_ifnot_negative_condition_pattern branch 2 times, most recently from 06596b7 to d2515c8 Compare January 8, 2026 12:02
@jumski jumski changed the base branch from 01-06-fix_step_array_map_overloads_to_use_topts_intersection_pattern_for_skippability_detection to graphite-base/584 January 8, 2026 12:17
@jumski jumski force-pushed the graphite-base/584 branch from 238c72d to bb09b62 Compare January 8, 2026 12:31
@jumski jumski force-pushed the 01-08-implement_ifnot_negative_condition_pattern branch from d2515c8 to 6eea9d1 Compare January 8, 2026 12:31
@jumski jumski changed the base branch from graphite-base/584 to 01-06-fix_step_array_map_overloads_to_use_topts_intersection_pattern_for_skippability_detection January 8, 2026 12:31
@jumski jumski force-pushed the 01-08-implement_ifnot_negative_condition_pattern branch from 6eea9d1 to d3c1db7 Compare January 8, 2026 13:19
@jumski jumski force-pushed the 01-08-implement_ifnot_negative_condition_pattern branch from d3c1db7 to 4354fcb Compare January 8, 2026 13:43
@jumski jumski force-pushed the 01-06-fix_step_array_map_overloads_to_use_topts_intersection_pattern_for_skippability_detection branch from bb09b62 to 6be7361 Compare January 11, 2026 19:26
@jumski jumski force-pushed the 01-08-implement_ifnot_negative_condition_pattern branch from 4354fcb to 3f4ff52 Compare January 11, 2026 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants