Skip to content

Conversation

@jumski
Copy link
Contributor

@jumski jumski commented Jan 6, 2026

Add type-safe condition patterns for Flow steps

This PR introduces a new ContainmentPattern<T> utility type that provides type safety for condition patterns in Flow steps. The implementation matches PostgreSQL's JSON containment semantics (@>) where:

  • Primitives require exact value matches
  • Objects have all keys optional and are recursively applied
  • Arrays expect elements to be present in the target array

The PR enhances the Flow API by:

  1. Adding proper type checking for condition options in all step methods
  2. Ensuring conditions for root steps match the flow input structure
  3. Ensuring conditions for dependent steps match the dependency object structure
  4. Preventing invalid keys or value types in condition patterns

Comprehensive type tests are included to verify the behavior of the ContainmentPattern<T> utility and its integration with the Flow API.

@changeset-bot
Copy link

changeset-bot bot commented Jan 6, 2026

⚠️ No Changeset found

Latest commit: 966c7d1

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 6, 2026

View your CI Pipeline Execution ↗ for commit 966c7d1

Command Status Duration Result
nx run edge-worker:test:integration ✅ Succeeded 3m 54s View ↗
nx run client:e2e ✅ Succeeded 1m 9s View ↗
nx run core:pgtap ✅ Succeeded <1s View ↗
nx run cli:e2e ✅ Succeeded 4s View ↗
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 26s View ↗
nx run edge-worker:e2e ✅ Succeeded 51s View ↗

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

@jumski jumski force-pushed the 01-05-add_whenfailed_option_for_error_handling_after_retries_exhausted branch from ccaa5de to 46b2302 Compare January 6, 2026 18:17
@jumski jumski force-pushed the 01-06-add_containmentpattern_t_type_for_type-safe_condition_options_in_dsl branch from f6528a8 to a3b1845 Compare January 6, 2026 18:17
@jumski jumski force-pushed the 01-05-add_whenfailed_option_for_error_handling_after_retries_exhausted branch from 46b2302 to c25ab9f Compare January 8, 2026 11:15
@jumski jumski force-pushed the 01-06-add_containmentpattern_t_type_for_type-safe_condition_options_in_dsl branch from a3b1845 to 2b3cca7 Compare January 8, 2026 11:15
@jumski jumski force-pushed the 01-06-add_containmentpattern_t_type_for_type-safe_condition_options_in_dsl branch from 2b3cca7 to 966c7d1 Compare January 11, 2026 19:26
@jumski jumski force-pushed the 01-05-add_whenfailed_option_for_error_handling_after_retries_exhausted branch from c25ab9f to 8863a35 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