TFBuild.IsRunningOnVSTS is confusing when using own build agent
See original GitHub issueWhat 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:
- Created 6 years ago
- Comments:5 (5 by maintainers)
Top GitHub Comments
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.
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 theIsRunningOn*
properties.I will look into improving the logic of
IsRunningOn
and PR it when I get a chance.