diff --git a/doc/changes/changelog.md b/doc/changes/changelog.md index 83ce934..72f2197 100644 --- a/doc/changes/changelog.md +++ b/doc/changes/changelog.md @@ -1,5 +1,6 @@ # Changes +* [1.2.0](changes_1.2.0.md) * [1.1.0](changes_1.1.0.md) * [1.0.0](changes_1.0.0.md) * [0.8.0](changes_0.8.0.md) diff --git a/doc/changes/changes_1.2.0.md b/doc/changes/changes_1.2.0.md new file mode 100644 index 0000000..83558e8 --- /dev/null +++ b/doc/changes/changes_1.2.0.md @@ -0,0 +1,23 @@ +# script-languages-container-ci-setup 1.2.0, released 2023-07-05 + +Code name: Updated SLC-CI to 1.3.0 + +## Summary + +Updated SLC-CI to 1.3.0 and moved the Config definition to SLC-CI. + +## Bug Fixes + +n/a + +## Features / Enhancements + +n/a + +## Documentation + +n/a + +## Refactoring + + - #55: Updated SLC-CI to 1.3.0 and moved the Config definition to SLC-CI. diff --git a/exasol_script_languages_container_ci_setup/lib/ci_build.py b/exasol_script_languages_container_ci_setup/lib/ci_build.py index 587f801..76a9990 100644 --- a/exasol_script_languages_container_ci_setup/lib/ci_build.py +++ b/exasol_script_languages_container_ci_setup/lib/ci_build.py @@ -24,7 +24,7 @@ def run_deploy_ci_build(aws_access: AwsAccess, project: str, github_url: str): logging.info(f"run_deploy_ci_build for aws profile {aws_access.aws_profile} for project {project} at {github_url}") dockerhub_secret_arn = aws_access.read_dockerhub_secret_arn() yml = render_template(CI_CODE_BUILD_TEMPLATE, project=project, - dockerhub_secret_arn=dockerhub_secret_arn, github_url=github_url, + dockerhub_secret_arn=dockerhub_secret_arn.aws_arn, github_url=github_url, webhook_filter_pattern=CI_BUILD_WEBHOOK_FILTER_PATTERN) aws_access.upload_cloudformation_stack(yml, ci_stack_name(project)) diff --git a/exasol_script_languages_container_ci_setup/lib/config/__init__.py b/exasol_script_languages_container_ci_setup/lib/config/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/exasol_script_languages_container_ci_setup/lib/config/config_data_model.py b/exasol_script_languages_container_ci_setup/lib/config/config_data_model.py deleted file mode 100644 index 7954696..0000000 --- a/exasol_script_languages_container_ci_setup/lib/config/config_data_model.py +++ /dev/null @@ -1,38 +0,0 @@ -# generated by datamodel-codegen: -# filename: - -from __future__ import annotations - -from typing import List - -from pydantic import BaseModel, Extra - - -class Ignore(BaseModel): - class Config: - extra = Extra.forbid - - paths: List[str] - - -class Build(BaseModel): - class Config: - extra = Extra.forbid - - ignore: Ignore - base_branch: str - - -class Release(BaseModel): - class Config: - extra = Extra.forbid - - timeout_in_minutes: int - - -class Config(BaseModel): - class Config: - extra = Extra.forbid - - build: Build - release: Release diff --git a/exasol_script_languages_container_ci_setup/lib/config/data_model_generator.py b/exasol_script_languages_container_ci_setup/lib/config/data_model_generator.py deleted file mode 100644 index a7102cd..0000000 --- a/exasol_script_languages_container_ci_setup/lib/config/data_model_generator.py +++ /dev/null @@ -1,51 +0,0 @@ -import json -import logging -from pathlib import Path -from tempfile import TemporaryDirectory - -from datamodel_code_generator import generate, InputFileType - -from exasol_script_languages_container_ci_setup.lib.render_template import render_template - -logger = logging.getLogger(__name__) - -CONFIG_DATA_MODEL_FILE_NAME = "config_data_model.py" - - -def config_data_model_default_output_file() -> Path: - return Path(__file__).parent / CONFIG_DATA_MODEL_FILE_NAME - - -def generate_config_data_model(output_file: Path) -> Path: - schema_dict = json.loads(render_template("config_schema.json")) - schema_json = json.dumps(schema_dict) - with TemporaryDirectory() as directory: - temp_output_file = Path(directory) / CONFIG_DATA_MODEL_FILE_NAME - generate(schema_json, input_file_type=InputFileType.JsonSchema, output=temp_output_file, - class_name="Config", apply_default_values_for_required_fields=True) - with temp_output_file.open("rt") as temp_output_file_handle: - with output_file.open("wt") as output_file_handle: - lines = (line for line in temp_output_file_handle) - lines = filter(lambda line: "# timestamp: " not in line, lines) - for line in lines: - output_file_handle.write(line) - return output_file - - -def regenerate_config_data_model(output_file: Path): - with TemporaryDirectory() as directory: - temp_output_file = Path(directory) / CONFIG_DATA_MODEL_FILE_NAME - generate_config_data_model(temp_output_file) - with temp_output_file.open("rt") as file: - new_model = file.read() - if output_file.is_file(): - with output_file.open("rt") as file: - old_model = file.read() - if new_model != old_model: - logger.warning(f"Regenerating config pydantic model to {output_file}") - with output_file.open("wt") as file: - file.write(new_model) - else: - logger.info(f"Generating config pydantic model to new file {output_file}") - with output_file.open("wt") as file: - file.write(new_model) diff --git a/exasol_script_languages_container_ci_setup/lib/generate_buildspec_common.py b/exasol_script_languages_container_ci_setup/lib/generate_buildspec_common.py index 5fb3936..9fa1b07 100644 --- a/exasol_script_languages_container_ci_setup/lib/generate_buildspec_common.py +++ b/exasol_script_languages_container_ci_setup/lib/generate_buildspec_common.py @@ -1,12 +1,11 @@ -import json + import logging from dataclasses import dataclass from pathlib import Path from typing import Optional, Tuple, List -import jsonschema +from exasol_script_languages_container_ci.lib.config.config_data_model import Config -from exasol_script_languages_container_ci_setup.lib.config.config_data_model import Config from exasol_script_languages_container_ci_setup.lib.render_template import render_template @@ -46,7 +45,7 @@ def get_config_file_parameter(config_file: Optional[str]): def _find_flavors(flavor_root_paths: Tuple[str, ...]) -> List[Flavor]: - """" + """ Find flavors under the given path(s) and return them in ordered list. """ flavors = set() diff --git a/exasol_script_languages_container_ci_setup/lib/run_start_build.py b/exasol_script_languages_container_ci_setup/lib/run_start_build.py index e8db77c..69bb554 100644 --- a/exasol_script_languages_container_ci_setup/lib/run_start_build.py +++ b/exasol_script_languages_container_ci_setup/lib/run_start_build.py @@ -2,10 +2,11 @@ import re from typing import Tuple, Dict, List, Optional +from exasol_script_languages_container_ci.lib.config.config_data_model import Config + from exasol_script_languages_container_ci_setup.lib.aws.aws_access import AwsAccess from exasol_script_languages_container_ci_setup.lib.aws.wrapper.datamodels.cloudformation import StackResourceSummary from exasol_script_languages_container_ci_setup.lib.ci_build import ci_stack_name -from exasol_script_languages_container_ci_setup.lib.config.config_data_model import Config from exasol_script_languages_container_ci_setup.lib.github_draft_release_creator import GithubDraftReleaseCreator from exasol_script_languages_container_ci_setup.lib.release_build import release_stack_name diff --git a/poetry.lock b/poetry.lock index e0aefa7..e07e725 100644 --- a/poetry.lock +++ b/poetry.lock @@ -474,14 +474,14 @@ test-randomorder = ["pytest-randomly"] [[package]] name = "datamodel-code-generator" -version = "0.20.0" +version = "0.21.0" description = "Datamodel Code Generator" category = "main" optional = false python-versions = ">=3.7,<4.0" files = [ - {file = "datamodel_code_generator-0.20.0-py3-none-any.whl", hash = "sha256:fdb8dc18fd3a5d2c92e5e3ac473c5a48f3540066941e56fd947d2975cfebd281"}, - {file = "datamodel_code_generator-0.20.0.tar.gz", hash = "sha256:84dc7d6ae64ca67834b414c107adf3510f46a474ac21467a683aca0a4a8f0806"}, + {file = "datamodel_code_generator-0.21.0-py3-none-any.whl", hash = "sha256:9247d934ddcaff4a91f23feb55a327b6dfc123464dc32b48554d2d5c4fc0c980"}, + {file = "datamodel_code_generator-0.21.0.tar.gz", hash = "sha256:5851a885d18f46e50f6ac959a716f49869fe6a46f5101b8872fda515e1cfc7fb"}, ] [package.dependencies] @@ -495,9 +495,9 @@ openapi-spec-validator = ">=0.2.8,<=0.5.2" packaging = "*" prance = ">=0.18.2,<1.0" pydantic = [ - {version = ">=1.10.0,<2.0.0", extras = ["email"], markers = "python_version >= \"3.11\" and python_version < \"4.0\""}, - {version = ">=1.5.1,<2.0.0", extras = ["email"], markers = "python_version < \"3.10\""}, - {version = ">=1.9.0,<2.0.0", extras = ["email"], markers = "python_version >= \"3.10\" and python_version < \"3.11\""}, + {version = ">=1.10.0,<3.0", extras = ["email"], markers = "python_version >= \"3.11\" and python_version < \"4.0\""}, + {version = ">=1.5.1,<3.0", extras = ["email"], markers = "python_version < \"3.10\""}, + {version = ">=1.9.0,<3.0", extras = ["email"], markers = "python_version >= \"3.10\" and python_version < \"3.11\""}, ] PySnooper = ">=0.4.1,<2.0.0" toml = ">=0.10.0,<1.0.0" @@ -669,23 +669,24 @@ simplejson = ">=3.16.0" [[package]] name = "exasol-script-languages-container-ci" -version = "1.2.0" +version = "1.3.0" description = "Implements CI builds for script-language-container." category = "main" optional = false python-versions = ">=3.8.0,<4.0" files = [ - {file = "exasol_script_languages_container_ci-1.2.0-py3-none-any.whl", hash = "sha256:aeaf372a2a543589c8c17a0da95f3f0239ecc6398363911f3e69306560f9580f"}, - {file = "exasol_script_languages_container_ci-1.2.0.tar.gz", hash = "sha256:826297ff9d1fa68767fefa7d60d1a01b36abcc422ab22099730db4d7b9a66566"}, + {file = "exasol_script_languages_container_ci-1.3.0-py3-none-any.whl", hash = "sha256:348efe39c151bb98619c5e701388de9035bc354b5c249c3ed543b66767ca3ba6"}, + {file = "exasol_script_languages_container_ci-1.3.0.tar.gz", hash = "sha256:572e004b4360d6a5f8b3a93f3ea908bec5d3c5095e8e5be095a8ada28e7b3b5b"}, ] [package.dependencies] click = ">=8.0.3,<9.0.0" +datamodel-code-generator = ">=0.21.0,<0.22.0" exasol-integration-test-docker-environment = ">=1.7.1,<2.0.0" exasol-script-languages-container-tool = ">=0.18.0,<0.19.0" GitPython = ">=3.1.0" PyGithub = ">=1.55.0,<2.0.0" -setuptools = ">=67.6.0,<68.0.0" +setuptools = ">=68.0.0,<69.0.0" [[package]] name = "exasol-script-languages-container-tool" @@ -709,14 +710,14 @@ typeguard = "<3.0.0" [[package]] name = "exceptiongroup" -version = "1.1.1" +version = "1.1.2" description = "Backport of PEP 654 (exception groups)" category = "main" optional = false python-versions = ">=3.7" files = [ - {file = "exceptiongroup-1.1.1-py3-none-any.whl", hash = "sha256:232c37c63e4f682982c8b6459f33a8981039e5fb8756b2074364e5055c498c9e"}, - {file = "exceptiongroup-1.1.1.tar.gz", hash = "sha256:d484c3090ba2889ae2928419117447a14daf3c1231d5e30d0aae34f354f01785"}, + {file = "exceptiongroup-1.1.2-py3-none-any.whl", hash = "sha256:e346e69d186172ca7cf029c8c1d16235aa0e04035e5750b4b95039e65204328f"}, + {file = "exceptiongroup-1.1.2.tar.gz", hash = "sha256:12c3e887d6485d16943a309616de20ae5582633e0a2eda17f4e10fd61c1e8af5"}, ] [package.extras] @@ -939,14 +940,14 @@ files = [ [[package]] name = "joblib" -version = "1.3.0" +version = "1.3.1" description = "Lightweight pipelining with Python functions" category = "main" optional = false python-versions = ">=3.7" files = [ - {file = "joblib-1.3.0-py3-none-any.whl", hash = "sha256:172d56d4c43dd6bcd953bea213018c4084cf754963bbf54b8dae40faea716b98"}, - {file = "joblib-1.3.0.tar.gz", hash = "sha256:0b12a65dc76c530dbd790dd92881f75c40932b4254a7c8e608a868df408ca0a3"}, + {file = "joblib-1.3.1-py3-none-any.whl", hash = "sha256:89cf0529520e01b3de7ac7b74a8102c90d16d54c64b5dd98cafcd14307fdf915"}, + {file = "joblib-1.3.1.tar.gz", hash = "sha256:1f937906df65329ba98013dc9692fe22a4c5e4a648112de500508b18a21b41e3"}, ] [[package]] @@ -1476,48 +1477,48 @@ files = [ [[package]] name = "pydantic" -version = "1.10.9" +version = "1.10.10" description = "Data validation and settings management using python type hints" category = "main" optional = false python-versions = ">=3.7" files = [ - {file = "pydantic-1.10.9-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e692dec4a40bfb40ca530e07805b1208c1de071a18d26af4a2a0d79015b352ca"}, - {file = "pydantic-1.10.9-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:3c52eb595db83e189419bf337b59154bdcca642ee4b2a09e5d7797e41ace783f"}, - {file = "pydantic-1.10.9-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:939328fd539b8d0edf244327398a667b6b140afd3bf7e347cf9813c736211896"}, - {file = "pydantic-1.10.9-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b48d3d634bca23b172f47f2335c617d3fcb4b3ba18481c96b7943a4c634f5c8d"}, - {file = "pydantic-1.10.9-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:f0b7628fb8efe60fe66fd4adadd7ad2304014770cdc1f4934db41fe46cc8825f"}, - {file = "pydantic-1.10.9-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:e1aa5c2410769ca28aa9a7841b80d9d9a1c5f223928ca8bec7e7c9a34d26b1d4"}, - {file = "pydantic-1.10.9-cp310-cp310-win_amd64.whl", hash = "sha256:eec39224b2b2e861259d6f3c8b6290d4e0fbdce147adb797484a42278a1a486f"}, - {file = "pydantic-1.10.9-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:d111a21bbbfd85c17248130deac02bbd9b5e20b303338e0dbe0faa78330e37e0"}, - {file = "pydantic-1.10.9-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:2e9aec8627a1a6823fc62fb96480abe3eb10168fd0d859ee3d3b395105ae19a7"}, - {file = "pydantic-1.10.9-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:07293ab08e7b4d3c9d7de4949a0ea571f11e4557d19ea24dd3ae0c524c0c334d"}, - {file = "pydantic-1.10.9-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7ee829b86ce984261d99ff2fd6e88f2230068d96c2a582f29583ed602ef3fc2c"}, - {file = "pydantic-1.10.9-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:4b466a23009ff5cdd7076eb56aca537c745ca491293cc38e72bf1e0e00de5b91"}, - {file = "pydantic-1.10.9-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:7847ca62e581e6088d9000f3c497267868ca2fa89432714e21a4fb33a04d52e8"}, - {file = "pydantic-1.10.9-cp311-cp311-win_amd64.whl", hash = "sha256:7845b31959468bc5b78d7b95ec52fe5be32b55d0d09983a877cca6aedc51068f"}, - {file = "pydantic-1.10.9-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:517a681919bf880ce1dac7e5bc0c3af1e58ba118fd774da2ffcd93c5f96eaece"}, - {file = "pydantic-1.10.9-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:67195274fd27780f15c4c372f4ba9a5c02dad6d50647b917b6a92bf00b3d301a"}, - {file = "pydantic-1.10.9-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2196c06484da2b3fded1ab6dbe182bdabeb09f6318b7fdc412609ee2b564c49a"}, - {file = "pydantic-1.10.9-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:6257bb45ad78abacda13f15bde5886efd6bf549dd71085e64b8dcf9919c38b60"}, - {file = "pydantic-1.10.9-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:3283b574b01e8dbc982080d8287c968489d25329a463b29a90d4157de4f2baaf"}, - {file = "pydantic-1.10.9-cp37-cp37m-win_amd64.whl", hash = "sha256:5f8bbaf4013b9a50e8100333cc4e3fa2f81214033e05ac5aa44fa24a98670a29"}, - {file = "pydantic-1.10.9-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:b9cd67fb763248cbe38f0593cd8611bfe4b8ad82acb3bdf2b0898c23415a1f82"}, - {file = "pydantic-1.10.9-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:f50e1764ce9353be67267e7fd0da08349397c7db17a562ad036aa7c8f4adfdb6"}, - {file = "pydantic-1.10.9-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:73ef93e5e1d3c8e83f1ff2e7fdd026d9e063c7e089394869a6e2985696693766"}, - {file = "pydantic-1.10.9-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:128d9453d92e6e81e881dd7e2484e08d8b164da5507f62d06ceecf84bf2e21d3"}, - {file = "pydantic-1.10.9-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:ad428e92ab68798d9326bb3e5515bc927444a3d71a93b4a2ca02a8a5d795c572"}, - {file = "pydantic-1.10.9-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:fab81a92f42d6d525dd47ced310b0c3e10c416bbfae5d59523e63ea22f82b31e"}, - {file = "pydantic-1.10.9-cp38-cp38-win_amd64.whl", hash = "sha256:963671eda0b6ba6926d8fc759e3e10335e1dc1b71ff2a43ed2efd6996634dafb"}, - {file = "pydantic-1.10.9-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:970b1bdc6243ef663ba5c7e36ac9ab1f2bfecb8ad297c9824b542d41a750b298"}, - {file = "pydantic-1.10.9-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:7e1d5290044f620f80cf1c969c542a5468f3656de47b41aa78100c5baa2b8276"}, - {file = "pydantic-1.10.9-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:83fcff3c7df7adff880622a98022626f4f6dbce6639a88a15a3ce0f96466cb60"}, - {file = "pydantic-1.10.9-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0da48717dc9495d3a8f215e0d012599db6b8092db02acac5e0d58a65248ec5bc"}, - {file = "pydantic-1.10.9-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:0a2aabdc73c2a5960e87c3ffebca6ccde88665616d1fd6d3db3178ef427b267a"}, - {file = "pydantic-1.10.9-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:9863b9420d99dfa9c064042304868e8ba08e89081428a1c471858aa2af6f57c4"}, - {file = "pydantic-1.10.9-cp39-cp39-win_amd64.whl", hash = "sha256:e7c9900b43ac14110efa977be3da28931ffc74c27e96ee89fbcaaf0b0fe338e1"}, - {file = "pydantic-1.10.9-py3-none-any.whl", hash = "sha256:6cafde02f6699ce4ff643417d1a9223716ec25e228ddc3b436fe7e2d25a1f305"}, - {file = "pydantic-1.10.9.tar.gz", hash = "sha256:95c70da2cd3b6ddf3b9645ecaa8d98f3d80c606624b6d245558d202cd23ea3be"}, + {file = "pydantic-1.10.10-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:adad1ee4ab9888f12dac2529276704e719efcf472e38df7813f5284db699b4ec"}, + {file = "pydantic-1.10.10-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:7a7db03339893feef2092ff7b1afc9497beed15ebd4af84c3042a74abce02d48"}, + {file = "pydantic-1.10.10-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:67b3714b97ff84b2689654851c2426389bcabfac9080617bcf4306c69db606f6"}, + {file = "pydantic-1.10.10-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:edfdf0a5abc5c9bf2052ebaec20e67abd52e92d257e4f2d30e02c354ed3e6030"}, + {file = "pydantic-1.10.10-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:20a3b30fd255eeeb63caa9483502ba96b7795ce5bf895c6a179b3d909d9f53a6"}, + {file = "pydantic-1.10.10-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:db4c7f7e60ca6f7d6c1785070f3e5771fcb9b2d88546e334d2f2c3934d949028"}, + {file = "pydantic-1.10.10-cp310-cp310-win_amd64.whl", hash = "sha256:a2d5be50ac4a0976817144c7d653e34df2f9436d15555189f5b6f61161d64183"}, + {file = "pydantic-1.10.10-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:566a04ba755e8f701b074ffb134ddb4d429f75d5dced3fbd829a527aafe74c71"}, + {file = "pydantic-1.10.10-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f79db3652ed743309f116ba863dae0c974a41b688242482638b892246b7db21d"}, + {file = "pydantic-1.10.10-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c62376890b819bebe3c717a9ac841a532988372b7e600e76f75c9f7c128219d5"}, + {file = "pydantic-1.10.10-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4870f13a4fafd5bc3e93cff3169222534fad867918b188e83ee0496452978437"}, + {file = "pydantic-1.10.10-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:990027e77cda6072a566e433b6962ca3b96b4f3ae8bd54748e9d62a58284d9d7"}, + {file = "pydantic-1.10.10-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:8c40964596809eb616d94f9c7944511f620a1103d63d5510440ed2908fc410af"}, + {file = "pydantic-1.10.10-cp311-cp311-win_amd64.whl", hash = "sha256:ea9eebc2ebcba3717e77cdeee3f6203ffc0e78db5f7482c68b1293e8cc156e5e"}, + {file = "pydantic-1.10.10-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:762aa598f79b4cac2f275d13336b2dd8662febee2a9c450a49a2ab3bec4b385f"}, + {file = "pydantic-1.10.10-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6dab5219659f95e357d98d70577b361383057fb4414cfdb587014a5f5c595f7b"}, + {file = "pydantic-1.10.10-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f3d4ee957a727ccb5a36f1b0a6dbd9fad5dedd2a41eada99a8df55c12896e18d"}, + {file = "pydantic-1.10.10-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:b69f9138dec566962ec65623c9d57bee44412d2fc71065a5f3ebb3820bdeee96"}, + {file = "pydantic-1.10.10-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:7aa75d1bd9cc275cf9782f50f60cddaf74cbaae19b6ada2a28e737edac420312"}, + {file = "pydantic-1.10.10-cp37-cp37m-win_amd64.whl", hash = "sha256:9f62a727f5c590c78c2d12fda302d1895141b767c6488fe623098f8792255fe5"}, + {file = "pydantic-1.10.10-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:aac218feb4af73db8417ca7518fb3bade4534fcca6e3fb00f84966811dd94450"}, + {file = "pydantic-1.10.10-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:88546dc10a40b5b52cae87d64666787aeb2878f9a9b37825aedc2f362e7ae1da"}, + {file = "pydantic-1.10.10-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c41bbaae89e32fc582448e71974de738c055aef5ab474fb25692981a08df808a"}, + {file = "pydantic-1.10.10-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2b71bd504d1573b0b722ae536e8ffb796bedeef978979d076bf206e77dcc55a5"}, + {file = "pydantic-1.10.10-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:e088e3865a2270ecbc369924cd7d9fbc565667d9158e7f304e4097ebb9cf98dd"}, + {file = "pydantic-1.10.10-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:3403a090db45d4027d2344859d86eb797484dfda0706cf87af79ace6a35274ef"}, + {file = "pydantic-1.10.10-cp38-cp38-win_amd64.whl", hash = "sha256:e0014e29637125f4997c174dd6167407162d7af0da73414a9340461ea8573252"}, + {file = "pydantic-1.10.10-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:9965e49c6905840e526e5429b09e4c154355b6ecc0a2f05492eda2928190311d"}, + {file = "pydantic-1.10.10-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:748d10ab6089c5d196e1c8be9de48274f71457b01e59736f7a09c9dc34f51887"}, + {file = "pydantic-1.10.10-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:86936c383f7c38fd26d35107eb669c85d8f46dfceae873264d9bab46fe1c7dde"}, + {file = "pydantic-1.10.10-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7a26841be620309a9697f5b1ffc47dce74909e350c5315ccdac7a853484d468a"}, + {file = "pydantic-1.10.10-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:409b810f387610cc7405ab2fa6f62bdf7ea485311845a242ebc0bd0496e7e5ac"}, + {file = "pydantic-1.10.10-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:ce937a2a2c020bcad1c9fde02892392a1123de6dda906ddba62bfe8f3e5989a2"}, + {file = "pydantic-1.10.10-cp39-cp39-win_amd64.whl", hash = "sha256:37ebddef68370e6f26243acc94de56d291e01227a67b2ace26ea3543cf53dd5f"}, + {file = "pydantic-1.10.10-py3-none-any.whl", hash = "sha256:a5939ec826f7faec434e2d406ff5e4eaf1716eb1f247d68cd3d0b3612f7b4c8a"}, + {file = "pydantic-1.10.10.tar.gz", hash = "sha256:3b8d5bd97886f9eb59260594207c9f57dce14a6f869c6ceea90188715d29921a"}, ] [package.dependencies] @@ -2037,14 +2038,14 @@ pbr = "*" [[package]] name = "setuptools" -version = "67.8.0" +version = "68.0.0" description = "Easily download, build, install, upgrade, and uninstall Python packages" category = "main" optional = false python-versions = ">=3.7" files = [ - {file = "setuptools-67.8.0-py3-none-any.whl", hash = "sha256:5df61bf30bb10c6f756eb19e7c9f3b473051f48db77fddbe06ff2ca307df9a6f"}, - {file = "setuptools-67.8.0.tar.gz", hash = "sha256:62642358adc77ffa87233bc4d2354c4b2682d214048f500964dbe760ccedf102"}, + {file = "setuptools-68.0.0-py3-none-any.whl", hash = "sha256:11e52c67415a381d10d6b462ced9cfb97066179f0e871399e006c4ab101fc85f"}, + {file = "setuptools-68.0.0.tar.gz", hash = "sha256:baf1fdb41c6da4cd2eae722e135500da913332ab3f2f5c7d33af9b492acb5235"}, ] [package.extras] @@ -2261,14 +2262,14 @@ test = ["mypy", "pytest", "typing-extensions"] [[package]] name = "typing-extensions" -version = "4.7.0" +version = "4.7.1" description = "Backported and Experimental Type Hints for Python 3.7+" category = "main" optional = false python-versions = ">=3.7" files = [ - {file = "typing_extensions-4.7.0-py3-none-any.whl", hash = "sha256:5d8c9dac95c27d20df12fb1d97b9793ab8b2af8a3a525e68c80e21060c161771"}, - {file = "typing_extensions-4.7.0.tar.gz", hash = "sha256:935ccf31549830cda708b42289d44b6f74084d616a00be651601a4f968e77c82"}, + {file = "typing_extensions-4.7.1-py3-none-any.whl", hash = "sha256:440d5dd3af93b060174bf433bccd69b0babc3b15b1a8dca43789fd7f61514b36"}, + {file = "typing_extensions-4.7.1.tar.gz", hash = "sha256:b75ddc264f0ba5615db7ba217daeb99701ad295353c45f9e95963337ceeeffb2"}, ] [[package]] @@ -2409,4 +2410,4 @@ testing = ["big-O", "flake8 (<5)", "jaraco.functools", "jaraco.itertools", "more [metadata] lock-version = "2.0" python-versions = ">=3.8.0,<4.0" -content-hash = "e4735454fdb2d503de3650385205c71863acff2a6472efcef42c7b6a5ed39435" +content-hash = "6a7851add81a9f1f8c57fdab0ab600a8da12f69e0a51a9d7eabec7294f01d327" diff --git a/pyproject.toml b/pyproject.toml index 526043f..825d362 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "exasol-script-languages-container-ci-setup" -version = "1.1.0" +version = "1.2.0" description = "Manages AWS cloud CI build infrastructure." license = "MIT" @@ -14,12 +14,11 @@ python = ">=3.8.0,<4.0" click = "^8.1.3" jinja2 = ">=3.1.0" exasol_error_reporting_python = "^0.3.0" -exasol-script-languages-container-ci = "^1.2.0" +exasol-script-languages-container-ci = "^1.3.0" boto3 = "1.26.163" botocore = "1.29.163" jsonschema = "^4.17.3" PyGithub = "^1.55.0" -datamodel-code-generator = "^0.20.0" [build-system] requires = ["poetry_core>=1.0.0"] diff --git a/test/conftest.py b/test/conftest.py index 0242ce9..139597f 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -1,29 +1,2 @@ -import logging -from exasol_script_languages_container_ci_setup.lib.config.data_model_generator import \ - config_data_model_default_output_file, regenerate_config_data_model -DISABLE_PYDANTIC_MODEL_GENERATION = "--disable-pydantic-model-generation" - -logger = logging.getLogger(__name__) - - -def pytest_addoption(parser): - parser.addoption( - DISABLE_PYDANTIC_MODEL_GENERATION, action="store_true", default=False, - help="Disables the generation of the pydantic models from the json schemas" - ) - - -def pytest_configure(config): - """ - Some of our tests are based on the pydantic model. We need to make sure, the tests work with the newest - version. However, we also need regenerate the file as early as possible, before other modules import it. - For that reason. we are triggering the regeneration in conftest. - """ - - if not config.getoption(DISABLE_PYDANTIC_MODEL_GENERATION): - output_file = config_data_model_default_output_file() - regenerate_config_data_model(output_file) - else: - logger.warning("Generation of pydantic models from json schema disabled") diff --git a/test/unit_tests/conftest.py b/test/unit_tests/conftest.py index 361e682..139597f 100644 --- a/test/unit_tests/conftest.py +++ b/test/unit_tests/conftest.py @@ -1,23 +1,2 @@ -from inspect import cleandoc -import pytest - -@pytest.fixture -def expected_json_config() -> str: - json = cleandoc(""" - { - "build": { - "ignore": { - "paths": [ - "a/b/c", - "e/f/g" - ] - }, - "base_branch": "" - }, - "release": { - "timeout_in_minutes": 1 - } - }""") - return json \ No newline at end of file diff --git a/test/unit_tests/test_config_data_model.py b/test/unit_tests/test_config_data_model.py deleted file mode 100644 index 3155a87..0000000 --- a/test/unit_tests/test_config_data_model.py +++ /dev/null @@ -1,34 +0,0 @@ -from inspect import cleandoc - -import pytest - -from exasol_script_languages_container_ci_setup.lib.config.config_data_model import Config, Build, Ignore, Release - - -@pytest.fixture -def expected_config() -> Config: - config = Config( - build=Build( - ignore=Ignore( - paths=[ - "a/b/c", - "e/f/g" - ] - ), - base_branch="" - ), - release=Release( - timeout_in_minutes=1 - ) - ) - return config - - -def test_serialization(expected_config, expected_json_config): - actual_json = expected_config.json(indent=4) - assert actual_json == expected_json_config - - -def test_json_deserialization(expected_config, expected_json_config): - actual_config = Config.parse_raw(expected_json_config) - assert actual_config == expected_config diff --git a/test/unit_tests/test_config_data_model_generator.py b/test/unit_tests/test_config_data_model_generator.py deleted file mode 100644 index 5ace60b..0000000 --- a/test/unit_tests/test_config_data_model_generator.py +++ /dev/null @@ -1,48 +0,0 @@ -import sys - -from exasol_script_languages_container_ci_setup.lib.config.data_model_generator import CONFIG_DATA_MODEL_FILE_NAME, \ - generate_config_data_model - - -def test_loading_generated_module(tmp_path): - config_data_model_file = tmp_path / CONFIG_DATA_MODEL_FILE_NAME - generate_config_data_model(config_data_model_file) - module = load_module(config_data_model_file) - assert True - - -def test_using_generated_module(tmp_path, expected_json_config): - config_data_model_file = tmp_path / CONFIG_DATA_MODEL_FILE_NAME - generate_config_data_model(config_data_model_file) - module = load_module(config_data_model_file) - config = create_config(module) - actual_json = config.json(indent=4) - assert actual_json == expected_json_config - - -def create_config(module): - config = module.Config( - build=module.Build( - ignore=module.Ignore( - paths=[ - "a/b/c", - "e/f/g" - ] - ), - base_branch="" - ), - release=module.Release( - timeout_in_minutes=1 - ) - ) - return config - - -def load_module(config_data_model_file): - import importlib.util - module_name = "test_create_model_can_be_imported" - spec = importlib.util.spec_from_file_location(module_name, config_data_model_file) - module = importlib.util.module_from_spec(spec) - sys.modules[module_name] = module - spec.loader.exec_module(module) - return module diff --git a/test/unit_tests/test_deploy_ci.py b/test/unit_tests/test_deploy_ci.py index cb8e879..b7fcd55 100644 --- a/test/unit_tests/test_deploy_ci.py +++ b/test/unit_tests/test_deploy_ci.py @@ -4,6 +4,7 @@ import pytest from exasol_script_languages_container_ci_setup.lib.aws.aws_access import AwsAccess +from exasol_script_languages_container_ci_setup.lib.aws.wrapper.datamodels.common import ARN from exasol_script_languages_container_ci_setup.lib.ci_build import run_deploy_ci_build, ci_stack_name, \ CI_BUILD_WEBHOOK_FILTER_PATTERN from exasol_script_languages_container_ci_setup.lib.release_build import run_deploy_release_build, release_stack_name @@ -28,7 +29,7 @@ def test_deploy_ci_upload_invoked(ci_code_build_yml): with expected values when we run run_deploy_ci_build() """ aws_access_mock: Union[MagicMock, AwsAccess] = create_autospec(AwsAccess) - aws_access_mock.read_dockerhub_secret_arn.return_value = DOCKERHUB_SECRET_ARN + aws_access_mock.read_dockerhub_secret_arn.return_value = ARN(aws_arn=DOCKERHUB_SECRET_ARN) run_deploy_ci_build(aws_access=aws_access_mock, project=PROJECT, github_url=GH_URL) assert call.upload_cloudformation_stack(ci_code_build_yml, ci_stack_name(PROJECT)) in aws_access_mock.mock_calls diff --git a/test/unit_tests/test_generate_buildspec.py b/test/unit_tests/test_generate_buildspec.py index 22eb96e..cb327b5 100644 --- a/test/unit_tests/test_generate_buildspec.py +++ b/test/unit_tests/test_generate_buildspec.py @@ -1,10 +1,9 @@ import json -import jsonschema import pydantic import pytest -from exasol_script_languages_container_ci_setup.lib.config.config_data_model import Config, Build, Ignore, Release +from exasol_script_languages_container_ci.lib.config.config_data_model import Config, Build, Ignore, Release from exasol_script_languages_container_ci_setup.lib.render_template import render_template from exasol_script_languages_container_ci_setup.lib.run_generate_buildspec import run_generate_buildspec, \ get_config_file_parameter diff --git a/test/unit_tests/test_start_release_build.py b/test/unit_tests/test_start_release_build.py index f9bafad..dc99560 100644 --- a/test/unit_tests/test_start_release_build.py +++ b/test/unit_tests/test_start_release_build.py @@ -3,11 +3,11 @@ from unittest.mock import MagicMock, create_autospec, call import pytest +from exasol_script_languages_container_ci.lib.config.config_data_model import Build, Ignore, Release, Config from exasol_script_languages_container_ci_setup.lib.aws.aws_access import AwsAccess from exasol_script_languages_container_ci_setup.lib.aws.wrapper.datamodels.cloudformation import StackResourceSummary from exasol_script_languages_container_ci_setup.lib.aws.wrapper.datamodels.common import PhysicalResourceId -from exasol_script_languages_container_ci_setup.lib.config.config_data_model import Config, Build, Ignore, Release from exasol_script_languages_container_ci_setup.lib.run_start_build import run_start_release_build, DEFAULT_TIMEOUT UPLOAD_URL = "https://uploads.github.com/repos/exasol/script-languages-repo/releases/123/assets{?name,label}" diff --git a/test/unit_tests/test_start_test_release_build.py b/test/unit_tests/test_start_test_release_build.py index 74920a1..8a1fa10 100644 --- a/test/unit_tests/test_start_test_release_build.py +++ b/test/unit_tests/test_start_test_release_build.py @@ -7,7 +7,7 @@ from exasol_script_languages_container_ci_setup.lib.aws.aws_access import AwsAccess from exasol_script_languages_container_ci_setup.lib.aws.wrapper.datamodels.cloudformation import StackResourceSummary from exasol_script_languages_container_ci_setup.lib.aws.wrapper.datamodels.common import PhysicalResourceId -from exasol_script_languages_container_ci_setup.lib.config.config_data_model import Config, Build, Release, Ignore +from exasol_script_languages_container_ci.lib.config.config_data_model import Config, Build, Release, Ignore from exasol_script_languages_container_ci_setup.lib.github_draft_release_creator import GithubDraftReleaseCreator from exasol_script_languages_container_ci_setup.lib.run_start_build import run_start_test_release_build, DEFAULT_TIMEOUT from test.mock_cast import mock_cast