1. Packages
  2. AzureDevOps
  3. API Docs
  4. BranchPolicyMinReviewers
Azure DevOps v3.1.1 published on Monday, May 20, 2024 by Pulumi

azuredevops.BranchPolicyMinReviewers

Explore with Pulumi AI

azuredevops logo
Azure DevOps v3.1.1 published on Monday, May 20, 2024 by Pulumi

    Branch policy for reviewers on pull requests. Includes the minimum number of reviewers and other conditions.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azuredevops from "@pulumi/azuredevops";
    
    const example = new azuredevops.Project("example", {name: "Example Project"});
    const exampleGit = new azuredevops.Git("example", {
        projectId: example.id,
        name: "Example Repository",
        initialization: {
            initType: "Clean",
        },
    });
    const exampleBranchPolicyMinReviewers = new azuredevops.BranchPolicyMinReviewers("example", {
        projectId: example.id,
        enabled: true,
        blocking: true,
        settings: {
            reviewerCount: 7,
            submitterCanVote: false,
            lastPusherCannotApprove: true,
            allowCompletionWithRejectsOrWaits: false,
            onPushResetApprovedVotes: true,
            onLastIterationRequireVote: false,
            scopes: [
                {
                    repositoryId: exampleGit.id,
                    repositoryRef: exampleGit.defaultBranch,
                    matchType: "Exact",
                },
                {
                    repositoryId: undefined,
                    repositoryRef: "refs/heads/releases",
                    matchType: "Prefix",
                },
                {
                    matchType: "DefaultBranch",
                },
            ],
        },
    });
    
    import pulumi
    import pulumi_azuredevops as azuredevops
    
    example = azuredevops.Project("example", name="Example Project")
    example_git = azuredevops.Git("example",
        project_id=example.id,
        name="Example Repository",
        initialization=azuredevops.GitInitializationArgs(
            init_type="Clean",
        ))
    example_branch_policy_min_reviewers = azuredevops.BranchPolicyMinReviewers("example",
        project_id=example.id,
        enabled=True,
        blocking=True,
        settings=azuredevops.BranchPolicyMinReviewersSettingsArgs(
            reviewer_count=7,
            submitter_can_vote=False,
            last_pusher_cannot_approve=True,
            allow_completion_with_rejects_or_waits=False,
            on_push_reset_approved_votes=True,
            on_last_iteration_require_vote=False,
            scopes=[
                azuredevops.BranchPolicyMinReviewersSettingsScopeArgs(
                    repository_id=example_git.id,
                    repository_ref=example_git.default_branch,
                    match_type="Exact",
                ),
                azuredevops.BranchPolicyMinReviewersSettingsScopeArgs(
                    repository_id=None,
                    repository_ref="refs/heads/releases",
                    match_type="Prefix",
                ),
                azuredevops.BranchPolicyMinReviewersSettingsScopeArgs(
                    match_type="DefaultBranch",
                ),
            ],
        ))
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azuredevops/sdk/v3/go/azuredevops"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := azuredevops.NewProject(ctx, "example", &azuredevops.ProjectArgs{
    			Name: pulumi.String("Example Project"),
    		})
    		if err != nil {
    			return err
    		}
    		exampleGit, err := azuredevops.NewGit(ctx, "example", &azuredevops.GitArgs{
    			ProjectId: example.ID(),
    			Name:      pulumi.String("Example Repository"),
    			Initialization: &azuredevops.GitInitializationArgs{
    				InitType: pulumi.String("Clean"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = azuredevops.NewBranchPolicyMinReviewers(ctx, "example", &azuredevops.BranchPolicyMinReviewersArgs{
    			ProjectId: example.ID(),
    			Enabled:   pulumi.Bool(true),
    			Blocking:  pulumi.Bool(true),
    			Settings: &azuredevops.BranchPolicyMinReviewersSettingsArgs{
    				ReviewerCount:                     pulumi.Int(7),
    				SubmitterCanVote:                  pulumi.Bool(false),
    				LastPusherCannotApprove:           pulumi.Bool(true),
    				AllowCompletionWithRejectsOrWaits: pulumi.Bool(false),
    				OnPushResetApprovedVotes:          pulumi.Bool(true),
    				OnLastIterationRequireVote:        pulumi.Bool(false),
    				Scopes: azuredevops.BranchPolicyMinReviewersSettingsScopeArray{
    					&azuredevops.BranchPolicyMinReviewersSettingsScopeArgs{
    						RepositoryId:  exampleGit.ID(),
    						RepositoryRef: exampleGit.DefaultBranch,
    						MatchType:     pulumi.String("Exact"),
    					},
    					&azuredevops.BranchPolicyMinReviewersSettingsScopeArgs{
    						RepositoryId:  nil,
    						RepositoryRef: pulumi.String("refs/heads/releases"),
    						MatchType:     pulumi.String("Prefix"),
    					},
    					&azuredevops.BranchPolicyMinReviewersSettingsScopeArgs{
    						MatchType: pulumi.String("DefaultBranch"),
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureDevOps = Pulumi.AzureDevOps;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new AzureDevOps.Project("example", new()
        {
            Name = "Example Project",
        });
    
        var exampleGit = new AzureDevOps.Git("example", new()
        {
            ProjectId = example.Id,
            Name = "Example Repository",
            Initialization = new AzureDevOps.Inputs.GitInitializationArgs
            {
                InitType = "Clean",
            },
        });
    
        var exampleBranchPolicyMinReviewers = new AzureDevOps.BranchPolicyMinReviewers("example", new()
        {
            ProjectId = example.Id,
            Enabled = true,
            Blocking = true,
            Settings = new AzureDevOps.Inputs.BranchPolicyMinReviewersSettingsArgs
            {
                ReviewerCount = 7,
                SubmitterCanVote = false,
                LastPusherCannotApprove = true,
                AllowCompletionWithRejectsOrWaits = false,
                OnPushResetApprovedVotes = true,
                OnLastIterationRequireVote = false,
                Scopes = new[]
                {
                    new AzureDevOps.Inputs.BranchPolicyMinReviewersSettingsScopeArgs
                    {
                        RepositoryId = exampleGit.Id,
                        RepositoryRef = exampleGit.DefaultBranch,
                        MatchType = "Exact",
                    },
                    new AzureDevOps.Inputs.BranchPolicyMinReviewersSettingsScopeArgs
                    {
                        RepositoryId = null,
                        RepositoryRef = "refs/heads/releases",
                        MatchType = "Prefix",
                    },
                    new AzureDevOps.Inputs.BranchPolicyMinReviewersSettingsScopeArgs
                    {
                        MatchType = "DefaultBranch",
                    },
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azuredevops.Project;
    import com.pulumi.azuredevops.ProjectArgs;
    import com.pulumi.azuredevops.Git;
    import com.pulumi.azuredevops.GitArgs;
    import com.pulumi.azuredevops.inputs.GitInitializationArgs;
    import com.pulumi.azuredevops.BranchPolicyMinReviewers;
    import com.pulumi.azuredevops.BranchPolicyMinReviewersArgs;
    import com.pulumi.azuredevops.inputs.BranchPolicyMinReviewersSettingsArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var example = new Project("example", ProjectArgs.builder()        
                .name("Example Project")
                .build());
    
            var exampleGit = new Git("exampleGit", GitArgs.builder()        
                .projectId(example.id())
                .name("Example Repository")
                .initialization(GitInitializationArgs.builder()
                    .initType("Clean")
                    .build())
                .build());
    
            var exampleBranchPolicyMinReviewers = new BranchPolicyMinReviewers("exampleBranchPolicyMinReviewers", BranchPolicyMinReviewersArgs.builder()        
                .projectId(example.id())
                .enabled(true)
                .blocking(true)
                .settings(BranchPolicyMinReviewersSettingsArgs.builder()
                    .reviewerCount(7)
                    .submitterCanVote(false)
                    .lastPusherCannotApprove(true)
                    .allowCompletionWithRejectsOrWaits(false)
                    .onPushResetApprovedVotes(true)
                    .onLastIterationRequireVote(false)
                    .scopes(                
                        BranchPolicyMinReviewersSettingsScopeArgs.builder()
                            .repositoryId(exampleGit.id())
                            .repositoryRef(exampleGit.defaultBranch())
                            .matchType("Exact")
                            .build(),
                        BranchPolicyMinReviewersSettingsScopeArgs.builder()
                            .repositoryId(null)
                            .repositoryRef("refs/heads/releases")
                            .matchType("Prefix")
                            .build(),
                        BranchPolicyMinReviewersSettingsScopeArgs.builder()
                            .matchType("DefaultBranch")
                            .build())
                    .build())
                .build());
    
        }
    }
    
    resources:
      example:
        type: azuredevops:Project
        properties:
          name: Example Project
      exampleGit:
        type: azuredevops:Git
        name: example
        properties:
          projectId: ${example.id}
          name: Example Repository
          initialization:
            initType: Clean
      exampleBranchPolicyMinReviewers:
        type: azuredevops:BranchPolicyMinReviewers
        name: example
        properties:
          projectId: ${example.id}
          enabled: true
          blocking: true
          settings:
            reviewerCount: 7
            submitterCanVote: false
            lastPusherCannotApprove: true
            allowCompletionWithRejectsOrWaits: false
            onPushResetApprovedVotes: true
            onLastIterationRequireVote: false
            scopes:
              - repositoryId: ${exampleGit.id}
                repositoryRef: ${exampleGit.defaultBranch}
                matchType: Exact
              - repositoryId: null
                repositoryRef: refs/heads/releases
                matchType: Prefix
              - matchType: DefaultBranch
    

    Create BranchPolicyMinReviewers Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new BranchPolicyMinReviewers(name: string, args: BranchPolicyMinReviewersArgs, opts?: CustomResourceOptions);
    @overload
    def BranchPolicyMinReviewers(resource_name: str,
                                 args: BranchPolicyMinReviewersArgs,
                                 opts: Optional[ResourceOptions] = None)
    
    @overload
    def BranchPolicyMinReviewers(resource_name: str,
                                 opts: Optional[ResourceOptions] = None,
                                 project_id: Optional[str] = None,
                                 settings: Optional[BranchPolicyMinReviewersSettingsArgs] = None,
                                 blocking: Optional[bool] = None,
                                 enabled: Optional[bool] = None)
    func NewBranchPolicyMinReviewers(ctx *Context, name string, args BranchPolicyMinReviewersArgs, opts ...ResourceOption) (*BranchPolicyMinReviewers, error)
    public BranchPolicyMinReviewers(string name, BranchPolicyMinReviewersArgs args, CustomResourceOptions? opts = null)
    public BranchPolicyMinReviewers(String name, BranchPolicyMinReviewersArgs args)
    public BranchPolicyMinReviewers(String name, BranchPolicyMinReviewersArgs args, CustomResourceOptions options)
    
    type: azuredevops:BranchPolicyMinReviewers
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args BranchPolicyMinReviewersArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args BranchPolicyMinReviewersArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args BranchPolicyMinReviewersArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args BranchPolicyMinReviewersArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args BranchPolicyMinReviewersArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var branchPolicyMinReviewersResource = new AzureDevOps.BranchPolicyMinReviewers("branchPolicyMinReviewersResource", new()
    {
        ProjectId = "string",
        Settings = new AzureDevOps.Inputs.BranchPolicyMinReviewersSettingsArgs
        {
            Scopes = new[]
            {
                new AzureDevOps.Inputs.BranchPolicyMinReviewersSettingsScopeArgs
                {
                    MatchType = "string",
                    RepositoryId = "string",
                    RepositoryRef = "string",
                },
            },
            AllowCompletionWithRejectsOrWaits = false,
            LastPusherCannotApprove = false,
            OnLastIterationRequireVote = false,
            OnPushResetAllVotes = false,
            OnPushResetApprovedVotes = false,
            ReviewerCount = 0,
            SubmitterCanVote = false,
        },
        Blocking = false,
        Enabled = false,
    });
    
    example, err := azuredevops.NewBranchPolicyMinReviewers(ctx, "branchPolicyMinReviewersResource", &azuredevops.BranchPolicyMinReviewersArgs{
    	ProjectId: pulumi.String("string"),
    	Settings: &azuredevops.BranchPolicyMinReviewersSettingsArgs{
    		Scopes: azuredevops.BranchPolicyMinReviewersSettingsScopeArray{
    			&azuredevops.BranchPolicyMinReviewersSettingsScopeArgs{
    				MatchType:     pulumi.String("string"),
    				RepositoryId:  pulumi.String("string"),
    				RepositoryRef: pulumi.String("string"),
    			},
    		},
    		AllowCompletionWithRejectsOrWaits: pulumi.Bool(false),
    		LastPusherCannotApprove:           pulumi.Bool(false),
    		OnLastIterationRequireVote:        pulumi.Bool(false),
    		OnPushResetAllVotes:               pulumi.Bool(false),
    		OnPushResetApprovedVotes:          pulumi.Bool(false),
    		ReviewerCount:                     pulumi.Int(0),
    		SubmitterCanVote:                  pulumi.Bool(false),
    	},
    	Blocking: pulumi.Bool(false),
    	Enabled:  pulumi.Bool(false),
    })
    
    var branchPolicyMinReviewersResource = new BranchPolicyMinReviewers("branchPolicyMinReviewersResource", BranchPolicyMinReviewersArgs.builder()
        .projectId("string")
        .settings(BranchPolicyMinReviewersSettingsArgs.builder()
            .scopes(BranchPolicyMinReviewersSettingsScopeArgs.builder()
                .matchType("string")
                .repositoryId("string")
                .repositoryRef("string")
                .build())
            .allowCompletionWithRejectsOrWaits(false)
            .lastPusherCannotApprove(false)
            .onLastIterationRequireVote(false)
            .onPushResetAllVotes(false)
            .onPushResetApprovedVotes(false)
            .reviewerCount(0)
            .submitterCanVote(false)
            .build())
        .blocking(false)
        .enabled(false)
        .build());
    
    branch_policy_min_reviewers_resource = azuredevops.BranchPolicyMinReviewers("branchPolicyMinReviewersResource",
        project_id="string",
        settings=azuredevops.BranchPolicyMinReviewersSettingsArgs(
            scopes=[azuredevops.BranchPolicyMinReviewersSettingsScopeArgs(
                match_type="string",
                repository_id="string",
                repository_ref="string",
            )],
            allow_completion_with_rejects_or_waits=False,
            last_pusher_cannot_approve=False,
            on_last_iteration_require_vote=False,
            on_push_reset_all_votes=False,
            on_push_reset_approved_votes=False,
            reviewer_count=0,
            submitter_can_vote=False,
        ),
        blocking=False,
        enabled=False)
    
    const branchPolicyMinReviewersResource = new azuredevops.BranchPolicyMinReviewers("branchPolicyMinReviewersResource", {
        projectId: "string",
        settings: {
            scopes: [{
                matchType: "string",
                repositoryId: "string",
                repositoryRef: "string",
            }],
            allowCompletionWithRejectsOrWaits: false,
            lastPusherCannotApprove: false,
            onLastIterationRequireVote: false,
            onPushResetAllVotes: false,
            onPushResetApprovedVotes: false,
            reviewerCount: 0,
            submitterCanVote: false,
        },
        blocking: false,
        enabled: false,
    });
    
    type: azuredevops:BranchPolicyMinReviewers
    properties:
        blocking: false
        enabled: false
        projectId: string
        settings:
            allowCompletionWithRejectsOrWaits: false
            lastPusherCannotApprove: false
            onLastIterationRequireVote: false
            onPushResetAllVotes: false
            onPushResetApprovedVotes: false
            reviewerCount: 0
            scopes:
                - matchType: string
                  repositoryId: string
                  repositoryRef: string
            submitterCanVote: false
    

    BranchPolicyMinReviewers Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The BranchPolicyMinReviewers resource accepts the following input properties:

    ProjectId string
    The ID of the project in which the policy will be created.
    Settings Pulumi.AzureDevOps.Inputs.BranchPolicyMinReviewersSettings
    A settings block as defined below.. This block must be defined exactly once.
    Blocking bool
    A flag indicating if the policy should be blocking. Defaults to true.
    Enabled bool
    A flag indicating if the policy should be enabled. Defaults to true.
    ProjectId string
    The ID of the project in which the policy will be created.
    Settings BranchPolicyMinReviewersSettingsArgs
    A settings block as defined below.. This block must be defined exactly once.
    Blocking bool
    A flag indicating if the policy should be blocking. Defaults to true.
    Enabled bool
    A flag indicating if the policy should be enabled. Defaults to true.
    projectId String
    The ID of the project in which the policy will be created.
    settings BranchPolicyMinReviewersSettings
    A settings block as defined below.. This block must be defined exactly once.
    blocking Boolean
    A flag indicating if the policy should be blocking. Defaults to true.
    enabled Boolean
    A flag indicating if the policy should be enabled. Defaults to true.
    projectId string
    The ID of the project in which the policy will be created.
    settings BranchPolicyMinReviewersSettings
    A settings block as defined below.. This block must be defined exactly once.
    blocking boolean
    A flag indicating if the policy should be blocking. Defaults to true.
    enabled boolean
    A flag indicating if the policy should be enabled. Defaults to true.
    project_id str
    The ID of the project in which the policy will be created.
    settings BranchPolicyMinReviewersSettingsArgs
    A settings block as defined below.. This block must be defined exactly once.
    blocking bool
    A flag indicating if the policy should be blocking. Defaults to true.
    enabled bool
    A flag indicating if the policy should be enabled. Defaults to true.
    projectId String
    The ID of the project in which the policy will be created.
    settings Property Map
    A settings block as defined below.. This block must be defined exactly once.
    blocking Boolean
    A flag indicating if the policy should be blocking. Defaults to true.
    enabled Boolean
    A flag indicating if the policy should be enabled. Defaults to true.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the BranchPolicyMinReviewers resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing BranchPolicyMinReviewers Resource

    Get an existing BranchPolicyMinReviewers resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: BranchPolicyMinReviewersState, opts?: CustomResourceOptions): BranchPolicyMinReviewers
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            blocking: Optional[bool] = None,
            enabled: Optional[bool] = None,
            project_id: Optional[str] = None,
            settings: Optional[BranchPolicyMinReviewersSettingsArgs] = None) -> BranchPolicyMinReviewers
    func GetBranchPolicyMinReviewers(ctx *Context, name string, id IDInput, state *BranchPolicyMinReviewersState, opts ...ResourceOption) (*BranchPolicyMinReviewers, error)
    public static BranchPolicyMinReviewers Get(string name, Input<string> id, BranchPolicyMinReviewersState? state, CustomResourceOptions? opts = null)
    public static BranchPolicyMinReviewers get(String name, Output<String> id, BranchPolicyMinReviewersState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Blocking bool
    A flag indicating if the policy should be blocking. Defaults to true.
    Enabled bool
    A flag indicating if the policy should be enabled. Defaults to true.
    ProjectId string
    The ID of the project in which the policy will be created.
    Settings Pulumi.AzureDevOps.Inputs.BranchPolicyMinReviewersSettings
    A settings block as defined below.. This block must be defined exactly once.
    Blocking bool
    A flag indicating if the policy should be blocking. Defaults to true.
    Enabled bool
    A flag indicating if the policy should be enabled. Defaults to true.
    ProjectId string
    The ID of the project in which the policy will be created.
    Settings BranchPolicyMinReviewersSettingsArgs
    A settings block as defined below.. This block must be defined exactly once.
    blocking Boolean
    A flag indicating if the policy should be blocking. Defaults to true.
    enabled Boolean
    A flag indicating if the policy should be enabled. Defaults to true.
    projectId String
    The ID of the project in which the policy will be created.
    settings BranchPolicyMinReviewersSettings
    A settings block as defined below.. This block must be defined exactly once.
    blocking boolean
    A flag indicating if the policy should be blocking. Defaults to true.
    enabled boolean
    A flag indicating if the policy should be enabled. Defaults to true.
    projectId string
    The ID of the project in which the policy will be created.
    settings BranchPolicyMinReviewersSettings
    A settings block as defined below.. This block must be defined exactly once.
    blocking bool
    A flag indicating if the policy should be blocking. Defaults to true.
    enabled bool
    A flag indicating if the policy should be enabled. Defaults to true.
    project_id str
    The ID of the project in which the policy will be created.
    settings BranchPolicyMinReviewersSettingsArgs
    A settings block as defined below.. This block must be defined exactly once.
    blocking Boolean
    A flag indicating if the policy should be blocking. Defaults to true.
    enabled Boolean
    A flag indicating if the policy should be enabled. Defaults to true.
    projectId String
    The ID of the project in which the policy will be created.
    settings Property Map
    A settings block as defined below.. This block must be defined exactly once.

    Supporting Types

    BranchPolicyMinReviewersSettings, BranchPolicyMinReviewersSettingsArgs

    Scopes List<Pulumi.AzureDevOps.Inputs.BranchPolicyMinReviewersSettingsScope>
    A scope block as defined below. Controls which repositories and branches the policy will be enabled for. This block must be defined at least once.
    AllowCompletionWithRejectsOrWaits bool
    Allow completion even if some reviewers vote to wait or reject. Defaults to false.
    LastPusherCannotApprove bool
    Prohibit the most recent pusher from approving their own changes. Defaults to false.
    OnLastIterationRequireVote bool
    On last iteration require vote. Defaults to false.
    OnPushResetAllVotes bool

    When new changes are pushed reset all code reviewer votes. Defaults to false.

    Note: If on_push_reset_all_votes is true then on_push_reset_approved_votes will be set to true. To enable on_push_reset_approved_votes, you need explicitly set on_push_reset_all_votes false or not configure.

    OnPushResetApprovedVotes bool
    When new changes are pushed reset all approval votes (does not reset votes to reject or wait). Defaults to false.
    ReviewerCount int
    The number of reviewers needed to approve.
    SubmitterCanVote bool
    Allow requesters to approve their own changes. Defaults to false.
    Scopes []BranchPolicyMinReviewersSettingsScope
    A scope block as defined below. Controls which repositories and branches the policy will be enabled for. This block must be defined at least once.
    AllowCompletionWithRejectsOrWaits bool
    Allow completion even if some reviewers vote to wait or reject. Defaults to false.
    LastPusherCannotApprove bool
    Prohibit the most recent pusher from approving their own changes. Defaults to false.
    OnLastIterationRequireVote bool
    On last iteration require vote. Defaults to false.
    OnPushResetAllVotes bool

    When new changes are pushed reset all code reviewer votes. Defaults to false.

    Note: If on_push_reset_all_votes is true then on_push_reset_approved_votes will be set to true. To enable on_push_reset_approved_votes, you need explicitly set on_push_reset_all_votes false or not configure.

    OnPushResetApprovedVotes bool
    When new changes are pushed reset all approval votes (does not reset votes to reject or wait). Defaults to false.
    ReviewerCount int
    The number of reviewers needed to approve.
    SubmitterCanVote bool
    Allow requesters to approve their own changes. Defaults to false.
    scopes List<BranchPolicyMinReviewersSettingsScope>
    A scope block as defined below. Controls which repositories and branches the policy will be enabled for. This block must be defined at least once.
    allowCompletionWithRejectsOrWaits Boolean
    Allow completion even if some reviewers vote to wait or reject. Defaults to false.
    lastPusherCannotApprove Boolean
    Prohibit the most recent pusher from approving their own changes. Defaults to false.
    onLastIterationRequireVote Boolean
    On last iteration require vote. Defaults to false.
    onPushResetAllVotes Boolean

    When new changes are pushed reset all code reviewer votes. Defaults to false.

    Note: If on_push_reset_all_votes is true then on_push_reset_approved_votes will be set to true. To enable on_push_reset_approved_votes, you need explicitly set on_push_reset_all_votes false or not configure.

    onPushResetApprovedVotes Boolean
    When new changes are pushed reset all approval votes (does not reset votes to reject or wait). Defaults to false.
    reviewerCount Integer
    The number of reviewers needed to approve.
    submitterCanVote Boolean
    Allow requesters to approve their own changes. Defaults to false.
    scopes BranchPolicyMinReviewersSettingsScope[]
    A scope block as defined below. Controls which repositories and branches the policy will be enabled for. This block must be defined at least once.
    allowCompletionWithRejectsOrWaits boolean
    Allow completion even if some reviewers vote to wait or reject. Defaults to false.
    lastPusherCannotApprove boolean
    Prohibit the most recent pusher from approving their own changes. Defaults to false.
    onLastIterationRequireVote boolean
    On last iteration require vote. Defaults to false.
    onPushResetAllVotes boolean

    When new changes are pushed reset all code reviewer votes. Defaults to false.

    Note: If on_push_reset_all_votes is true then on_push_reset_approved_votes will be set to true. To enable on_push_reset_approved_votes, you need explicitly set on_push_reset_all_votes false or not configure.

    onPushResetApprovedVotes boolean
    When new changes are pushed reset all approval votes (does not reset votes to reject or wait). Defaults to false.
    reviewerCount number
    The number of reviewers needed to approve.
    submitterCanVote boolean
    Allow requesters to approve their own changes. Defaults to false.
    scopes Sequence[BranchPolicyMinReviewersSettingsScope]
    A scope block as defined below. Controls which repositories and branches the policy will be enabled for. This block must be defined at least once.
    allow_completion_with_rejects_or_waits bool
    Allow completion even if some reviewers vote to wait or reject. Defaults to false.
    last_pusher_cannot_approve bool
    Prohibit the most recent pusher from approving their own changes. Defaults to false.
    on_last_iteration_require_vote bool
    On last iteration require vote. Defaults to false.
    on_push_reset_all_votes bool

    When new changes are pushed reset all code reviewer votes. Defaults to false.

    Note: If on_push_reset_all_votes is true then on_push_reset_approved_votes will be set to true. To enable on_push_reset_approved_votes, you need explicitly set on_push_reset_all_votes false or not configure.

    on_push_reset_approved_votes bool
    When new changes are pushed reset all approval votes (does not reset votes to reject or wait). Defaults to false.
    reviewer_count int
    The number of reviewers needed to approve.
    submitter_can_vote bool
    Allow requesters to approve their own changes. Defaults to false.
    scopes List<Property Map>
    A scope block as defined below. Controls which repositories and branches the policy will be enabled for. This block must be defined at least once.
    allowCompletionWithRejectsOrWaits Boolean
    Allow completion even if some reviewers vote to wait or reject. Defaults to false.
    lastPusherCannotApprove Boolean
    Prohibit the most recent pusher from approving their own changes. Defaults to false.
    onLastIterationRequireVote Boolean
    On last iteration require vote. Defaults to false.
    onPushResetAllVotes Boolean

    When new changes are pushed reset all code reviewer votes. Defaults to false.

    Note: If on_push_reset_all_votes is true then on_push_reset_approved_votes will be set to true. To enable on_push_reset_approved_votes, you need explicitly set on_push_reset_all_votes false or not configure.

    onPushResetApprovedVotes Boolean
    When new changes are pushed reset all approval votes (does not reset votes to reject or wait). Defaults to false.
    reviewerCount Number
    The number of reviewers needed to approve.
    submitterCanVote Boolean
    Allow requesters to approve their own changes. Defaults to false.

    BranchPolicyMinReviewersSettingsScope, BranchPolicyMinReviewersSettingsScopeArgs

    MatchType string
    The match type to use when applying the policy. Supported values are Exact (default), Prefix or DefaultBranch.
    RepositoryId string
    The repository ID. Needed only if the scope of the policy will be limited to a single repository. If match_type is DefaultBranch, this should not be defined.
    RepositoryRef string
    The ref pattern to use for the match when match_type other than DefaultBranch. If match_type is Exact, this should be a qualified ref such as refs/heads/master. If match_type is Prefix, this should be a ref path such as refs/heads/releases.
    MatchType string
    The match type to use when applying the policy. Supported values are Exact (default), Prefix or DefaultBranch.
    RepositoryId string
    The repository ID. Needed only if the scope of the policy will be limited to a single repository. If match_type is DefaultBranch, this should not be defined.
    RepositoryRef string
    The ref pattern to use for the match when match_type other than DefaultBranch. If match_type is Exact, this should be a qualified ref such as refs/heads/master. If match_type is Prefix, this should be a ref path such as refs/heads/releases.
    matchType String
    The match type to use when applying the policy. Supported values are Exact (default), Prefix or DefaultBranch.
    repositoryId String
    The repository ID. Needed only if the scope of the policy will be limited to a single repository. If match_type is DefaultBranch, this should not be defined.
    repositoryRef String
    The ref pattern to use for the match when match_type other than DefaultBranch. If match_type is Exact, this should be a qualified ref such as refs/heads/master. If match_type is Prefix, this should be a ref path such as refs/heads/releases.
    matchType string
    The match type to use when applying the policy. Supported values are Exact (default), Prefix or DefaultBranch.
    repositoryId string
    The repository ID. Needed only if the scope of the policy will be limited to a single repository. If match_type is DefaultBranch, this should not be defined.
    repositoryRef string
    The ref pattern to use for the match when match_type other than DefaultBranch. If match_type is Exact, this should be a qualified ref such as refs/heads/master. If match_type is Prefix, this should be a ref path such as refs/heads/releases.
    match_type str
    The match type to use when applying the policy. Supported values are Exact (default), Prefix or DefaultBranch.
    repository_id str
    The repository ID. Needed only if the scope of the policy will be limited to a single repository. If match_type is DefaultBranch, this should not be defined.
    repository_ref str
    The ref pattern to use for the match when match_type other than DefaultBranch. If match_type is Exact, this should be a qualified ref such as refs/heads/master. If match_type is Prefix, this should be a ref path such as refs/heads/releases.
    matchType String
    The match type to use when applying the policy. Supported values are Exact (default), Prefix or DefaultBranch.
    repositoryId String
    The repository ID. Needed only if the scope of the policy will be limited to a single repository. If match_type is DefaultBranch, this should not be defined.
    repositoryRef String
    The ref pattern to use for the match when match_type other than DefaultBranch. If match_type is Exact, this should be a qualified ref such as refs/heads/master. If match_type is Prefix, this should be a ref path such as refs/heads/releases.

    Import

    Azure DevOps Branch Policies can be imported using the project ID and policy configuration ID:

    $ pulumi import azuredevops:index/branchPolicyMinReviewers:BranchPolicyMinReviewers example 00000000-0000-0000-0000-000000000000/0
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Azure DevOps pulumi/pulumi-azuredevops
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the azuredevops Terraform Provider.
    azuredevops logo
    Azure DevOps v3.1.1 published on Monday, May 20, 2024 by Pulumi