Azure / Azure/azure-devops-cli-extension

[Feature Request] Add support for managing Status Check policies

Open
#1,040 1 comment 1 reaction 0 assignees View on GitHub
Feature
Dominant language
Python
Stars
682
Forks
278
Avg merge
3d 23h
Merged PRs (30d)
3

Description

**Is your feature request related to a problem? Please describe.**
There don't appear to be commands for creating and managing Status Check policies, even though policies created in the UI are reported when using `az repos policy list`.

**Describe the solution you'd like**
Add a new status-check subgroup under policies with create and update commands to match the other policy types.
`az repos policy status-check create`
`az repos policy status-check update`

**Additional context**
In case it helps anyone else, the Bash snippet below (using the wonderfully helpful invoke command) can be used in the meantime as a workaround to create status check policies.
```
echo '{
"isBlocking": true,
"isEnabled": true,
"settings": {
"authorId": null,
"defaultDisplayName": null,
"invalidateOnSourceUpdate": false,
"policyApplicability": null,
"scope": [
{
"matchKind": "Exact",
"refName": "refs/heads/master",
"repositoryId": "{REPOID}"
}
],
"statusGenre": null,
"statusName": "{DESIREDSTATUS}"
},
"type": {
"displayName": "Status",
"id": "cbdc66da-9728-4af8-aada-9a5a32e4a226"
}
}' > status-policy-request.json
az devops invoke --area policy \
--resource configurations \
--route-parameters project={PROJECTNAME} \
--in-file status-policy-request.json \
--http-method post \
-o json
rm status-policy-request.json
```
https://docs.microsoft.com/en-us/rest/api/azure/devops/policy/configurations/create?view=azure-devops-rest-5.1

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.