Skip to content

[Bug] 5.6.5 Does not recognise master as a source-branch #2587

Closed

Description

@WesToleman

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.

Activity

  1. sairamb87 commented on Feb 8, 2021

    @sairamb87

    We are facing similar error as reported by WesToleman, today we are unable to generate a build using Azure Devops, and its failing across different branches while calculating the newer version

    Version: GitVersion.Tool 5.6.5 x64
    Build Agent: Azure DevOps

    ERROR [02/08/21 4:51:07:31] An unexpected error occurred:
    GitVersion.Configuration.ConfigurationException: Branch configuration 'bugfix' 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) in D:\a\GitVersion\GitVersion\src\GitVersion.Core\Configuration\ConfigurationBuilder.cs
    at GitVersion.Configuration.ConfigurationBuilder.Build() in D:\a\GitVersion\GitVersion\src\GitVersion.Core\Configuration\ConfigurationBuilder.cs
    at GitVersion.Configuration.ConfigProvider.Provide(String workingDirectory, Config overrideConfig) in D:\a\GitVersion\GitVersion\src\GitVersion.Core\Configuration\ConfigProvider.cs
    at GitVersion.Configuration.ConfigProvider.Provide(Config overrideConfig) in D:\a\GitVersion\GitVersion\src\GitVersion.Core\Configuration\ConfigProvider.cs
    at GitVersion.GitVersionContextFactory.Create(GitVersionOptions gitVersionOptions) in D:\a\GitVersion\GitVersion\src\GitVersion.Core\Core\GitVersionContextFactory.cs:line 30
    at GitVersion.GitVersionCoreModule.<>c__DisplayClass0_0.b__3() in D:\a\GitVersion\GitVersion\src\GitVersion.Core\GitVersionCoreModule.cs
    at System.Lazy1.ViaFactory(LazyThreadSafetyMode mode) at System.Lazy1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
    at System.Lazy1.CreateValue() at System.Lazy1.get_Value()

    ERROR [02/08/21 4:51:07:31] An unexpected error occurred:
    GitVersion.Configuration.ConfigurationException: Branch configuration 'bugfix' 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) in D:\a\GitVersion\GitVersion\src\GitVersion.Core\Configuration\ConfigurationBuilder.cs
    at GitVersion.Configuration.ConfigurationBuilder.Build() in D:\a\GitVersion\GitVersion\src\GitVersion.Core\Configuration\ConfigurationBuilder.cs
    at GitVersion.Configuration.ConfigProvider.Provide(String workingDirectory, Config overrideConfig) in D:\a\GitVersion\GitVersion\src\GitVersion.Core\Configuration\ConfigProvider.cs
    at GitVersion.Configuration.ConfigProvider.Provide(Config overrideConfig) in D:\a\GitVersion\GitVersion\src\GitVersion.Core\Configuration\ConfigProvider.cs
    at GitVersion.GitVersionContextFactory.Create(GitVersionOptions gitVersionOptions) in D:\a\GitVersion\GitVersion\src\GitVersion.Core\Core\GitVersionContextFactory.cs
    at GitVersion.GitVersionCoreModule.<>c__DisplayClass0_0.b__3() in D:\a\GitVersion\GitVersion\src\GitVersion.Core\GitVersionCoreModule.cs
    at System.Lazy1.ViaFactory(LazyThreadSafetyMode mode) at System.Lazy1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
    at System.Lazy1.CreateValue() at System.Lazy1.get_Value()
    at GitVersion.VersionCalculation.NextVersionCalculator.get_context() in D:\a\GitVersion\GitVersion\src\GitVersion.Core\VersionCalculation\NextVersionCalculator.cs
    at GitVersion.VersionCalculation.NextVersionCalculator.FindVersion() in D:\a\GitVersion\GitVersion\src\GitVersion.Core\VersionCalculation\NextVersionCalculator.cs
    at GitVersion.GitVersionCalculateTool.CalculateVersionVariables() in D:\a\GitVersion\GitVersion\src\GitVersion.Core\Core\GitVersionCalculateTool.cs
    at GitVersion.GitVersionExecutor.RunGitVersionTool(GitVersionOptions gitVersionOptions) in D:\a\GitVersion\GitVersion\src\GitVersion.App\GitVersionExecutor.cs
    at GitVersion.VersionCalculation.NextVersionCalculator.get_context() in D:\a\GitVersion\GitVersion\src\GitVersion.Core\VersionCalculation\NextVersionCalculator.cs
    at GitVersion.VersionCalculation.NextVersionCalculator.FindVersion() in D:\a\GitVersion\GitVersion\src\GitVersion.Core\VersionCalculation\NextVersionCalculator.cs:line 32
    at GitVersion.GitVersionCalculateTool.CalculateVersionVariables() in D:\a\GitVersion\GitVersion\src\GitVersion.Core\Core\GitVersionCalculateTool.cs
    at GitVersion.GitVersionExecutor.RunGitVersionTool(GitVersionOptions gitVersionOptions) in D:\a\GitVersion\GitVersion\src\GitVersion.App\GitVersionExecutor.cs
    INFO [02/08/21 4:51:07:31] Attempting to show the current git graph (please include in issue):
    INFO [02/08/21 4:51:07:31] Showing max of 100 commits

  2. lankaapura commented on Feb 8, 2021

    @lankaapura

    We are also facing the same issue, and 5.6.4 seems to be working.

    @sairamb87 you can update the pipeline step to use exact version until we have a fix.

    image

  3. sairamb87 commented on Feb 8, 2021

    @sairamb87

    We are also facing the same issue, and 5.6.4 seems to be working.

    @sairamb87 you can update the pipeline step to use exact version until we have a fix.

    image

    @lankaapura, Thank you 👍

    Yes, 5.6.4 is working fine, and we have already updated our pipelines to use this version, until we get a fix for 5.6.5

  4. self-assigned this
    on Feb 8, 2021
  5. asbjornu commented on Feb 8, 2021

    @asbjornu
    Member

    I assume this is related to #2573.

  6. arturcic commented on Feb 8, 2021

    @arturcic
    Member

    Yes, working on it

  7. added 4 commits that reference this issue on Feb 8, 2021
  8. added 2 commits that reference this issue on Feb 8, 2021
  9. added this to the 5.6.6 milestone on Feb 8, 2021
  10. lankaapura commented on Feb 8, 2021

    @lankaapura

    Thanks @arturcic for getting it fixed fast 👍 when can we expect the new release/patch?

  11. github-actions commented on Feb 8, 2021

    @github-actions

    🎉 This issue has been resolved in version 5.6.6 🎉
    The release is available on:

    Your GitReleaseManager bot 📦🚀

  12. arturcic commented on Feb 8, 2021

    @arturcic
    Member

    Can you all confirm it is fixed?

  13. sairamb87 commented on Feb 8, 2021

    @sairamb87

    Can you all confirm it is fixed?

    @arturcic Thanks for resolving this issue, 5.6.6 version is working as expected 👍

  14. arturcic commented on Feb 8, 2021

    @arturcic
    Member

    @sairamb87 thanks for the confirmation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions