Version of your agent? 2.105.6 Windows
VisualStudio.com + Microsoft Visual Studio Enterprise 2015 Version 14.0.25425.01 Update 3
When using Gated Check-in, the v2 Build Agent does not assign the Work Item of your choice (inside Visual Studio) but all work items since the upgrade to v2. Basically every check in adds one more item to the list of associated work items to a changeset.
This does not only create a wrong version history in the source control (using TFVC), but it also breaks the reconcile mechanism, as the returned changeset does not match the expected result and Visual Studio does not clean up the UI as it should (only the files are reverted to un-edited state)
Related to #491. This is still an issue for us as well.
OK that is not good. At first glance I thought this was only about the "associated changes" info on the build summary page. I'll look into this.
I found the issue. I'm working to validate a fix for the agent. I'll share better workaround details later today after I can validate the fix. A very crude workaround for now would be to set a variable on the definition build.clean=all so the workspace will get deleted and recreated.
Great, prefer to not have "all" on gated builds 馃殼
Sorry for the delay. I thought an easier workaround existed using the extended client SDK. Ultimately I found out using the extended client SDK as a workaround is going to be more work than just using tf.exe / TEE-CLC for the workaround:
tf shelve /move /replace /recursive <shelvesetname> $(build.sourcesdirectory) /loginType:OAuth /login:.,$(system.accesstoken) /noprompt (this clears the last-saved-checkin-metadata for the workspace, e.g. associated workitems)Doing this won't affect the associated work items for the gated check-in being built. It just clears the last-saved-checkin-metadata so that the next build won't start with a dirty state.
Another workaround is to build my commit in my PR. I don't think much has changed in master since the last released version. So should be very stable. Another option would be to cherry-pick it onto one of the previous release commits.
The fix is in master now. It will be part of the 2.107.2 release. We've been releasing about once every week or so. So 2.107.2 will probably be released next week.
This release contains the fix: https://github.com/Microsoft/vsts-agent/releases/tag/v2.108.0
@ericsciple Confirmed fixed, thank you for keeping us up 2 date.