How to Label Source upon successful build on Visual Studio Team Services

12,639

Solution 1

I just noticed that the feature is now available in build vNext. Its configuration is in the Repository tab in the build definition.

Labeling

Solution 2

I think Yves Dierick's answer was correct back in October 2015, but the layout of the VSTS screens has changed a lot since then. In the latest version (as of February 2017), you can add a label to a successful build by selecting the Get Sources task in the Build Definition, choosing show Advanced Settings in the top-right corner and then selecting the On success radio button under the Tag Sources section that appears.

Took me a while to find it, so I thought it might help someone else. It doesn't help that this option is under "Tag sources" and doesn't mention the word "label" at all.

enter image description here


Update 13/03/2018

They've tweaked the layout of this page again, but made it simpler if anything, and now the option is more helpfully named "Label Sources". Updated option for labelling builds

Solution 3

For those of you running across this thread looking for a solution to TFS hosted (not VSO), note that support for build labels came out in TFS 2015 Update 1: https://www.visualstudio.com/en-us/news/tfs2015-update1-vs.aspx

We're not running Update 1 yet, so I can't confirm.

Edit: We're now running Update 1 (and 2, actually), and label build sources works for on-prem.

Solution 4

The Label Sources feature is unavailable in vNext build.

Besides the Label Sources feature, the Associate Work Items and Create Work Item on Build Failure features are unavailable as well.

You can submit one feature request about it on the Microsoft UserVoice site: https://visualstudio.uservoice.com/forums/121579-visual-studio/category/30925-team-foundation-server-visual-studio-online

Share:
12,639
cilerler
Author by

cilerler

SELECT TOP (10) Reputation FROM Users WHERE LOWER(Location) LIKE '%bocaraton%' OR LOWER(Location) LIKE '%boyntonbeach%' OR LOWER(Location) LIKE '%delraybeach%' OR LOWER(Location) LIKE '%deerfieldbeach%' OR LOWER(Location) LIKE '%coconutcreek%' OR LOWER(Location) LIKE '%coralsprings%' OR LOWER(Location) LIKE '%margate%' OR LOWER(Location) LIKE '%pompanobeach%' ORDER BY Reputation DESC; #GO

Updated on June 24, 2022

Comments

  • cilerler
    cilerler almost 2 years

    I was trying to use new Build on Visual Studio Team Services (not XAML) but couldn't figure out how to label the source upon successful build. Any idea?

    Below is the screenshot that shows how to do in XAML one.

    enter image description here

    I already have a feature request at https://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/9613014-allow-label-source-upon-succesful-build-on-visual I'm actually asking for a workaround until Microsoft implements it.

  • cilerler
    cilerler over 8 years
    Thx Vicky, I already posted to UserVoice actually looking for a workaround. Thank you for your time!
  • Yves Dierick
    Yves Dierick over 8 years
    sorry, cannot post images, my reputation is too low :-(
  • Dave New
    Dave New over 8 years
    @cilerler: Edited with a screenshot!
  • llykke
    llykke about 8 years
    We're running on-premise TFS 2015 update 1 and the feature is present.
  • Greg Veres
    Greg Veres almost 8 years
    But how do you use this field? No matter what I put in this field I get an error message saying "Invalid source label format: ". I even typed what you put in your screen shot but I still get the error. I can't find the docs pointing to what variables can be used in this field. Any help would be appreciated.
  • Jay Wick
    Jay Wick almost 8 years
  • JoeBrockhaus
    JoeBrockhaus over 7 years
    @GregVeres try something like $(Build.DefinitionName)_$(Build.DefinitionVersion)_$(Build.B‌​uildId)_$(Build.Buil‌​dNumber)_$(My.Variab‌​le) (from visualstudio.com/en-us/docs/build/define/repository# )
  • Malyngo
    Malyngo about 6 years
    It seems like, again, they changed the layout and moved this to somewhere I just can't find it.
  • Philip Stratford
    Philip Stratford about 6 years
    Actually I think they've made it simpler now. It's still in the same place as in my screenshot above, but the Advanced Settings slider seems to have gone. Just make sure you've got the Get Sources task selected on the left-hand side.