Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to configure the 'message highlight pattern' for the TFS2015.2 build definition command line step?

It is possible to configure the Error message highlight pattern and Warning message highlight pattern of the TFS2015.2 Command Line step?

For example, I may have the following build definition that runs a command line utility, say gulp, to perform some tasks such as code linting.

Example build definition showing command line step

The precise standard output (via stdout) of this utility would be varied depending on the precise lint tasks being run. For example, one tool for analysing TypeScript code and another tool for analysing Sass code.

Furthermore, the utility may:

  • Write messages to the error stream (via stderr).
  • Return a non-zero exit code.

Neither of the cases above are useful to me because in certain scenarios I don't want TFS to consider the build step has failed. I do however want warnings highlighted in the logs and build summary.

It would be useful to be able to teach the Command Line step about specific output message patterns that represent warnings and errors.

In the build logs for the Command Line step I see this:

Build log extract showing message highlight pattern

This seems to suggest a way to configure the line matching patterns for output that represents warnings and errors. However, I cannot find a way to configure these, hence my question.

I should point out that I'm aware there are other ways of achieving this:

  • One way for example is via a targeted build step that is designed to wrap the command line utility. The built-in Gulp and npm steps for instance, or perhaps a custom authored step / extension.

  • Another way is to emit Logging Commands from a build script as asked here.

My question specifically relates to employing the built-in generic Command Line step directly when these options aren't available or desirable.

like image 863
Matt Brooks Avatar asked Oct 31 '22 04:10

Matt Brooks


1 Answers

For now, this can't be achieved by Command Line step directly. You may could ask a feature request in uservoice. The TFS administrator and PM will kindly review it.

UserVoice: https://visualstudio.uservoice.com/forums/330519-team-services/

like image 116
PatrickLu-MSFT Avatar answered Nov 14 '22 23:11

PatrickLu-MSFT