Skip to content
This repository was archived by the owner on Mar 27, 2024. It is now read-only.

sonarcloud_quality_gate_selection is broken when the selection contains more than 99 project_keys #137

@kiuby

Description

@kiuby

Description

Right now, we can't create a quality gate selection which contains more than 99 projects due to the pagination.

Affected Resource(s)

  • sonarcloud_quality_gate_selection

Terraform Configuration Files

resource "sonarcloud_quality_gate_selection" "my_quality_gate_selection" {
  gate_id = sonarcloud_quality_gate.my_quality_gate.gate_id
  # it should contains more than 99 projects
  project_keys = [ "xx", "yy", ...]
}

Expected Behavior

We should be able to create a quality gate selection with more than 99 projects.

Actual Behavior

The creation is working, but the apply is failing just after (when it tried to retrieve the list from sonarcloud api after the creation)

Steps to Reproduce

Create a sonarcloud_quality_gate_selection with more than 99 project_keys, and apply it.

References

Error during the apply:

 Error: Could not find Quality Gate Selection
│
│   with sonarcloud_quality_gate_selection.my_quality_gate_selection
│   on main.tf line 331, in resource "sonarcloud_quality_gate_selection" "my_quality_gate_selection":
│  331: resource "sonarcloud_quality_gate_selection" "my_quality_gate_selection" {
│
|  The findSelection function was unable to find the project keys:  [...]
| in the response: &{Paging:{PageIndex:1 PageSize:100 Total:144}
  • #0000

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions