- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 660
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
Vercel sync env vars extension #1425
Conversation
🦋 Changeset detectedLatest commit: abf51d1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 10 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughA new extension for synchronizing environment variables with Vercel has been implemented. This extension requires a Vercel project ID and an access token, automating the synchronization process during the deployment of Trigger.dev tasks. Additionally, the core module has been updated to export the new functionality, and a new function, Changes
Possibly related PRs
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
@trigger.dev/build
@trigger.dev/core
@trigger.dev/react-hooks
trigger.dev
@trigger.dev/sdk
commit: |
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
packages/build/src/extensions/vercelSyncEnvVars.ts (1)
14-24
: Simplify and enhance error messages for clarityConsider refining the error messages to be more concise and user-friendly. This improves readability and assists users in quickly understanding the issue.
Apply this diff to adjust the error messages:
- "vercelSyncEnvVars: you did not pass in a projectId or set the VERCEL_PROJECT_ID env var.", + "Missing 'projectId'. Provide it via options or set the 'VERCEL_PROJECT_ID' environment variable.",Similarly, adjust the
vercelAccessToken
error message:- "vercelSyncEnvVars: you did not pass in a vercelAccessToken or set the VERCEL_ACCESS_TOKEN env var.", + "Missing 'vercelAccessToken'. Provide it via options or set the 'VERCEL_ACCESS_TOKEN' environment variable.",
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
- .changeset/good-ligers-sit.md (1 hunks)
- packages/build/src/extensions/vercelSyncEnvVars.ts (1 hunks)
🧰 Additional context used
🪛 LanguageTool
.changeset/good-ligers-sit.md
[uncategorized] ~5-~5: Possible missing comma found.
Context: ...on. Given a Vercel projectId and access token it will sync Vercel env vars when deplo...(AI_HYDRA_LEO_MISSING_COMMA)
🔇 Additional comments (7)
.changeset/good-ligers-sit.md (1)
1-5
: LGTM! Minor grammatical suggestion and request for additional information.The changeset file correctly documents the patch update for the "@trigger.dev/build" package. However, there's a minor grammatical issue in the description, and it could benefit from more details.
Consider adding a comma after "access token" in the description:
-Added a Vercel sync env vars extension. Given a Vercel projectId and access token it will sync Vercel env vars when deploying Trigger.dev tasks. +Added a Vercel sync env vars extension. Given a Vercel projectId and access token, it will sync Vercel env vars when deploying Trigger.dev tasks.Could you provide more information on how users can utilize this new extension? For example:
- Are there any configuration steps required?
- How does one specify the Vercel projectId and access token?
- Are there any limitations or considerations users should be aware of?
Adding this information would make the changeset more informative for users and maintainers.
🧰 Tools
🪛 LanguageTool
[uncategorized] ~5-~5: Possible missing comma found.
Context: ...on. Given a Vercel projectId and access token it will sync Vercel env vars when deplo...(AI_HYDRA_LEO_MISSING_COMMA)
packages/build/src/extensions/vercelSyncEnvVars.ts (6)
4-6
: FunctionsyncVercelEnvVars
is well-definedThe
syncVercelEnvVars
function is correctly defined, exporting aBuildExtension
and accepting optional parameters for flexibility.
8-12
: Environment variables resolution order is appropriateThe code appropriately prioritizes
options
, thenprocess.env
, and finallyctx.env
when retrievingprojectId
andvercelAccessToken
.
35-39
: Proper validation ofvercelEnvironment
Excellent use of error handling to ensure
vercelEnvironment
is valid, enhancing robustness.
58-61
: [Duplicate Comment] Extract inline types into interfaces for better maintainabilityThe inline type annotations in the filter function can reduce readability. Consider defining interfaces or type aliases for the environment variable objects.
69-73
: [Duplicate Comment] Avoid logging potentially sensitive error informationLogging the entire
error
object may expose sensitive information. Consider logging only the error message to prevent leaking stack traces or other details.
77-82
: Extension structure is correctly implementedThe returned object properly defines the extension name and the
onBuildComplete
method, ensuring integration with the build process.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Outside diff range and nitpick comments (2)
packages/build/src/extensions/core.ts (1)
6-6
: Consider maintaining alphabetical order of exports.For better maintainability, consider moving the new export statement to maintain alphabetical ordering with other exports.
export * from "./core/additionalFiles.js"; export * from "./core/additionalPackages.js"; -export * from "./core/syncEnvVars.js"; export * from "./core/aptGet.js"; export * from "./core/ffmpeg.js"; +export * from "./core/syncEnvVars.js"; export * from "./core/vercelSyncEnvVars.js";packages/build/src/extensions/core/vercelSyncEnvVars.ts (1)
69-74
: Consider using a dedicated logging utility instead ofconsole.error
For better log management and consistency across the application, consider using a logging framework or the existing logging infrastructure instead of
console.error
.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
- packages/build/src/extensions/core.ts (1 hunks)
- packages/build/src/extensions/core/vercelSyncEnvVars.ts (1 hunks)
🧰 Additional context used
🔇 Additional comments (1)
packages/build/src/extensions/core.ts (1)
6-6
: LGTM! Export statement follows established patterns.The new export statement correctly follows the module's established patterns for exposing core functionality.
Summary by CodeRabbit
New Features
Documentation