Skip to content

Conversation

jumski
Copy link
Contributor

@jumski jumski commented Sep 16, 2025

TL;DR

Changed initial_tasks from hardcoded "1" to NULL for dependent map steps, improving semantic correctness.

What changed?

  • Modified the database schema to allow NULL values for initial_tasks in the step_states table
  • Added a constraint to ensure initial_tasks is not NULL when a step is started
  • Updated SQL functions to:
    • Set initial_tasks = NULL for dependent map steps during flow creation
    • Resolve the NULL value to the actual array length when dependencies complete
    • Prevent steps with NULL initial_tasks from starting
  • Moved the implementation plan from pkgs/core/PLAN_use_null_for_map_initial_tasks.md to the root directory
  • Updated the PLAN.md to prioritize this change before other map-related work
  • Added new tests to verify the NULL behavior works correctly

How to test?

  • Run the new test files:
    • pkgs/core/supabase/tests/initial_tasks_null/dependent_maps_null.test.sql
    • pkgs/core/supabase/tests/start_flow/dependent_map_initial_tasks_null.test.sql
  • Verify that dependent map steps start with NULL initial_tasks
  • Verify that when dependencies complete, NULL is resolved to the correct array length
  • Verify that steps cannot start with NULL initial_tasks

Why make this change?

This change improves semantic correctness in the system:

  • NULL correctly represents "unknown until dependencies complete"
  • The previous approach of using "1" as a placeholder was misleading
  • This change makes the code more explicit about the state of map steps
  • It's an important foundation for upcoming map features like array distribution and output aggregation

Copy link

changeset-bot bot commented Sep 16, 2025

⚠️ No Changeset found

Latest commit: 2b71eb5

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

Copy link
Contributor

coderabbitai bot commented Sep 16, 2025

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 09-16-make-initial-tasks-nullable

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@jumski jumski marked this pull request as ready for review September 16, 2025 10:33
Copy link

nx-cloud bot commented Sep 16, 2025

View your CI Pipeline Execution ↗ for commit 2b71eb5

Command Status Duration Result
nx run-many -t build --projects client,dsl --co... ✅ Succeeded 4s View ↗
nx affected -t build --configuration=production... ✅ Succeeded 4s View ↗
nx affected -t lint typecheck test --parallel -... ✅ Succeeded 6m 3s View ↗

☁️ Nx Cloud last updated this comment at 2025-09-16 14:45:42 UTC

@jumski jumski force-pushed the 09-16-make-initial-tasks-nullable branch 2 times, most recently from 3de38b1 to de5ffae Compare September 16, 2025 14:25
Copy link
Contributor

🔍 Preview Deployment: Website

Deployment successful!

🔗 Preview URL: https://pr-215.pgflow.pages.dev

📝 Details:

  • Branch: 09-16-make-initial-tasks-nullable
  • Commit: 37984a1b528dd6d509925647e148e191948b5fce
  • View Logs

_Last updated: _

Copy link
Contributor

🔍 Preview Deployment: Playground

Deployment successful!

🔗 Preview URL: https://pr-215--pgflow-demo.netlify.app

📝 Details:

  • Branch: 09-16-make-initial-tasks-nullable
  • Commit: 37984a1b528dd6d509925647e148e191948b5fce
  • View Logs

_Last updated: _

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.

1 participant