2

I am trying to create a BitBucket hook that would get triggered when a PR is merged to one of the release branches. After that it would identify which release branches are newer, open a feature branch for each of the newer release branches. After, it would cherry-pick commits from the PR to each of the new feature branches. This is a similar workflow to Auto-Merge in BitBucket. Unfortunately automated merge doesn't work for our repository.

I am using Custom Hook in BitBucket setting it to trigger on PR merge. However I can't find any way to cherry-pick a commit using BitBucket Server API Neither do I see a way using BitBucket REST API

I don't even see a way to create a commit which could work, If I could provide a changeset.

The only way, I can figure out this can be done, is to use gitCommandBuilderFactory to checkout the repository and cherry-pick afterwards. But that seems like a very expensive operation for BitBucket server to run, especially if there are multiple release branches to work with.

  • This is exactly what the Automatic Merge feature in Bitbucket Server is for! Why is it not working for you? Probably if you're just careful about how you name the release branches it would work? Or do the auto-merges always have conflicts? – G. Sylvie Davies Sep 12 '19 at 04:26
  • Yes, that is the case with the repository. It is very big, with a high number of developers working on it. It is structured in a way that there are a lot of package.config type documents with numerical references that change multiple times during any given release. Each change like that usually causes a merge conflict. With a teem spanning over multiple international locations it can get difficult to resolve the conflicts. – Ivan Kolisnyk Sep 16 '19 at 13:01

0 Answers0