forked from triggerdotdev/trigger.dev
-
Notifications
You must be signed in to change notification settings - Fork 0
[pull] main from triggerdotdev:main #292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ents Vercel's NeonDB integration renders database connection environment variables at runtime, which means Trigger.dev cannot directly sync these values during the build process. This change adds support for fetching branch-specific NeonDB connection strings via the Neon API. Changes: - Discover NEON_PROJECT_ID from incoming Vercel environment variables - Call NeonDB API to search for branches matching the git branch name - Filter branches to find exact matches with Vercel environment prefix (e.g., "preview/branch-name") to avoid false positives from partial string matches - Retrieve branch endpoints and select the write endpoint (or first available) - Build connection strings (DATABASE_URL, POSTGRES_URL, etc.) using the branch endpoint host while preserving user/password credentials Safety measures for non-production environments: - Filter out all Neon-related env vars (DATABASE_URL, PGHOST, etc.) before calling the Neon API to prevent accidental use of production database credentials - Only add branch-specific database env vars if a matching Neon branch is found and the API call succeeds - If neonDbAccessToken is not provided or the API fails, non-production environments will not receive any database connection env vars Usage: Users must provide a NEON_ACCESS_TOKEN (via options or env var) to enable automatic branch resolution for preview deployments. Production environments continue to use Vercel's standard env var sync without modification.
… syncing Add a new `syncNeonEnvVars` build extension for syncing environment variables from Neon database projects to Trigger.dev. The extension automatically detects branches and builds appropriate PostgreSQL connection strings for non-production environments (staging, dev, preview). Features of `syncNeonEnvVars`: - Fetches branch-specific database credentials from Neon API - Generates all standard Postgres connection strings (DATABASE_URL, POSTGRES_URL, POSTGRES_PRISMA_URL, etc.) with both pooled and unpooled variants - Supports custom database name, role name, and env var prefix options - Skips automatically in Vercel environments (Neon's Vercel integration handles this) - Skips for production environments (designed for preview/staging/dev branches) Improvements to `syncVercelEnvVars`: - When running in a Vercel build environment (detected via VERCEL env var), values are now read from process.env instead of the Vercel API response - This ensures the build uses the actual runtime values Vercel provides - Removed embedded Neon-specific logic (now handled by separate extension) - Simplified and cleaned up the extension code Documentation updates for both extensions with usage examples and configuration options.
…ents (#2729) Vercel's NeonDB integration renders database connection environment variables at runtime, which means Trigger.dev cannot directly sync these values during the build process. This change adds support for fetching branch-specific NeonDB connection strings via the Neon API. feat(build): Add syncNeonEnvVars extension and improve Vercel env var syncing Add a new `syncNeonEnvVars` build extension for syncing environment variables from Neon database projects to Trigger.dev. The extension automatically detects branches and builds appropriate PostgreSQL connection strings for non-production environments (staging, dev, preview). Features of `syncNeonEnvVars`: - Fetches branch-specific database credentials from Neon API - Generates all standard Postgres connection strings (DATABASE_URL, POSTGRES_URL, POSTGRES_PRISMA_URL, etc.) with both pooled and unpooled variants - Supports custom database name, role name, and env var prefix options - Skips automatically in Vercel environments (Neon's Vercel integration handles this) - Skips for production environments (designed for preview/staging/dev branches) Improvements to `syncVercelEnvVars`: - When running in a Vercel build environment (detected via VERCEL env var), values are now read from process.env instead of the Vercel API response - This ensures the build uses the actual runtime values Vercel provides - Removed embedded Neon-specific logic (now handled by separate extension) - Simplified and cleaned up the extension code Documentation updates for both extensions with usage examples and configuration options. Closes #2714 ## ✅ Checklist - [x] I have followed every step in the [contributing guide](https://github.com/triggerdotdev/trigger.dev/blob/main/CONTRIBUTING.md) - [x] The PR title follows the convention. - [x] I ran and tested the code works --- ## Testing Set up Vercel + Trigger.dev envs, used Vercel's chat-bot-ai template.
chore: Improve Vercel/Neon `syncEnvVars` build extensions docs
…low (#2748) Improved a couple of error messages. Also fixed an issue with the s2 token caching.
The previous examples lacked start and end anchors
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )