Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR simplifies the S3 configuration validation by removing the redundant check for the key variable, which is hardcoded and therefore always defined. The changes update both the TypeScript lambda handler and the Dockerfile to reflect this simplification.
- Removed unnecessary validation check for the hardcoded
keyvariable in the lambda handler - Updated error messages to only reference
S3_BUCKET_NAMEas the required environment variable - Cleaned up Dockerfile to remove unused
ARGdeclaration (though a duplicateENVstatement was introduced)
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| scripts/src/lambda-handler.ts | Simplified validation logic to only check for bucketName since key is hardcoded and always defined |
| scripts/Dockerfile.script | Removed unused ARG AWS_S3_BUCKET_NAME declaration and added ENV statement (resulting in duplicate) |
Comments suppressed due to low confidence (1)
scripts/Dockerfile.script:28
- The
ENV S3_BUCKET_NAME=${AWS_S3_BUCKET_NAME}statement is duplicated on lines 24 and 28. Remove the duplicate declaration.
ENV S3_BUCKET_NAME=${AWS_S3_BUCKET_NAME}
RUN npx playwright install chromium --with-deps && \
npx playwright install-deps chromium
ENV S3_BUCKET_NAME=${AWS_S3_BUCKET_NAME}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| RUN npm install aws-lambda-ric | ||
| RUN npm ci --only=production | ||
| ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright | ||
| ENV S3_BUCKET_NAME=${AWS_S3_BUCKET_NAME} |
There was a problem hiding this comment.
The environment variable S3_BUCKET_NAME is being set to ${AWS_S3_BUCKET_NAME}, but AWS_S3_BUCKET_NAME is no longer defined as an ARG (it was removed in this PR). This will result in S3_BUCKET_NAME being set to an empty string at build time. Either restore the ARG AWS_S3_BUCKET_NAME declaration or rely on the runtime environment to provide this variable and remove these ENV declarations.
No description provided.