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): use enum values for applicationLogLevel and systemLogLevel #29904
base: main
Are you sure you want to change the base?
Conversation
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.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request
. Additionally, if clarification is needed add Clarification Request
to a comment.
Exemption Request: minor typescript change |
Hi @dali546, thanks for making this change! Not sure why it wasn't an enum before. I'll have to double check to see if this is backwards compatible. In the meantime looks like the build step is failing because the some integration test snapshots need updates. You can use |
Hi @aaythapa, thank you for taking a look at this PR... I've cloned down this repo, but unsure where to run |
Hi @dali546, looking through the build log and I see You can enforce the enum type by making a new property (maybe called This PR pretty much fixes the same issue you're trying to fix so feel free to use it as reference (note this PR doesn't deprecate the old property for some reason, this pr is a good example of adding a deprecated label). You can use our integ test guide to add new integ tests. |
Hi @aaythapa. I need a little help. Locally I am trying to run Any advice? |
Hi @dali546, sorry about the delay. Not sure what the exact issue could be. You can try deleting the snapshot folder for the test and re-making it. I see that |
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
bac94f7
to
f027aeb
Compare
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.
@dali546 looks good, just some small final comments.
systemLogLevelV2: lambda.SystemLogLevel.WARN, | ||
}); | ||
}).toThrow(/Only define systemLogLevel or systemLogLevelV2, not both./); | ||
}); |
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.
Can you add one more test for the case where systemLogLevelV2
or applicationLogLevelV2
is set but loggingFormat
isn't set to LoggingFormat.JSON
code: new lambda.InlineCode('foo'), | ||
handler: 'index.handler', | ||
runtime: lambda.Runtime.NODEJS_18_X, | ||
logFormat: lambda.LogFormat.JSON, |
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.
nit: can you use loggingFormat here too
@mergify update |
✅ Branch has been successfully updated |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Issue # (if applicable)
Reason for this change
Enumerate
ApplicationLogLevel
andSystemLogLevel
to help with typingDescription of changes
Both fields should use the enum type for available options
Description of how you validated changes
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license