MicrosoftPremier / VstsExtensions

Documentation and issue tracking for Microsoft Premier Services Visual Studio Team Services Extensions
MIT License
56 stars 14 forks source link

How to improve this statistics output #105

Closed PreetSangha closed 3 years ago

PreetSangha commented 4 years ago

My output doesn't offer a lot of breakdown and all I get is a summary

Total warnings: 3999, Filtered warnings: 3999

and

Total warnings: 3997, Filtered warnings: 3997

Please could you show me how get an example output showing a break down like this: image

My task is

- task: BuildQualityChecks@7
  condition: ne(variables['patchBuild'], 'true')
  inputs:
    checkWarnings: true
    warningFailOption: 'build'
    showStatistics: true
    warningTaskFilters: '/^(((android|xcode|gradlew)\s+)?build|ant|maven|cmake|gulp|Compile)/i'
    buildConfiguration: '$(buildConfiguration)'
    buildPlatform: '$(buildPlatform)'
    includePartiallySucceeded: true
    baseBranchRef: refs/heads/master
    inclusiveFiltering: false

And my output is like this:

2020-07-04T00:47:27.6432312Z ##[section]Starting: BuildQualityChecks
2020-07-04T00:47:27.6592947Z ==============================================================================
2020-07-04T00:47:27.6593307Z Task         : Build Quality Checks
2020-07-04T00:47:27.6593658Z Description  : Breaks a build based on quality metrics like number of warnings or code coverage.
2020-07-04T00:47:27.6593968Z Version      : 7.3.0
2020-07-04T00:47:27.6594203Z Author       : Microsoft Premier Services
2020-07-04T00:47:27.6594618Z Help         : [[Docs]](https://github.com/MicrosoftPremier/VstsExtensions/blob/master/BuildQualityChecks/en-US/overview.md)
2020-07-04T00:47:27.6595076Z ==============================================================================
2020-07-04T00:47:28.0667425Z SystemVssConnection exists true
2020-07-04T00:47:28.7438237Z Using IdentifierJobResolver
2020-07-04T00:47:33.8767286Z - Compile SOL
2020-07-04T00:47:33.8781183Z Waiting for previous tasks to upload information...
2020-07-04T00:47:38.9542271Z Validating build warnings policy...
2020-07-04T00:47:39.0133738Z Running task warnings analysis...
2020-07-04T00:47:39.0139643Z Counting warnings from tasks:
2020-07-04T00:47:39.0140034Z   - Compile SOL
2020-07-04T00:47:43.1857060Z      Running MSBuild task log analysis...
2020-07-04T00:47:43.2585918Z      Total warnings: 3999, Filtered warnings: 3999
2020-07-04T00:47:43.2592725Z Overall total warnings: 3999
2020-07-04T00:47:43.2594526Z Overall filtered warnings: 3999
2020-07-04T00:47:43.3798092Z Found baseline build with ID 148272.
2020-07-04T00:47:43.4732440Z Running task warnings analysis...
2020-07-04T00:47:43.4737628Z Counting warnings from tasks:
2020-07-04T00:47:43.4738014Z   - Build SqlProcessor
2020-07-04T00:47:43.5772697Z      Running generic task log analysis...
2020-07-04T00:47:43.5777119Z      Total warnings: 0, Filtered warnings: 0
2020-07-04T00:47:43.5777522Z   - Compile SOL
2020-07-04T00:47:54.3715168Z      Running MSBuild task log analysis...
2020-07-04T00:47:54.5193409Z      Total warnings: 3997, Filtered warnings: 3997
2020-07-04T00:47:54.5194059Z   - BuildQualityChecks
2020-07-04T00:47:54.6013992Z      Running generic task log analysis...
2020-07-04T00:47:54.6014456Z      Total warnings: 0, Filtered warnings: 0
2020-07-04T00:47:54.6019201Z Overall total warnings: 3997
2020-07-04T00:47:54.6019572Z Overall filtered warnings: 3997
2020-07-04T00:47:54.6032198Z [ERROR] The number of warnings (3999) has increased since the previous build! The previous build had 3997 warning(s).
2020-07-04T00:47:54.6033147Z ##[error]The number of warnings (3999) has increased since the previous build! The previous build had 3997 warning(s).
2020-07-04T00:47:54.6568695Z ##[section]Finishing: BuildQualityChecks
ReneSchumacher commented 4 years ago

Hi @PreetSangha,

warning statistics are not shown in the task log. Instead, you have to look at the Extensions tab in the build summary view as described at https://github.com/MicrosoftPremier/VstsExtensions/blob/master/BuildQualityChecks/en-US/overview.md#extension-summary-section. In addition, you have to set showStatistics to true, which you already did.

The screenshot in the docs also shows a file warnings analysis (see https://github.com/MicrosoftPremier/VstsExtensions/blob/master/BuildQualityChecks/en-US/WarningsPolicy.md#file-warnings-parameters) with a custom file analysis title and a custom run title (see https://github.com/MicrosoftPremier/VstsExtensions/blob/master/BuildQualityChecks/en-US/overview.md#reporting-options).

PreetSangha commented 4 years ago

Thank you, that explains it. I can't for life of me remember seeing the extensions tab before I upgraded to @7, but I'm happy to admit I could have just been overlooking it.

May I request putting yaml examples show how to do the same as you're showing in the non yaml examples? I'm sure it would make it very easy for people to compare and contrast. Again thank you for the prompt response.

ReneSchumacher commented 4 years ago

What examples are you looking for exactly? I don't think we have any real full examples in the task docs. The screenshots just show the UI elements for reference, while all yaml properties are listed as part of the documentation in addition to a full yaml snippet with all possible properties in the overall documentation.

If you're looking for any specific scenarios, I'm more than happy to provide a sample here. Just let me know what you're looking for.

ReneSchumacher commented 3 years ago

Hi @PreetSangha,

do you need additional help or can we close this issue?

René

PreetSangha commented 3 years ago

Hey @ReneSchumacher. Sorry for not getting back to you. No I don't need more help as your help has been fantastic.

Thank you again!