dschuermans / TagBuildOnPathChangesExtension

VSTS / TFS build extension which allows you to tag your build for a given path filter(s)
MIT License
0 stars 2 forks source link

Suggestion: Use System.PullRequest.SourceBranch and System.PullRequest.TargetBranch #4

Open AJH16 opened 5 years ago

AJH16 commented 5 years ago

For use in PR workflows, it would be good to check the existence of System.PullRequest.SourceBranch and System.PullRequest.TargetBranch and use them rather than HEAD/HEAD~ for the file comparison to make sure that multi-commit pull requests are still captured properly.

dschuermans commented 5 years ago

Hey @AJH16

Again, makes sense to implement it as such.

I'll see if can make some time available to put in some more work on this.. I'm pretty swamped on a personal and professional level atm :/

AJH16 commented 5 years ago

I understand that. I wish I'd thought about it before I nuked my powershell script, but I would have had to jump through some hoops to get a release on the code since I developed my version of it on the clock. My employer is pretty good about that kind of thing, but still takes some effort.

For our needs, I ended up foregoing the powershell route entirely though and instead deployed a .Net Standard tool that is bundled in with my internal extension and called by a powershell script. I'm guessing it probably wouldn't work on an Azure build node, but it works great for on-prem and has way more capability for doing things like finding the last successful build on the given branch. Have to put a .Net Core installer on the pipeline before it runs to make sure Core is installed, but it handles all the deployment to the agents and works great.

I suppose it's probably possible to do the same in powershell, but it's way WAY past my powershell experience.