Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for settings -> scope -> match_type = DefaultBranch #305

Closed
esciara opened this issue Feb 17, 2021 · 2 comments
Closed

Add support for settings -> scope -> match_type = DefaultBranch #305

esciara opened this issue Feb 17, 2021 · 2 comments

Comments

@esciara
Copy link

esciara commented Feb 17, 2021

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

From the REST API supports the DefaultBranch value for matchKind:

  {
    "createdBy": {
      ...
    },
    ...
    "settings": {
      "allowDownvotes": false,
      "blockLastPusherVote": false,
      "creatorVoteCounts": true,
      "minimumApproverCount": 2,
      "requireVoteOnLastIteration": true,
      "resetOnSourcePush": false,
      "resetRejectionsOnSourcePush": false,
      "scope": [
        {
          "matchKind": "DefaultBranch",
          "refName": null,
          "repositoryId": null
        }
      ]
    },
    "type": {
      ...
    },
    ...
  }

It should be possible to set it:

resource "azuredevops_branch_policy_min_reviewers" "p" {
  ...
  settings {
    ...
    scope {
      match_type     = "DefaultBranch"
    }
  }
}

But currently, the only values supported are Exact and Prefix.

New or Affected Resource(s)

  • azuredevops_branch_policy_min_reviewers

Potential Terraform Configuration

resource "azuredevops_branch_policy_min_reviewers" "one" {
  project_id = local.project_id

  enabled  = true
  blocking = true

  settings {
    reviewer_count     = 2

    scope {
      match_type     = "DefaultBranch"
    }
  }
}

References

The values of matchKind are not documented in the API documentation as the settings are defined as a json object.

esciara added a commit to esciara/terraform-provider-azuredevops that referenced this issue Feb 17, 2021
esciara added a commit to esciara/terraform-provider-azuredevops that referenced this issue Feb 17, 2021
@ariciputi
Copy link

Hi,
I had the same issue today and I landed here. AFAICU there is a PR open for this, but it got stuck somehow. How can I help to make this done?

@wetwicky
Copy link
Contributor

Hi,
I also had the same issue but with the resource 'azuredevops_branch_policy_status_check'.
we would requires the same fix for match_type

resource "azuredevops_branch_policy_status_check" "p" {
  ...
  settings {
    ...
    scope {
      match_type     = "DefaultBranch"
    }
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants