aws / aws/aws-cdk

pipelines: additionalInputs documentation is lacking in detail

Open
#30,188 4 comments 1 reaction 0 assignees View on GitHub
@aws-cdk/pipelines documentation effort/medium feature-request p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Describe the issue

We have one repository with tooling and another repository with application code to be analyzed. This seems to fit with using toolingRepo as the main input and appRepo as an additionalInput. However, the documentation does not have enough detail to set this up correctly without trial and failure.

At first attempt I got the error message
```
additionalInputs: "../app-repo" must not exist yet. If you want to merge multiple artifacts, use a "cp" command.
```

Google led me to https://github.com/aws/aws-cdk/issues/17224 which is unhelpful, because the error message was actually true: The sibling directory `app-repo` did indeed exist.

It turns out CodePipeline action provider "GitHub (Version 2)" and CodePipeline action input artifacts works together to put the repository source code in a sibling directory named the same as the repository. So the documentation may mention something like:

> The construct works by making the specified directory into a symlink to the output file set. Note that the output file set may already exist as a sibling directory. Eg. source code can exist with the repository name as a sibling directory name, in which case symlink creation will fail and you need to use a different sibling directory name.

Once I had understood the above, my next task failed because a file was not found. It appears that when there are multiple source repositories, any step that does not explicitly set its `input` will just get one of them, including ones used in `additionalInputs`. So the documentation might make it clear:

> When you have specified a `CodePipelineSource` as an additional input, CDK will no longer know which source to use as the default for other steps. You must explicitly specify `input` for all steps in the pipeline.

### Links

https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.pipelines-readme.html#additional-inputs
https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.pipelines.ShellStepProps.html#additionalinputs

Contributor guide

Open the contributing guide

Research direction

Start with the additional-inputs section in the aws-cdk-lib.pipelines README and the ShellStepProps additionalInputs API documentation linked in the issue. Document sibling-directory and symlink behavior, and explain that every step must explicitly set input when an additional CodePipelineSource is used; done means both reported setup failures are addressed without trial and error.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.