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

fix(pipelines): additionalInputs fails for deep directory #17074

Merged
merged 1 commit into from Oct 20, 2021

Conversation

rix0rrr
Copy link
Contributor

@rix0rrr rix0rrr commented Oct 20, 2021

If the directory is nested deeper than one level underneath . or ..,
the wrong directory gets created.

Also add in protection against the directory already existing, in which
case the same behavior would happen.

Fixes #16936.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

If the directory is nested deeper than one level underneath `.` or `..`,
the wrong directory gets created.

Also add in protection against the directory already existing, in which
case the same behavior would happen.

Fixes #16936.
@rix0rrr rix0rrr requested a review from a team October 20, 2021 13:12
@rix0rrr rix0rrr self-assigned this Oct 20, 2021
@gitpod-io
Copy link

gitpod-io bot commented Oct 20, 2021

@github-actions github-actions bot added the @aws-cdk/aws-codepipeline Related to AWS CodePipeline label Oct 20, 2021
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Oct 20, 2021
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject89A8053A-LhjRyN9kxr8o
  • Commit ID: 5666e7f
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit 403d3ce into master Oct 20, 2021
@mergify mergify bot deleted the huijbers/additional-inputs branch October 20, 2021 14:03
@mergify
Copy link
Contributor

mergify bot commented Oct 20, 2021

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@fab-mindflow
Copy link

Hi @rix0rrr,

This PR looks like it has introduced a failure on my current pipeline.
I am using additionalInputs in a CodeBuildStep to import a directory created from the previous CodeBuildStep.

    // Step 1
    const step1 = new CodeBuildStep("Step1", {
      primaryOutputDirectory: "/tmp/myfolder",
      // ...
    })

    const step2 = new CodeBuildStep("Step2", {
      additionalInputs: { "./step1": step1 },
      // ...
    })

This now stops the build with the following error:

[Container] 2021/10/28 06:05:31 Running command [[ ! -d "./step1" ]] || { echo 'additionalInputs: "./step1" must not exist yet. If you want to merge multiple artifacts, use a "cp" command.'; exit 1; } && ln -s -- "$CODEBUILD_SRC_DIR_Step1_Output" "./step1"
/codebuild/output/tmp/script.sh: 4: [[: not found
additionalInputs: "./step1" must not exist yet. If you want to merge multiple artifacts, use a "cp" command.

Am I doing something wrong? Or is this a regression?

@kyri-petrou
Copy link

Experiencing the same issue as @fab-mindflow. Could you please advice whether the behaviour of additionalInputs has changed?

@rix0rrr
Copy link
Contributor Author

rix0rrr commented Nov 23, 2021

This was a regression that was fixed in #17279

TikiTDO pushed a commit to TikiTDO/aws-cdk that referenced this pull request Feb 21, 2022
If the directory is nested deeper than one level underneath `.` or `..`,
the wrong directory gets created.

Also add in protection against the directory already existing, in which
case the same behavior would happen.

Fixes aws#16936.


----

*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/aws-codepipeline Related to AWS CodePipeline contribution/core This is a PR that came from AWS.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(pipelines): additionalinputs cannot mount deep directory
6 participants