jdamata / terraform-provider-sonarqube

Terraform provider for managing Sonarqube configuration
GNU General Public License v3.0
62 stars 54 forks source link

fix(group): fix broken code with deprecated group API from 10.0 #153

Closed hanks closed 1 year ago

hanks commented 1 year ago

Why

Related to https://github.com/jdamata/terraform-provider-sonarqube/issues/152, andthere is a breaking change from Sonarqube 10, that in the group API since 10.0, no ID in the request or response body

Screenshot 2023-04-15 at 17 31 19

below is the test response to sonarqube 10:

  curl -x "" https://xxx:@sq.test.com/api/user_groups/search\?q\=Project-Users-6 | jq .          

{
  "paging": {
    "pageIndex": 1,
    "pageSize": 100,
    "total": 1
  },
  "groups": [
    {
      "name": "Project-Users-6",
      "description": "This is a group 6",
      "membersCount": 0,
      "default": false,
      "managed": false
    }
  ]
}

so created this fix to make sonarqube_group resource to be compatible to support both ID and Name operations.

Changes

Test

hanks commented 1 year ago

@jdamata hi, would you be able to check this PR? it will be a little tricky for the Sonarqube 10.0 release with these API changes, thanks.

hanks commented 1 year ago

@jdamata thanks for the review, is there any ETA to bump the version?

hanks commented 1 year ago

@jdamata thanks! that will be saving my life 😄