Cake Build Auto Merge Feature

I am using cakebuid as my build tool for TFS 2017 Update 2 and trying to implement traditional Git Flow . There are several automatic mergers in this thread that happen every time changes get to master , these changes should be distributed to the development branch . Using cakes, I can run a PowerShell script or use LibGit2Sharp to do an automatic merge for best case scenarios. But what about conflicts? Do I need to crash the whole assembly because the merge process is not working? We have something about merging in TFS, it is nothing but a Pull Request .

Question

Is there any tool or add-on for cake that allows me to create a Pull Request during the execution of the build step?

+4
source share
3 answers

Finally, I sometimes create a package:

Nuget: https://www.nuget.org/packages/Cake.Tfs.AutoMerge

GitHub: https://github.com/mabreuortega/Cake.Tfs

The way you can use it now is like this:

Task("Merge")
    .Does(c => {
        CreateAutoMergePullRequest(
            new AutoMergeSettings 
            {
                        // Required
                CollectionUri = "https://{instance}/{collection-name}",
                ProjectName = "project-name",
                RepositoryName = "repository-name",
                SourceBranch = "refs/heads/release/1.0.0",
                TargetBranch = "refs/heads/develop",
                Title = "[Auto Merge from Release]",

                        // Optional
                Description = "Brief description of the changes about to get merge",

                        // Control
                DeleteSourceBranch = false,
                SquashMerge = false,
                OverridePolicies = true,
                AutoComplete = true,
                AutoApprove = true
            });
    });

Any suggestions please use the GitHub tracker.

Hope this help!

0
source

I don’t think you have an add-on to create a transfer request, but since you can run PowerShell, you can easily use the TFS rest api to create a transfer request

https://www.visualstudio.com/en-us/docs/integrate/api/git/pull-requests/pull-requests

+2

, VSTS CLI:

https://blogs.msdn.microsoft.com/devops/2017/11/15/introducing-the-new-cli-for-vsts/

which includes the ability to create a transfer request:

https://docs.microsoft.com/en-gb/cli/vsts/get-started?view=vsts-cli-latest#create-a-pull-request

I don’t think it would be especially difficult to create a Cake Addin that wraps this tool and provides functionality through a set of add-ons.

At the same time, you can use this tool using the process aliases that currently exist in Cake.

+2
source

Source: https://habr.com/ru/post/1688645/


All Articles