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 groups and permissions for azure_devops_v1 #291

Merged
merged 1 commit into from
Jan 18, 2022
Merged

Add groups and permissions for azure_devops_v1 #291

merged 1 commit into from
Jan 18, 2022

Conversation

brk3
Copy link
Contributor

@brk3 brk3 commented Dec 14, 2021

This commit extends azure_devops_v1 to allow the user to create groups,
and assign these groups permissions to AZDO projects and pipelines
("build definitions").

The following example will:

  1. Create a group in AZDO called "Contoso Group"
  2. Added UPNs paul and john to this group
  3. Assign this group full permissions on the project and builds.
groups = {
  contoso = {
    project_key  = "contoso_project"
    display_name = "Contoso Group"
    description  = "Group for Contoso Team Members"
    members = {
      user_principal_names = [
        "paul.bourke@contoso.com",
        "john.doe@contoso.com",
      ]
    }
  }
}

permissions = {
  projects = {
    contoso_project = {
      group_key = "contoso_project"
      permissions = {
        "GENERIC_READ"     = "Allow",
        "GENERIC_WRITE"    = "Allow",
        "START_BUILD"      = "Allow",
        "ADMINISTER_BUILD" = "Allow",
      }
    }
  }

  build_definitions = {
    end_to_end = {
      project_key = "contoso_project"
      group_key   = "contoso"
      permissions = {
        "ViewBuilds"          = "Allow",
        "QueueBuilds"         = "Allow",
        "ManageBuildQueue"    = "Allow",
        "StopBuilds"          = "Allow",
        "ViewBuildDefinition" = "Allow",
      }
    }

    rover_build = {
      project_key = "contoso_project"
      group_key   = "contoso"
      permissions = {
        "ViewBuilds"          = "Allow",
        "QueueBuilds"         = "Allow",
        "ManageBuildQueue"    = "Allow",
        "StopBuilds"          = "Allow",
        "ViewBuildDefinition" = "Allow",
      }
    }
  }
}

Issue-id

PR Checklist


  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • My code follows the code style of this project.
  • I ran lint checks locally prior to submission.
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

Description

Does this introduce a breaking change

  • YES
  • NO

Testing

This commit extends azure_devops_v1 to allow the user to create groups,
and assign these groups permissions to AZDO projects and pipelines
("build definitions").

The following example will:

1. Create a group in AZDO called "Contoso Group"
2. Added UPNs paul and john to this group
3. Assign this group full permissions on the project and build.

```
groups = {
  contoso = {
    project_key  = "contoso_project"
    display_name = "Contoso Group"
    description  = "Group for Contoso Team Members"
    members = {
      user_principal_names = [
        "paul.bourke@contoso.com",
        "john.doe@contoso.com",
      ]
    }
  }
}

permissions = {
  projects = {
    contoso_project = {
      group_key = "contoso_project"
      permissions = {
        "GENERIC_READ"     = "Allow",
        "GENERIC_WRITE"    = "Allow",
        "START_BUILD"      = "Allow",
        "ADMINISTER_BUILD" = "Allow",
      }
    }
  }

  build_definitions = {
    end_to_end = {
      project_key = "contoso_project"
      group_key   = "contoso"
      permissions = {
        "ViewBuilds"          = "Allow",
        "QueueBuilds"         = "Allow",
        "ManageBuildQueue"    = "Allow",
        "StopBuilds"          = "Allow",
        "ViewBuildDefinition" = "Allow",
      }
    }

    rover_build = {
      project_key = "contoso_project"
      group_key   = "contoso"
      permissions = {
        "ViewBuilds"          = "Allow",
        "QueueBuilds"         = "Allow",
        "ManageBuildQueue"    = "Allow",
        "StopBuilds"          = "Allow",
        "ViewBuildDefinition" = "Allow",
      }
    }
  }
}
```
@arnaudlh arnaudlh added this to the 2201 milestone Jan 13, 2022
Copy link
Contributor

@LaurentLesle LaurentLesle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @brk3 for those additions. LGTM

@LaurentLesle LaurentLesle merged commit be407ea into Azure:master Jan 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants