From ea471da196d0cf19223d50d302d47308f411b34c Mon Sep 17 00:00:00 2001 From: Marius Tolzmann Date: Thu, 20 Oct 2022 13:57:00 +0200 Subject: [PATCH 1/4] release: prepare 0.17.0 release --- CHANGELOG.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 44788e5..27f4708 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.17.0] + +### Added + +- Add support for Terraform GitHub Provider version `5.x` + ## [0.16.2] ### Fixed @@ -78,8 +84,7 @@ This needs migration actions if you already used this module with the `hashicorp To migrate from a previous version, please ensure that you are using the `integrations/github` official GitHub Terraform Provider. - -``` hcl +```hcl terraform { required_version = "~> 1.0" @@ -96,7 +101,7 @@ Once you've updated the provider, a manual state migration is required to migrate existing resources to the new provider. The following command will replace the provider in the state. -``` bash +```bash terraform state replace-provider registry.terraform.io/hashicorp/github registry.terraform.io/integrations/github ``` @@ -380,7 +385,8 @@ Please review plans and report regressions and issues asap so we can improve doc - This is the initial release of our GitHub Repository module with support for creating and managing GitHub Repositories for Organizations. -[unreleased]: https://github.com/mineiros-io/terraform-github-repository/compare/v0.16.2...HEAD +[unreleased]: https://github.com/mineiros-io/terraform-github-repository/compare/v0.17.0...HEAD +[0.17.0]: https://github.com/mineiros-io/terraform-github-repository/compare/v0.16.2...v0.17.0 [0.16.2]: https://github.com/mineiros-io/terraform-github-repository/compare/v0.16.1...v0.16.2 [0.16.1]: https://github.com/mineiros-io/terraform-github-repository/compare/v0.16.0...v0.16.1 [0.16.0]: https://github.com/mineiros-io/terraform-github-repository/compare/v0.15.0...v0.16.0 From 773846a89b92771bbb50c987b763e35b3c78e8c1 Mon Sep 17 00:00:00 2001 From: Marius Tolzmann Date: Thu, 20 Oct 2022 13:56:41 +0200 Subject: [PATCH 2/4] feat: Add support for provider 5.x --- test/unit-complete/provider.tf | 7 +++++-- versions.tf | 4 +--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/test/unit-complete/provider.tf b/test/unit-complete/provider.tf index a64e150..535e234 100644 --- a/test/unit-complete/provider.tf +++ b/test/unit-complete/provider.tf @@ -6,8 +6,11 @@ terraform { required_providers { github = { source = "integrations/github" - version = "~> 4.19" + version = "~> 5.0" + } + tls = { + source = "hashicorp/tls" + version = "~> 2.1" } - tls = "~> 2.1" } } diff --git a/versions.tf b/versions.tf index c58e515..5aeedce 100644 --- a/versions.tf +++ b/versions.tf @@ -5,12 +5,10 @@ terraform { required_version = "~> 1.0" - # 4.7.0 to 4.9.1 has a security regression: new repositories created via a - # template have a public visibility. Has been fixed in 4.9.2. required_providers { github = { source = "integrations/github" - version = "~> 4.20" + version = ">= 4.20, < 6.0" } } } From e87878ba491a459247d5bcfd08583608adffedfe Mon Sep 17 00:00:00 2001 From: Marius Tolzmann Date: Thu, 20 Oct 2022 14:32:14 +0200 Subject: [PATCH 3/4] fix: mask broken versions --- README.md | 4 ++-- README.tfdoc.hcl | 4 ++-- test/unit-complete/provider.tf | 2 +- versions.tf | 1 + 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 85c2414..df15cc4 100644 --- a/README.md +++ b/README.md @@ -10,11 +10,11 @@ A [Terraform] module for creating a public or private repository on [Github]. -**_This module supports Terraform v1.x and is compatible with the Official Terraform GitHub Provider v4.10 and above from `integrations/github`._** +**_This module supports Terraform v1.x and is compatible with the Official Terraform GitHub Provider v4.20 and above from `integrations/github`._** **Attention: This module is incompatible with the Hashicorp GitHub Provider! The latest version of this module supporting `hashicorp/github` provider is `~> 0.10.0`** -_Security related notice: Versions 4.7.0, 4.8.0, 4.9.0 and 4.9.1 of the Terraform Github Provider are deny-listed in version constraints as a regression introduced in 4.7.0 and fixed in 4.9.2 creates public repositories from templates even if visibility is set to private._ +** Note: Versions 5.3.0, 5.4.0, and 5.5.0 of the Terraform Github Provider have broken branch protections support and should not be used.** - [GitHub as Code](#github-as-code) diff --git a/README.tfdoc.hcl b/README.tfdoc.hcl index 79d71fa..ab43b59 100644 --- a/README.tfdoc.hcl +++ b/README.tfdoc.hcl @@ -39,11 +39,11 @@ section { content = <<-END A [Terraform] module for creating a public or private repository on [Github]. - **_This module supports Terraform v1.x and is compatible with the Official Terraform GitHub Provider v4.10 and above from `integrations/github`._** + **_This module supports Terraform v1.x and is compatible with the Official Terraform GitHub Provider v4.20 and above from `integrations/github`._** **Attention: This module is incompatible with the Hashicorp GitHub Provider! The latest version of this module supporting `hashicorp/github` provider is `~> 0.10.0`** - _Security related notice: Versions 4.7.0, 4.8.0, 4.9.0 and 4.9.1 of the Terraform Github Provider are deny-listed in version constraints as a regression introduced in 4.7.0 and fixed in 4.9.2 creates public repositories from templates even if visibility is set to private._ + ** Note: Versions 5.3.0, 5.4.0, and 5.5.0 of the Terraform Github Provider have broken branch protections support and should not be used.** END section { diff --git a/test/unit-complete/provider.tf b/test/unit-complete/provider.tf index 535e234..7cd89ca 100644 --- a/test/unit-complete/provider.tf +++ b/test/unit-complete/provider.tf @@ -6,7 +6,7 @@ terraform { required_providers { github = { source = "integrations/github" - version = "~> 5.0" + version = "~> 5.0, !=5.3.0, !=5.4.0, !=5.5.0" } tls = { source = "hashicorp/tls" diff --git a/versions.tf b/versions.tf index 5aeedce..01e52ac 100644 --- a/versions.tf +++ b/versions.tf @@ -5,6 +5,7 @@ terraform { required_version = "~> 1.0" + # branch_protections_v3 are broken in >= 5.3 required_providers { github = { source = "integrations/github" From 9a4693a85802738bebd04b181798274e4352a68d Mon Sep 17 00:00:00 2001 From: Marius Tolzmann Date: Thu, 20 Oct 2022 14:11:54 +0200 Subject: [PATCH 4/4] fix: remove projects test as disabled in test org --- test/unit-complete/variables.tf | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/test/unit-complete/variables.tf b/test/unit-complete/variables.tf index fab5130..55b155f 100644 --- a/test/unit-complete/variables.tf +++ b/test/unit-complete/variables.tf @@ -101,16 +101,7 @@ variable "projects" { name = string, body = string })) - default = [ - { - name = "Testproject" - body = "This is a fancy test project for testing" - }, - { - name = "Another Testproject" - body = "This is a fancy test project for testing" - } - ] + default = [] } variable "issue_labels" {