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

refactor: DBTP-1630 Terraform environment domain tests refactor #715

Open
wants to merge 34 commits into
base: main
Choose a base branch
from

Conversation

DeveloperConnor
Copy link
Contributor

@DeveloperConnor DeveloperConnor commented Jan 10, 2025

Addresses DBTP-1630

  • Moves manifest writing and generating into a ManifestGenerator class
  • Implements FileProvider and moves files mkfile utility into it
  • Moves environment terraform-generate tests out of _legacy tests file and into domain tests with ManifestGenerator mocking, decoupling domain from click
  • removes deprecated vpc-name flag and logic
  • add handling for EnvironmentNotFoundException (previously led to stack trace in cli)
  • removes obsolete get_environment_pipeline_names function and tests

Checklist:

Title:

  • Scope included as per conventional commits
  • Ticket reference included (unless it's a quick out of ticket thing)

Description:

  • Link to ticket included (unless it's a quick out of ticket thing)
  • Includes tests (or an explanation for why it doesn't)
  • If the work includes user interface changes, before and after screenshots included in description
  • Includes any applicable changes to the documentation in this code base
  • Includes link(s) to any applicable changes to the documentation in the DBT Platform Documentation (can be to a pull request)

Tasks:

  • Run the end to end tests for this branch and confirm that they are passing

@DeveloperConnor DeveloperConnor requested a review from a team as a code owner January 10, 2025 14:39
fg="red",
)
raise click.Abort
def generate(name):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed the deprecation warning when providing a vpc to generate-terraform - its been here for 7months now, seems like no one should be impacted /shrug

):
env_template = setup_templates().get_template("environments/main.tf")
class PlatformTerraformManifestGenerator:
def __init__(self, file_provider):
Copy link
Contributor

Choose a reason for hiding this comment

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

missing type hints?

def __init__(self, config_provider):
def __init__(
self,
config_provider,
Copy link
Contributor

Choose a reason for hiding this comment

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

missing type hints?

@ksugden ksugden force-pushed the DBTP-1630-terraform-environment-tests branch from 3c7d315 to 7a199b7 Compare January 13, 2025 13:37
}
)

def write_manifest(self, environment_name: str, manifest_content: str):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This should prob be a private method?

application_name: str,
environment_config: dict,
terraform_platform_modules_version_override: str = None,
):
Copy link
Contributor

Choose a reason for hiding this comment

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

return value?

from dbt_platform_helper.providers.yaml_file import YamlFileProvider


class CacheProvider:
def __init__(
self,
file_provider: FileProvider = None,
file_provider: YamlFileProvider = None,
Copy link
Contributor

Choose a reason for hiding this comment

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

At what point do we create the ".platform-helper-config-cache.yml" file?

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.

4 participants