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.

Is it possible to raise and display build warnings from build steps using TFS 2015?

See original GitHub issue

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 or Command Line step. The build logs also capture anything written to the standard output stream. It is also possible to fail a Command Line step if anything is written to the standard error stream.

Question 1

Is it possible to raise build warnings via PowerShell and Command Line steps so that they’re displayed on the build summary page under Issues? For example, in the same way that the Visual Studio Build / MSBuild steps are raised and displayed?

image

Question 2

I notice in the build logs for the Command Line step the following lines:

2015-09-22T12:29:21.0696320Z Executing the following commandline. (workingFolder = C:\Builds\_work\dacceaf2\Repo)
2015-09-22T12:29:21.0696320Z C:\Builds\_work\dacceaf2\Repo\tools\Test\bin\Release\Test.exe .\src\Web\Content\Images\ C:\Builds\_work\dacceaf2\staging\Web\Content\Images\
2015-09-22T12:29:21.0696320Z Error message highlight pattern: 
2015-09-22T12:29:21.0706314Z Warning message highlight pattern: 

Is there any way to set these highlight patterns for the step?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
mattbrooks2010commented, Sep 24, 2015

@pascalberger OK thanks — tried emitting the output below from a PowerShell step and got the desired result on the build summary page:

Write-Host "##vso[task.logissue type=warning;]Test warning"
Write-Host "##vso[task.logissue type=error;]Test error"

image

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.

2reactions
pascalbergercommented, Sep 23, 2015

You should be able to return warnings and errors from your script using logging commands.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Returning warnings from custom msbuild in TFS
Reference this thread : Is it possible to raise and display build warnings from build steps using TFS 2015? Share. Share a link...
Read more >
How to change state of TFS 2015 if build has warnings
I am using TFS 2015 UI to modify a build. I want the TFS build to be in failed state in case any...
Read more >
Build Quality Checks - Visual Studio Marketplace
Extension for Azure DevOps - Breaks a build based on quality metrics like number of warnings or code coverage.
Read more >
Compiler Warnings by compiler version | Microsoft Learn
The compiler can suppress warnings that were introduced after a version you specify by using the /Wv compiler option. This option is useful...
Read more >
Increase Build Log Verbosity to Get More Details About a ...
... build verbosity from within Visual Studio Options. We recommend switching it to normal; this displays errors, warnings, messages with ...
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