MicrosoftPremier / VstsExtensions

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

Baseline build ID is a pull request build not a merged to master build #57

Closed andrebriggs closed 4 years ago

andrebriggs commented 4 years ago

I found the following when running. The extension chose a build Id from a PR build (8820 in graphic below) not from the latest merged to master branch build (individual CI in AzDO build).

I noticed that guidance for Pull Request Policy builds is missing

My config

  - task: mspremier.BuildQualityChecks.QualityChecks-task.BuildQualityChecks@6
    displayName: 'Check build quality'
    inputs:
      checkWarnings: false
      warningFailOption: fixed
      warningFilters: ''
      showStatistics: true
      checkCoverage: true
      coverageFailOption: 'Previous Value'
      coverageType: branches
      buildConfiguration: ''
      buildPlatform: ''
      explicitFilter: true
      baseDefinitionId: 128
      baseBranchRef: refs/heads/master
      runTitle: 'Code Coverage Evaluation'
    condition: and(eq(variables['Agent.JobStatus'], 'Succeeded'), endsWith(variables['Agent.JobName'], 'node_12_x'))

Log

2019-12-19T21:03:15.8644893Z ##[section]Starting: Check build quality
2019-12-19T21:03:15.8652925Z ==============================================================================
2019-12-19T21:03:15.8653428Z Task         : Build Quality Checks
2019-12-19T21:03:15.8653595Z Description  : Breaks a build based on quality metrics like number of warnings or code coverage.
2019-12-19T21:03:15.8654014Z Version      : 6.1.2
2019-12-19T21:03:15.8654286Z Author       : Microsoft Premier Services
2019-12-19T21:03:15.8654825Z Help         : [[Docs]](https://github.com/MicrosoftPremier/VstsExtensions/blob/master/BuildQualityChecks/en-US/overview.md)
2019-12-19T21:03:15.8655464Z ==============================================================================
2019-12-19T21:03:16.1753874Z SystemVssConnection exists true
2019-12-19T21:03:16.5423140Z Validating code coverage policy...
2019-12-19T21:03:19.1522704Z Successfully read code coverage data from build.
2019-12-19T21:03:19.1553362Z Total branches: 1044
2019-12-19T21:03:19.1555137Z Covered branches: 524
2019-12-19T21:03:19.1559230Z Code Coverage (%): 50.1916
2019-12-19T21:03:19.2186132Z Found baseline build with ID 8820.
2019-12-19T21:03:19.5336726Z Successfully read code coverage data from build.
2019-12-19T21:03:19.5340213Z Total branches: 1037
2019-12-19T21:03:19.5340775Z Covered branches: 517
2019-12-19T21:03:19.5346448Z Code Coverage (%): 49.8554
2019-12-19T21:03:19.5399822Z ##[section]Finishing: Check build quality

Builds

image

ReneSchumacher commented 4 years ago

Hi @andrebriggs,

I'm not exactly sure what might be causing this. Since you're with Microsoft as well, I'll get back to you via email. Perhaps you can provide access to the actual build definition and builds so I can dig deeper.

Cheers, René

ReneSchumacher commented 4 years ago

Hi @andrebriggs,

this issue occurs when your code is hosted outside of Azure DevOps. I have already fixed the issue and will release an updated version of the task shortly.

René

andrebriggs commented 4 years ago

Thanks @ReneSchumacher! Looking forward to the new release

ReneSchumacher commented 4 years ago

Hey @andrebriggs,

this issue is now fixed in the latest task version v6.2.x. Let me know if you still see issues.

Happy building, René