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

Adding in a pipeline type param. #285

Merged
merged 9 commits into from
Apr 16, 2021
Merged

Adding in a pipeline type param. #285

merged 9 commits into from
Apr 16, 2021

Conversation

StewartW
Copy link
Contributor

@StewartW StewartW commented Aug 2, 2020

Issue #, if available: #185

Description of changes:
I've re-introduced a pipeline type param, I hope you find this useful. The primary motivation is to make the overall shape of pipelines more configurable. For example we currently have pipelines at Skyscanner that are used for deploying CloudCustodian to all of our accounts, or executing CDK in them. (And I would like to eventually share some of these back to the ADF community at some point too.)

I also think it is a good starting place to resolving issue #282 by creating a CDK pipeline type, and utilising the new CDK Pipeline Construct.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Changing the logic of cdk_stacks/main.py so that it will use that param
in order to select the right type of pipeline to deploy.

Also added in some unit tests to ensure it throws an exception when an
invalid type is used as well as some unit tests to ensure that the
adf_standard_pipeline type works as intended. As it has now been moved
into its file so that main.py can be easily extended to add new pipeline
types.

Initial Commit at seperating out pipeline generation from main.py

Unit tests

Documentation Update
Copy link
Collaborator

@sbkok sbkok left a comment

Choose a reason for hiding this comment

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

Thanks @StewartW for adding these changes and refactoring as you go.

@@ -0,0 +1,58 @@
# Pipeline Types Guide

In order to enhance the flexibility of ADF, it's possible to define custom pipeline types as separate CDK Stacks (either installed via PIP or added to the bootstrap repository)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you add a segment at the top section of adding custom pipeline types to state that this is for developers/advanced user of ADF. To contribute new pipeline types back into ADF.

The wording of custom pipeline types makes it sound like this can be Company/ADF deployment specific.
So you can define your own Company-A specific Pipeline Type. However, if someone would add this in their local installation of ADF (i.e. the bootstrap repo), it will get overwritten with each version upgrade of ADF.
Unfortunately there is no easy way to work around this limitation at the moment. So I would recommend highlighting that 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.

I've added in a section below this. Let me know if it reads correctly for you.

docs/pipeline-types-guide.md Outdated Show resolved Hide resolved
@@ -0,0 +1,142 @@
# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for adding tests for some of the changes you made, I appreciate this!

stewartwallace added 2 commits September 26, 2020 08:48
Renamed adf_standard_pipelines to adf_default_pipeline.
Also renamed the generate function inside it.

Standardised default pipeline type to "default". It was previously mixed
between "Default" and "default"

General linting
@StewartW
Copy link
Contributor Author

@sbkok thanks for pulling in the latest patches. One less thing of my to-do list.

Copy link
Collaborator

@sbkok sbkok left a comment

Choose a reason for hiding this comment

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

Looks great @StewartW, thanks for adding this.

Copy link
Collaborator

@thomasmcgannon thomasmcgannon left a comment

Choose a reason for hiding this comment

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

LGTM

@sbkok sbkok merged commit 5c7ebf7 into awslabs:master Apr 16, 2021
sbkok added a commit to sbkok/aws-deployment-framework that referenced this pull request May 17, 2021
**Why?**

When generating a pipeline, the code optimization introduced by PR awslabs#285
broke the notification_endpoint configuration. When set, it would try to
configure the notification in the main generator as well as in the
default ADF pipeline generator.

**What?**

Removing the notification endpoint configuration from the main template,
as that is replaced by the default ADF pipeline generator
implementation.
sbkok added a commit to sbkok/aws-deployment-framework that referenced this pull request May 21, 2021
**Why?**

When generating a pipeline, the code optimization introduced by PR awslabs#285
broke the notification_endpoint configuration. When set, it would try to
configure the notification in the main generator as well as in the
default ADF pipeline generator.

**What?**

Removing the notification endpoint configuration from the main template,
as that is replaced by the default ADF pipeline generator
implementation.
sbkok added a commit that referenced this pull request Jul 16, 2021
* Fix duplicate notification endpoint setup in pipeline generation

**Why?**

When generating a pipeline, the code optimization introduced by PR #285
broke the notification_endpoint configuration. When set, it would try to
configure the notification in the main generator as well as in the
default ADF pipeline generator.

**What?**

Removing the notification endpoint configuration from the main template,
as that is replaced by the default ADF pipeline generator
implementation.

* Upgrade to latest CDK, pylint, and others

Upgrade to CDK v1.105 and latest version of pylint and other
libraries.

Upgrade of pylint resulted in new errors as listed below.
These errors have been fixed as part of this commit too.
sbkok added a commit that referenced this pull request Nov 8, 2021
**Why?**

When generating a pipeline, the code optimization introduced by PR #285
broke the notification_endpoint configuration. When set, it would try to
configure the notification in the main generator as well as in the
default ADF pipeline generator.

**What?**

Removing the notification endpoint configuration from the main template,
as that is replaced by the default ADF pipeline generator
implementation.

Co-authored-by: Stewart Wallace <[email protected]>
@sbkok sbkok added this to the v3.2.0 milestone Nov 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants