From d5f9abc2fe84ffa1946d6ee26c56480575cbb321 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 25 Oct 2023 22:43:42 +0000 Subject: [PATCH 1/6] Bump google.golang.org/grpc from 1.56.1 to 1.56.3 Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.56.1 to 1.56.3. - [Release notes](https://github.com/grpc/grpc-go/releases) - [Commits](https://github.com/grpc/grpc-go/compare/v1.56.1...v1.56.3) --- updated-dependencies: - dependency-name: google.golang.org/grpc dependency-type: indirect ... Signed-off-by: dependabot[bot] --- go.mod | 4 ++-- go.sum | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 9343bae5..6372cf07 100644 --- a/go.mod +++ b/go.mod @@ -9,6 +9,7 @@ require ( github.com/hashicorp/terraform-plugin-sdk/v2 v2.28.0 github.com/hashicorp/terraform-plugin-testing v1.5.1 github.com/satori/uuid v1.2.0 + golang.org/x/exp v0.0.0-20230809150735-7b3493d9a819 ) require ( @@ -18,7 +19,6 @@ require ( github.com/tidwall/pretty v1.2.0 // indirect github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect - golang.org/x/exp v0.0.0-20230809150735-7b3493d9a819 // indirect ) require ( @@ -62,6 +62,6 @@ require ( golang.org/x/text v0.13.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect - google.golang.org/grpc v1.56.1 // indirect + google.golang.org/grpc v1.56.3 // indirect google.golang.org/protobuf v1.31.0 // indirect ) diff --git a/go.sum b/go.sum index 5b697097..6ba7c9b4 100644 --- a/go.sum +++ b/go.sum @@ -173,8 +173,8 @@ google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6 google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A= google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= -google.golang.org/grpc v1.56.1 h1:z0dNfjIl0VpaZ9iSVjA6daGatAYwPGstTjt5vkRMFkQ= -google.golang.org/grpc v1.56.1/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= +google.golang.org/grpc v1.56.3 h1:8I4C0Yq1EjstUzUJzpcRVbuYA2mODtEmpWiQoN/b2nc= +google.golang.org/grpc v1.56.3/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= From 90ddb422ef966c7e0054b4dcbdc9e413cac9fbdb Mon Sep 17 00:00:00 2001 From: Laurent Michenaud Date: Tue, 31 Oct 2023 09:31:37 +0100 Subject: [PATCH 2/6] fix: alm settings update gitlab returns no content --- sonarqube/resource_sonarqube_alm_gitlab.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonarqube/resource_sonarqube_alm_gitlab.go b/sonarqube/resource_sonarqube_alm_gitlab.go index e1f76573..a86dab4d 100644 --- a/sonarqube/resource_sonarqube_alm_gitlab.go +++ b/sonarqube/resource_sonarqube_alm_gitlab.go @@ -127,7 +127,7 @@ func resourceSonarqubeAlmGitlabUpdate(d *schema.ResourceData, m interface{}) err m.(*ProviderConfiguration).httpClient, "POST", sonarQubeURL.String(), - http.StatusOK, + http.StatusNoContent, "resourceSonarqubeAlmGitlabUpdate", ) if err != nil { From d7dd453962dd02af811f9d373349251b9279221e Mon Sep 17 00:00:00 2001 From: david-ortiz Date: Tue, 31 Oct 2023 12:44:34 +0100 Subject: [PATCH 3/6] fix: retrocompatibility break when v0.62.3 was released --- ...arqube_qualityprofile_project_association.go | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/sonarqube/resource_sonarqube_qualityprofile_project_association.go b/sonarqube/resource_sonarqube_qualityprofile_project_association.go index 703688e8..9425687b 100644 --- a/sonarqube/resource_sonarqube_qualityprofile_project_association.go +++ b/sonarqube/resource_sonarqube_qualityprofile_project_association.go @@ -97,7 +97,6 @@ func resourceSonarqubeQualityProfileProjectAssociationRead(d *schema.ResourceDat // Id is composed of qualityProfile name and project name idSlice := strings.Split(d.Id(), "/") - // Call api/qualityprofiles/search to return the qualityProfileID sonarQubeURL := m.(*ProviderConfiguration).sonarQubeURL sonarQubeURLSubPath := sonarQubeURL.Path @@ -124,10 +123,18 @@ func resourceSonarqubeQualityProfileProjectAssociationRead(d *schema.ResourceDat var qualityProfileID string for _, value := range getQualityProfileResponse.Profiles { - if idSlice[0] == value.Name && idSlice[2] == value.Language { - qualityProfileID = value.Key - language = value.Language - qualityProfile = value.Name + if len(idSlice) == 3 { + if idSlice[0] == value.Name && idSlice[2] == value.Language { + qualityProfileID = value.Key + language = value.Language + qualityProfile = value.Name + } + } else { + if idSlice[0] == value.Name && d.Get("language").(string) == value.Language { + qualityProfileID = value.Key + language = value.Language + qualityProfile = value.Name + } } } From 12ec42abe52810bd0d9be6c7e661ff8f925855f6 Mon Sep 17 00:00:00 2001 From: david-ortiz Date: Tue, 31 Oct 2023 15:47:26 +0100 Subject: [PATCH 4/6] test: get language from sonarqube_project --- ...qualityprofile_project_association_test.go | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/sonarqube/resource_sonarqube_qualityprofile_project_association_test.go b/sonarqube/resource_sonarqube_qualityprofile_project_association_test.go index 8a69c552..f24d32c3 100644 --- a/sonarqube/resource_sonarqube_qualityprofile_project_association_test.go +++ b/sonarqube/resource_sonarqube_qualityprofile_project_association_test.go @@ -112,3 +112,48 @@ func TestAccSonarqubeQualityProfileProjectAssociationSonarWay(t *testing.T) { }, }) } + +func testAccSonarqubeQualityProfileProjectAssociationSonarWayGetLanguage(rnd string, name string, language string) string { + return fmt.Sprintf(` + resource "sonarqube_project" "%[1]s" { + name = "%[2]s" + project = "%[2]s" + visibility = "public" + } + + resource "sonarqube_qualityprofile_project_association" "%[1]s" { + quality_profile = "Sonar way" + project = sonarqube_project.%[1]s.name + language = sonarqube_project.%[1]s.language + }`, rnd, name, language) +} + +func TestAccSonarqubeQualityProfileProjectAssociationSonarWayGetLanguage(t *testing.T) { + rnd := generateRandomResourceName() + name := "sonarqube_qualityprofile_project_association." + rnd + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccSonarqubeQualityProfileProjectAssociationSonarWayGetLanguage(rnd, "testAccSonarqubeProfileProjectAssociation", "js"), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(name, "quality_profile", "Sonar way"), + resource.TestCheckResourceAttr(name, "project", "testAccSonarqubeProfileProjectAssociation"), + resource.TestCheckResourceAttr(name, "language", "js"), + ), + }, + { + ResourceName: name, + ImportState: true, + ImportStateVerify: true, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(name, "quality_profile", "Sonar way"), + resource.TestCheckResourceAttr(name, "project", "testAccSonarqubeProfileProjectAssociation"), + resource.TestCheckResourceAttr(name, "language", "js"), + ), + }, + }, + }) +} From d1263af98a812f3ebd62a939524dcafd24bece80 Mon Sep 17 00:00:00 2001 From: david-ortiz Date: Fri, 3 Nov 2023 11:11:39 +0100 Subject: [PATCH 5/6] test: remove tests --- ...qualityprofile_project_association_test.go | 45 ------------------- 1 file changed, 45 deletions(-) diff --git a/sonarqube/resource_sonarqube_qualityprofile_project_association_test.go b/sonarqube/resource_sonarqube_qualityprofile_project_association_test.go index f24d32c3..8a69c552 100644 --- a/sonarqube/resource_sonarqube_qualityprofile_project_association_test.go +++ b/sonarqube/resource_sonarqube_qualityprofile_project_association_test.go @@ -112,48 +112,3 @@ func TestAccSonarqubeQualityProfileProjectAssociationSonarWay(t *testing.T) { }, }) } - -func testAccSonarqubeQualityProfileProjectAssociationSonarWayGetLanguage(rnd string, name string, language string) string { - return fmt.Sprintf(` - resource "sonarqube_project" "%[1]s" { - name = "%[2]s" - project = "%[2]s" - visibility = "public" - } - - resource "sonarqube_qualityprofile_project_association" "%[1]s" { - quality_profile = "Sonar way" - project = sonarqube_project.%[1]s.name - language = sonarqube_project.%[1]s.language - }`, rnd, name, language) -} - -func TestAccSonarqubeQualityProfileProjectAssociationSonarWayGetLanguage(t *testing.T) { - rnd := generateRandomResourceName() - name := "sonarqube_qualityprofile_project_association." + rnd - - resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - Steps: []resource.TestStep{ - { - Config: testAccSonarqubeQualityProfileProjectAssociationSonarWayGetLanguage(rnd, "testAccSonarqubeProfileProjectAssociation", "js"), - Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr(name, "quality_profile", "Sonar way"), - resource.TestCheckResourceAttr(name, "project", "testAccSonarqubeProfileProjectAssociation"), - resource.TestCheckResourceAttr(name, "language", "js"), - ), - }, - { - ResourceName: name, - ImportState: true, - ImportStateVerify: true, - Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr(name, "quality_profile", "Sonar way"), - resource.TestCheckResourceAttr(name, "project", "testAccSonarqubeProfileProjectAssociation"), - resource.TestCheckResourceAttr(name, "language", "js"), - ), - }, - }, - }) -} From 616a50a1dc94659c95fd0856bcdad3281e245b6f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 9 Nov 2023 01:11:33 +0000 Subject: [PATCH 6/6] Bump github.com/hashicorp/go-retryablehttp from 0.7.4 to 0.7.5 Bumps [github.com/hashicorp/go-retryablehttp](https://github.com/hashicorp/go-retryablehttp) from 0.7.4 to 0.7.5. - [Changelog](https://github.com/hashicorp/go-retryablehttp/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/go-retryablehttp/compare/v0.7.4...v0.7.5) --- updated-dependencies: - dependency-name: github.com/hashicorp/go-retryablehttp dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 4 ++-- go.sum | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 9343bae5..b94bc936 100644 --- a/go.mod +++ b/go.mod @@ -4,11 +4,12 @@ go 1.18 require ( github.com/hashicorp/go-cleanhttp v0.5.2 - github.com/hashicorp/go-retryablehttp v0.7.4 + github.com/hashicorp/go-retryablehttp v0.7.5 github.com/hashicorp/go-version v1.6.0 github.com/hashicorp/terraform-plugin-sdk/v2 v2.28.0 github.com/hashicorp/terraform-plugin-testing v1.5.1 github.com/satori/uuid v1.2.0 + golang.org/x/exp v0.0.0-20230809150735-7b3493d9a819 ) require ( @@ -18,7 +19,6 @@ require ( github.com/tidwall/pretty v1.2.0 // indirect github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect - golang.org/x/exp v0.0.0-20230809150735-7b3493d9a819 // indirect ) require ( diff --git a/go.sum b/go.sum index 5b697097..0b3db1b7 100644 --- a/go.sum +++ b/go.sum @@ -47,8 +47,8 @@ github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+l github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/go-plugin v1.4.10 h1:xUbmA4jC6Dq163/fWcp8P3JuHilrHHMLNRxzGQJ9hNk= github.com/hashicorp/go-plugin v1.4.10/go.mod h1:6/1TEzT0eQznvI/gV2CM29DLSkAK/e58mUWKVsPaph0= -github.com/hashicorp/go-retryablehttp v0.7.4 h1:ZQgVdpTdAL7WpMIwLzCfbalOcSUdkDZnpUv3/+BxzFA= -github.com/hashicorp/go-retryablehttp v0.7.4/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= +github.com/hashicorp/go-retryablehttp v0.7.5 h1:bJj+Pj19UZMIweq/iie+1u5YCdGrnxCT9yvm0e+Nd5M= +github.com/hashicorp/go-retryablehttp v0.7.5/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=