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): changes needed to support other engines #15191

Merged
merged 14 commits into from
Jun 24, 2021

Conversation

eladb
Copy link
Contributor

@eladb eladb commented Jun 18, 2021

This PR includes changes needed in the Pipelines library that can help with implementation of other pipeline engines. Namely, these changes were identified during work to implement a GitHub workflows engine.

  1. Add support in PipelineStructure for publishing the CFN template of a stack to the assets bucket. This is enabled by setting publishTemplate: true.
  2. Add support in PipelineStructure for omitting the "prepare" step in case the engine only wants a single step for each stack deployment. This is enabled by setting prepareStep: false.
  3. Add graphNode.uniqueId which returns a graph-wide unique ID of the node.
  4. Add graphNode.allDeps which returns a union of the node's dependencies and the dependencies of all its parents.
  5. Renamed PipelineStructure to PipelineGraph.

Additionally, in order to allow engine providers to leverage these helpers, I've moved all these types under lib/helpers-internal so they can be imported through a barrel import: import { PipelineGraph } from '@aws-cdk/pipelines/helpers-internal'.


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

@gitpod-io
Copy link

gitpod-io bot commented Jun 18, 2021

@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Jun 18, 2021
@eladb eladb requested a review from rix0rrr June 18, 2021 12:54
@eladb eladb marked this pull request as draft June 18, 2021 12:54
@peterwoodworth peterwoodworth added the @aws-cdk/pipelines CDK Pipelines library label Jun 18, 2021
@peterwoodworth peterwoodworth assigned rix0rrr and unassigned rix0rrr Jun 18, 2021
@rix0rrr
Copy link
Contributor

rix0rrr commented Jun 21, 2021

Add support in PipelineStructure for publishing the CFN template of a stack to the assets bucket. This is enabled by setting publishTemplate: true.

Wait up -- you shouldn't need to do this. The DefaultSynthesizer already adds the stack template as an asset, and so it will be in the asset manifest and be uploaded as part of the regular asset publishing step.

@rix0rrr
Copy link
Contributor

rix0rrr commented Jun 21, 2021

Consider if we want to move this from "test" to a public API (maybe with a Beta1 suffix).

If we want to do this properly we should be able to publish it as a plugin package on NPM, no? (That would prove that other people would be able to do the same)

Copy link
Contributor

@rix0rrr rix0rrr left a comment

Choose a reason for hiding this comment

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

Where do you need CreateStack again?

@eladb
Copy link
Contributor Author

eladb commented Jun 22, 2021

Add support in PipelineStructure for publishing the CFN template of a stack to the assets bucket. This is enabled by setting publishTemplate: true.

Wait up -- you shouldn't need to do this. The DefaultSynthesizer already adds the stack template as an asset, and so it will be in the asset manifest and be uploaded as part of the regular asset publishing step.

This is about considering the template asset in the pipeline graph (not about adding another asset to the assembly). Without this, the PipelineStructure class used to simply filter out this asset.

@eladb
Copy link
Contributor Author

eladb commented Jun 22, 2021

Where do you need CreateStack again?

It's needed by the GitHub action I am using.

@eladb
Copy link
Contributor Author

eladb commented Jun 22, 2021

Consider if we want to move this from "test" to a public API (maybe with a Beta1 suffix).

If we want to do this properly we should be able to publish it as a plugin package on NPM, no? (That would prove that other people would be able to do the same)

Good point. Definitely doable. I guess I can extract this already to a separate package.

@eladb eladb changed the title feat(pipelines): prototype GitHub workflows engine feat(pipelines): changes needed to support other engines Jun 23, 2021
@eladb eladb marked this pull request as ready for review June 23, 2021 12:37
@eladb eladb requested a review from rix0rrr June 23, 2021 12:37
@eladb eladb force-pushed the benisrae/pipelines-github branch from 4022d0c to 219e715 Compare June 24, 2021 12:19
@eladb eladb merged commit 2ce4322 into huijbers/tryout-pipelines-refactor Jun 24, 2021
@eladb eladb deleted the benisrae/pipelines-github branch June 24, 2021 14:50
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject89A8053A-LhjRyN9kxr8o
  • Commit ID: c401381
  • Result: FAILED
  • Build Logs (available for 30 days)

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

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

Successfully merging this pull request may close these issues.

4 participants