fix(stepfunctions): disabling logging still requires LogGroup#30816
fix(stepfunctions): disabling logging still requires LogGroup#30816mergify[bot] merged 9 commits intoaws:mainfrom
Conversation
aws-cdk-automation
left a comment
There was a problem hiding this comment.
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.
This comment was marked as resolved.
This comment was marked as resolved.
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
| * @default No log group. Required if your log level is not set to OFF. | ||
| */ | ||
| readonly destination: logs.ILogGroup; | ||
| readonly destination?: logs.ILogGroup; |
There was a problem hiding this comment.
will this not be a breaking change for existing usage? example:
const logOptions: LogOptions = {
destination: <LogGroup>
}
const stateMachine: StateMachine = new StateMachine(parent, 'ID', {
logs: logOptions,
...
}
...
stateMachine.logs.destination.logGroupName // Error
stateMachine.logs.destination!.logGroupName // Change needed
Some user(s) might be utilising ILogGroup's public properties from logOptions which will now cause issues because now such users will need to make non-null assertions before using such properties (e.g. with !)
There was a problem hiding this comment.
According to the jsii-diff documentation:
You are allowed to make inputs optional
So i think this change is not a breaking change.
There was a problem hiding this comment.
I think @Tietew is right here. The example Chakshu mentioned is output property while the changed code is for input property.
|
|
||
| expect(() => { | ||
| new sfn.StateMachine(stack, 'MyStateMachine', { | ||
| definitionBody: sfn.DefinitionBody.fromChainable(sfn.Chain.start(new sfn.Pass(stack, 'Pass'))), |
There was a problem hiding this comment.
can we not directly pass new sfn.Pass(stack, 'Pass') to DefintionBody.fromChainable as Pass implements IChainable?
There was a problem hiding this comment.
it's just a copy & paste.
README also uses sfn.Chain.start() instead of bare sfn.Pass.
LogOptions.destination optional
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #30816 +/- ##
=======================================
Coverage 82.16% 82.16%
=======================================
Files 119 119
Lines 6857 6857
Branches 1157 1157
=======================================
Hits 5634 5634
Misses 1120 1120
Partials 103 103
Flags with carried forward coverage won't be shown. Click here to find out more.
|
GavinZZ
left a comment
There was a problem hiding this comment.
LGTM, thank you and apologize for the wait on the review!
| * @default No log group. Required if your log level is not set to OFF. | ||
| */ | ||
| readonly destination: logs.ILogGroup; | ||
| readonly destination?: logs.ILogGroup; |
There was a problem hiding this comment.
I think @Tietew is right here. The example Chakshu mentioned is output property while the changed code is for input property.
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
|
This pull request has been removed from the queue for the following reason: The pull request can't be updated You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. If you want to requeue this pull request, you need to post a comment with the text: |
|
@Mergifyio update |
❌ Mergify doesn't have permission to updateDetailsFor security reasons, Mergify can't update this pull request. Try updating locally. |
|
@mergify update |
☑️ Nothing to doDetails
|
Pull request has been modified.
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 main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
|
Comments on closed issues and PRs are hard for our team to see. |
Issue # (if applicable)
Closes #30814.
Reason for this change
To disable logging on a StateMachine (with logging enabled), we should specify
LogLevel.OFFtoLogOptions.level. But cannot remove the LogGroup becauseLogOptions.destinationis required.Description of changes
LogOptions.destinationoptional.LogOptions.destinationis present whenLogOptions.levelis notOFF.Description of how you validated changes
Unit and integ tests that verify
LogOptions.destinationis opitional whenLogOptions.levelisOFFand throw an exception otherwise.Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license