Tfs 2015 VNext Checkin task - tfs

The new "VNext" build system has tasks to perform operations like MSBuild and Deploy things. One common task it has been missing out of box is the task to checkin items to tfs.
The xaml builds had the provision to use tfs api's and write a c# code to perform this tasks, but dosen't seem straight forward with the powershell based "VNext" tasks.
The TFS 2015 API does not have a straight way to do this as well.
Is there a out of box solution to do this or any api call to checkin code during builds?

The TFA API does have a Checkin method in VersionControl client namespace.
Here is an example - http://singhtechies.com/programatically-checkin-file-to-tfs-using-c/

You can use the New-TFSChangeset cmdlet.
NAME
New-TfsChangeset
SYNOPSIS
SYNTAX
New-TfsChangeset [-Author <String>] [-Comment <String>] [[-Item] <QualifiedItemSpec[]>] [-Prompt] [-Notes
<String>] [-Override <String>] [-Recurse] [-Saved] [-Validate] [<CommonParameters>]

Related

TFS Release Step Create Task

I'm converting our XAML build process to vNEXT build for our on-premise TFS 2017. One step I like to automate is the create a work item task for a specific user to execute after the release has been done. Is there a built in way to do this? I have a PowerShell script but I'd prefer not to use it if there is already a better way
No, there is still no out-of-the-box feature for this. Either using the REST api or the Client Object model in a powershell script just like you have done will do the trick.
You could also take a look at this similar question: How to have TFS automatically add certain tasks to new work items?, jessehouwing has provided a great answer.
Another way is using TFS Aggregator- a serverside pugin for TFS 2013
(update 2 and later) which has the ability to create new work items
based on rules. An example task can be found here:
https://github.com/tfsaggregator/tfsaggregator/wiki/Auto-Create-Children
Update
After go through the extension in VSTS marketplace (https://marketplace.visualstudio.com/) , there is also no existing task could do this. You may still use your powershell script or write your own extension.

Unable to find the task "Tokenize with XPath/Regular expressions" in TFS online

I am doing CI automation for Dot net application. I had did token replacement using the task "Tokenize with XPath/Regular expressions" in TFS for configuration replacement.
Now i am trying the same in the TFS online. In TFS online i am not able to find the same task(Tokenize with XPath/Regular expressions).
That is not an out of the box task, you need to install the release management utility task extension : https://marketplace.visualstudio.com/items?itemName=ms-devlabs.utilitytasks

How to integrate TFS 2015 and VSTS

We need to synchronize several projects hosted on Visual Studio Team Services with our on-promise TFS 2015 Update 2. The ultimate goal of TFS is to have CI/CD happening within company for all external projects. However, we don't want to interrupt developers for whom using VSTS will be better choice then TFS.
However, I can't find any solution for TFS to use VSTS as a repository, though TFS can use Git. Maybe, I should look differently on this case. Does anyone know any possible solution?
You'll need tools to migrate between on-premise TFS and VSTS, like:
TFS Integration Tools
OpsHub Visual Studio Online Migration Utility
A useful blog for your reference.
I suspect that setting this up is going to be tricky or it's going to cost you.
The free OpsHub migration utility isn't going to help you in this scenario so you're looking at a commercial product like :
TaskTop Sync or OpsHub Integration Manager
but I haven't used them in this scenario so can't comment on either.
TFS Integration tools would probably do the job but you've got some work to do to get them working and it's not pretty. I have them setup at the minute to sync Work Items from TFS 2015 to VSTS for testing purposes and it works okay. My blog on setting them up with VSTS/2015 is here
Would you not consider doing your CI/CD directly from VSTS rather than an on-premise TFS? You could still have the build/release agent running on-prem and you could lock down permissions for your external devs so you control all the build and releases and any other projects.
Git would be a simpler way of merging code between VSTS and TFS2015 but that assumes you are using Git on your 2015 projects and I believe it would be manual process for someone to do this (someone may be able to comment on a way to make this work)

CompilationOutputs in TFS 2010

Is there any similar property to CompilationOutputs in TFS 2010?
If not, how to get all compiled assemblies including all metadata as in TFS 2008?
In TFS2010, if you use the UpgradeTemplate.xaml build process template you can keep your existing TFS 2008 based MSBuild proj files that use the CompilationOutputs property and continue building as per usual.
If you are using TFS2010 workflow based builds (i.e. DefaultTemplate.xaml or a derivative) then the approach will need to be somewhat different. The workflow makes a call to an MSBuild activity internally in order to compile the solution and there is nothing in the properties for that task that returns the data you're looking for.
To work around the change, further down in the workflow there is an CopyDirectory tasks that moves files from the binaries folder to the drop location. You could always put in your own workflow activities just before or around that point in the process and do what ever it is you are wanting to do.

Is it possible to update tfs metics like code churn, code coverage, last to break the build with Team City?

We've been using Team City as our build deployment server. We'd like to now update the metrics in tfs like "Code Churn", "Code Coverage". Is it possible to do this with TeamCity or do we just need to start using the tfs build server?
It is possible to publish builds results (including metrics) to the TFS server but only when those are collected via MSTest. The MSTest /publish command might be helpful here. It looks like publishing custom results like this will be easier in TFS2010 but there are no details as of yet.

Resources