NeebletWorm
NeebletWorm

Reputation: 79

How do I create pull request using TFVC?

I have troubles figuring out how I can create pull request which can get declined or approved and immediately merged afterward.

I am using Azure DevOps.

I searched around but I can't seem to find anything (even on Microsoft's website) any help.

I am not using Git, instead, Team Foundation Version Control (TFVC).

I checked over there : https://learn.microsoft.com/en-us/azure/devops/repos/tfvc/?view=azure-devops

Still nothing. What am I missing ?

Upvotes: 3

Views: 1921

Answers (1)

jessehouwing
jessehouwing

Reputation: 115025

The concept of a Pull Request exists in Git only. These is no direct equivalent in TFVC. The recommendation would be to switch to Git if this is how you'd want to work. TFVC adds a lot of overhead to branching and doesn't support Pull Request and pull request validation using pipelines directly.

Closest you get is a Code Review request and a Shelveset build.

Instead of Checking in your code you can Request Review, which will open a Code Review work item and will create a Shelveset containing your changes.

Request Review in My Work

You can also request a code review on a not-yet checked-in merge. Which would be the closest to a pull-request, but having to create and manage branches that way in TFVC has far more overhead than in Git.

Then when the code review is approved, you can go ahead and directly commit the changes, or you could do a shelveset build by selecting your shelveset upon queuing. This will validate your changes without checking them in.

Run pipeline with shelveset

You can use the "Gated Checkin options" to only check in, but require the build to succeed on success:

enter image description here

You may need to use my TFVC Checkin task to perform the checkin upon a condition of your chosing.

enter image description here enter image description here

You can make that step conditional using the condition editor:

enter image description here

Upvotes: 7

Related Questions