MicrosoftPremier / VstsExtensions

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

Setting baseBranchRef: $(System.PullRequest.TargetBranch) from second run is not working as expected. #101

Closed rajanimail1 closed 4 years ago

rajanimail1 commented 4 years ago

Hello team,

As per the documentation https://github.com/MicrosoftPremier/VstsExtensions/blob/master/BuildQualityChecks/en-US/PullRequests.md, I would like to set base policy evaluation on pull request target branch. I set this as baseBranchRef: $(System.PullRequest.TargetBranch) In my case it will be 'refs/heads/master'.

IndividualCI (BuildID: 193342)

For the first PR(BuildID: 193372) here is the result. 'No baseline build for current branch found. Looking for builds on pull request target branch. Found baseline build with ID 193342'

For second PR(BuildID: 193376), here is the result. 'Found baseline build with ID 193372'

In the second PR I am expecting it to compare against BuildID 193342 but it compared with previous BuildId 193372.

I would like to compare the PRs always with target branch but seems like setting baseBranchRef to any particular branch from second run is not working as expected. It is executing in a default scenario.

Is this a bug?

Thanks, Rajani

ReneSchumacher commented 4 years ago

Hi @rajanimail1,

could you run the build again with the variable System.Debug set to true and send the log of the Build Quality Checks task to PSGerExtSupport@microsoft.com? I would like to take closer look at the variables in your build. The behavior you describe looks as if the variable $(System.PullRequest.TargetBranch) isn't set correctly or at least not the way we expect it. Do you have your code in Azure Repos or in GitHub?

Thanks, René

ReneSchumacher commented 4 years ago

Hi @rajanimail1,

as mentioned via email the issue is fixed in v7.2.1 that is currently being published to the marketplace.

Thanks for reporting the issue and happy building! René