Azure Pipelines - Pull Request Inheritance
See original GitHub issueI’m using a trunk-based branching strategy that I’m trying to version using the GitVersion@4 task in Azure Devops. All works perfectly fine when building off feature branches, but Pull Request builds don’t appear to be inheriting properly. The flow we have is: feature/bug -> PR -> master -> release
In the log I can see it’s using the feature/bug branch itself a base - should it not be the pull request branch?
branches:
feature:
mode: ContinuousDelivery
regex: feature[/-]
increment: Minor
tag: useBranchName
source-branches:
- develop
bug:
mode: ContinuousDelivery
regex: bug[/-]
increment: Patch
tag: useBranchName
source-branches:
- develop
develop:
mode: ContinuousDeployment
regex: master
is-source-branch-for:
- feature
- bug
master:
regex: none
release:
regex: release[/-]
tag: 'rc'
increment: Patch
source-branches:
- develop
2019-02-12T06:55:20.1541113Z INFO [02/12/19 6:55:20:15] Skipping fetching, if GitVersion does not calculate your version as expected you might need to allow fetching or use dynamic repositories
2019-02-12T06:55:20.1618952Z INFO [02/12/19 6:55:20:16] Creating local branch refs/heads/pull/47/merge pointing at 8c67860532d18571431936267369df202c5ca5cd
2019-02-12T06:55:20.2369132Z INFO [02/12/19 6:55:20:23] Skipping update of 'refs/remotes/origin/bug/MAA-132' as it already matches the remote ref.
2019-02-12T06:55:20.2394975Z INFO [02/12/19 6:55:20:23] Skipping update of 'refs/remotes/origin/features/PullRequestTest' as it already matches the remote ref.
2019-02-12T06:55:20.2424231Z INFO [02/12/19 6:55:20:24] Skipping update of 'refs/remotes/origin/master' as it already matches the remote ref.
2019-02-12T06:55:20.2455320Z INFO [02/12/19 6:55:20:24] Skipping update of 'refs/remotes/origin/releases/2.6.0' as it already matches the remote ref.
2019-02-12T06:55:20.2471394Z INFO [02/12/19 6:55:20:24] HEAD points at branch 'refs/heads/pull/47/merge'.
2019-02-12T06:55:20.2488407Z INFO [02/12/19 6:55:20:24] End: Normalizing git directory for branch 'refs/pull/47/merge' (Took: 622.39ms)
2019-02-12T06:55:20.2489447Z INFO [02/12/19 6:55:20:24] IsDynamicGitRepository: False
2019-02-12T06:55:20.2490902Z INFO [02/12/19 6:55:20:24] Returning Project Root from DotGitDirectory: /workspace/3/s/.git - /workspace/3/s
2019-02-12T06:55:20.2491523Z INFO [02/12/19 6:55:20:24] Project root is: /workspace/3/s
2019-02-12T06:55:20.2491664Z INFO [02/12/19 6:55:20:24] DotGit directory is: /workspace/3/s/.git
2019-02-12T06:55:20.3330331Z INFO [02/12/19 6:55:20:33] IsDynamicGitRepository: False
2019-02-12T06:55:20.3332671Z INFO [02/12/19 6:55:20:33] Returning Project Root from DotGitDirectory: /workspace/3/s/.git - /workspace/3/s
2019-02-12T06:55:20.3352748Z INFO [02/12/19 6:55:20:33] Begin: Loading version variables from disk cache
2019-02-12T06:55:20.3362024Z INFO [02/12/19 6:55:20:33] Cache file /workspace/3/s/.git/gitversion_cache/D9024F533F722C05B92F78C8F61F289F0A9FE0B2.yml not found.
2019-02-12T06:55:20.3362464Z INFO [02/12/19 6:55:20:33] End: Loading version variables from disk cache (Took: 0.92ms)
2019-02-12T06:55:20.3364513Z INFO [02/12/19 6:55:20:33] IsDynamicGitRepository: False
2019-02-12T06:55:20.3365209Z INFO [02/12/19 6:55:20:33] Returning Project Root from DotGitDirectory: /workspace/3/s/.git - /workspace/3/s
2019-02-12T06:55:20.5384237Z INFO [02/12/19 6:55:20:53] Using latest commit on specified branch
2019-02-12T06:55:20.5498945Z INFO [02/12/19 6:55:20:54] Begin: Attempting to inherit branch configuration from parent branch
2019-02-12T06:55:20.5621357Z INFO [02/12/19 6:55:20:56] HEAD is merge commit, this is likely a pull request using bug/MAA-132 as base
2019-02-12T06:55:20.6286815Z INFO [02/12/19 6:55:20:62] Begin: Finding branch source of 'bug/MAA-132'
2019-02-12T06:55:20.6417145Z INFO [02/12/19 6:55:20:64] Begin: Finding merge base between 'bug/MAA-132' and 'master'.
2019-02-12T06:55:20.6448661Z INFO [02/12/19 6:55:20:64] Found merge base of d126a3fec374f4f70695df90bde35d3f8f5d440b
2019-02-12T06:55:20.6530978Z INFO [02/12/19 6:55:20:65] Merge base of bug/MAA-132' and 'master is d126a3fec374f4f70695df90bde35d3f8f5d440b
2019-02-12T06:55:20.6531846Z INFO [02/12/19 6:55:20:65] End: Finding merge base between 'bug/MAA-132' and 'master'. (Took: 11.25ms)
2019-02-12T06:55:20.6540060Z INFO [02/12/19 6:55:20:65] Begin: Finding merge base between 'bug/MAA-132' and 'origin/master'.
2019-02-12T06:55:20.6540355Z INFO [02/12/19 6:55:20:65] Found merge base of d126a3fec374f4f70695df90bde35d3f8f5d440b
2019-02-12T06:55:20.6541092Z INFO [02/12/19 6:55:20:65] Merge base of bug/MAA-132' and 'origin/master is d126a3fec374f4f70695df90bde35d3f8f5d440b
2019-02-12T06:55:20.6541462Z INFO [02/12/19 6:55:20:65] End: Finding merge base between 'bug/MAA-132' and 'origin/master'. (Took: 0.21ms)
2019-02-12T06:55:20.7201226Z INFO [02/12/19 6:55:20:71] Multiple source branches have been found, picking the first one (master).
2019-02-12T06:55:20.7206831Z This may result in incorrect commit counting.
2019-02-12T06:55:20.7206996Z Options were:
2019-02-12T06:55:20.7207103Z master, origin/master
2019-02-12T06:55:20.7207643Z INFO [02/12/19 6:55:20:71] End: Finding branch source of 'bug/MAA-132' (Took: 91.56ms)
2019-02-12T06:55:20.7217200Z INFO [02/12/19 6:55:20:72] Begin: Getting branches containing the commit 'd126a3fec374f4f70695df90bde35d3f8f5d440b'.
2019-02-12T06:55:20.7217564Z INFO [02/12/19 6:55:20:72] Trying to find direct branches.
2019-02-12T06:55:20.7227208Z INFO [02/12/19 6:55:20:72] No direct branches found, searching through tracked branches.
...
2019-02-12T06:55:20.9184469Z INFO [02/12/19 6:55:20:91] Searching for commits reachable from 'master'.
2019-02-12T06:55:20.9185263Z INFO [02/12/19 6:55:20:91] The branch 'master' has a matching commit.
2019-02-12T06:55:20.9186533Z INFO [02/12/19 6:55:20:91] Searching for commits reachable from 'origin/master'.
2019-02-12T06:55:20.9187115Z INFO [02/12/19 6:55:20:91] The branch 'origin/master' has a matching commit.
2019-02-12T06:55:20.9188683Z INFO [02/12/19 6:55:20:91] End: Getting branches containing the commit 'd126a3fec374f4f70695df90bde35d3f8f5d440b'. (Took: 197.40ms)
2019-02-12T06:55:20.9191330Z INFO [02/12/19 6:55:20:91] Begin: Getting branches containing the commit '8c67860532d18571431936267369df202c5ca5cd'.
2019-02-12T06:55:20.9192356Z INFO [02/12/19 6:55:20:91] Trying to find direct branches.
2019-02-12T06:55:20.9192945Z INFO [02/12/19 6:55:20:91] No direct branches found, searching through tracked branches.
...
2019-02-12T06:55:21.0532772Z INFO [02/12/19 6:55:21:05] Searching for commits reachable from 'origin/master'.
2019-02-12T06:55:21.1170042Z INFO [02/12/19 6:55:21:11] The branch 'origin/master' has no matching commits.
2019-02-12T06:55:21.1170596Z INFO [02/12/19 6:55:21:11] End: Getting branches containing the commit '8c67860532d18571431936267369df202c5ca5cd'. (Took: 197.75ms)
2019-02-12T06:55:21.1197404Z INFO [02/12/19 6:55:21:11] Found possible parent branches: master, origin/master
2019-02-12T06:55:21.1244944Z WARN [02/12/19 6:55:21:12] Failed to inherit Increment branch configuration, ended up with: master, origin/master
Issue Analytics
- State:
- Created 5 years ago
- Comments:23 (10 by maintainers)
Top Results From Across the Web
Git branch policies and settings - Azure Repos
A branch that has required policies configured can't be deleted, and requires pull requests (PRs) for all changes.
Read more >Autocomplete work items with pull requests - Azure
The work item, whose work item type is managed with the Inheritance process model, is already in a State that belongs to the...
Read more >Ease customization by migrating projects to the Inheritance ...
You've been able to trigger a build based on a pull request (PR) and get that quick feedback before a merge for a...
Read more >Inheritance for the parameters defined in azure pipelines
I have multiple azure pipelines which have similar azure YAML files. The parameters defined in those YAML files are repetitive.
Read more >Azure DevOps - Inherit Development Links from Child to ...
Based on my understanding, you want parent work items to display builds and deployments tracked by child work items. Testing on my side, ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
We are seeing the same issue now with no configuration changes on our side. It only started recently.
I’ve just experienced a similar warning on a local build, directly in my VS2019 output (speaking of develop instead of master, but otherwise, same symptom). I have no GitVersion configuration at all. I do not have time right now to dig into this, but I’ll try to have a look anyway (my setup does not involve Azure DevOps, so should be easier to reproduce…)