Skip to content

Conversation

@jumski
Copy link
Contributor

@jumski jumski commented Dec 1, 2025

Refactor Flow Compilation Environment Detection

This PR improves how we detect local/development environments for flow compilation by:

  1. Adding an explicit isLocalEnvironment property to the PlatformAdapter interface
  2. Replacing the environment variable-based detection with a cleaner approach that:
    • Removes direct access to environment variables in FlowWorkerLifecycle
    • Adds a new isLocalSupabaseEnv() function for checking environment records
    • Simplifies the flow compilation mode detection logic

The changes make the code more maintainable by:

  • Adding a helpful comment about FlowShape JSON serialization
  • Improving log messages during flow compilation
  • Updating tests to use the new approach for environment detection
  • Making the environment detection more explicit and testable

This refactoring maintains the same behavior while making the code more robust and easier to understand.

@changeset-bot
Copy link

changeset-bot bot commented Dec 1, 2025

⚠️ No Changeset found

Latest commit: 7440546

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 Author

jumski commented Dec 1, 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.

@nx-cloud
Copy link

nx-cloud bot commented Dec 1, 2025

View your CI Pipeline Execution ↗ for commit 7440546

Command Status Duration Result
nx affected -t verify-exports --base=origin/mai... ✅ Succeeded 4s View ↗
nx affected -t build --configuration=production... ✅ Succeeded 26s View ↗
nx affected -t lint typecheck test --parallel -... ✅ Succeeded 3m 54s View ↗
nx run edge-worker:e2e ✅ Succeeded 2m 40s View ↗
nx run cli:e2e ✅ Succeeded 3s View ↗

☁️ Nx Cloud last updated this comment at 2025-12-01 09:48:12 UTC

@jumski jumski changed the base branch from 12-01-add_flow_compilation_at_worker_startup_with_sql_direct_call to graphite-base/475 December 1, 2025 08:54
@jumski jumski force-pushed the graphite-base/475 branch from 1bef6d0 to f98a265 Compare December 1, 2025 08:55
@jumski jumski force-pushed the 12-01-move_local_environment_detection_from_flowworkerlifecycle_to_platformadapter branch from 4074b3f to 88f515d Compare December 1, 2025 08:55
@jumski jumski changed the base branch from graphite-base/475 to 12-01-add_flow_compilation_at_worker_startup_with_sql_direct_call December 1, 2025 08:55
@jumski jumski changed the base branch from 12-01-add_flow_compilation_at_worker_startup_with_sql_direct_call to graphite-base/475 December 1, 2025 09:35
@jumski jumski force-pushed the 12-01-move_local_environment_detection_from_flowworkerlifecycle_to_platformadapter branch from 88f515d to 7440546 Compare December 1, 2025 09:39
@jumski jumski force-pushed the graphite-base/475 branch from f98a265 to c5ef186 Compare December 1, 2025 09:39
@jumski jumski changed the base branch from graphite-base/475 to 12-01-add_flow_compilation_at_worker_startup_with_sql_direct_call December 1, 2025 09:39
@github-actions
Copy link
Contributor

github-actions bot commented Dec 1, 2025

🔍 Preview Deployment: Website

Deployment successful!

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

📝 Details:

  • Branch: 12-01-move_local_environment_detection_from_flowworkerlifecycle_to_platformadapter
  • Commit: 2fde1e2c6ee17d193450f70b90780a8953a4bd91
  • 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.

2 participants