MicrosoftPremier / VstsExtensions

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

Quality Checks for PRs #16

Closed MisinformedDNA closed 5 years ago

MisinformedDNA commented 5 years ago

When PRs come in, they are always on a new branch and, thus, have no baseline. What's the best way to handle this? Looks like someone intended to write documentation for that scenario.

I was thinking of only adding this task in the PR build, but maybe it should be in the CI build so that master can be the baseline.

Thoughts?

MisinformedDNA commented 5 years ago

Well that's weird, when I ran the PR build with CI build as the baseline, it interpreted that as all the issues going away and then coming back.

image

Here's the log from the task:

SystemVssConnection exists true Validating build warnings policy... Counting warnings from tasks:

  • Build solution src/eCommerce.Web/eCommerce.Web.sln
  • Running MSBuild log analysis...
  • Total warnings: 109, Filtered warnings: 109 Total warnings: 109 Filtered warnings: 109 Found baseline build with ID 3072. Counting warnings from tasks:
  • Build solution
  • Running MSBuild log analysis...
  • Total warnings: 109, Filtered warnings: 109 Total warnings: 109 Filtered warnings: 109
ReneSchumacher commented 5 years ago

Hi Dan,

you're right, I always wanted to write proper documentation for this scenario and always had more urgent things to do :(

Adding the policy to your build for the master branch is correct. If possible, you should even use the same build defintion for CI and PR builds. If some of the steps in CI are not needed during PR, you can easily skip them using custom execution conditions based on the variable Build.SourceBranch or Build.SourceBranchName.

The behavior you're seeing now comes from a new feature we introduced in the last version. It groups warnings by task. Unfortunately, the only piece of information we can use to (hopefully properly) group warnings is the task display name. Since the display names of your build step in your CI and PR builds differ, the task simply assumes that youre now building something else. Just update the display name of one of the build so that both look the same (e.g., Build solution instead of Build solution src/eCommerce.Web/eCommerce.Web.sln) and it will work.

If that doesn't help or if you need anything else, just let me know.

Happy building! René

ReneSchumacher commented 5 years ago

Hey Dan,

I'm going to close this issue for now, as I didn't receive any new feedback. Please feel free to open another issue if you need more help.

Thanks, René

MisinformedDNA commented 5 years ago

Sorry. It's working great now!