pipelines: support batch enabled CodeBuild projects in CodePipeline
- Dominant language
- TypeScript
- Stars
- 12.9k
- Forks
- 4.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 83
Description
### Describe the feature
CodeBuild projects can run a single BuildSpec in parallel. This greatly reduces the pipeline wall time for large suites of integration tests or other long running parallelizable tasks. It is achieved by enabling batch building for the project.
The L2 construct `aws-codepipeline.Pipeline` supports this as easy as setting `executeBatchBuild` on the properties when creating a [CodeBuildAction](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_codepipeline_actions.CodeBuildAction.html).
The L3 construct `pipelines.CodePipeline` maps into a L2 Pipeline, so it seems it would be a simple affair to have a new property for its [CodeBuildStep](https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/pipelines/lib/codepipeline/codebuild-step.ts) that is conveyed to the L2 construct.
### Use Case
I want the self-updating feature of the L3 construct, but also want to run tests in parallel without having to rewrite to the L2 construct.
### Proposed Solution
Add a new property `CodeBuildStepProps.buildType` (same name as in the Console), that has enum values `Single` (default) and `Batch`.
Or simply `CodeBuildStepProps.executeBatchBuild` with a boolean value same as `CodeBuildAction` since the `CodeBuildStep` is CodeBuild specific, after all. And this avoids confusing it with `CodeBuildStepProps.type`, which I couldn't find in the Console.
### Other Information
_No response_
### Acknowledgements
- [ ] I may be able to implement this feature request
- [ ] This feature might incur a breaking change
### CDK version used
2.132.1 (build 9df7dd3)
### Environment details (OS name and version, etc.)
Windows 10 Version 22H2
Contributor guide
Research direction
Start with packages/aws-cdk-lib/pipelines/lib/codepipeline/codebuild-step.ts and trace how CodeBuildStep is conveyed to the L2 CodeBuildAction. Check the existing CodeBuildAction batch-build option, then verify that a CodeBuildStep can opt into batch builds while retaining the current single-build default.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, typescript
- Domain
- cloud, devops
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100