feat(codepipeline): branches and files support in git push filter L2 construct#33872
feat(codepipeline): branches and files support in git push filter L2 construct#33872mergify[bot] merged 3 commits intoaws:mainfrom
Conversation
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.
| * Git pull request filter for trigger. | ||
| */ | ||
| export interface GitPullRequestFilter { | ||
| export interface GitPullRequestFilter extends GitFilter{ |
There was a problem hiding this comment.
| export interface GitPullRequestFilter extends GitFilter{ | |
| export interface GitPullRequestFilter extends GitFilter { |
| } | ||
| } | ||
|
|
||
| function ValidateGitPushFilter(pushFilter: GitPushFilter[], actionName: string) { |
There was a problem hiding this comment.
| 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.
| if (pushFilter!== undefined) { | |
| if (pushFilter !== undefined) { |
| if (pushFilter!== undefined) { | ||
| ValidateGitPushFilter(pushFilter, sourceAction.actionProperties.actionName); | ||
| } | ||
| if (pullRequestFilter!== undefined) { |
There was a problem hiding this comment.
| if (pullRequestFilter!== undefined) { | |
| if (pullRequestFilter !== undefined) { |
| }); | ||
| } | ||
|
|
||
| function validateGitPullRequestFilter(pullRequestFilter: GitPullRequestFilter[], actionName: string) { |
There was a problem hiding this comment.
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.
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.
| 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.
| 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