-
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(stepfunctions): disabling logging still requires LogGroup #30816
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.
This comment was marked as resolved.
This comment was marked as resolved.
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
*/ | ||
readonly destination: logs.ILogGroup; | ||
readonly destination?: logs.ILogGroup; |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we not directly pass new sfn.Pass(stack, 'Pass')
to DefintionBody.fromChainable
as Pass implements IChainable
?
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.
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.
|
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.
LGTM, thank you and apologize for the wait on the review!
*/ | ||
readonly destination: logs.ILogGroup; | ||
readonly destination?: logs.ILogGroup; |
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.
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 updateFor security reasons, Mergify can't update this pull request. Try updating locally. |
@mergify update |
☑️ Nothing to do
|
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.OFF
toLogOptions.level
. But cannot remove the LogGroup becauseLogOptions.destination
is required.Description of changes
LogOptions.destination
optional.LogOptions.destination
is present whenLogOptions.level
is notOFF
.Description of how you validated changes
Unit and integ tests that verify
LogOptions.destination
is opitional whenLogOptions.level
isOFF
and 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