aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.72k stars 3.94k forks source link

codepipeline: Add Branches and File Paths to CodePipeline pipeline GitPushFilter configuration #31009

Open wilhen01 opened 4 months ago

wilhen01 commented 4 months ago

Describe the feature

Currently, as it seems, only tag-based filters are available (or exposed) in CodePipeline pipeline GitPushFilter configuration via tagsExcludes and tagsIncludes parameters. However, both Branches and FilePaths options exist in CloudFormation spec https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codepipeline-pipeline-gitpushfilter.html Can you please add the two missing configuration parameters? Thanks!

Use Case

Branch-based pipeline trigger.

Proposed Solution

Add branchesExclude, branchesInclude, filePathsExclude and filePathsInclude parameters to match CloudFormation spec.

Other Information

Previously raised as #29124 but the fix was reverted so opening this to track progress on actually getting it implemented.

Acknowledgements

CDK version used

v2.128.0 (TypeScript)

Environment details (OS name and version, etc.)

MacOS Sonoma 14.3.1

einstein-aws commented 4 months ago

I submitted this feature request initially in https://github.com/aws/aws-cdk/issues/29124 and I would love it see it added. Thanks!

wilhen01 commented 4 months ago

There also appears to be a draft PR #30516 which goes some way to implementing this issue?

ashishdhingra commented 4 months ago

The workaround mentioned here is to use escape hatch. The filters Branches and FilePaths mentioned at AWS::CodePipeline::Pipeline GitPushFilter are missing from GitPushFilter.

The PR https://github.com/aws/aws-cdk/pull/30516/ appears to deprecate existing filters in favor of CodeStarSourceConnection Source Action as in file diff.

shandc007 commented 4 weeks ago

Any update on #31009? The escape hatch is also not working