-
Notifications
You must be signed in to change notification settings - Fork 4.2k
feat(codepipeline): branches and files support in git push filter L2 construct #33872
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
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.
(This review is outdated)
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #33872 +/- ##
=======================================
Coverage 82.35% 82.35%
=======================================
Files 120 120
Lines 6941 6941
Branches 1172 1172
=======================================
Hits 5716 5716
Misses 1120 1120
Partials 105 105
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
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, mostly minor comments.
@@ -36,7 +36,21 @@ export interface GitPushFilter { | |||
/** | |||
* Git pull request filter for trigger. | |||
*/ | |||
export interface GitPullRequestFilter { | |||
export interface GitPullRequestFilter extends GitFilter{ |
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.
export interface GitPullRequestFilter extends GitFilter{ | |
export interface GitPullRequestFilter extends GitFilter { |
} | ||
} | ||
|
||
function ValidateGitPushFilter(pushFilter: GitPushFilter[], actionName: string) { |
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.
function ValidateGitPushFilter(pushFilter: GitPushFilter[], actionName: string) { | |
function validateGitPushFilter(pushFilter: GitPushFilter[], actionName: string) { |
if (!pushFilter?.length && !pullRequestFilter?.length) { | ||
throw new UnscopedValidationError(`must specify either GitPushFilter or GitPullRequestFilter for the trigger with sourceAction with name '${sourceAction.actionProperties.actionName}'`); | ||
} | ||
if (pushFilter!== undefined) { |
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.
if (pushFilter!== undefined) { | |
if (pushFilter !== undefined) { |
if (pushFilter!== undefined) { | ||
ValidateGitPushFilter(pushFilter, sourceAction.actionProperties.actionName); | ||
} | ||
if (pullRequestFilter!== undefined) { |
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.
if (pullRequestFilter!== undefined) { | |
if (pullRequestFilter !== undefined) { |
}); | ||
} | ||
|
||
function validateGitPullRequestFilter(pullRequestFilter: GitPullRequestFilter[], actionName: string) { |
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.
Not specific to this line but all the new lines added in this file.
It's really hard to review the validation logics to make sure we don't accidentally introduce breaking change. I appreciate the fact that we're doing synthesis validation to early error out. Curious if there is a way that we can simplify some of the validations and leave it to CFN deployment time?
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"m doing this since I found some ambiguous error msg from codepipeline backend during running integ tests, I believe it will make customer confused. I didn't add any validation check with clear error msg from cp backend.
For the avoiding breaking change, I think the current integ test was working will cover that part.
I'll aslo work on some improvement in our backend part as well
} | ||
|
||
private getTagsFilterProperty(filter: GitPushFilter) : CfnPipeline.GitTagFilterCriteriaProperty | undefined { | ||
return filter.tagsExcludes?.length || filter.tagsIncludes?.length ?{ |
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.
return filter.tagsExcludes?.length || filter.tagsIncludes?.length ?{ | |
return filter.tagsExcludes?.length || filter.tagsIncludes?.length ? { |
|
||
/** | ||
* Git push filter for trigger. | ||
*/ | ||
export interface GitPushFilter { | ||
export interface GitPushFilter extends GitFilter{ |
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.
export interface GitPushFilter extends GitFilter{ | |
export interface GitPushFilter extends GitFilter { |
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). |
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. |
branches and files in git push filter in codepipeline L2 construct
Refer to the README content of reverted pr:(https://github.com/aws/aws-cdk/pull/30462/files). Credit to @go-to-k
Issue # 31009(#31009)
Reason for this change
Branches and files in git push filter under codepipeline trigger has been supported last year, and cdk library didn't support this feature yet.
Description of changes
Support ranches and files in git push filter under codepipeline trigger.
Describe any new or updated permissions being added
No
Description of how you validated changes
Unit test/Integ test/ local deployment
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license