hashicorp / terraform-provider-bitbucket

This Terraform provider is archived per our provider archiving process: https://terraform.io/docs/internals/archiving.html
https://registry.terraform.io
Mozilla Public License 2.0
32 stars 107 forks source link

Fix for bug where pagination was not happening #28

Closed alucillo closed 5 years ago

alucillo commented 5 years ago

The BitBucket API returns a paginated list of results for the default reviewers. Each page is limited to 10 results. This PR fixes a bug where the bitbucket_default_reviewers resource was not paginating results and as a result limited us to 10 default reviewers.

BEFORE: Incorrectly showing 10 default reviewers instead of 13

Terraform will perform the following actions:

-/+ bitbucket_default_reviewers.xyz (new resource required)
      id:                   "abc/xyz/reviewers" => <computed> (forces new resource)
      owner:                "abc" => "abc"
      repository:           "xyz" => "xyz"
      reviewers.#:          "10" => "12" (forces new resource)
      reviewers.2026587276: "" => "nester" (forces new resource)
      reviewers.2148309749: "joe" => "joe"
      reviewers.2149516979: "billy" => "billy"
      reviewers.236488699:  "bob" => "bob"
      reviewers.2449433192: "foo" => "foo"
      reviewers.2468887411: "soap" => "soap"
      reviewers.3486131507: "" => "bar" (forces new resource)
      reviewers.3510966834: "glow" => "glow"
      reviewers.380778529:  "sublime" => "sublime"
      reviewers.718298102:  "bit" => "bit"
      reviewers.801735074:  "bucket" => "bucket"
      reviewers.98717443:   "friend" => "friend"

Plan: 1 to add, 0 to change, 1 to destroy.

AFTER: Correctly showing 13 default reviewers that I want reduced to 12

Terraform will perform the following actions:

-/+ bitbucket_default_reviewers.xyz (new resource required)
      id:                   "abc/xyz/reviewers" => <computed> (forces new resource)
      owner:                "abc" => "abc"
      repository:           "xyz" => "xyz"
      reviewers.#:          "13" => "12" (forces new resource)
      reviewers.2026587276: "coffee" => "coffee"
      reviewers.2148309749: "nester" => "nester"
      reviewers.2149516979: "joe" => "joe"
      reviewers.236488699:  "billy" => "billy"
      reviewers.2449433192: "bob" => "bob"
      reviewers.2468887411: "foo" => "foo"
      reviewers.3335378986: "shampoo" => "" (forces new resource)
      reviewers.3486131507: "soap" => "soap"
      reviewers.3510966834: "bar" => "bar"
      reviewers.380778529:  "glow" => "glow"
      reviewers.718298102:  "bit" => "bit"
      reviewers.801735074:  "bucket" => "bucket"
      reviewers.98717443:   "friend" => "friend"

Plan: 1 to add, 0 to change, 1 to destroy.
alucillo commented 5 years ago

@appilon any chance I can get some love on this PR? 😄