Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public void RegexIsRequired()
SetupConfigFileContent(text);
var ex = Should.Throw<ConfigurationException>(() => configProvider.Provide(repoPath));
ex.Message.ShouldBe($"Branch configuration 'bug' is missing required configuration 'regex'{System.Environment.NewLine}" +
"See https://gitversion.net/docs/configuration/ for more info");
"See https://gitversion.net/docs/configuration for more info");
}

[Test]
Expand All @@ -112,7 +112,7 @@ public void SourceBranchIsRequired()
SetupConfigFileContent(text);
var ex = Should.Throw<ConfigurationException>(() => configProvider.Provide(repoPath));
ex.Message.ShouldBe($"Branch configuration 'bug' is missing required configuration 'source-branches'{System.Environment.NewLine}" +
"See https://gitversion.net/docs/configuration/ for more info");
"See https://gitversion.net/docs/configuration for more info");
}

[Test(Description = "This test proves the configuration validation will fail early with a helpful message when a branch listed in source-branches has no configuration.")]
Expand All @@ -127,7 +127,7 @@ public void SourceBranchesValidationShouldFailWhenMatchingBranchConfigurationIsM
SetupConfigFileContent(text);
var ex = Should.Throw<ConfigurationException>(() => configProvider.Provide(repoPath));
ex.Message.ShouldBe($"Branch configuration 'bug' defines these 'source-branches' that are not configured: '[notconfigured]'{System.Environment.NewLine}" +
"See https://gitversion.net/docs/configuration/ for more info");
"See https://gitversion.net/docs/configuration for more info");
}

[Test(Description = "Well-known branches may not be present in the configuration file. This test confirms the validation check succeeds when the source-branches configuration contain these well-known branches.")]
Expand Down
6 changes: 3 additions & 3 deletions src/GitVersion.Core/Configuration/ConfigurationBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,18 +155,18 @@ private static void ValidateConfiguration(Config config)
var regex = branchConfig.Regex;
if (regex == null)
{
throw new ConfigurationException($"Branch configuration '{name}' is missing required configuration 'regex'{System.Environment.NewLine}" + "See https://gitversion.net/docs/configuration/ for more info");
throw new ConfigurationException($"Branch configuration '{name}' is missing required configuration 'regex'{System.Environment.NewLine}" + "See https://gitversion.net/docs/configuration for more info");
}

var sourceBranches = branchConfig.SourceBranches;
if (sourceBranches == null)
{
throw new ConfigurationException($"Branch configuration '{name}' is missing required configuration 'source-branches'{System.Environment.NewLine}" + "See https://gitversion.net/docs/configuration/ for more info");
throw new ConfigurationException($"Branch configuration '{name}' is missing required configuration 'source-branches'{System.Environment.NewLine}" + "See https://gitversion.net/docs/configuration for more info");
}

var missingSourceBranches = sourceBranches.Where(sb => !config.Branches.ContainsKey(sb)).ToArray();
if (missingSourceBranches.Any())
throw new ConfigurationException($"Branch configuration '{name}' defines these 'source-branches' that are not configured: '[{string.Join(",", missingSourceBranches)}]'{System.Environment.NewLine}" + "See https://gitversion.net/docs/configuration/ for more info");
throw new ConfigurationException($"Branch configuration '{name}' defines these 'source-branches' that are not configured: '[{string.Join(",", missingSourceBranches)}]'{System.Environment.NewLine}" + "See https://gitversion.net/docs/configuration for more info");
}
}

Expand Down