-
-
Notifications
You must be signed in to change notification settings - Fork 635
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
Fix: Extract the correct SDK version during build #1530
Conversation
🦋 Changeset detectedLatest commit: 0e2b2c2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 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 |
WalkthroughThis pull request updates the SDK version in the build manifest and introduces enhancements to the Changes
Possibly related PRs
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 eslint
apps/webapp/app/presenters/v3/DeploymentPresenter.server.tsOops! Something went wrong! :( ESLint: 8.45.0 ESLint couldn't find the config "custom" to extend from. Please check that the name of the config is correct. The config "custom" was referenced from the config file in "/.eslintrc.js". If you still have problems, please stop by https://eslint.org/chat/help to chat with the team. 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: 0
🧹 Outside diff range and nitpick comments (1)
packages/cli-v3/src/build/plugins.ts (1)
95-184
: Consider adding unit tests forSdkVersionExtractor
To ensure reliability and facilitate future maintenance, consider adding unit tests for the
SdkVersionExtractor
class. Testing scenarios should include:
- Successful extraction of the SDK version.
- Handling cases where the package is not found.
- Situations where the package does not have the expected name or version.
- Error conditions during file reading or JSON parsing.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (5)
.changeset/fuzzy-doors-know.md
(1 hunks)apps/webapp/app/presenters/v3/DeploymentPresenter.server.ts
(2 hunks)apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.deployments.$deploymentParam/route.tsx
(1 hunks)packages/cli-v3/src/build/buildWorker.ts
(4 hunks)packages/cli-v3/src/build/plugins.ts
(2 hunks)
✅ Files skipped from review due to trivial changes (1)
- .changeset/fuzzy-doors-know.md
🔇 Additional comments (7)
packages/cli-v3/src/build/plugins.ts (2)
7-10
: Approved the addition of necessary imports
The new imports for esmResolveSync
, readPackageJSON
, resolvePackageJSON
, dirname
, and readJSONFile
are appropriate and necessary for the functionality introduced in the SdkVersionExtractor
class.
95-184
: Implementation of SdkVersionExtractor
class is well-structured
The SdkVersionExtractor
class effectively encapsulates the logic for extracting the SDK version from the package. The use of an esbuild plugin to integrate this extraction into the build process is appropriate. Error handling and logging provide clarity during debugging.
apps/webapp/app/presenters/v3/DeploymentPresenter.server.ts (2)
111-111
: Approved inclusion of cliVersion
in worker selection
Including cliVersion
in the worker
selection ensures that the CLI version is retrieved alongside other relevant data.
149-149
: Approved addition of cliVersion
to deployment data
Adding cliVersion
to the deployment object correctly exposes the CLI version in the response, enabling it to be used in the UI and other components.
packages/cli-v3/src/build/buildWorker.ts (2)
30-30
: Integration of SdkVersionExtractor
into build process is appropriate
The inclusion of SdkVersionExtractor
and its plugin into the build process allows for dynamic extraction of the SDK version during the build. This enhancement is well-integrated and maintains the extensibility of the build system.
Also applies to: 65-66, 75-75
87-87
: Approved setting packageVersion
using extracted SDK version
Using sdkVersionExtractor.sdkVersion
for packageVersion
, with a fallback to CORE_VERSION
, ensures that the build manifest reflects the correct SDK version. This approach maintains compatibility while dynamically incorporating version information.
apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.deployments.$deploymentParam/route.tsx (1)
154-157
: Approved addition of CLI Version
to deployment details
Displaying the CLI Version
in the deployment details provides users with valuable information about the deployment environment. The implementation follows the existing pattern and handles the absence of cliVersion
gracefully.
logger.debug("[SdkVersionExtractor] Extracting SDK version", { args }); | ||
|
||
try { | ||
const resolvedPath = esmResolveSync(args.path, { |
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.
You'll need to dynamically require mlly
or else the CLI won't build
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.
Actually scratch that, it's not true. Leaving this here for self-shame reasons.
@trigger.dev/build
@trigger.dev/core
@trigger.dev/react-hooks
trigger.dev
@trigger.dev/sdk
@trigger.dev/rsc
commit: |
Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
Refactor
DeploymentPresenter
to include CLI version in deployment responses.Chores