question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TFBuild.IsRunningOnVSTS is confusing when using own build agent

See original GitHub issue

What You Are Seeing?

I have a VSTS build agent, which is triggering a cake build on GitHub commits.

I tried using the TFBuild.IsRunningOnVSTS to check if this was a build running on VSTS, as I am also using AppVeyor.

What is Expected?

I would have expected TFBuild.IsRunningOnVSTS to return true. It returned false.

This seems to be per design as seen in the TFBuildProvider

What version of Cake are you using?

Latest

I discussed this briefly with @patriksvensson on Gitter and we kind of agreed that the IsRunningOnVSTS and IsRunningOnTFS properties could be a bit misleading.

@patriksvensson suggested a possible rename:

IsRunningOnVSTS -> IsRunningOnSharedAgent IsRunningOnTFS -> IsRunningOnOwnAgent

To me this would be much more clear as VSTS can both run shared and own agents.

@agc93 you seem to be the original author of this feature, what do you think about this?

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
agc93commented, Apr 27, 2017

Any thoughts/feedback before I start on this @Cheesebaron or @patriksvensson ? I’ve talked to Microsoft about it, so I’ll try and improve the logic as well as adding that new property.

0reactions
agc93commented, May 1, 2017

Okay so I don’t think removing IsRunningOnVSTS/IsRunningOnTFS is either a) the right call or b) something we can change at this point (that’s one hell of a breaking change).

As discussed, you can already use TFBuild.Environment.Agent.IsHosted to confirm if you’re on a hosted agent, regardless of the IsRunningOn* properties.

I will look into improving the logic of IsRunningOn and PR it when I get a chance.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TFS Build Agent Stopped Running
Try to change a domain account which is a member of the Build Agent Service Accounts group and belongs to "Agent Pool Service...
Read more >
Azure Pipelines Agents
An agent that you set up and manage on your own to run jobs is a self-hosted agent. You can use self-hosted agents...
Read more >
Self-hosted Windows agents - Azure Pipelines
Learn how to use Windows agents to build and deploy your Windows and Azure code for Azure Pipelines.
Read more >
Building Apps Using Self-Hosted Build Agents in Azure ...
This process is an alternative to using Microsoft-hosted build agents and allows you to customize your build agent to your specific needs. Try...
Read more >
TFS Build Agent Can't Connect to Package Feed
I logged into the Build Server as the Service Account, and I'm able to connect to the feed through a web browser just...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found