Skip to content

Conversation

@sbkok
Copy link
Collaborator

@sbkok sbkok commented Dec 30, 2020

Upgrade to Python 3.8 and latest version of CDK, pylint, and other
libraries.

Due to requirements defined in aws-sam-cli, boto3 and botocore had to be
set to 1.14.63 and 1.17.63 respectively.

Upgrade of pylint resulted in new errors as listed below.
These errors have been fixed as part of this commit too.

find src/ -iname "*.py" | xargs pylint --rcfile .pylintrc
************* Module adf-build.organization_policy
src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/organization_policy.py:23:0: R1721: Unnecessary use of a comprehension (unnecessary-comprehension)
************* Module adf-build.shared.cdk.cdk_stacks.main
src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_stacks/main.py:86:16: R1724: Unnecessary "elif" after "continue" (no-else-continue)
************* Module adf-build.shared.cdk.clean_pipelines
src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/clean_pipelines.py:77:16: W1309: Using an f-string that does not have any interpolated variables (f-string-without-interpolation)
************* Module adf-build.shared.python.parameter_store
src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/parameter_store.py:66:12: W0707: Consider explicitly re-raising using the 'from' keyword (raise-missing-from)
src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/parameter_store.py:82:12: W0707: Consider explicitly re-raising using the 'from' keyword (raise-missing-from)
************* Module adf-build.shared.python.cloudformation
src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/cloudformation.py:206:12: W0707: Consider explicitly re-raising using the 'from' keyword (raise-missing-from)
************* Module adf-build.shared.python.organizations
src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/organizations.py:160:12: W0707: Consider explicitly re-raising using the 'from' keyword (raise-missing-from)
************* Module adf-build.shared.python.codepipeline
src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/codepipeline.py:28:0: R1721: Unnecessary use of a comprehension (unnecessary-comprehension)
************* Module adf-build.shared.resolver
src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/resolver.py:39:12: W0707: Consider explicitly re-raising using the 'from' keyword (raise-missing-from)
src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/resolver.py:92:16: W0707: Consider explicitly re-raising using the 'from' keyword (raise-missing-from)
************* Module main
src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/provisioner/main.py:13:0: C0411: third party import "from organizations import Organizations" should be placed before "from src import read_config_files, delete_default_vpc, Support" (wrong-import-order)
src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/provisioner/main.py:14:0: C0411: third party import "from logger import configure_logger" should be placed before "from src import read_config_files, delete_default_vpc, Support" (wrong-import-order)
src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/provisioner/main.py:15:0: C0411: third party import "from parameter_store import ParameterStore" should be placed before "from src import read_config_files, delete_default_vpc, Support" (wrong-import-order)
src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/provisioner/main.py:16:0: C0411: third party import "from sts import STS" should be placed before "from src import read_config_files, delete_default_vpc, Support" (wrong-import-order)
************* Module src.vpc
src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/provisioner/src/vpc.py:60:16: W0707: Consider explicitly re-raising using the 'from' keyword (raise-missing-from)
src/lambda_codebase/account/main.py:113:0: E0012: Bad option value 'bad-continuation' (bad-option-value)

This fixes issues #267, #300, and #325.

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

@sbkok sbkok added this to the v3.1.0 milestone Dec 30, 2020
@sbkok sbkok force-pushed the upgrade-dependency-versions branch 3 times, most recently from c024a4c to 0a94366 Compare January 7, 2021 15:06
@sbkok sbkok force-pushed the upgrade-dependency-versions branch from 0a94366 to 3b06a01 Compare February 4, 2021 14:44
sbkok added 3 commits February 4, 2021 15:45
Upgrade to Python 3.8, CDK v1.88 and latest version of pylint and other
libraries. Upgraded to use STANDARD:5.0 CodeBuild image.

Due to requirements defined in aws-sam-cli, boto3 and botocore had to be
set to 1.14.63 and 1.17.63 respectively.

Upgrade of pylint resulted in new errors as listed below.
These errors have been fixed as part of this commit too.

```bash
find src/ -iname "*.py" | xargs pylint --rcfile .pylintrc
************* Module adf-build.organization_policy
src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/organization_policy.py:23:0: R1721: Unnecessary use of a comprehension (unnecessary-comprehension)
************* Module adf-build.shared.cdk.cdk_stacks.main
src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_stacks/main.py:86:16: R1724: Unnecessary "elif" after "continue" (no-else-continue)
************* Module adf-build.shared.cdk.clean_pipelines
src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/clean_pipelines.py:77:16: W1309: Using an f-string that does not have any interpolated variables (f-string-without-interpolation)
************* Module adf-build.shared.python.parameter_store
src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/parameter_store.py:66:12: W0707: Consider explicitly re-raising using the 'from' keyword (raise-missing-from)
src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/parameter_store.py:82:12: W0707: Consider explicitly re-raising using the 'from' keyword (raise-missing-from)
************* Module adf-build.shared.python.cloudformation
src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/cloudformation.py:206:12: W0707: Consider explicitly re-raising using the 'from' keyword (raise-missing-from)
************* Module adf-build.shared.python.organizations
src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/organizations.py:160:12: W0707: Consider explicitly re-raising using the 'from' keyword (raise-missing-from)
************* Module adf-build.shared.python.codepipeline
src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/codepipeline.py:28:0: R1721: Unnecessary use of a comprehension (unnecessary-comprehension)
************* Module adf-build.shared.resolver
src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/resolver.py:39:12: W0707: Consider explicitly re-raising using the 'from' keyword (raise-missing-from)
src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/resolver.py:92:16: W0707: Consider explicitly re-raising using the 'from' keyword (raise-missing-from)
************* Module main
src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/provisioner/main.py:13:0: C0411: third party import "from organizations import Organizations" should be placed before "from src import read_config_files, delete_default_vpc, Support" (wrong-import-order)
src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/provisioner/main.py:14:0: C0411: third party import "from logger import configure_logger" should be placed before "from src import read_config_files, delete_default_vpc, Support" (wrong-import-order)
src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/provisioner/main.py:15:0: C0411: third party import "from parameter_store import ParameterStore" should be placed before "from src import read_config_files, delete_default_vpc, Support" (wrong-import-order)
src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/provisioner/main.py:16:0: C0411: third party import "from sts import STS" should be placed before "from src import read_config_files, delete_default_vpc, Support" (wrong-import-order)
************* Module src.vpc
src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/provisioner/src/vpc.py:60:16: W0707: Consider explicitly re-raising using the 'from' keyword (raise-missing-from)
src/lambda_codebase/account/main.py:113:0: E0012: Bad option value 'bad-continuation' (bad-option-value)
```
**Why**

CDK generate the CloudFormation changes, using jsii v1.20.0 generated an
issue where it reported: `ValueError: write to closed file`.

**What?**

CDK 1.88.0 is compatible with older versions of jsii, so relying on that
instead.
**Why?**

The `apt-get update` could fail as it fetches the latest updates that
might break the build. Instead, we should rely on the packages that have
been installed in the CodeBuild image instead.

**What?**

Changed to rely on the latest STANDARD:5.0 container image packages.

**References**

* Fix for issue awslabs#325
@sbkok sbkok force-pushed the upgrade-dependency-versions branch from 3b06a01 to c78ac9c Compare February 4, 2021 14:46
@sbkok
Copy link
Collaborator Author

sbkok commented Feb 4, 2021

Updated PR to use CDK v1.88.0, CodeBuild STANDARD:5.0, and fixing the yarnpkg GPG issue #325.

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

Copy link

@deltagarrett deltagarrett 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 34be485 into awslabs:master Feb 12, 2021
@sbkok sbkok deleted the upgrade-dependency-versions branch February 12, 2021 15:27
sbkok added a commit to sbkok/aws-deployment-framework that referenced this pull request Feb 12, 2021
**Features 🏗**

* Adds Enterprise Support to account creation process awslabs#233, closes awslabs#232:
  * ADF will raise a ticket to add the account to an existing AWS support subscription when an account is created. As a prerequisite, your organization master account must already have enterprise support activated.
* Adds nested deployment map support awslabs#266 and awslabs#328, closes awslabs#265:
  * This enables usage of sub directories within the deployment_maps folder.

**Fixes 🐞**

* Fixes specific role usage to be used in Build and Deploy only awslabs#295.
* Corrects removing pipelines anchor in docs awslabs#279.
* Fixes CI builds due to isort version mismatch awslabs#284.
* Fixes error handling of generate_params intrinsic upload function awslabs#277, closes awslabs#276.
* Fixes spec_inline attribute of CodeBuild in docs awslabs#289.
* Fixes provider spec_inline support of CodeBuild in awslabs#293.
* Fixes supported list of intrinsic upload path styles, enables usage of s3-url and s3-key-only awslabs#275, closes awslabs#299.
* Fixes create deployment account concurrency failure awslabs#287, closes awslabs#280.
* Fixes approval stage usage, by limiting specific role usage to Build and Deploy steps awslabs#295.
* Fixes yarnpkg GPG awslabs#313,  closes awslabs#325.
* Removes dependency on botocore.vendored.requests awslabs#326, closes awslabs#324.

**Improvements ✨**

* Improves docs on providers and their properties awslabs#274.
* Separates pipeline cleanup from input generation script awslabs#288.
* Upgrades Python from v3.7 to v3.8 awslabs#313.
* Upgrades CodeBuild image from "aws/codebuild/standard:2.0" to "aws/codebuild/standard:5.0" awslabs#313, closes awslabs#267, closes awslabs#300.
* Upgrades CDK from v1.32 to v1.88 awslabs#313, closes awslabs#292.
@sbkok sbkok mentioned this pull request Feb 12, 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