Registering custom checkin policy for Certain users in TFS

这一生的挚爱 提交于 2020-01-03 02:10:43

问题


I have created custom checkin policy for TFS. It is deployed to the client system. I have added the custom checkin policy for project collection in TFS. But I have a number of clients that have not installed the custom checkin policy, when these developers want to check in, Visual Studio shows an error

Internal error in Check for PMS Details. Error loading the Check for PMS Details ...

So I want to apply the custom checkin policy for certain users. For example the user is admin then no need to run the custom checkin policy.


回答1:


As others mention, the policy needs to be installed on the Client machine to work. There is no getting around that. You can, however, in the policy itself check the Identity and group membership of the user doing the check-in and skip the policy validation (always return an empty array of PolicyFailures) in that case.

I have been working on such a policy, but never found time to finish it. The policy I have been building works in the same way as the ConditionalPath policy that ships in the TFS Power tools. Basically it wraps another (set of) rules and places a condition on their execution.




回答2:


Custom policies need to be installed onto the client system, they are not centrally processed.

A check in policy can be scoped only to the project level within TFS, as far as I am aware you are unable to limit a policy in any other way unless you handle this within the policy itself.




回答3:


You must install your check-in policies on all TFS Windows clients, otherwise you get the nasty error.

A conditional policy can be implemented in two ways.

  1. set the condition inside the custom policy code
  2. use a Gated check-in build and customize the Build template

There is a third option, a Server side event handler, but I generally discourage it.



来源:https://stackoverflow.com/questions/25933809/registering-custom-checkin-policy-for-certain-users-in-tfs

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!