-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix(aws): Resolve all Sentry packages to local versions in layer build #17106
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
Conversation
size-limit report 📦
|
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.
Bug: Incorrect Path Resolution in `buildPackageJson`
The packagesDir
path in the buildPackageJson
function is incorrectly resolved. path.resolve(__dirname, '..')
points to packages/aws-serverless
, but it should point to the monorepo's root packages
directory to scan all Sentry packages for resolutions
. The correct path is path.resolve(__dirname, '../..')
.
packages/aws-serverless/scripts/buildLambdaLayer.ts#L144-L145
sentry-javascript/packages/aws-serverless/scripts/buildLambdaLayer.ts
Lines 144 to 145 in 38b810e
console.log('Building package.json'); | |
const packagesDir = path.resolve(__dirname, '..'); |
Bug: Incorrect Path in Lambda Layer Package.json
The package.json
generated for the AWS Lambda layer at ./build/aws/dist-serverless/nodejs/package.json
contains an incorrect relative path in its resolutions
field. The path file:../../../../../../packages/${packageDir}
is one level too deep and includes a redundant packages/
segment. The correct path should be file:../../../../../${packageDir}
to properly reference local packages, otherwise, yarn resolutions will point to incorrect locations.
packages/aws-serverless/scripts/buildLambdaLayer.ts#L161-L162
sentry-javascript/packages/aws-serverless/scripts/buildLambdaLayer.ts
Lines 161 to 162 in 38b810e
if (typeof packageName === 'string' && packageName) { | |
resolutions[packageName] = `file:../../../../../../packages/${packageDir}`; |
Was this report helpful? Give feedback by reacting with 👍 or 👎
This fixes the AWS Layer release build which tried to fetch the new package versions from the NPM registry, which don't exist yet during the build. We now build a new
package.json
that usesresolutions
to point all Sentry packages to their local version.