-
Notifications
You must be signed in to change notification settings - Fork 4k
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): Expose stack output namespaces in custom pipelines.Step
s
#23110
feat(pipelines): Expose stack output namespaces in custom pipelines.Step
s
#23110
Conversation
43bed9c
to
9ec69ac
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
9ec69ac
to
fd37e4e
Compare
✅ Updated pull request passes all PRLinter validations. Dissmissing previous PRLinter review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like a pretty simple feature to me, and looks like it's working as intended. In my opinion this feels like quite a lot of effort for not an immense payoff compared to the workaround. As I am new on the team I am going to run this by another engineer before approving
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love this change! I'd like you to change a couple of small things, but overall thanks for generalizing this feature. Approved if you address my comments.
(Please do write a description of the motivation, the change and significant decisions made in the PR body though! Linking to the issue is not sufficient to cover the last 2 parts.)
packages/@aws-cdk/pipelines/lib/codepipeline/stack-outputs-map.ts
Outdated
Show resolved
Hide resolved
actionName: options.actionName, | ||
runOrder: options.runOrder, | ||
// Map the reference to the variable name the CDK has generated for you. | ||
userParameters: {stackOutput: options.stackOutputsMap.mapOutputReference(this.stackOutputReference)}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't compile, since stackOutputsMap
is optional (should require a ?.
or !.
), but I'm pretty sure our code translator would balk at that.
Since ProduceActionOptions
is much more of an output struct than an input struct, you have my permission to make the field required and silence the backwards compatibility checker.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added the compat error to 5bd7d2c, is that sufficient?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that is it exactly
packages/@aws-cdk/pipelines/lib/codepipeline/codepipeline-action-factory.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/pipelines/lib/helpers-internal/pipeline-graph.ts
Outdated
Show resolved
Hide resolved
mapOutputReference -> toCodePipeline
stackOutputDependencies -> consumedStackOutputs
8c30b18
to
b238b26
Compare
I've addressed the comments (unsure if the compat check is correctly handled) and updated the PR description now. |
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
@rix0rrr I don't understand the Mergify error https://github.com/aws/aws-cdk/runs/9825660539, is there some configuration/permission missing in my fork, or is it permissions in this repo that is sad? |
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state. |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Closes #23000 as per request from #23000 (comment).
In order for custom steps to include
CfnOutput
in their action configurations, there needed to be a way to access and/or generate the output variable namespaces.ShellStep
already had this capability.This change generalizes the
StackOutputReference
usages by letting implementors ofStep
define theStackOutputReference
s their step consumes, instead of hardwiring it toShellStep
.To actually consume the references, the
ICodePipelineActionFactory
provides aStackOutputsMap
that exposes a method torender
StackOutputReference
s into their assigned CodePipeline variable names.All Submissions:
Adding new Unconventional Dependencies:
New Features
yarn integ
to deploy the infrastructure and generate the snapshot (i.e.yarn integ
without--dry-run
)?By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license