Skip to content
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

Merged
merged 8 commits into from Aug 17, 2020
Merged

fix(codebuild): fails on using PR Events together with FILE_PATH filters in a FilterGroup #9725

merged 8 commits into from Aug 17, 2020

Conversation

JaseKirby
Copy link
Contributor

@JaseKirby JaseKirby commented Aug 14, 2020

Remove blocking validation on GitHub webhook file path filter when event is PUSH only.

Fixes #8867


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

Copy link
Contributor

@skinny85 skinny85 left a 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) {
Copy link
Contributor

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.

Comment on lines 1634 to 1644
'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();
},

Copy link
Contributor

@skinny85 skinny85 Aug 14, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'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();
},

@skinny85 skinny85 changed the title fix(codebuild): remove validation on github source PR event and file path filter fix(codebuild): fails on using PR Events together with FILE_PATH filters in a FilterGroup Aug 14, 2020
@mergify mergify bot dismissed skinny85’s stale review August 16, 2020 20:22

Pull request has been modified.

Copy link
Contributor

@skinny85 skinny85 left a 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!

@mergify
Copy link
Contributor

mergify bot commented Aug 17, 2020

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-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 2af57c4
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify
Copy link
Contributor

mergify bot commented Aug 17, 2020

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).

@mergify mergify bot merged commit fdaf6bc into aws:master Aug 17, 2020
misterjoshua pushed a commit to misterjoshua/aws-cdk that referenced this pull request Aug 19, 2020
…ers in a FilterGroup (aws#9725)

Remove blocking validation on GitHub webhook file path filter when `event` is `PUSH` only.

Fixes aws#8867

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[aws-codebuild] Codebuild source Github PR doesn't work with FILE_PATH
3 participants