-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to raise and display build warnings from build steps using TFS 2015? #573
Comments
You should be able to return warnings and errors from your script using logging commands. |
@pascalberger OK thanks — tried emitting the output below from a PowerShell step and got the desired result on the build summary page:
Is there currently a generic way of teaching the build system what forms of existing tool output should be considered as warnings though — as per question 2 above? Additionally are there any built-in generic conventions (other than the logging commands) for triggering a 'partially succeeded' step rather than a 'failed' step? I'm happy the logging commands will work for us but they are proprietary — existing build logic will need updating. |
the logging cmds are the only mechanism. and even though are proprietary, then just go to console out |
I am using PowerShellOnTargetMachines Using File
|
I am also interested in VSTS being able to report warnings logged by MSBuild when invoked via a script such as Cake Build. We're currently using Jenkins and this works really well there, however we'd like to migrate to VSTS but this is a show stopper for us. I've also logged an issue here MicrosoftPremier/VstsExtensions#2 related to this. |
@cosminstirbu If you're using Cake you might be intereste in the Cake.Issues Addin. It provides addins for parsing MsBuild output for warnings and processing them further (by e.g. posting them as comments to VSTS pull requests). If it doesn't cover your scenario it can easily be enchanced with additional addins or code in your Cake script. |
The addin looks like a good alternative. I'll have a look into it, as it's not quite clear if I should first redirect the output of the MSBuild to a file, and use that file as the input of the addin, or it can simply work off the MSBuild console output. Thank you for mentioning it. |
Background
The questions below relate to TFS 2015 on-premise.
It is possible to fail a build step by returning a non-zero exit code from, for example, a
PowerShell
orCommand Line
step. The build logs also capture anything written to the standard output stream. It is also possible to fail aCommand Line
step if anything is written to the standard error stream.Question 1
Is it possible to raise build warnings via
PowerShell
andCommand Line
steps so that they're displayed on the build summary page underIssues
? For example, in the same way that theVisual Studio Build
/MSBuild
steps are raised and displayed?Question 2
I notice in the build logs for the
Command Line
step the following lines:Is there any way to set these highlight patterns for the step?
The text was updated successfully, but these errors were encountered: