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

@changeset-bot
Copy link

changeset-bot bot commented Sep 16, 2025

⚠️ No Changeset found

Latest commit: 4665802

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

@coderabbitai
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.

Copy link
Contributor Author

jumski commented Sep 16, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge:queue - adds this PR to the back of the merge queue
  • hotfix:queue - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

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

nx-cloud bot commented Sep 16, 2025

View your CI Pipeline Execution ↗ for commit 4665802

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

☁️ Nx Cloud last updated this comment at 2025-10-06 15:42:27 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
@jumski jumski force-pushed the 09-16-make-initial-tasks-nullable branch from de5ffae to 2b71eb5 Compare September 16, 2025 14:37
@jumski jumski force-pushed the 09-16-make-initial-tasks-nullable branch from 2b71eb5 to dd1dde0 Compare October 5, 2025 18:59
@jumski jumski force-pushed the 09-15-complete-cascade branch from 474b8fd to 5a6c7d3 Compare October 5, 2025 18:59
@jumski jumski force-pushed the 09-15-complete-cascade branch from 5a6c7d3 to 7da0caf Compare October 5, 2025 19:20
@jumski jumski force-pushed the 09-16-make-initial-tasks-nullable branch from dd1dde0 to 2adddf3 Compare October 5, 2025 19:20
@jumski jumski force-pushed the 09-15-complete-cascade branch from 7da0caf to a422670 Compare October 6, 2025 15:25
@jumski jumski force-pushed the 09-16-make-initial-tasks-nullable branch from 2adddf3 to 4665802 Compare October 6, 2025 15:25
@github-actions
Copy link
Contributor

github-actions bot commented Oct 6, 2025

🔍 Preview Deployment: Website

Deployment successful!

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

📝 Details:

  • Branch: 09-16-make-initial-tasks-nullable
  • Commit: 63917dfca8b151da154a86b2b609eb27ce747ad5
  • View Logs

_Last updated: _

@github-actions
Copy link
Contributor

github-actions bot commented Oct 6, 2025

🔍 Preview Deployment: Playground

Deployment successful!

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

📝 Details:

  • Branch: 09-16-make-initial-tasks-nullable
  • Commit: 63917dfca8b151da154a86b2b609eb27ce747ad5
  • View Logs

_Last updated: _

@graphite-app
Copy link
Contributor

graphite-app bot commented Oct 7, 2025

Merge activity

  • Oct 7, 8:28 AM UTC: jumski added this pull request to the Graphite merge queue.
  • Oct 7, 8:29 AM UTC: CI is running for this pull request on a draft pull request (#232) due to your merge queue CI optimization settings.
  • Oct 7, 8:29 AM UTC: Merged by the Graphite merge queue via draft PR: #232.

graphite-app bot pushed a commit that referenced this pull request Oct 7, 2025
…215)

### 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
@graphite-app graphite-app bot closed this Oct 7, 2025
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