Build vNext and continuous integration on GitHub

One of the great news of build vNext is the ability to create a build that targets source on GitHub project, not only on Git or TFVC repositories that are in current TFS or VSO instance. Given this, plus the fact that VSO has a 5 basic user license for Free, and you can use VSO as Continuous integration Engine for your GitHub projects.

To create a build that targets GitHub source code, you should simply login into your GitHub account, then navigate in your personal settings and finally choose “Personal Access tokens”

image

Figure 1: Personal access tokens in GitHub

I do not want to cover how GitHub tokens works, but basically each token has a set of capabilities associated with it, so you can decide the level of access bounded with each token. This is particularly important if you want to use that token to access only your public repositories and not the private ones.

image

Figure 2: Access levels associated to your token

Once you have a valid token you should write it down securely in some tool (I use KeePass) because the UI of GitHub will not give you way to easily retrieve that token. Once you have the token you can instruct VSO to create Continuous Integration build.

The first step is having a VSO account and create a Team Project, I’ve called my team Project GitHub, then navigate to the Build Tab. Once you press the Green Plus Button you are asked for the type of the build, I choose Visual Studio for this example because my GitHub Project contains Visual Studio solution.

Once the build editor is opened, you can go to Repository tab, then choose GitHub as repository type, and insert previously generated Access token. If the token is good, just wait for few seconds, and you should be able to see the list of GitHub repositories you have access to.

image

Figure 1: Configure the build to take sources from GitHub

Thanks to the access token, VSO build infrastructure can check if the repository gets new push, if you go to the Triggers tab you can ask VSO to trigger a build for each push in all the branches you want to monitor.

image

Figure 2: You can use CI even if the repository is on Git Hub

This is all you need to create a build. To verify that everything is ok you can simply trigger a new build, and, if the build has no specific requirement, you can use the Hosted Agent offered by VSO to build your project.

You can safely remove the Index Sources & Publish Symbols, because VSO cannot index source code outside your account. If you leave this task on the build, you will have warning during build.

image

Figure 3: Remove Indexing Sources task from your GitHub build.

Finally, in the General Tab, you can ask VSO to generate a Badge for the build.

image

Figure 4: Badge build

A badge is a simple url that renders an image that specify if the latest build succeded, failed or partially succeeded. Once you have a badge, you can include on the wiki page of your project in GitHub, simply including in the Readme.MD file in project root.

image

Figure 5: Build badge in action.

Et voilà, with few clicks you have Continuous Integration for GitHub Project using Visual Studio Online.

Gian Maria.

VSO vNext build error: You cannot run the vsoAgent.exe interactively ..

Error Symptom: You installed and configured an Agent for the new Visual Studio Online Build System, and you decided not to run as a service, but interactively. When you double click the VsoAgent.exe executable you got this error.

You cannot run the vsoAgent.exe interactively from within the Agent folder. Try running it from the parent folder

I’ve encountered this error on my main workstation machine, and I’m not sure why I got this error. Actually I’ve configured agent for TFS 2015 RC without this problem and in the same machine I got three distinct agents, but only the one targeting my VSO primary account is having this problem.

If you open a command prompt and run the program from the parent folder everything runs just fine.

image

Figure 1: Running from the parent folder solves the problem

Solution: the simplest solution to avoid opening a CLI is creating a shortcut to the executable and change the Start In location

image

Figure 2: Configure the agent with Start In main folder

This should solve the problem. Double clicking on the link now run the agent just fine.

Gian Maria.

Microsoft support for non Windows developers

During Build 2015 conference Microsoft announced Visual Studio Code, a free IDE to develop web, cloud and modern application. The nice aspect of VS Code is that it runs on every platform, here is a screenshot of Code running on a Linux Ubuntu box.

 image

Figure 1: Visual Studio Code running on Linux box

I can now clone a git repository from my Visual Studio Online account and create a first Hello Node Js application. VS Code is not just an editor, and I’m able to debug my node.js code with easy.

image

Figure 2: Debugging node.js code in Visual Studio Code

VS Code has native support for Git, and I’m able to manage my repository doing push/pull/commit etc, directly from VS Code. Support is still basic, if you need a rebase you should go with CLI, but VS Code is still in preview, so I’m expecting more to come in the near future.

image

Figure 3: Create a commit directly from VSCode

image

Figure 4: I pushed changes directly from VS Code in VSO

You can use all VSO feature, if you like you can edit code directly from Web interface if you need to do a quick fix, or if you need to edit a Readme.MD file.

image

Figure 5: Editing in Web Interface in Visual Studio Online

Thanks to Visual Studio Code, and Visual Studio Online, you can manage your projects from your favourites environment.

Gian Maria Ricci

Rename Team Project in VSO

With yesterday update, one of the most requested feature for TFS/VSO was finally active, you can now rename a Team Project. It can be done directly from collection administration page, in the same place where you can delete a Team Project

 

image

Once selected you should only provide a new name.

image

Now you will be warned with a long warning message that tells you exactly what kind of intervention you need to do after the rename.

image

Clicking the link provided in the warning box will bring you to a page full of detailed step on how to perform all the above operations. (http://vsalmdocs.azurewebsites.net/Library/vs/alm/admin/project-rename )

The first operation you need to do is recreate all local workspaces unless you will have Visual Studio 2012 or Visual Studio 2013 Update5, that can manage this situation automatically. So it is just a matter of time before this step will be automatic. Until Now, if you try to access Local workspaces of renamed project with older version you will be greeted with a detailed error message.

image

Another annoying stuff is that you need to edit all the build based on TFVC, and update path of solution/project to build, because build are still not updated by the rename project. I think that this will be fixed in some next upgrade.

One of the nicest stuff is that you will have automatic redirect of old urls. As an example I’ve renamed TP Experiments, but I’m still able to use the old url in the Browser.

https://gianmariaricci.visualstudio.com/DefaultCollection/Experiments/_versionControl#path=%24%2FExperiments%2Ftrunk%2FElasticsearch%2FMusicDb&_a=contents

Clearly the redirect will work until you create a new TP with the name of the old renamed project.

Gian Maria.

Some love to Kanban Board in Visual Studio online

In some of recent updates on Visual Studio Online the team put some love into the Kanban Board. In January they enable editing tiles on the Board. In february we can Adding and editing some fields directly from the Board, as well as the ability to split column.

image

Figure 1: Split columns in Kanban Board.

I must admit that split column is a must and I’m very happy to have it now on my VSO account. In March the ability to reorder card on the board was introduced, as well as the possibility to specify Definition of Done for each column. Finally, with April deployment, we have now the ability to customize cards, as well as Markdown on Definition of Done, plus the ability to configure the Cumulative Flow Diagram.

With all these updates, Kanban support in VSO is starting to become really interesting.

Gian Maria.