Skip to content

Conversation

bryantbiggs
Copy link
Member

@bryantbiggs bryantbiggs commented Oct 27, 2022

Description

  • Update GitHub action versions to use latest. This remove warnings related to https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
  • Ensure pre-commit config is aligned with latest
  • Add lock.yml workflow to automatically lock issues and PRs after 30 days. Theres a lot "Me too" or "I have this issue, when will this get fixed" on really old/stale issues and in order to properly triage, users need to supply their configurations. This workflow is pulled from the AWS provider's repo to force users to fill out a proper issue ticket and keep chatter out of merged PRs or old issues
  • Update supported Terraform min version to v1.0+ and AWS provider to v4.0+

Motivation and Context

  • Patch warnings on CI checks to keep output clean
  • Focus on new issues and PRs

Breaking Changes

  • No

How Has This Been Tested?

  • I have updated at least one of the examples/* to demonstrate and validate my change(s)
  • I have tested and validated these changes using one or more of the provided examples/* projects
  • I have executed pre-commit run -a on my pull request

@bryantbiggs bryantbiggs changed the title fix: Update CI configuration files to use latest version feat!: Update supported Terraform min version to v1.0+ and AWS provider to v4.0+ Oct 27, 2022
@@ -1,3 +1,3 @@
terraform {
required_version = ">= 0.13.1"
required_version = ">= 1.0"
Copy link
Member

Choose a reason for hiding this comment

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

The code in wrappers should not be updated. The hook autogenerates it.

Copy link
Member Author

Choose a reason for hiding this comment

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

hmm, I'm afraid I don't know how these work. Both the ALB and ACM are failing because of the 0.13 requirement it looks like but each time I run pre-commit run -a locally, it changes the 1.0 I specified back to 0.13.1

Copy link
Member

Choose a reason for hiding this comment

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

I will take a look at the failing modules tomorrow morning.

Thank you for an update across all (or almost all)!

Copy link
Member

Choose a reason for hiding this comment

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

BTW the version in wrappers is hardcoded right in here - https://github.com/antonbabenko/pre-commit-terraform/blob/master/hooks/terraform_wrapper_module_for_each.sh#L41 . It is ok for the wrappers.

Copy link
Member

@antonbabenko antonbabenko left a comment

Choose a reason for hiding this comment

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

LGTM. Tell me if I should apply a similar update to the pre-commit.yml in other failing modules.

# Run only validate pre-commit check on min version supported
if: ${{ matrix.directory != '.' }}
uses: clowdhaus/terraform-composite-actions/pre-commit@v1.3.0
if: ${{ matrix.directory != '.' && !contains(matrix.directory, 'wrappers') }}
Copy link
Member

Choose a reason for hiding this comment

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

The correct way is probably to disable clowdhaus/terraform-min-max from fetching terraform versions from the wrappers directories, but the simplest is to disable runs of pre-commit terraform_validate step, so I did.

Wrappers define just the minimum required versions of the Terraform for itself, but they don't know (and should not know) what they are wrapping and what is their required version of the Terraform. Hope it makes sense :)

What do you think?

Copy link
Member Author

Choose a reason for hiding this comment

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

this works!

with:
terraform-version: ${{ steps.minMax.outputs.maxVersion }}
terraform-docs-version: ${{ env.TERRAFORM_DOCS_VERSION }}
install-hcledit: true
Copy link
Member

Choose a reason for hiding this comment

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

Installing hcledit in all modules should be fine.

@bryantbiggs bryantbiggs merged commit 4fa9065 into terraform-aws-modules:master Oct 29, 2022
@bryantbiggs bryantbiggs deleted the chore/update-ci branch October 29, 2022 14:06
antonbabenko pushed a commit that referenced this pull request Oct 29, 2022
## [4.0.0](v3.3.0...v4.0.0) (2022-10-29)

### ⚠ BREAKING CHANGES

* Update supported Terraform min version to v1.0+ and AWS provider to v4.0+ (#47)

### Features

* Update supported Terraform min version to v1.0+ and AWS provider to v4.0+ ([#47](#47)) ([4fa9065](4fa9065))
@antonbabenko
Copy link
Member

This PR is included in version 4.0.0 🎉

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants