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 policy in Azure DevOps CLI extension #317

Closed
gauravsaralMs opened this issue Jan 7, 2019 · 3 comments
Closed

Add policy in Azure DevOps CLI extension #317

gauravsaralMs opened this issue Jan 7, 2019 · 3 comments
Assignees
Labels
Feature Feature Work required.

Comments

@gauravsaralMs
Copy link
Contributor

Creating this task to evaluate inclusion of Policy in Azure DevOps extension

@gauravsaralMs gauravsaralMs added Area: ProToCol The bugs under ProToCol Team Feature Feature Work required. Task Enhancements or engineering items will fall in this category. labels Jan 7, 2019
@gauravsaralMs gauravsaralMs self-assigned this Jan 7, 2019
@atbagga atbagga removed Area: ProToCol The bugs under ProToCol Team Task Enhancements or engineering items will fall in this category. labels Jan 7, 2019
@gauravsaralMs
Copy link
Contributor Author

Action Present in VSTeam powershell module? Should we have it in CLI? (proposal)
List Team Policy Type Get-VSTeamPolicyType Yes
Get Team Policy Type Get-VSTeamPolicyType Yes
Create policy Add-VSTeamPolicy Yes
Remove policy Remove-VSTeamPolicy Yes
Update policy Update-VSTeamPolicy Yes
Get policy Get-VSTeamPolicy Yes
List policy Get-VSTeamPolicy Yes
List policy Evaluation No Yes
Get policy Evaluation No Yes
Requeue policy Evaluation No Yes

Recommendation:
In order to make policy really useful we need to give a end to end story that is why evaluation looks like a set which we should have

Proposal:
In order to make policy really useful we need to give a end to end story that is why evaluation looks like a set which we should have

Action Command Parameters Response
List Team Policy Type Az devops policy type list Org, Project Direct response from API
Get Team Policy Type Az devops policy type get Org, Project, policy Id Direct response from API
Create policy Az devops policy create Org, Project, enabled (yes/ no), blocking (yes/ no), settings (jobject/ string) Direct response from API
Remove policy Az devops policy remove Org, Project, policy Id Direct response from API
Update policy Az devops policy update Org, Project, policy Id, enabled (yes/ no), blocking (yes/ no), settings (jobject/ string) Direct response from API
Get policy Az devops policy get Org, Project, policy Id, Direct response from API
List policy Az devops policy list Org, Project, Direct response from API
List policy Evaluation Az devops policy evaluation list Org, Project, Artifact Id (string), includeNotApplicable (yes/ no), top (int), skip (int) Direct response from API
Get policy Evaluation Az devops policy evaluation get Org, Project, Evaluation Id Direct response from API
Requeue policy Evaluation Az devops policy evaluation requeue Org, Project, Evaluation Id Direct response from API

We will need to close on how can we expose settings to CLI user
Option 1:
Just take string as input (user will have to pass a json serialized string)

Option 2:
Split policy create in multiple create which are type specific, then also we will not be able to expose complete settings capability because for
Same policy type setting can differ like JArray in scope

@gauravsaralMs
Copy link
Contributor Author

gauravsaralMs commented Jan 21, 2019

After latest discussion

Action Command Parameters Response
Create Policy Az repos policies create Org,
Project Id ,
Repository,
Setting (string) (passing this will make every param below useless),
PolicyType,
Valid Values (ApprovalCount, BuildPolicy, GitCaseEnforcement, MaximumGitBlobSize, MergeStrategy, WorkItem)
minimumApproverCount (Valid for Type ApprovalCount),
creatorVoteCounts (Valid for Type ApprovalCount),
buildDefinitionId (Valid for Type BuildPolicy),
enforceConsistentCase (Valid for Type GitCaseEnforcement),
MaximumGitBlobSizeInBytes (Valid for Type MaximumGitBlobSize),
useUncompressedSize (Valid for Type MaximumGitBlobSize),
useSquashMerge (Valid for Type MergeStrategy),
Direct response from API
Remove Policy Az repos policies remove Org,
Project Id ,
PolicyId,
Direct response from API
Update policy Az repos policies update Org,
Project Id ,
PolicyId,
Setting (string) (passing this will make every param below useless),
Valid Values (ApprovalCount, BuildPolicy, GitCaseEnforcement, MaximumGitBlobSize, MergeStrategy, WorkItem)
minimumApproverCount (Valid for Type ApprovalCount),
creatorVoteCounts (Valid for Type ApprovalCount),
buildDefinitionId (Valid for Type BuildPolicy),
enforceConsistentCase (Valid for Type GitCaseEnforcement),
MaximumGitBlobSizeInBytes (Valid for Type MaximumGitBlobSize),
useUncompressedSize (Valid for Type MaximumGitBlobSize),
useSquashMerge (Valid for Type MergeStrategy),
Direct response from API
Get policy Az repos policies show Org,
Project Id ,
PolicyId,
Direct response from API
List policy Az repos policies list Org,
Project Id ,
Direct response from API

We already have
List Policy Evaluation
https://docs.microsoft.com/en-us/cli/azure/ext/azure-devops/repos/pr/policies?view=azure-cli-latest#ext-azure-devops-az-repos-pr-policies-list
Queue policy Evaluation
https://docs.microsoft.com/en-us/cli/azure/ext/azure-devops/repos/pr/policies?view=azure-cli-latest#ext-azure-devops-az-repos-pr-policies-queue

@snankani snankani added in progress Development in progress and removed documentation labels Jan 23, 2019
This was referenced Jan 24, 2019
@gauravsaralMs
Copy link
Contributor Author

This is complete, hence closing this

cc: @snankani @geverghe

@gauravsaralMs gauravsaralMs removed the in progress Development in progress label Jan 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Feature Work required.
Projects
None yet
Development

No branches or pull requests

3 participants