Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(pipelines): additionalInputs fails for certain repository names #15753

Closed
bodokaiser opened this issue Jul 25, 2021 · 4 comments · Fixed by #16017
Closed

(pipelines): additionalInputs fails for certain repository names #15753

bodokaiser opened this issue Jul 25, 2021 · 4 comments · Fixed by #16017
Assignees
Labels
@aws-cdk/pipelines CDK Pipelines library bug This issue is a bug. effort/small Small work item – less than a day of effort needs-reproduction This issue needs reproduction. p2 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Comments

@bodokaiser
Copy link

It appears to me that the repository parameter used with CodePipelineSource.connection fails when used in additionalInputs of the CodePipeline props.

In our production setup, we get the following failure in the CodePipeline:
Screen Shot 2021-07-25 at 13 57 46

I tried reducing the problem to a minimal example and get a different error:

11 | [Container] 2021/07/25 11:54:01  INSTALL: 1 commands
12 | [Container] 2021/07/25 11:54:01  BUILD: 3 commands
13 | [Container] 2021/07/25 11:54:01 Phase complete: DOWNLOAD_SOURCE State: SUCCEEDED
14 | [Container] 2021/07/25 11:54:01 Phase context status code:  Message:
15 | [Container] 2021/07/25 11:54:01 Entering phase INSTALL
16 | [Container] 2021/07/25 11:54:01 Running command ln -s "$CODEBUILD_SRC_DIR_bodokaiser_cdk-pipeline-invalid-inputs_Source" "some_additional_input"
17 | ln: invalid option -- 'p'
18 | Try 'ln --help' for more information.

Reproduction Steps

Reproduction steps are summarized in the README.md of cdk-pipeline-invalid-inputs

What did you expect to happen?

A successful build.

What actually happened?

In our production environment CodePipeline raises an error that the input source name is invalid (containing dashes?) while in the minimal example the synth command fail.

Environment

  • CDK CLI Version : 1.115.0
  • Framework Version: 1.115.0
  • Node.js Version: 16.5.0
  • OS : macOS Big Sur
  • Language (Version): Typescript (4.3.5)

This is 🐛 Bug Report

@bodokaiser bodokaiser added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jul 25, 2021
@github-actions github-actions bot added the @aws-cdk/pipelines CDK Pipelines library label Jul 25, 2021
@ryparker
Copy link
Contributor

Hey @bodokaiser 👋🏻

I wasn't able to reproduce this with the given code (replaced connection arn and repos).

Is that error throwing on the Source stage? Looking at the error I can see it starts with Error calling startBuild this seems like an error thrown by CodeBuild and not CodePipeline.

@ryparker ryparker added needs-reproduction This issue needs reproduction. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. effort/small Small work item – less than a day of effort p2 and removed needs-triage This issue or PR still needs to be triaged. labels Jul 29, 2021
@bodokaiser
Copy link
Author

@ryparker

The error is thrown in the Synth CodeBuild step right after the Source stage.

Do you repos contain dashes? My hypothesis is that it has something to do with dashes in the repository name which is either not formated correctly or too carefully validated.

In our production setup, the Synth CodeBuild step has the error:

Screen Shot 2021-07-30 at 06 41 04

editing the Synth CodeBuild step through the web interface reveals the following naming of the input artifacts:

Screen Shot 2021-07-30 at 06 42 02

I am not exactly sure how this relates to the error I encounter in the minimal repository cdk-pipeline-invalid-inputs. With that error:

Screen Shot 2021-07-30 at 06 45 08

it appears to me to be indeed related to the presence of dashes in the repository name as the -pipeline-invalid-inputs segment of cdk-pipeline-invalid-inputs is somewhat interpreted as command line argument -p"invalid-inputs or the like.

@bodokaiser
Copy link
Author

@ryparker @rix0rrr is there anything else I can do for you to support you on this?

rix0rrr added a commit that referenced this issue Aug 12, 2021
Cause: dashes are valid in *artifact names* in CodePipeline, but are *not*
valid in *secondary source names* in CodeBuild.

Do a sanitization to the intersection of requirements between
CodePipeline and CodeBuild.

Fixes #15753.
@mergify mergify bot closed this as completed in #16017 Aug 12, 2021
mergify bot pushed a commit that referenced this issue Aug 12, 2021
…16017)

Cause: dashes are valid in *artifact names* in CodePipeline, but are *not*
valid in *secondary source names* in CodeBuild.

Do a sanitization to the intersection of requirements between
CodePipeline and CodeBuild.

Fixes #15753.


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

hollanddd pushed a commit to hollanddd/aws-cdk that referenced this issue Aug 26, 2021
…ws#16017)

Cause: dashes are valid in *artifact names* in CodePipeline, but are *not*
valid in *secondary source names* in CodeBuild.

Do a sanitization to the intersection of requirements between
CodePipeline and CodeBuild.

Fixes aws#15753.


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
david-doyle-as24 pushed a commit to david-doyle-as24/aws-cdk that referenced this issue Sep 7, 2021
…ws#16017)

Cause: dashes are valid in *artifact names* in CodePipeline, but are *not*
valid in *secondary source names* in CodeBuild.

Do a sanitization to the intersection of requirements between
CodePipeline and CodeBuild.

Fixes aws#15753.


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/pipelines CDK Pipelines library bug This issue is a bug. effort/small Small work item – less than a day of effort needs-reproduction This issue needs reproduction. p2 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants