Closed
Description
GitVersion 5.6.5 fails to calculate a version for our latest merge to master. "An unexpected error occurred: GitVersion.Configuration.ConfigurationException: Branch configuration 'breaking' defines these 'source-branches' that are not configured: '[master]'".
Expected Behavior
GitVersion calculates a new version for the latest merge to master.
Actual Behavior
It fails to generate a version.
C:\buildAgent\work\8279e39e642aeaf7\MyProject\build\build.ps1 : INFO [02/08/21 9:24:27:82] Applicable
build agent found: 'TeamCity'.
INFO [02/08/21 9:24:27:86] Working directory: C:\buildAgent\work\8279e39e642aeaf7\MyProject\build
INFO [02/08/21 9:24:27:89] Branch from build environment: refs/heads/master
INFO [02/08/21 9:24:27:89] Project root is: C:\buildAgent\work\8279e39e642aeaf7\
INFO [02/08/21 9:24:27:89] DotGit directory is: C:\buildAgent\work\8279e39e642aeaf7\.git
INFO [02/08/21 9:24:27:89] Begin: Normalizing git directory for branch 'refs/heads/master'
INFO [02/08/21 9:24:27:94] One remote found (origin ->
'https://git-server/scm/MyProject.git').
INFO [02/08/21 9:24:27:94] Skipping fetching, if GitVersion does not calculate your version as expected you might
need to allow fetching or use dynamic repositories
INFO [02/08/21 9:24:27:95] Updating local branch master to point at 3deb3f6 Merge pull request #293 in
MyProject from feature/latest-feature to master
INFO [02/08/21 9:24:28:02] Skipping update of 'refs/remotes/origin/refactor/a-refactor' as it already
matches the remote ref.
INFO [02/08/21 9:24:28:02] Skipping update of 'refs/remotes/origin/spike/a-spike' as it already matches the
remote ref.
INFO [02/08/21 9:24:28:03] HEAD points at branch 'refs/heads/master'.
INFO [02/08/21 9:24:28:03] End: Normalizing git directory for branch 'refs/heads/master' (Took: 134.79ms)
INFO [02/08/21 9:24:28:05] Begin: Loading version variables from disk cache
INFO [02/08/21 9:24:28:05] Cache file
C:\buildAgent\work\8279e39e642aeaf7\.git\gitversion_cache\7286C5B59843A8EFFCC658F1495ED9B50FADA2E1.yml not found.
INFO [02/08/21 9:24:28:05] End: Loading version variables from disk cache (Took: 1.27ms)
ERROR [02/08/21 9:24:28:18] An unexpected error occurred:
GitVersion.Configuration.ConfigurationException: Branch configuration 'breaking' defines these 'source-branches' that
are not configured: '[master]'
See https://gitversion.net/docs/configuration for more info
at GitVersion.Configuration.ConfigurationBuilder.ValidateConfiguration(Config config)
at GitVersion.Configuration.ConfigurationBuilder.Build()
at GitVersion.Configuration.ConfigProvider.Provide(String workingDirectory, Config overrideConfig)
at GitVersion.Configuration.ConfigProvider.Provide(Config overrideConfig)
at GitVersion.GitVersionContextFactory.Create(GitVersionOptions gitVersionOptions)
at GitVersion.GitVersionCoreModule.<>c__DisplayClass0_0.<RegisterTypes>b__3()
at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
at System.Lazy`1.CreateValue()
at System.Lazy`1.get_Value()
at GitVersion.VersionCalculation.NextVersionCalculator.get_context()
at GitVersion.VersionCalculation.NextVersionCalculator.FindVersion()
at GitVersion.GitVersionCalculateTool.CalculateVersionVariables()
at GitVersion.GitVersionExecutor.RunGitVersionTool(GitVersionOptions gitVersionOptions)
INFO [02/08/21 9:24:28:18] Attempting to show the current git graph (please include in issue):
INFO [02/08/21 9:24:28:18] Showing max of 100 commits
INFO [02/08/21 9:24:28:41] * 3deb3f6 77 seconds ago (HEAD -> master, origin/master)
|\
| * 54d51b0 3 days ago
|/
* 0e71916 3 days ago (tag: 0.93.0)
|\
| * 04854f7 3 days ago
|/
* fe91a20 3 days ago (tag: 0.92.0)
|\
| * 378b105 3 days ago
| * c7ec444 3 days ago
|/
* 7ff164f 4 days ago (tag: 0.91.1)
Steps to Reproduce
Use this custom GitVersion configuration. Merge into master, attempt to calculate a new master version.
mode: Mainline
branches:
breaking:
regex: breaking[/]
mode: ContinuousDeployment
increment: Major
source-branches: ['master']
is-release-branch: false
feature:
regex: feature[/]
mode: ContinuousDeployment
increment: Minor
source-branches: ['master']
is-release-branch: false
bugfix:
regex: bugfix[/]
mode: ContinuousDeployment
increment: Patch
source-branches: ['master']
is-release-branch: false
refactor:
regex: refactor[/]
mode: ContinuousDeployment
increment: Patch
source-branches: ['master']
is-release-branch: false
ci:
regex: ci[/]
mode: ContinuousDeployment
increment: Patch
source-branches: ['master']
is-release-branch: false
ci:
regex: test[/]
mode: ContinuousDeployment
increment: Patch
source-branches: ['master']
is-release-branch: false
tag-prefix: 'v'
ignore:
sha: []
Context
Our master is always shippable so every merge must have a new release version. The custom configuration automatically generates a new version according to the prefix of the merged branch.
Your Environment
Using the GitVersion.CommandLine package on Windows. Fails on both CI Build on TeamCity and locally.