dbt-platform-helper 10.11.2__tar.gz → 10.11.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of dbt-platform-helper might be problematic. Click here for more details.
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/PKG-INFO +1 -1
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/COMMANDS.md +2 -2
- dbt_platform_helper-10.11.3/dbt_platform_helper/commands/version.py +38 -0
- dbt_platform_helper-10.11.3/dbt_platform_helper/utils/platform_config.py +32 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/utils/validation.py +2 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/utils/versioning.py +28 -18
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/platform_helper.py +2 -2
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/pyproject.toml +1 -1
- dbt_platform_helper-10.11.2/dbt_platform_helper/commands/version.py +0 -38
- dbt_platform_helper-10.11.2/dbt_platform_helper/utils/platform_config.py +0 -19
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/LICENSE +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/README.md +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/__init__.py +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/addon-plans.yml +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/addons-template-map.yml +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/commands/__init__.py +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/commands/application.py +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/commands/check_cloudformation.py +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/commands/codebase.py +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/commands/conduit.py +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/commands/config.py +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/commands/copilot.py +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/commands/database.py +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/commands/dns.py +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/commands/environment.py +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/commands/generate.py +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/commands/notify.py +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/commands/pipeline.py +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/commands/secrets.py +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/constants.py +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/custom_resources/__init__.py +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/custom_resources/s3_object.py +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/default-extensions.yml +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/exceptions.py +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/jinja2_tags.py +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/.copilot/config.yml +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/.copilot/image_build_run.sh +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/.copilot/phases/build.sh +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/.copilot/phases/install.sh +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/.copilot/phases/post_build.sh +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/.copilot/phases/pre_build.sh +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/COMMANDS.md.jinja +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/addon-instructions.txt +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/addons/README.md +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/addons/env/addons.parameters.yml +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/addons/env/aurora-postgres.yml +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/addons/env/monitoring.yml +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/addons/env/opensearch.yml +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/addons/env/rds-postgres.yml +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/addons/env/redis-cluster.yml +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/addons/env/s3.yml +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/addons/env/vpc.yml +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/addons/svc/appconfig-ipfilter.yml +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/addons/svc/prometheus-policy.yml +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/addons/svc/s3-policy.yml +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/addons/svc/subscription-filter.yml +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/ci-codebuild-role-policy.json +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/create-codebuild-role.json +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/custom-codebuild-role-policy.json +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/env/manifest.yml +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/env/overrides/.gitignore +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/env/overrides/README.md +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/env/overrides/bin/override.ts +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/env/overrides/cdk.json +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/env/overrides/log_resource_policy.json +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/env/overrides/package-lock.json +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/env/overrides/package.json +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/env/overrides/stack.ts +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/env/overrides/tsconfig.json +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/env/terraform-overrides/cfn.patches.yml +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/environments/main.tf +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/pipelines/codebase/manifest.yml +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/pipelines/codebase/overrides/.gitignore +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/pipelines/codebase/overrides/bin/override.ts +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/pipelines/codebase/overrides/buildspec.deploy.yml +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/pipelines/codebase/overrides/buildspec.image.yml +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/pipelines/codebase/overrides/cdk.json +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/pipelines/codebase/overrides/package-lock.json +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/pipelines/codebase/overrides/package.json +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/pipelines/codebase/overrides/stack.ts +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/pipelines/codebase/overrides/tsconfig.json +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/pipelines/codebase/overrides/types.ts +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/pipelines/environments/buildspec.yml +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/pipelines/environments/manifest.yml +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/pipelines/environments/overrides/cfn.patches.yml +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/svc/maintenance_pages/default.html +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/svc/maintenance_pages/dmas-migration.html +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/svc/maintenance_pages/migration.html +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/svc/manifest-backend.yml +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/svc/manifest-public.yml +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/templates/svc/overrides/cfn.patches.yml +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/utils/__init__.py +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/utils/application.py +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/utils/arn_parser.py +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/utils/aws.py +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/utils/click.py +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/utils/cloudformation.py +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/utils/cloudfoundry.py +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/utils/files.py +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/utils/git.py +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/utils/manifests.py +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/utils/messages.py +0 -0
- {dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/utils/template.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: dbt-platform-helper
|
|
3
|
-
Version: 10.11.
|
|
3
|
+
Version: 10.11.3
|
|
4
4
|
Summary: Set of tools to help transfer applications/services from GOV.UK PaaS to DBT PaaS augmenting AWS Copilot.
|
|
5
5
|
License: MIT
|
|
6
6
|
Author: Department for Business and Trade Platform Team
|
|
@@ -1002,8 +1002,8 @@ platform-helper database copy <source_db> <target_db>
|
|
|
1002
1002
|
|
|
1003
1003
|
[↩ Parent](#platform-helper)
|
|
1004
1004
|
|
|
1005
|
-
Contains subcommands for getting version information about the
|
|
1006
|
-
|
|
1005
|
+
Contains subcommands for getting version information about the
|
|
1006
|
+
current project.
|
|
1007
1007
|
|
|
1008
1008
|
## Usage
|
|
1009
1009
|
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import click
|
|
2
|
+
|
|
3
|
+
from dbt_platform_helper.utils.click import ClickDocOptGroup
|
|
4
|
+
from dbt_platform_helper.utils.platform_config import get_environment_pipeline_names
|
|
5
|
+
from dbt_platform_helper.utils.versioning import get_required_platform_helper_version
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class VersionCommand:
|
|
9
|
+
def __init__(self):
|
|
10
|
+
self.command_group = self.version
|
|
11
|
+
self.command = self.get_platform_helper_for_project
|
|
12
|
+
|
|
13
|
+
@click.group(chain=True, cls=ClickDocOptGroup)
|
|
14
|
+
def version():
|
|
15
|
+
"""Contains subcommands for getting version information about the
|
|
16
|
+
current project."""
|
|
17
|
+
|
|
18
|
+
@version.command(help="Print the version of platform-tools required by the current project")
|
|
19
|
+
@click.option(
|
|
20
|
+
"--pipeline",
|
|
21
|
+
required=False,
|
|
22
|
+
type=click.Choice(get_environment_pipeline_names()),
|
|
23
|
+
help="Take into account platform-tools version overrides in the specified pipeline",
|
|
24
|
+
)
|
|
25
|
+
def get_platform_helper_for_project(pipeline):
|
|
26
|
+
"""
|
|
27
|
+
Version precedence is in this order:
|
|
28
|
+
- if the --pipeline option is supplied, the version in 'platform-config.yml' in:
|
|
29
|
+
environment_pipelines:
|
|
30
|
+
<pipeline>:
|
|
31
|
+
...
|
|
32
|
+
versions:
|
|
33
|
+
platform-helper
|
|
34
|
+
- The version from default_versions/platform-helper in 'platform-config.yml'
|
|
35
|
+
- Fall back on the version in the deprecated '.platform-helper-version' file
|
|
36
|
+
"""
|
|
37
|
+
required_version = get_required_platform_helper_version(pipeline)
|
|
38
|
+
click.secho(required_version)
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import yaml
|
|
2
|
+
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
|
|
5
|
+
from dbt_platform_helper.constants import PLATFORM_CONFIG_FILE
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def _read_config_file_contents():
|
|
9
|
+
if Path(PLATFORM_CONFIG_FILE).exists():
|
|
10
|
+
return Path(PLATFORM_CONFIG_FILE).read_text()
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def load_unvalidated_config_file():
|
|
14
|
+
file_contents = _read_config_file_contents()
|
|
15
|
+
if not file_contents:
|
|
16
|
+
return {}
|
|
17
|
+
try:
|
|
18
|
+
return yaml.safe_load(file_contents)
|
|
19
|
+
except yaml.parser.ParserError:
|
|
20
|
+
return {}
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def get_environment_pipeline_names():
|
|
24
|
+
pipelines_config = load_unvalidated_config_file().get("environment_pipelines")
|
|
25
|
+
if pipelines_config:
|
|
26
|
+
return pipelines_config.keys()
|
|
27
|
+
return {}
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def is_terraform_project() -> bool:
|
|
31
|
+
config = yaml.safe_load(Path(PLATFORM_CONFIG_FILE).read_text())
|
|
32
|
+
return not config.get("legacy_project", False)
|
{dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/utils/validation.py
RENAMED
|
@@ -615,6 +615,8 @@ def load_and_validate_platform_config(
|
|
|
615
615
|
return conf
|
|
616
616
|
except ParserError:
|
|
617
617
|
abort_with_error(f"{PLATFORM_CONFIG_FILE} is not valid YAML")
|
|
618
|
+
except SchemaError as e:
|
|
619
|
+
abort_with_error(f"Schema error in {PLATFORM_CONFIG_FILE}. {e}")
|
|
618
620
|
|
|
619
621
|
|
|
620
622
|
def config_file_check(path=PLATFORM_CONFIG_FILE):
|
{dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/utils/versioning.py
RENAMED
|
@@ -16,7 +16,7 @@ from dbt_platform_helper.constants import PLATFORM_HELPER_VERSION_FILE
|
|
|
16
16
|
from dbt_platform_helper.exceptions import IncompatibleMajorVersion
|
|
17
17
|
from dbt_platform_helper.exceptions import IncompatibleMinorVersion
|
|
18
18
|
from dbt_platform_helper.exceptions import ValidationException
|
|
19
|
-
from dbt_platform_helper.utils.
|
|
19
|
+
from dbt_platform_helper.utils.platform_config import load_unvalidated_config_file
|
|
20
20
|
|
|
21
21
|
VersionTuple = Optional[Tuple[int, int, int]]
|
|
22
22
|
|
|
@@ -104,22 +104,40 @@ def get_github_released_version(repository: str, tags: bool = False) -> Tuple[in
|
|
|
104
104
|
return parse_version(package_info["tag_name"])
|
|
105
105
|
|
|
106
106
|
|
|
107
|
+
def _get_latest_release():
|
|
108
|
+
package_info = requests.get("https://pypi.org/pypi/dbt-platform-helper/json").json()
|
|
109
|
+
released_versions = package_info["releases"].keys()
|
|
110
|
+
parsed_released_versions = [parse_version(v) for v in released_versions]
|
|
111
|
+
parsed_released_versions.sort(reverse=True)
|
|
112
|
+
return parsed_released_versions[0]
|
|
113
|
+
|
|
114
|
+
|
|
107
115
|
def get_platform_helper_versions(include_project_versions=True) -> PlatformHelperVersions:
|
|
108
116
|
try:
|
|
109
117
|
locally_installed_version = parse_version(version("dbt-platform-helper"))
|
|
110
118
|
except PackageNotFoundError:
|
|
111
119
|
locally_installed_version = None
|
|
112
120
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
121
|
+
latest_release = _get_latest_release()
|
|
122
|
+
|
|
123
|
+
if not include_project_versions:
|
|
124
|
+
return PlatformHelperVersions(
|
|
125
|
+
local_version=locally_installed_version,
|
|
126
|
+
latest_release=latest_release,
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
deprecated_version_file = Path(PLATFORM_HELPER_VERSION_FILE)
|
|
130
|
+
version_from_file = (
|
|
131
|
+
parse_version(deprecated_version_file.read_text())
|
|
132
|
+
if deprecated_version_file.exists()
|
|
133
|
+
else None
|
|
134
|
+
)
|
|
135
|
+
|
|
136
|
+
platform_config_default, pipeline_overrides = None, {}
|
|
118
137
|
|
|
119
|
-
|
|
138
|
+
platform_config = load_unvalidated_config_file()
|
|
120
139
|
|
|
121
|
-
if
|
|
122
|
-
platform_config = load_and_validate_platform_config(disable_aws_validation=True)
|
|
140
|
+
if platform_config:
|
|
123
141
|
platform_config_default = parse_version(
|
|
124
142
|
platform_config.get("default_versions", {}).get("platform-helper")
|
|
125
143
|
)
|
|
@@ -130,13 +148,6 @@ def get_platform_helper_versions(include_project_versions=True) -> PlatformHelpe
|
|
|
130
148
|
if pipeline.get("versions", {}).get("platform-helper")
|
|
131
149
|
}
|
|
132
150
|
|
|
133
|
-
deprecated_version_file = Path(PLATFORM_HELPER_VERSION_FILE)
|
|
134
|
-
version_from_file = (
|
|
135
|
-
parse_version(deprecated_version_file.read_text())
|
|
136
|
-
if deprecated_version_file.exists()
|
|
137
|
-
else None
|
|
138
|
-
)
|
|
139
|
-
|
|
140
151
|
out = PlatformHelperVersions(
|
|
141
152
|
local_version=locally_installed_version,
|
|
142
153
|
latest_release=latest_release,
|
|
@@ -145,8 +156,7 @@ def get_platform_helper_versions(include_project_versions=True) -> PlatformHelpe
|
|
|
145
156
|
pipeline_overrides=pipeline_overrides,
|
|
146
157
|
)
|
|
147
158
|
|
|
148
|
-
|
|
149
|
-
_process_version_file_warnings(out)
|
|
159
|
+
_process_version_file_warnings(out)
|
|
150
160
|
|
|
151
161
|
return out
|
|
152
162
|
|
|
@@ -20,7 +20,7 @@ from dbt_platform_helper.commands.generate import generate as generate_commands
|
|
|
20
20
|
from dbt_platform_helper.commands.notify import notify as notify_commands
|
|
21
21
|
from dbt_platform_helper.commands.pipeline import pipeline as pipeline_commands
|
|
22
22
|
from dbt_platform_helper.commands.secrets import secrets as secrets_commands
|
|
23
|
-
from dbt_platform_helper.commands.version import
|
|
23
|
+
from dbt_platform_helper.commands.version import VersionCommand
|
|
24
24
|
from dbt_platform_helper.utils.click import ClickDocOptGroup
|
|
25
25
|
|
|
26
26
|
|
|
@@ -47,7 +47,7 @@ platform_helper.add_command(pipeline_commands)
|
|
|
47
47
|
platform_helper.add_command(secrets_commands)
|
|
48
48
|
platform_helper.add_command(notify_commands)
|
|
49
49
|
platform_helper.add_command(database_commands)
|
|
50
|
-
platform_helper.add_command(
|
|
50
|
+
platform_helper.add_command(VersionCommand().command_group)
|
|
51
51
|
|
|
52
52
|
if __name__ == "__main__":
|
|
53
53
|
platform_helper()
|
|
@@ -3,7 +3,7 @@ line-length = 100
|
|
|
3
3
|
|
|
4
4
|
[tool.poetry]
|
|
5
5
|
name = "dbt-platform-helper"
|
|
6
|
-
version = "10.11.
|
|
6
|
+
version = "10.11.3"
|
|
7
7
|
description = "Set of tools to help transfer applications/services from GOV.UK PaaS to DBT PaaS augmenting AWS Copilot."
|
|
8
8
|
authors = ["Department for Business and Trade Platform Team <sre-team@digital.trade.gov.uk>"]
|
|
9
9
|
license = "MIT"
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import click
|
|
2
|
-
|
|
3
|
-
from dbt_platform_helper.utils.click import ClickDocOptGroup
|
|
4
|
-
from dbt_platform_helper.utils.platform_config import get_environment_pipeline_names
|
|
5
|
-
from dbt_platform_helper.utils.versioning import (
|
|
6
|
-
check_platform_helper_version_needs_update,
|
|
7
|
-
)
|
|
8
|
-
from dbt_platform_helper.utils.versioning import get_required_platform_helper_version
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
@click.group(chain=True, cls=ClickDocOptGroup)
|
|
12
|
-
def version():
|
|
13
|
-
"""Contains subcommands for getting version information about the current
|
|
14
|
-
project."""
|
|
15
|
-
check_platform_helper_version_needs_update()
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
@version.command(help="Print the version of platform-tools required by the current project")
|
|
19
|
-
@click.option(
|
|
20
|
-
"--pipeline",
|
|
21
|
-
required=False,
|
|
22
|
-
type=click.Choice(get_environment_pipeline_names()),
|
|
23
|
-
help="Take into account platform-tools version overrides in the specified pipeline",
|
|
24
|
-
)
|
|
25
|
-
def get_platform_helper_for_project(pipeline):
|
|
26
|
-
"""
|
|
27
|
-
Version precedence is in this order:
|
|
28
|
-
- if the --pipeline option is supplied, the version in 'platform-config.yml' in:
|
|
29
|
-
environment_pipelines:
|
|
30
|
-
<pipeline>:
|
|
31
|
-
...
|
|
32
|
-
versions:
|
|
33
|
-
platform-helper
|
|
34
|
-
- The version from default_versions/platform-helper in 'platform-config.yml'
|
|
35
|
-
- Fall back on the version in the deprecated '.platform-helper-version' file
|
|
36
|
-
"""
|
|
37
|
-
required_version = get_required_platform_helper_version(pipeline)
|
|
38
|
-
click.secho(required_version)
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
from pathlib import Path
|
|
2
|
-
|
|
3
|
-
import yaml
|
|
4
|
-
|
|
5
|
-
from dbt_platform_helper.constants import PLATFORM_CONFIG_FILE
|
|
6
|
-
from dbt_platform_helper.utils.validation import load_and_validate_platform_config
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
def get_environment_pipeline_names():
|
|
10
|
-
if not Path(PLATFORM_CONFIG_FILE).exists():
|
|
11
|
-
return {}
|
|
12
|
-
|
|
13
|
-
config = load_and_validate_platform_config(disable_aws_validation=True, disable_file_check=True)
|
|
14
|
-
return config.get("environment_pipelines", {}).keys()
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
def is_terraform_project() -> bool:
|
|
18
|
-
config = yaml.safe_load(Path(PLATFORM_CONFIG_FILE).read_text())
|
|
19
|
-
return not config.get("legacy_project", False)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/addon-plans.yml
RENAMED
|
File without changes
|
|
File without changes
|
{dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/commands/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/commands/codebase.py
RENAMED
|
File without changes
|
{dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/commands/conduit.py
RENAMED
|
File without changes
|
{dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/commands/config.py
RENAMED
|
File without changes
|
{dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/commands/copilot.py
RENAMED
|
File without changes
|
{dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/commands/database.py
RENAMED
|
File without changes
|
{dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/commands/dns.py
RENAMED
|
File without changes
|
|
File without changes
|
{dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/commands/generate.py
RENAMED
|
File without changes
|
{dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/commands/notify.py
RENAMED
|
File without changes
|
{dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/commands/pipeline.py
RENAMED
|
File without changes
|
{dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/commands/secrets.py
RENAMED
|
File without changes
|
{dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/constants.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/exceptions.py
RENAMED
|
File without changes
|
{dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/jinja2_tags.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/utils/__init__.py
RENAMED
|
File without changes
|
{dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/utils/application.py
RENAMED
|
File without changes
|
{dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/utils/arn_parser.py
RENAMED
|
File without changes
|
{dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/utils/aws.py
RENAMED
|
File without changes
|
{dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/utils/click.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/utils/files.py
RENAMED
|
File without changes
|
{dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/utils/git.py
RENAMED
|
File without changes
|
{dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/utils/manifests.py
RENAMED
|
File without changes
|
{dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/utils/messages.py
RENAMED
|
File without changes
|
{dbt_platform_helper-10.11.2 → dbt_platform_helper-10.11.3}/dbt_platform_helper/utils/template.py
RENAMED
|
File without changes
|