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(module/test_infrastructure): module creation and adjusted examples #10

Merged
merged 25 commits into from
Mar 28, 2024

Conversation

acelebanski
Copy link
Contributor

Description

PR delivers changes for test_infrastructure:

  • Creation of the test_infrastructure module and integrating it with reference architecture examples in favour of a separate test infra example
  • Made the module compliant with the following principles
    • README.md adjusted to new style with additional header file
    • minimum Terraform version set to 1.5
    • refactor variables:
      • descriptions
      • types with optionals
      • default values
      • validations
      • simplify main.tf by removing not required try
      • remove name generation logic from the module
      • add terraform registry reference

Motivation and Context

#8

How Has This Been Tested?

Refactored common_vmseries example has been deployed in the lab.

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist

  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes if appropriate.
  • All new and existing tests passed.

@acelebanski acelebanski added the refactor Related to code refactoring label Jan 28, 2024
modules/test_infrastructure/main.tf Outdated Show resolved Hide resolved
modules/test_infrastructure/main.tf Show resolved Hide resolved
modules/test_infrastructure/variables.tf Outdated Show resolved Hide resolved
modules/test_infrastructure/versions.tf Outdated Show resolved Hide resolved
examples/common_vmseries/main.tf Show resolved Hide resolved
modules/test_infrastructure/main.tf Show resolved Hide resolved
modules/test_infrastructure/main.tf Outdated Show resolved Hide resolved
modules/test_infrastructure/variables.tf Outdated Show resolved Hide resolved
@migara
Copy link
Member

migara commented Feb 7, 2024

/plan paths="modules/vmseries"

Testing job ID: 7815502865
Job result: FAILURE
Job result: FAILURE

@migara
Copy link
Member

migara commented Feb 7, 2024

/plan paths="modules/vmseries"

Testing job ID: 7816328335
Job result: SUCCESS

modules/test_infrastructure/README.md Outdated Show resolved Hide resolved
examples/common_vmseries/README.md Outdated Show resolved Hide resolved
Copy link
Contributor

@alperenkose alperenkose left a comment

Choose a reason for hiding this comment

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

Copy link
Contributor

@sebastianczech sebastianczech left a comment

Choose a reason for hiding this comment

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

Generally, it looks good , I have only 2 optional comments.

examples/common_vmseries/example.tfvars Show resolved Hide resolved
modules/test_infrastructure/main.tf Show resolved Hide resolved
Copy link
Contributor

@sebastianczech sebastianczech left a comment

Choose a reason for hiding this comment

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

Overall great job. I have few comments, but they are optional 👍

modules/test_infrastructure/main.tf Outdated Show resolved Hide resolved
modules/test_infrastructure/main.tf Outdated Show resolved Hide resolved
modules/test_infrastructure/main.tf Outdated Show resolved Hide resolved
modules/test_infrastructure/main.tf Outdated Show resolved Hide resolved
Copy link
Contributor

@alperenkose alperenkose left a comment

Choose a reason for hiding this comment

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

That's great work in deed 👍🏻 I just have one comment, I think we don't handle the auto creation of hidden readme files with a dot for .README.md, this can result us forgetting about it and committing a new README.md file without "." in the test_instrastructure module.

I think we can handle this in one of the 2 ways;

  • Creating a terraform-docs yaml file within the test_infrastructure module itself so it has the output set as .README.md. This config should take precedence over the one in the root module if I understand correctly. We might need to remove yaml config file reference in pre-commit hooks. Need to be tested.
    https://terraform-docs.io/user-guide/configuration/
  • Targeting the test_infrastructure module separately in pre-commit hooks, by creating another hook with specific --output-file parameter to generate .README.md in the module. Need to be tested as well, might have a conflict when we have a generic terraform-docs and module specific terraform-docs hook at the same time.
    https://terraform-docs.io/how-to/pre-commit-hooks/

Copy link
Contributor

@alperenkose alperenkose left a comment

Choose a reason for hiding this comment

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

Opened a separate case for the .README.md file handling referred to here: #10 (review)

@acelebanski acelebanski marked this pull request as ready for review March 28, 2024 13:26
@acelebanski acelebanski requested a review from a team as a code owner March 28, 2024 13:26
@acelebanski acelebanski merged commit 7f01d41 into refactor-modules Mar 28, 2024
1 check passed
@acelebanski acelebanski deleted the refactor_test_infrastructure branch March 28, 2024 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Related to code refactoring
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants