[aws-codepipeline-actions] fetchSubmodules support for all Sources
- Dominant language
- TypeScript
- Stars
- 12.9k
- Forks
- 4.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 83
Description
`BitBucketSourceAction` is required to setup a pipeline using BitBucket. It's easy enough to setup codestar to work with this for private repos. The issue I am running into, is that submodules are not being included in the source code. This makes it impossible to use the pipeline in it's current state.
Please add the ability to specify submodule in the action and ideally, make it match what is possible in the console. I cannot even choose the events I want to trigger either which is a big issue as well but one I have been dealing with for a while now.
### Use Case
Submodules are a necessary part of all git projects I am working on. This limitation is making using pipelines extremely difficult because now the only solution is to use keys and checkout the repo in codebuild. This is not only redundant, it makes this action useless for anything other than a simple git project. Again, you cannot even control the events so you cannot stop building on every commit to the repo. No ability to add a nobuild comment or control the events you want to trigger the build.
### Proposed Solution
Ideal solution would be to allow the same props as the Codebuild BitBucketSourceProps: https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-codebuild.BitBucketSourceProps.html
It seems you cannot use that for the pipeline with the CDK and that really stinks because it has everything I need...
### Other
I am currently using:
```typescript
new BitBucketSourceAction({
actionName: 'BitBucket',
branch: this._props.git.branch,
codeBuildCloneOutput: true,
connectionArn: this._props.git.codeStartArn,
output: this._artifactBaseSource,
owner: this._props.git.owner,
repo: this._props.git.repo,
}),
```
This is what I used to use before I figured out this was not possible to use with code pipeline:
```typescript
const bbSource = codebuild.Source.bitBucket({
branchOrRef: this._props.git.branch,
cloneDepth: 1,
fetchSubmodules: true,
owner: this._props.git.owner,
repo: this._props.git.repo,
webhook: true,
webhookFilters: [
// Only on PUSH and PR Merged do we build (no support for message yet to allow for no builds)
codebuild.FilterGroup.inEventOf(codebuild.EventAction.PUSH, codebuild.EventAction.PULL_REQUEST_MERGED).andBranchIs(GIT_REPO_BRANCH)
]
});
```
The codebuild props allow more control. Ideally, I would prefer the ability to use that over the `BitBucketSourceAction` but this is not possible.
It should also be noted that `codeBuildCloneOutput` is not very clear on what it does. I cannot find any examples of how to use this properly so not really sure if I even need this.
I cannot select full clone for the repo even though it is an option when I go to edit the source in the pipeline. I bring this up because there is a work-a-round here: https://stackoverflow.com/a/64163023/650206
Basically, I cannot use CDK pipelines yet due to this limitation with the CDK. This seems like a pretty serious issue and moving from BitBucket is not an option. May need to go back to Terraform for this and that is not ideal.
* [ ] :wave: I may be able to implement this feature request
* [ ] :warning: This feature might incur a breaking change
---
This is a :rocket: Feature Request
Contributor guide
Research direction
Start at the BitBucketSourceAction entry point in the AWS CDK source and compare its available properties with CodeBuild's BitBucketSourceProps, especially fetchSubmodules and clone behavior. Trace the source-action configuration and existing tests, then verify that submodule support is available for the relevant source actions and that the generated pipeline configuration matches the requested behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, typescript
- Domain
- cloud, devops
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100