Search code examples
tfsbuildtfsbuildtfs-2015tfvc

TFS2015 vNext build check-in TFVC


I have a XAML build who I migrated to vNext build. One step is a batch execution.

This batch modifies a version file and checks in TVFC the change.

In XAML build works like a charm. The same batch show me this log:

2019-08-07T18:10:07.7390807Z Current version: 2.0.13.17
2019-08-07T18:10:07.7546806Z C:\agent1\_work\1\s\Version.INI
2019-08-07T18:10:07.7546806Z 1 File(s) copied
2019-08-07T18:10:08.4098764Z TF14067: The item \agent1\_work\1\s\Version.ini could not be found in the ws_1_85;Project Collection Build Service workspace, or you do not have permission to access it.
2019-08-07T18:10:08.7374743Z There are no pending changes matching the specified items.
2019-08-07T18:10:08.7530742Z No files checked in.

It seems there are no files changed. I checked the Version.ini file has been modified successfully. Here the .bat:

\\VersionUpdater\VersionUpdater.exe  /UPDATE VERSIONPATH="%~dp0Version.ini"  SOLUTIONFOLDER="%~dp0Develop"
xcopy "%~dp0Version.ini" "%~dp0actualversion\" /Y
call %~dp0tf.bat checkout "%~dp0Version.ini"
set /p Version=<"%~dp0Version.ini"
\\VersionUpdater\VersionUpdater.exe  /INCREMENT VERSIONPATH="%~dp0Version.ini"
call %~dp0tf.bat checkin "%~dp0Version.ini" /noprompt /comment:"Version upgrade %Version%"

Solution

  • To combat these issues I've built a set of tasks that perform the check-in for you.

    See:

    What you're likely running into:

    • Workspace changes:

      • The XAML build uses Server workspace.
      • The 1.x 2015 agent defaults to local workspaces (but can use Server workspaces).
      • The 2.x 2015+ agent enforces local workspaces.
    • tf vc checkout isn't supported on local workspaces

    • TeamFoundation workspace cache directory moved

      • Different agents use different versions of the Client Object Model.
      • Each major version of the Object Model stores the machine workspaces in version specific folder.
    • tf.exe / tf.bat may be using a different object model cache than the agent.

      • tf relies on the client cache as well.

    Possible fixes:

    1. Remove the call to tf checkout
    2. Match the version of tf to the client object model of the agent.
    3. Call tf vc workspaces /collection:SERVERURI /computer:AGENTMACHINENAME to refresh the workspace cache from your batch script.
    4. Upgrade to TFS 2018 to get all the better features of the 2.x agent.
    5. Use my TF VC tasks