Thursday, 12 October 2017

Mistake in .sln Can Cause NuGet Restore Task in Build to Fail and Hide the Real Issue

NuGet packages are very commonly used in VS Development. Using build VSTS task NuGet Restore is general practice of downloading packages while doing the automated builds. Today suddenly a team ran into the same issue described here https://developercommunity.visualstudio.com/content/problem/97737/error-da-toolnuget400x64nugetexe-failed-with-retur.html. Let’s have a look at the real issue caused this error in this particular teams’ instance and how it was found and resolved.

Tuesday, 3 October 2017

Setting Quality Profile via VSTS/TFS Build for SonarQube

Sonar analysis helps to identify the technical debt in the source code of your project. Running it integrated with VSTS or TFS builds add more value by automating the quality checks with sonar server. You can define your own custom Quality Profile to analyze your source code with selected set of rules. Let’s look at how you can specify the Quality Profile with the TFS/VSTS build task, that can be used to automate scanning of your code, when using the SonarQube extension in the visual studio marketplace.


You can set the parameter “sonar.profile” in the advance settings of the build task “Prepare the SonarQube analysis”.  (It is mentioned that this property is deprecated in https://jira.sonarsource.com/browse/SONAR-5370, but it still works and this property is an item that should not be deprecated is the opinion of many people commented there which is very much agreeable). The syntax that should be used to specify the property is as below.

/d:sonar.profile=profilenameimage

This applies the profile in the scanning when the project is getting created for the first time in SonarQube as well.image

It is possible for you to specify a Quality Profile for a project that is already created and then without using this parameter. but this would be useful when handling these scans and projects in a more dynamic way, creating and removing projects from SonarQube dynamically if required.

Sunday, 1 October 2017

Code Review with Git in Team Services

Code Review plays important part in software development as it helps to identify issues that may be overlooked. Reviews on code improve overall quality of the delivered software, and reviews are done in different ways by the teams, at times using pair programming, peer review and formal inspection of code by team leads etc. Team Services Git  version control now facilitates Code Review, via pull requests.

Business Rules for Work Items in Team Services

For inherited process model in VSTS, you can use Custom Rules to define rules that can clear the value of a field, copy a value into a field, and apply values based on dependencies between different fields' etc. You can define actions against conditions using custom rules. This provide you the flexibility in VSTS to go beyond the level of setting a default value or making a field required. To customize work items in an existing team project of Hosted XML model for VSTS, or on-premises TFS, you have to customize, downloaded process template or individual work item XML files (using witadmin tool) respectively. Differences between process models are described here.

Friday, 29 September 2017

TFS DB Restore–DB Set to Suspect

When you have configured backups with TFS admin console and restore them in case of a need, you are expecting, your TFS databases to restore without any issues. But you might run into this situation if you just, missed simple thing to check. For example the target server SQL version, should exactly match to the source or your production TFS, SQL version. Let’s have a look at learning experience I went through due to a slight mistake, which taught me how much vigilant you need to be when you are doing the, administrative work with TFS.