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(codebuild): fails on using PR Events together with FILE_PATH filters in a FilterGroup #9725
Conversation
…h filter when event is push only, fixes #8867
…sing comma trails, fixes #8867
…by/aws-cdk into JaseKirby/fix-issue-8867
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.
Thanks a lot @JaseKirby !
Small comment around the tests, otherwise looks great!
@@ -582,6 +582,36 @@ export = { | |||
|
|||
test.done(); | |||
}, | |||
'with GitHub source including PULL_REQUEST_CREATED Event and FILE_PATH filter'(test: Test) { |
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 change the below test instead? To show that it works now.
'cannot have file path conditions if the Group contains any action other than PUSH'(test: Test) { | ||
const filterGroup = codebuild.FilterGroup.inEventOf(codebuild.EventAction.PULL_REQUEST_CREATED, | ||
codebuild.EventAction.PUSH); | ||
|
||
test.throws(() => { | ||
filterGroup.andFilePathIsNot('.*\\.java'); | ||
}, /A file path condition cannot be added if a Group contains any event action other than PUSH/); | ||
|
||
test.done(); | ||
}, | ||
|
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.
'cannot have file path conditions if the Group contains any action other than PUSH'(test: Test) { | |
const filterGroup = codebuild.FilterGroup.inEventOf(codebuild.EventAction.PULL_REQUEST_CREATED, | |
codebuild.EventAction.PUSH); | |
test.throws(() => { | |
filterGroup.andFilePathIsNot('.*\\.java'); | |
}, /A file path condition cannot be added if a Group contains any event action other than PUSH/); | |
test.done(); | |
}, | |
'can have FILE_PATH filters if the Group contains PUSH and PR_CREATED events'(test: Test) { | |
codebuild.FilterGroup.inEventOf( | |
codebuild.EventAction.PULL_REQUEST_CREATED, | |
codebuild.EventAction.PUSH) | |
.andFilePathIsNot('.*\\.java'); | |
test.done(); | |
}, |
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.
Thanks so much for the contribution @JaseKirby!
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). |
Remove blocking validation on GitHub webhook file path filter when
event
isPUSH
only.Fixes #8867
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license