-
Notifications
You must be signed in to change notification settings - Fork 4k
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(lambda-nodejs): logLevel
property of BundlingOptions
is ignored when nodeModules
are defined
#18456
Conversation
logLevel
property of BundlingOptions
is ignored when nodeModules
are definedlogLevel
property of BundlingOptions
is ignored when nodeModules
are defined
Title does not follow the guidelines of Conventional Commits. Please adjust title before merge. |
logLevel
property of BundlingOptions
is ignored when nodeModules
are definedlogLevel
property of BundlingOptions
is ignored when nodeModules
are defined
@jogold can you take a look? |
Will do, this week or next week. |
@jogold did you have a chance to take a look at this? |
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.
Sorry for the late reply @flavioleggio.
This looks good.
Can you update the jsdoc in types.ts
both for the LogLevel
enum and the logLevel
prop to reflect that this log level doesn't only apply to esbuild now?
Hi @jogold
No worries!
Done |
@corymhall LGTM |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
…ed when `nodeModules` are defined (aws#18456) In this pull request I managed to propagate the effect of the `logLevel` property downstream to the `PackageManager` class. I had to refactor the static approach for constructing handler objects for the various package managers as we need to pass a new optional property in the `fromLockFile(lockFilePath: string)` static builder method. The value for `installCommand` attribute in the constructor now depends on the log level and the approach varies between package managers: while `npm ci` supports a flexible `--loglevel` command option matching each of the `LogLevel` enum existing values, `yarn install` only supports a `--silent` option and similarly `pnpm install` supports a `--reporter=silent` which suppresses the command output except for errors and warnings. For `yarn` and `pnpm` my idea is to include the silent options whenever a log level is specified and its value is different from the default `LogLevel.INFO`. I also adapted existing unit tests and added new ones taking into account the property's value. I have no experience with yarn and pnpm and I am not sure that any tests exist using bundling with yarn- and pnpm-based lambda function handlers, so I cannot guarantee that my changes work for that too. Fixes aws#18383 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
In this pull request I managed to propagate the effect of the
logLevel
property downstream to thePackageManager
class.I had to refactor the static approach for constructing handler objects for the various package managers as we need to pass a new optional property in the
fromLockFile(lockFilePath: string)
static builder method.The value for
installCommand
attribute in the constructor now depends on the log level and the approach varies between package managers: whilenpm ci
supports a flexible--loglevel
command option matching each of theLogLevel
enum existing values,yarn install
only supports a--silent
option and similarlypnpm install
supports a--reporter=silent
which suppresses the command output except for errors and warnings. Foryarn
andpnpm
my idea is to include the silent options whenever a log level is specified and its value is different from the defaultLogLevel.INFO
.I also adapted existing unit tests and added new ones taking into account the property's value. I have no experience with yarn and pnpm and I am not sure that any tests exist using bundling with yarn- and pnpm-based lambda function handlers, so I cannot guarantee that my changes work for that too.
Fixes #18383
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license