fix(aws): Resolve all Sentry packages to local versions in layer build#17106
fix(aws): Resolve all Sentry packages to local versions in layer build#17106
Conversation
size-limit report 📦
|
There was a problem hiding this comment.
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
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
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.jsonthat usesresolutionsto point all Sentry packages to their local version.