jessehouwing / azure-pipelines-tfvc-tasks

Azure Pipelines tasks for Team Foundation Version Control
https://marketplace.visualstudio.com/items?itemName=jessehouwing.jessehouwing-vsts-tfvc-tasks
MIT License
27 stars 18 forks source link

Fail when multiple users have identical names #44

Closed tbergstedt closed 6 years ago

tbergstedt commented 7 years ago

I know this is a bit of an edge-case, but we're experiencing problems when multiple users have identical names. The error message from e.g. checkin action is then

Exception calling "CheckIn" with "1" argument(s): "System.Web.Services.Protocols.SoapException: Multiple identities found matching 'FirstName LastName'. Please specify one of the following identities: 2017-02-16T08:01:47.1774241Z ##[error]- FirstName LastName (userid1) 2017-02-16T08:01:47.1774241Z ##[error]- FirstName LastName (userid2)

It seems the extension simply uses BUILD_QUEUEDBY, which consists of simply "FirstName LastName". Is it possible to instead use user-Id for these operations

jessehouwing commented 7 years ago

Have you tested whether that works? I don't have an environment that exhibits this issue.

If you go to the build agent and open up the tasks folder, you can "patch" the task by hand-editing the tfvccheckin.ps1 and updating the variable to read BUILD_QUEUEDBYID. I'm not 100% certain this will work and whether I'll need to transform that to either the identity guid or the account name. Identities in VSTS are a nasty thing.

This should be resolved for certain in the planned rewrite which will use tf.exe that ships with the 2.x agent.

tbergstedt commented 7 years ago

I did as you said and changed that single call in tfvccheckin.ps1 to $checkinParameters.Author = $env:BUILD_QUEUEDBYID

It worked. Thanks for pointing out the solution.

JasonDonnelly commented 7 years ago

Hi,

I followed the solution above and amended the tfvccheckin.ps1 file in the agents task folder and the solution worked for me as well.

How do I handle the case where a new agent (we have sixteen agents across four build servers) get this script from TFS for the first time?

Is there a central repository where I should amend the tfvccheckin.ps1 file?

Thanks Jason

jessehouwing commented 7 years ago

Have you tested it against tfs or vsts?

On Aug 24, 2017 15:14, "Jason Donnelly" notifications@github.com wrote:

Hi,

I followed the solution above and amended the tfvccheckin.ps1 file in the agents task folder and the solution worked for me as well.

How do I handle the case where a new agent (we have sixteen agents across four build servers) get this script from TFS for the first time?

Is there a central repository where I should amend the tfvccheckin.ps1 file?

Thanks Jason

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jessehouwing/vsts-tfvc-tasks/issues/44#issuecomment-324631116, or mute the thread https://github.com/notifications/unsubscribe-auth/AD-uS5qX6p2-QKilT2B2vy3o3fL0IZMBks5sbXcrgaJpZM4MEBZO .

JasonDonnelly commented 7 years ago

Hi,

We're using TFS2015.3 on premise.

Regards Jason

jessehouwing commented 6 years ago

I suppose this has been fixed by the fix for #46

jessehouwing commented 6 years ago

jessehouwing.jessehouwing-vsts-tfvc-tasksDEV-1.2.8.zip