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

feat(pipelines): step outputs #19024

Merged
merged 14 commits into from Feb 23, 2022
Merged

feat(pipelines): step outputs #19024

merged 14 commits into from Feb 23, 2022

Conversation

rix0rrr
Copy link
Contributor

@rix0rrr rix0rrr commented Feb 17, 2022

Make it possible to export environment variables from a CodeBuildStep,
and pipeline sources, and use them in the environment variables of
a CodeBuildStep or ShellStep.

Closes #17189, closes #18893, closes #15943, closes #16407.


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

feat(pipelines): step outputs

Make it possible to export environment variables from a CodeBuildStep,
and pipeline sources, and use them in the environment variables of
a CodeBuildStep or ShellStep.

Closes #17189, closes #18893, closes #15943, closes #16407.
@rix0rrr rix0rrr requested a review from a team February 17, 2022 17:40
@rix0rrr rix0rrr self-assigned this Feb 17, 2022
@gitpod-io
Copy link

gitpod-io bot commented Feb 17, 2022

@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Feb 17, 2022
Copy link
Contributor

@kaizencc kaizencc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have any major points of contention so instead I have a few nitpicky ones.

packages/@aws-cdk/pipelines/README.md Outdated Show resolved Hide resolved
packages/@aws-cdk/pipelines/lib/blueprint/step-output.ts Outdated Show resolved Hide resolved
this.exportedVariables.add(variableName);

// return `#{${this.variablesNamespace}.${variableName}}`;
return new StepOutput(this, variableName).toString();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused why we are sending variableName as the value for engineSpecificInformation to StepOutput. It doesn't seem like the variable name is engine specific. Feels like engineSpecificInformation could be named better.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea about "engineSpeicificInformation" is that it is arbitrary information that doesn't matter to the framework.

It matters to the engine, and only the engine gets to interpret it.

In this case, for the CodePipeline engine, the only thing necessary is the variable name (as the step itself is already known).

I suppose I could make it just a string, and if the engine needs to encode something else into it, it can just JSON-encode something in there...?

@@ -307,13 +315,15 @@ export class CodeBuildFactory implements ICodePipelineActionFactory {
? { _PROJECT_CONFIG_HASH: projectConfigHash }
: {};


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra line?

Comment on lines 46 to 50
});
new PipelineStack(app, 'VariablePipelineStack', {
env: { account: process.env.CDK_DEFAULT_ACCOUNT, region: process.env.CDK_DEFAULT_REGION },
});
app.synth();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
});
new PipelineStack(app, 'VariablePipelineStack', {
env: { account: process.env.CDK_DEFAULT_ACCOUNT, region: process.env.CDK_DEFAULT_REGION },
});
app.synth();
});
new PipelineStack(app, 'VariablePipelineStack', {
env: { account: process.env.CDK_DEFAULT_ACCOUNT, region: process.env.CDK_DEFAULT_REGION },
});
app.synth();

/**
* Additional data on the output, to be interpreted by the engine
*/
public readonly engineSpecificInformation: any;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like and/or don't understand this naming convention. I get that it is engine specific, but I don't see the need to call this out in the name and make it so cryptic. We are sending in the variableName in codepipeline, what other values are you imagining could be sent in here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Depends on the engine.

For CodePipeline, it happens to be the variable name. But I suppose I can rename it. Let's talk later today.

rix0rrr and others added 3 commits February 22, 2022 09:57
Co-authored-by: Kaizen Conroy <36202692+kaizen3031593@users.noreply.github.com>
@mergify
Copy link
Contributor

mergify bot commented Feb 23, 2022

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).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject89A8053A-LhjRyN9kxr8o
  • Commit ID: cd78286
  • 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 0dec2ee into master Feb 23, 2022
@mergify mergify bot deleted the huijbers/pipeline-outputs branch February 23, 2022 22:59
@mergify
Copy link
Contributor

mergify bot commented Feb 23, 2022

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution/core This is a PR that came from AWS.
Projects
None yet
3 participants