From 2341c02f64832e0ad8259cb8add3934a03d9eb52 Mon Sep 17 00:00:00 2001 From: Artur Stolear Date: Fri, 25 Apr 2025 14:12:39 +0200 Subject: [PATCH 01/35] Update GitVersion schemas Changed the Dependabot commit-message prefix from "(deps)" to "(sdk)" for improved clarity. Added GitVersion configuration and output schemas (6.3) to define and validate versioning rules and outputs within the project. --- .github/dependabot.yml | 2 +- schemas/6.3/GitVersion.configuration.json | 426 ++++++++++++++++++++++ schemas/6.3/GitVersion.json | 184 ++++++++++ 3 files changed, 611 insertions(+), 1 deletion(-) create mode 100644 schemas/6.3/GitVersion.configuration.json create mode 100644 schemas/6.3/GitVersion.json diff --git a/.github/dependabot.yml b/.github/dependabot.yml index db3877003d..d770a0b0e4 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,7 +4,7 @@ updates: labels: - "dependencies" commit-message: - prefix: "(deps)" + prefix: "(sdk)" directory: "/" schedule: interval: daily diff --git a/schemas/6.3/GitVersion.configuration.json b/schemas/6.3/GitVersion.configuration.json new file mode 100644 index 0000000000..9681e070f1 --- /dev/null +++ b/schemas/6.3/GitVersion.configuration.json @@ -0,0 +1,426 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://gitversion.net/schemas/6.3/GitVersion.configuration.json", + "title": "GitVersion Configuration (6.3)", + "description": "GitVersion configuration schema (6.3)", + "type": "object", + "properties": { + "assembly-file-versioning-format": { + "description": "Specifies the format of AssemblyFileVersion and overwrites the value of assembly-file-versioning-scheme.", + "type": [ + "string", + "null" + ] + }, + "assembly-file-versioning-scheme": { + "description": "The scheme to use when setting AssemblyFileVersion attribute. Can be 'MajorMinorPatchTag', 'MajorMinorPatch', 'MajorMinor', 'Major', 'None'. Defaults to 'MajorMinorPatch'.", + "default": "MajorMinorPatch", + "enum": [ + "MajorMinorPatchTag", + "MajorMinorPatch", + "MajorMinor", + "Major", + "None", + null + ] + }, + "assembly-informational-format": { + "description": "Specifies the format of AssemblyInformationalVersion. Defaults to '{InformationalVersion}'.", + "default": "'{InformationalVersion}'", + "type": [ + "string", + "null" + ] + }, + "assembly-versioning-format": { + "description": "Specifies the format of AssemblyVersion and overwrites the value of assembly-versioning-scheme.", + "type": [ + "string", + "null" + ] + }, + "assembly-versioning-scheme": { + "description": "The scheme to use when setting AssemblyVersion attribute. Can be 'MajorMinorPatchTag', 'MajorMinorPatch', 'MajorMinor', 'Major', 'None'. Defaults to 'MajorMinorPatch'.", + "default": "MajorMinorPatch", + "enum": [ + "MajorMinorPatchTag", + "MajorMinorPatch", + "MajorMinor", + "Major", + "None", + null + ] + }, + "branches": { + "description": "The header for all the individual branch configuration.", + "type": "object", + "additionalProperties": { + "type": "object", + "properties": { + "commit-message-incrementing": { + "description": "Sets whether it should be possible to increment the version with special syntax in the commit message. Can be 'Disabled', 'Enabled' or 'MergeMessageOnly'.", + "enum": [ + "Enabled", + "Disabled", + "MergeMessageOnly", + null + ] + }, + "mode": { + "description": "The deployment mode for this branch. Can be 'ManualDeployment', 'ContinuousDelivery', 'ContinuousDeployment'.", + "enum": [ + "ManualDeployment", + "ContinuousDelivery", + "ContinuousDeployment", + null + ] + }, + "increment": { + "description": "The increment strategy for this branch. Can be 'Inherit', 'Patch', 'Minor', 'Major', 'None'.", + "$ref": "#/$defs/incrementStrategy" + }, + "is-main-branch": { + "description": "When using Mainline mode, this indicates that this branch is a mainline. By default main and support/* are mainlines.", + "type": [ + "boolean", + "null" + ] + }, + "is-release-branch": { + "description": "Indicates this branch configuration represents a release branch in GitFlow.", + "type": [ + "boolean", + "null" + ] + }, + "is-source-branch-for": { + "description": "The branches that this branch is a source branch.", + "$ref": "#/$defs/hashSetOfString" + }, + "label": { + "description": "The label to use for this branch. Use the value {BranchName} or similar as a placeholder to insert a named capture group from RegularExpression (fx. the branch name).", + "type": [ + "string", + "null" + ] + }, + "pre-release-weight": { + "description": "Provides a way to translate the PreReleaseLabel to a number.", + "type": [ + "integer", + "null" + ] + }, + "prevent-increment": { + "description": "The prevent increment configuration section.", + "$ref": "#/$defs/preventIncrementConfiguration" + }, + "regex": { + "format": "regex", + "description": "The regular expression pattern to use to match this branch.", + "type": [ + "string", + "null" + ] + }, + "source-branches": { + "description": "The source branches for this branch.", + "$ref": "#/$defs/hashSetOfString" + }, + "track-merge-message": { + "description": "This property is a branch related property and gives the user the possibility to control the behavior of whether the merge commit message will be interpreted as a next version or not.", + "type": [ + "boolean", + "null" + ] + }, + "track-merge-target": { + "description": "Strategy which will look for tagged merge commits directly off the current branch.", + "type": [ + "boolean", + "null" + ] + }, + "tracks-release-branches": { + "description": "Indicates this branch configuration represents develop in GitFlow.", + "type": [ + "boolean", + "null" + ] + } + } + } + }, + "commit-date-format": { + "description": "The format to use when calculating the commit date. Defaults to 'yyyy-MM-dd'. See [Standard Date and Time Format Strings](https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings) and [Custom Date and Time Format Strings](https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings).", + "default": "yyyy-MM-dd", + "type": [ + "string", + "null" + ] + }, + "commit-message-incrementing": { + "description": "Sets whether it should be possible to increment the version with special syntax in the commit message. Can be 'Disabled', 'Enabled' or 'MergeMessageOnly'.", + "enum": [ + "Enabled", + "Disabled", + "MergeMessageOnly", + null + ] + }, + "mode": { + "description": "The deployment mode for this branch. Can be 'ManualDeployment', 'ContinuousDelivery', 'ContinuousDeployment'.", + "enum": [ + "ManualDeployment", + "ContinuousDelivery", + "ContinuousDeployment", + null + ] + }, + "ignore": { + "description": "The header property for the ignore configuration.", + "type": "object", + "properties": { + "commits-before": { + "format": "date-time", + "description": "Commits before this date will be ignored. Format: yyyy-MM-ddTHH:mm:ss.", + "type": [ + "string", + "null" + ] + }, + "sha": { + "description": "A sequence of SHAs to be excluded from the version calculations.", + "$ref": "#/$defs/hashSetOfString" + } + } + }, + "increment": { + "description": "The increment strategy for this branch. Can be 'Inherit', 'Patch', 'Minor', 'Major', 'None'.", + "$ref": "#/$defs/incrementStrategy" + }, + "is-main-branch": { + "description": "When using Mainline mode, this indicates that this branch is a mainline. By default main and support/* are mainlines.", + "type": [ + "boolean", + "null" + ] + }, + "is-release-branch": { + "description": "Indicates this branch configuration represents a release branch in GitFlow.", + "type": [ + "boolean", + "null" + ] + }, + "is-source-branch-for": { + "description": "The branches that this branch is a source branch.", + "$ref": "#/$defs/hashSetOfString" + }, + "label": { + "description": "The label to use for this branch. Use the value {BranchName} or similar as a placeholder to insert a named capture group from RegularExpression (fx. the branch name).", + "type": [ + "string", + "null" + ] + }, + "major-version-bump-message": { + "format": "regex", + "description": "The regular expression to match commit messages with to perform a major version increment. Defaults to '\\+semver:\\s?(breaking|major)'", + "default": "\\+semver:\\s?(breaking|major)", + "type": [ + "string", + "null" + ] + }, + "merge-message-formats": { + "description": "Custom merge message formats to enable identification of merge messages that do not follow the built-in conventions.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "minor-version-bump-message": { + "format": "regex", + "description": "The regular expression to match commit messages with to perform a minor version increment. Defaults to '\\+semver:\\s?(feature|minor)'", + "default": "\\+semver:\\s?(feature|minor)", + "type": [ + "string", + "null" + ] + }, + "next-version": { + "description": "Allows you to bump the next version explicitly. Useful for bumping main or a feature branch with breaking changes", + "type": [ + "string", + "null" + ] + }, + "no-bump-message": { + "format": "regex", + "description": "Used to tell GitVersion not to increment when in Mainline development mode. Defaults to '\\+semver:\\s?(none|skip)'", + "default": "\\+semver:\\s?(none|skip)", + "type": [ + "string", + "null" + ] + }, + "patch-version-bump-message": { + "format": "regex", + "description": "The regular expression to match commit messages with to perform a patch version increment. Defaults to '\\+semver:\\s?(fix|patch)'", + "default": "\\+semver:\\s?(fix|patch)", + "type": [ + "string", + "null" + ] + }, + "pre-release-weight": { + "description": "Provides a way to translate the PreReleaseLabel to a number.", + "type": [ + "integer", + "null" + ] + }, + "prevent-increment": { + "description": "The prevent increment configuration section.", + "$ref": "#/$defs/preventIncrementConfiguration" + }, + "regex": { + "format": "regex", + "description": "The regular expression pattern to use to match this branch.", + "type": [ + "string", + "null" + ] + }, + "semantic-version-format": { + "description": "Specifies the semantic version format that is used when parsing the string. Can be 'Strict' or 'Loose'. Defaults to 'Strict'.", + "default": "Strict", + "enum": [ + "Strict", + "Loose" + ] + }, + "source-branches": { + "description": "The source branches for this branch.", + "$ref": "#/$defs/hashSetOfString" + }, + "tag-prefix": { + "format": "regex", + "description": "A regular expression which is used to trim Git tags before processing. Defaults to '[vV]?'", + "default": "[vV]?", + "type": [ + "string", + "null" + ] + }, + "tag-pre-release-weight": { + "description": "The pre-release weight in case of tagged commits. Defaults to 60000.", + "type": [ + "integer", + "null" + ] + }, + "track-merge-message": { + "description": "This property is a branch related property and gives the user the possibility to control the behavior of whether the merge commit message will be interpreted as a next version or not.", + "type": [ + "boolean", + "null" + ] + }, + "track-merge-target": { + "description": "Strategy which will look for tagged merge commits directly off the current branch.", + "type": [ + "boolean", + "null" + ] + }, + "tracks-release-branches": { + "description": "Indicates this branch configuration represents develop in GitFlow.", + "type": [ + "boolean", + "null" + ] + }, + "update-build-number": { + "description": "Whether to update the build number in the project file. Defaults to true.", + "default": "true", + "type": "boolean" + }, + "version-in-branch-pattern": { + "format": "regex", + "description": "A regular expression which is used to determine the version number in the branch name or commit message (e.g., v1.0.0-LTS). Defaults to '(?[vV]?\\d+(\\.\\d+)?(\\.\\d+)?).*'.", + "default": "(?[vV]?\\d+(\\.\\d+)?(\\.\\d+)?).*", + "type": [ + "string", + "null" + ] + }, + "strategies": { + "description": "Specifies which version strategies (one or more) will be used to determine the next version. Following values are available: 'ConfiguredNextVersion', 'MergeMessage', 'TaggedCommit', 'TrackReleaseBranches', 'VersionInBranchName' and 'Mainline'.", + "type": "array", + "items": { + "enum": [ + "None", + "Fallback", + "ConfiguredNextVersion", + "MergeMessage", + "TaggedCommit", + "TrackReleaseBranches", + "VersionInBranchName", + "Mainline" + ] + } + }, + "workflow": { + "description": "The base template of the configuration to use. Possible values are: 'GitFlow/v1' or 'GitHubFlow/v1'", + "type": [ + "string", + "null" + ] + } + }, + "$defs": { + "incrementStrategy": { + "enum": [ + "None", + "Major", + "Minor", + "Patch", + "Inherit" + ] + }, + "hashSetOfString": { + "type": "array", + "items": { + "type": "string" + } + }, + "preventIncrementConfiguration": { + "type": "object", + "properties": { + "of-merged-branch": { + "description": "Prevent increment when branch merged.", + "type": [ + "boolean", + "null" + ] + }, + "when-branch-merged": { + "description": "Prevent increment when branch merged.", + "type": [ + "boolean", + "null" + ] + }, + "when-current-commit-tagged": { + "description": "This branch related property controls the behavior whether to use the tagged (value set to true) or the incremented (value set to false) semantic version. Defaults to true.", + "type": [ + "boolean", + "null" + ] + } + } + } + } +} \ No newline at end of file diff --git a/schemas/6.3/GitVersion.json b/schemas/6.3/GitVersion.json new file mode 100644 index 0000000000..80cd006aec --- /dev/null +++ b/schemas/6.3/GitVersion.json @@ -0,0 +1,184 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://gitversion.net/schemas/6.3/GitVersion.json", + "title": "GitVersion version variables output", + "description": "GitVersion output schema", + "type": "object", + "properties": { + "AssemblySemFileVer": { + "description": "Suitable for .NET AssemblyFileVersion. Defaults to Major.Minor.Patch.0.", + "type": [ + "string", + "null" + ] + }, + "AssemblySemVer": { + "description": "Suitable for .NET AssemblyVersion. Defaults to Major.Minor.0.0", + "type": [ + "string", + "null" + ] + }, + "BranchName": { + "description": "The name of the checked out Git branch.", + "type": [ + "string", + "null" + ] + }, + "BuildMetaData": { + "description": "The build metadata, usually representing number of commits since the VersionSourceSha.", + "type": [ + "integer", + "null" + ] + }, + "CommitDate": { + "description": "The ISO-8601 formatted date of the commit identified by Sha.", + "type": [ + "string", + "null" + ] + }, + "CommitsSinceVersionSource": { + "description": "The number of commits since the version source.", + "type": [ + "integer", + "null" + ] + }, + "EscapedBranchName": { + "description": "Equal to BranchName, but with / replaced with -.", + "type": [ + "string", + "null" + ] + }, + "FullBuildMetaData": { + "description": "The BuildMetaData suffixed with BranchName and Sha.", + "type": [ + "string", + "null" + ] + }, + "FullSemVer": { + "description": "The full, SemVer 2.0 compliant version number.", + "type": [ + "string", + "null" + ] + }, + "InformationalVersion": { + "description": "Suitable for .NET AssemblyInformationalVersion. Defaults to FullSemVer suffixed by FullBuildMetaData.", + "type": [ + "string", + "null" + ] + }, + "Major": { + "description": "The major version. Should be incremented on breaking changes.", + "type": [ + "integer", + "null" + ] + }, + "MajorMinorPatch": { + "description": "Major, Minor and Patch joined together, separated by '.'.", + "type": [ + "string", + "null" + ] + }, + "Minor": { + "description": "The minor version. Should be incremented on new features.", + "type": [ + "integer", + "null" + ] + }, + "Patch": { + "description": "The patch version. Should be incremented on bug fixes.", + "type": [ + "integer", + "null" + ] + }, + "PreReleaseLabel": { + "description": "The pre-release label is the name of the pre-release.", + "type": [ + "string", + "null" + ] + }, + "PreReleaseLabelWithDash": { + "description": "The pre-release label prefixed with a dash.", + "type": [ + "string", + "null" + ] + }, + "PreReleaseNumber": { + "description": "The pre-release number is the number of commits since the last version bump.", + "type": [ + "integer", + "null" + ] + }, + "PreReleaseTag": { + "description": "The pre-release tag is the pre-release label suffixed by the PreReleaseNumber.", + "type": [ + "string", + "null" + ] + }, + "PreReleaseTagWithDash": { + "description": "The pre-release tag prefixed with a dash.", + "type": [ + "string", + "null" + ] + }, + "SemVer": { + "description": "The semantic version number, including PreReleaseTagWithDash for pre-release version numbers.", + "type": [ + "string", + "null" + ] + }, + "Sha": { + "description": "The SHA of the Git commit.", + "type": [ + "string", + "null" + ] + }, + "ShortSha": { + "description": "The Sha limited to 7 characters.", + "type": [ + "string", + "null" + ] + }, + "UncommittedChanges": { + "description": "The number of uncommitted changes present in the repository.", + "type": [ + "integer", + "null" + ] + }, + "VersionSourceSha": { + "description": "The SHA of the commit used as version source.", + "type": [ + "string", + "null" + ] + }, + "WeightedPreReleaseNumber": { + "description": "A summation of branch specific pre-release-weight and the PreReleaseNumber. Can be used to obtain a monotonically increasing version number across the branches.", + "type": [ + "integer", + "null" + ] + } + } +} \ No newline at end of file From 3de9326592015a90ea1006555c77da101e32d0bc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 25 Apr 2025 15:47:35 +0000 Subject: [PATCH 02/35] (deps): Bump System.CommandLine Bumps the microsoft group with 1 update in the /new-cli directory: [System.CommandLine](https://github.com/dotnet/dotnet). Updates `System.CommandLine` from 2.0.0-beta5.25224.107 to 2.0.0-beta5.25225.101 - [Release notes](https://github.com/dotnet/dotnet/releases) - [Commits](https://github.com/dotnet/dotnet/commits) --- updated-dependencies: - dependency-name: System.CommandLine dependency-version: 2.0.0-beta5.25225.101 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: microsoft ... Signed-off-by: dependabot[bot] --- new-cli/Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/new-cli/Directory.Packages.props b/new-cli/Directory.Packages.props index 747f4524bc..40bb320506 100644 --- a/new-cli/Directory.Packages.props +++ b/new-cli/Directory.Packages.props @@ -20,7 +20,7 @@ - + From c11cd7ae66ac05703989d63ffc27e3ccd00cc82c Mon Sep 17 00:00:00 2001 From: Artur Stolear Date: Fri, 25 Apr 2025 17:14:23 +0200 Subject: [PATCH 03/35] refactor: update remote branch handling in tests --- .../Extensions/GitRepositoryTestingExtensions.cs | 15 +++++++++++++++ .../IntegrationTests/RemoteRepositoryScenarios.cs | 7 +------ .../VersionInCurrentBranchNameScenarios.cs | 6 +----- .../VersionInMergedBranchNameScenarios.cs | 6 +----- ...VersionInBranchNameBaseVersionStrategyTests.cs | 6 +----- 5 files changed, 19 insertions(+), 21 deletions(-) diff --git a/src/GitVersion.Core.Tests/Extensions/GitRepositoryTestingExtensions.cs b/src/GitVersion.Core.Tests/Extensions/GitRepositoryTestingExtensions.cs index b9982f9d47..1570e7bf58 100644 --- a/src/GitVersion.Core.Tests/Extensions/GitRepositoryTestingExtensions.cs +++ b/src/GitVersion.Core.Tests/Extensions/GitRepositoryTestingExtensions.cs @@ -65,6 +65,21 @@ public static void DumpGraph(this IGitRepository repository, Action? wri public static void DumpGraph(this IRepository repository, Action? writer = null, int? maxCommits = null) => DumpGraph(repository.ToGitRepository().Path, writer, maxCommits); + public static void RenameRemote(this LibGit2Sharp.RemoteCollection remotes, string oldName, string newName) + { + if (oldName.IsEquivalentTo(newName)) return; + if (remotes.Any(remote => remote.Name == newName)) + { + throw new InvalidOperationException($"A remote with the name '{newName}' already exists."); + } + if (!remotes.Any(remote => remote.Name == oldName)) + { + throw new InvalidOperationException($"A remote with the name '{oldName}' does not exist."); + } + remotes.Add(newName, remotes[oldName].Url); + remotes.Remove(oldName); + } + public static GitVersionVariables GetVersion(this RepositoryFixtureBase fixture, IGitVersionConfiguration? configuration = null, IRepository? repository = null, string? commitId = null, bool onlyTrackedBranches = true, string? targetBranch = null) { diff --git a/src/GitVersion.Core.Tests/IntegrationTests/RemoteRepositoryScenarios.cs b/src/GitVersion.Core.Tests/IntegrationTests/RemoteRepositoryScenarios.cs index e2720e37da..af76ec7acd 100644 --- a/src/GitVersion.Core.Tests/IntegrationTests/RemoteRepositoryScenarios.cs +++ b/src/GitVersion.Core.Tests/IntegrationTests/RemoteRepositoryScenarios.cs @@ -142,17 +142,12 @@ private static void CopyRemoteBranchesToHeads(Repository repository) [TestCase("custom", "release/3.0.0", "0.1.0-alpha.5")] public void EnsureRemoteReleaseBranchesAreTracked(string origin, string branchName, string expectedVersion) { - if (SysEnv.OSVersion.Platform == PlatformID.Win32NT) - { - Assert.Ignore("Test ignored on Windows - LibGitSharp 0.31.0 fails"); - } - using var fixture = new RemoteRepositoryFixture("develop"); fixture.CreateBranch(branchName); fixture.MakeACommit(); - if (origin != "origin") fixture.LocalRepositoryFixture.Repository.Network.Remotes.Rename("origin", origin); + if (origin != "origin") fixture.LocalRepositoryFixture.Repository.Network.Remotes.RenameRemote("origin", origin); fixture.LocalRepositoryFixture.Fetch(origin); fixture.LocalRepositoryFixture.Checkout("develop"); diff --git a/src/GitVersion.Core.Tests/IntegrationTests/VersionInCurrentBranchNameScenarios.cs b/src/GitVersion.Core.Tests/IntegrationTests/VersionInCurrentBranchNameScenarios.cs index 51548c6cf8..387559ff4e 100644 --- a/src/GitVersion.Core.Tests/IntegrationTests/VersionInCurrentBranchNameScenarios.cs +++ b/src/GitVersion.Core.Tests/IntegrationTests/VersionInCurrentBranchNameScenarios.cs @@ -54,12 +54,8 @@ public void TakesVersionFromNameOfRemoteReleaseBranchInOrigin() [Test] public void DoesNotTakeVersionFromNameOfRemoteReleaseBranchInCustomRemote() { - if (SysEnv.OSVersion.Platform == PlatformID.Win32NT) - { - Assert.Ignore("Test ignored on Windows - LibGitSharp 0.31.0 fails"); - } using var fixture = new RemoteRepositoryFixture(); - fixture.LocalRepositoryFixture.Repository.Network.Remotes.Rename("origin", "upstream"); + fixture.LocalRepositoryFixture.Repository.Network.Remotes.RenameRemote("origin", "upstream"); fixture.BranchTo("release/2.0.0"); fixture.MakeACommit(); Commands.Fetch(fixture.LocalRepositoryFixture.Repository, fixture.LocalRepositoryFixture.Repository.Network.Remotes.First().Name, [], new(), null); diff --git a/src/GitVersion.Core.Tests/IntegrationTests/VersionInMergedBranchNameScenarios.cs b/src/GitVersion.Core.Tests/IntegrationTests/VersionInMergedBranchNameScenarios.cs index a36baccecc..8da8e0ce2c 100644 --- a/src/GitVersion.Core.Tests/IntegrationTests/VersionInMergedBranchNameScenarios.cs +++ b/src/GitVersion.Core.Tests/IntegrationTests/VersionInMergedBranchNameScenarios.cs @@ -70,12 +70,8 @@ public void TakesVersionFromNameOfRemoteReleaseBranchInOrigin() [Test] public void DoesNotTakeVersionFromNameOfRemoteReleaseBranchInCustomRemote() { - if (SysEnv.OSVersion.Platform == PlatformID.Win32NT) - { - Assert.Ignore("Test ignored on Windows - LibGitSharp 0.31.0 fails"); - } using var fixture = new RemoteRepositoryFixture(); - fixture.LocalRepositoryFixture.Repository.Network.Remotes.Rename("origin", "upstream"); + fixture.LocalRepositoryFixture.Repository.Network.Remotes.RenameRemote("origin", "upstream"); fixture.BranchTo("release/2.0.0"); fixture.MakeACommit(); fixture.LocalRepositoryFixture.Fetch("upstream"); diff --git a/src/GitVersion.Core.Tests/VersionCalculation/Strategies/VersionInBranchNameBaseVersionStrategyTests.cs b/src/GitVersion.Core.Tests/VersionCalculation/Strategies/VersionInBranchNameBaseVersionStrategyTests.cs index 4d53a8b07c..868baca593 100644 --- a/src/GitVersion.Core.Tests/VersionCalculation/Strategies/VersionInBranchNameBaseVersionStrategyTests.cs +++ b/src/GitVersion.Core.Tests/VersionCalculation/Strategies/VersionInBranchNameBaseVersionStrategyTests.cs @@ -98,14 +98,10 @@ public void CanTakeVersionFromNameOfConfiguredReleaseBranch(string branchName, s [TestCase("origin", "release/3.0.0", "3.0.0")] public void CanTakeVersionFromNameOfRemoteReleaseBranch(string origin, string branchName, string expectedBaseVersion) { - if (SysEnv.OSVersion.Platform == PlatformID.Win32NT) - { - Assert.Ignore("Test ignored on Windows - LibGitSharp 0.31.0 fails"); - } using var fixture = new RemoteRepositoryFixture(); fixture.CreateBranch(branchName); - if (origin != "origin") fixture.LocalRepositoryFixture.Repository.Network.Remotes.Rename("origin", origin); + if (origin != "origin") fixture.LocalRepositoryFixture.Repository.Network.Remotes.RenameRemote("origin", origin); fixture.LocalRepositoryFixture.Fetch(origin); var localRepository = fixture.LocalRepositoryFixture.Repository.ToGitRepository(); From 843d43bdff4390d5ff063935724a975c48272e62 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Apr 2025 17:02:02 +0000 Subject: [PATCH 04/35] (deps): Bump System.CommandLine Bumps the microsoft group with 1 update in the /new-cli directory: [System.CommandLine](https://github.com/dotnet/dotnet). Updates `System.CommandLine` from 2.0.0-beta5.25225.101 to 2.0.0-beta5.25227.104 - [Release notes](https://github.com/dotnet/dotnet/releases) - [Commits](https://github.com/dotnet/dotnet/commits) --- updated-dependencies: - dependency-name: System.CommandLine dependency-version: 2.0.0-beta5.25227.104 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: microsoft ... Signed-off-by: dependabot[bot] --- new-cli/Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/new-cli/Directory.Packages.props b/new-cli/Directory.Packages.props index 40bb320506..4d7fa52d1a 100644 --- a/new-cli/Directory.Packages.props +++ b/new-cli/Directory.Packages.props @@ -20,7 +20,7 @@ - + From 645b94464f90c641a47d09cb82c220b1c436aa1c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Apr 2025 17:30:52 +0000 Subject: [PATCH 05/35] (deps): Bump Serilog.Sinks.File Bumps the serilog group with 1 update in the /new-cli directory: [Serilog.Sinks.File](https://github.com/serilog/serilog-sinks-file). Updates `Serilog.Sinks.File` from 6.0.0 to 7.0.0 - [Release notes](https://github.com/serilog/serilog-sinks-file/releases) - [Changelog](https://github.com/serilog/serilog-sinks-file/blob/dev/CHANGES.md) - [Commits](https://github.com/serilog/serilog-sinks-file/compare/v6.0.0...v7.0.0) --- updated-dependencies: - dependency-name: Serilog.Sinks.File dependency-version: 7.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: serilog ... Signed-off-by: dependabot[bot] --- new-cli/Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/new-cli/Directory.Packages.props b/new-cli/Directory.Packages.props index 4d7fa52d1a..75ac4102ff 100644 --- a/new-cli/Directory.Packages.props +++ b/new-cli/Directory.Packages.props @@ -18,7 +18,7 @@ - + From 8e1f1a987d659f6f9eefe31f533a815a73488935 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 29 Apr 2025 16:04:17 +0000 Subject: [PATCH 06/35] (deps): Bump System.CommandLine Bumps the microsoft group with 1 update in the /new-cli directory: [System.CommandLine](https://github.com/dotnet/dotnet). Updates `System.CommandLine` from 2.0.0-beta5.25227.104 to 2.0.0-beta5.25228.110 - [Release notes](https://github.com/dotnet/dotnet/releases) - [Commits](https://github.com/dotnet/dotnet/commits) --- updated-dependencies: - dependency-name: System.CommandLine dependency-version: 2.0.0-beta5.25228.110 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: microsoft ... Signed-off-by: dependabot[bot] --- new-cli/Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/new-cli/Directory.Packages.props b/new-cli/Directory.Packages.props index 75ac4102ff..49efcead58 100644 --- a/new-cli/Directory.Packages.props +++ b/new-cli/Directory.Packages.props @@ -20,7 +20,7 @@ - + From 291a5c976b864009bed2e833a2311c7d77af0f2f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 30 Apr 2025 15:51:58 +0000 Subject: [PATCH 07/35] (deps): Bump System.CommandLine Bumps the microsoft group with 1 update in the /new-cli directory: [System.CommandLine](https://github.com/dotnet/dotnet). Updates `System.CommandLine` from 2.0.0-beta5.25228.110 to 2.0.0-beta5.25229.110 - [Release notes](https://github.com/dotnet/dotnet/releases) - [Commits](https://github.com/dotnet/dotnet/commits) --- updated-dependencies: - dependency-name: System.CommandLine dependency-version: 2.0.0-beta5.25229.110 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: microsoft ... Signed-off-by: dependabot[bot] --- new-cli/Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/new-cli/Directory.Packages.props b/new-cli/Directory.Packages.props index 49efcead58..64d8b08431 100644 --- a/new-cli/Directory.Packages.props +++ b/new-cli/Directory.Packages.props @@ -20,7 +20,7 @@ - + From 39c55bd12b14e3a4a5b2211c539ea50d9a35a45a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 May 2025 16:22:28 +0000 Subject: [PATCH 08/35] (deps): Bump System.CommandLine Bumps the microsoft group with 1 update in the /new-cli directory: [System.CommandLine](https://github.com/dotnet/command-line-api). Updates `System.CommandLine` from 2.0.0-beta5.25229.110 to 2.0.0-beta5.25252.1 - [Release notes](https://github.com/dotnet/command-line-api/releases) - [Changelog](https://github.com/dotnet/command-line-api/blob/main/docs/History.md) - [Commits](https://github.com/dotnet/command-line-api/commits) --- updated-dependencies: - dependency-name: System.CommandLine dependency-version: 2.0.0-beta5.25252.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: microsoft ... Signed-off-by: dependabot[bot] --- new-cli/Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/new-cli/Directory.Packages.props b/new-cli/Directory.Packages.props index 64d8b08431..2c2dab505b 100644 --- a/new-cli/Directory.Packages.props +++ b/new-cli/Directory.Packages.props @@ -20,7 +20,7 @@ - + From cb1c7adb961a543e6ce1d3220dfbdaff4d08f429 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 May 2025 16:33:02 +0000 Subject: [PATCH 09/35] (deps): Bump JsonSchema.Net and JsonSchema.Net.Generation in /src Bumps [JsonSchema.Net](https://github.com/json-everything/json-everything) and [JsonSchema.Net.Generation](https://github.com/json-everything/json-everything). These dependencies needed to be updated together. Updates `JsonSchema.Net` from 7.3.4 to 7.3.4 - [Commits](https://github.com/json-everything/json-everything/commits) Updates `JsonSchema.Net.Generation` from 5.0.1 to 5.0.2 - [Commits](https://github.com/json-everything/json-everything/compare/schema-gen-v5.0.1...schema-gen-v5.0.2) --- updated-dependencies: - dependency-name: JsonSchema.Net dependency-version: 7.3.4 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: JsonSchema.Net.Generation dependency-version: 5.0.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- src/Directory.Packages.props | 2 +- src/GitVersion.Schema/GitVersion.Schema.csproj | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index 9de153e620..92636476d0 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -20,7 +20,7 @@ - + diff --git a/src/GitVersion.Schema/GitVersion.Schema.csproj b/src/GitVersion.Schema/GitVersion.Schema.csproj index 3b8e57273a..beef892b98 100644 --- a/src/GitVersion.Schema/GitVersion.Schema.csproj +++ b/src/GitVersion.Schema/GitVersion.Schema.csproj @@ -4,7 +4,6 @@ schema - From 0b477a7c3634eb1b33dbc01dc765d5b18984756b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 May 2025 15:44:23 +0000 Subject: [PATCH 10/35] (deps): Bump System.CommandLine Bumps the microsoft group with 1 update in the /new-cli directory: [System.CommandLine](https://github.com/dotnet/command-line-api). Updates `System.CommandLine` from 2.0.0-beta5.25252.1 to 2.0.0-beta5.25256.1 - [Release notes](https://github.com/dotnet/command-line-api/releases) - [Changelog](https://github.com/dotnet/command-line-api/blob/main/docs/History.md) - [Commits](https://github.com/dotnet/command-line-api/commits) --- updated-dependencies: - dependency-name: System.CommandLine dependency-version: 2.0.0-beta5.25256.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: microsoft ... Signed-off-by: dependabot[bot] --- new-cli/Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/new-cli/Directory.Packages.props b/new-cli/Directory.Packages.props index 2c2dab505b..1a2e9da61e 100644 --- a/new-cli/Directory.Packages.props +++ b/new-cli/Directory.Packages.props @@ -20,7 +20,7 @@ - + From d08512097b54f4855c907f3696f5b29ded4421b2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 May 2025 16:00:09 +0000 Subject: [PATCH 11/35] (build deps): Bump jetbrains/qodana-action from 2025.1.0 to 2025.1.1 Bumps [jetbrains/qodana-action](https://github.com/jetbrains/qodana-action) from 2025.1.0 to 2025.1.1. - [Release notes](https://github.com/jetbrains/qodana-action/releases) - [Commits](https://github.com/jetbrains/qodana-action/compare/v2025.1.0...v2025.1.1) --- updated-dependencies: - dependency-name: jetbrains/qodana-action dependency-version: 2025.1.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/qodana_analysis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/qodana_analysis.yml b/.github/workflows/qodana_analysis.yml index bb02b3e74d..de9cd77019 100644 --- a/.github/workflows/qodana_analysis.yml +++ b/.github/workflows/qodana_analysis.yml @@ -26,7 +26,7 @@ jobs: global-json-file: global.json - name: 'Qodana Scan' - uses: jetbrains/qodana-action@v2025.1.0 + uses: jetbrains/qodana-action@v2025.1.1 with: args: --baseline,qodana.sarif.json cache-default-branch-only: true From cd20992bcc5f120d778abf09c3ac2ab747505c4c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 7 May 2025 15:22:45 +0000 Subject: [PATCH 12/35] (deps): Bump System.CommandLine Bumps the microsoft group with 1 update in the /new-cli directory: [System.CommandLine](https://github.com/dotnet/dotnet). Updates `System.CommandLine` from 2.0.0-beta5.25256.1 to 2.0.0-beta5.25257.101 - [Release notes](https://github.com/dotnet/dotnet/releases) - [Commits](https://github.com/dotnet/dotnet/commits) --- updated-dependencies: - dependency-name: System.CommandLine dependency-version: 2.0.0-beta5.25257.101 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: microsoft ... Signed-off-by: dependabot[bot] --- new-cli/Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/new-cli/Directory.Packages.props b/new-cli/Directory.Packages.props index 1a2e9da61e..d92059a665 100644 --- a/new-cli/Directory.Packages.props +++ b/new-cli/Directory.Packages.props @@ -20,7 +20,7 @@ - + From 5b2a3a593f04e107433752e840a74f827999e56d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 May 2025 20:37:03 +0000 Subject: [PATCH 13/35] (sdk): Bump dotnet-sdk from 9.0.203 to 9.0.300 Bumps [dotnet-sdk](https://github.com/dotnet/sdk) from 9.0.203 to 9.0.300. - [Release notes](https://github.com/dotnet/sdk/releases) - [Commits](https://github.com/dotnet/sdk/compare/v9.0.203...v9.0.300) --- updated-dependencies: - dependency-name: dotnet-sdk dependency-version: 9.0.300 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index dfbf12676d..6e31df06a5 100644 --- a/global.json +++ b/global.json @@ -5,6 +5,6 @@ "src" ], "sdk": { - "version": "9.0.203" + "version": "9.0.300" } } From c1aeeb6889afe7ce8776c4ff9c2c24be2448311e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 May 2025 21:04:10 +0000 Subject: [PATCH 14/35] Update System.CommandLine to 2.0.0-beta5.25260.104 --- updated-dependencies: - dependency-name: System.CommandLine dependency-version: 2.0.0-beta5.25260.104 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- new-cli/Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/new-cli/Directory.Packages.props b/new-cli/Directory.Packages.props index d92059a665..5bc68e429e 100644 --- a/new-cli/Directory.Packages.props +++ b/new-cli/Directory.Packages.props @@ -20,7 +20,7 @@ - + From 9d87a5fcdeded075dc6a6668b25047a5e085b7fb Mon Sep 17 00:00:00 2001 From: Artur Stolear Date: Tue, 13 May 2025 23:52:48 +0200 Subject: [PATCH 15/35] switches dependabot to cron migrates dependabot update schedule from daily/monthly to cron for more precise control. --- .github/dependabot.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index d770a0b0e4..e3aff17114 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -7,7 +7,8 @@ updates: prefix: "(sdk)" directory: "/" schedule: - interval: daily + interval: cron + cronjob: "0 12 * * *" - package-ecosystem: nuget labels: - "dependencies" @@ -38,7 +39,8 @@ updates: - "/new-cli" - "/src" schedule: - interval: daily + interval: cron + cronjob: "0 12 * * *" open-pull-requests-limit: 10 - package-ecosystem: github-actions @@ -52,7 +54,8 @@ updates: - "actions/*" directory: "/" schedule: - interval: daily + interval: cron + cronjob: "0 12 * * *" - package-ecosystem: npm labels: @@ -65,4 +68,5 @@ updates: - "remark*" directory: "/" schedule: - interval: monthly + interval: cron + cronjob: "0 12 1,15 * *" From 8315ef7511ea74ac47ac3c1ad2738cf5bfed9400 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 May 2025 22:11:32 +0000 Subject: [PATCH 16/35] Update: - Microsoft.Bcl.AsyncInterfaces to 9.0.4, 9.0.5 - Microsoft.Build.Utilities.Core to 17.13.9, 17.14.7 - Microsoft.Extensions.Configuration.CommandLine to 9.0.5 - Microsoft.Extensions.DependencyInjection to 9.0.5 - Microsoft.Extensions.DependencyInjection.Abstractions to 9.0.5 - Microsoft.Extensions.FileSystemGlobbing to 9.0.5 - Microsoft.Extensions.Hosting to 9.0.5 - Microsoft.Extensions.Options to 9.0.5 - System.Drawing.Common to 9.0.4, 9.0.5 - System.Security.Cryptography.Xml to 9.0.4, 9.0.5 - System.Text.Json to 9.0.5 --- updated-dependencies: - dependency-name: Microsoft.Bcl.AsyncInterfaces dependency-version: 9.0.5 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: Microsoft.Build.Utilities.Core dependency-version: 17.14.7 dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: Microsoft.Build.Utilities.Core dependency-version: 17.14.7 dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: Microsoft.Extensions.Configuration.CommandLine dependency-version: 9.0.5 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: Microsoft.Extensions.DependencyInjection dependency-version: 9.0.5 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: Microsoft.Extensions.DependencyInjection dependency-version: 9.0.5 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: Microsoft.Extensions.DependencyInjection dependency-version: 9.0.5 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: Microsoft.Extensions.DependencyInjection.Abstractions dependency-version: 9.0.5 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: Microsoft.Extensions.FileSystemGlobbing dependency-version: 9.0.5 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: Microsoft.Extensions.Hosting dependency-version: 9.0.5 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: Microsoft.Extensions.Options dependency-version: 9.0.5 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: MSBuild.ProjectCreation dependency-version: 14.0.5 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: System.Collections.Immutable dependency-version: 9.0.5 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: System.Collections.Immutable dependency-version: 9.0.5 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: System.Drawing.Common dependency-version: 9.0.5 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: System.Reflection.Metadata dependency-version: 9.0.5 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: System.Security.Cryptography.Xml dependency-version: 9.0.5 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: System.Text.Json dependency-version: 9.0.5 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: System.Text.Json dependency-version: 9.0.5 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- src/Directory.Packages.props | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index 92636476d0..66501ee075 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -12,8 +12,8 @@ - - + + @@ -23,13 +23,13 @@ - + - - - - - + + + + + @@ -38,11 +38,11 @@ - + - - + + From 3918bc2d0674060f1ccf1503f4d612e0a399e31e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 15 May 2025 13:12:18 +0000 Subject: [PATCH 17/35] Update Microsoft.Build.Utilities.Core to 17.14.7, 17.14.8 --- updated-dependencies: - dependency-name: Microsoft.Build.Utilities.Core dependency-version: 17.14.8 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: Microsoft.Build.Utilities.Core dependency-version: 17.14.8 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: MSBuild.ProjectCreation dependency-version: 14.0.5 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: System.Collections.Immutable dependency-version: 9.0.5 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: System.Collections.Immutable dependency-version: 9.0.5 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: System.Reflection.Metadata dependency-version: 9.0.5 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- src/Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index 66501ee075..dcfdd35e21 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -25,7 +25,7 @@ - + From 52cacc79dec658cbbeb7ebd7f138e4a023ca426d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 15 May 2025 15:23:56 +0000 Subject: [PATCH 18/35] (docs deps): Bump undici from 6.21.1 to 6.21.3 in the npm_and_yarn group Bumps the npm_and_yarn group with 1 update: [undici](https://github.com/nodejs/undici). Updates `undici` from 6.21.1 to 6.21.3 - [Release notes](https://github.com/nodejs/undici/releases) - [Commits](https://github.com/nodejs/undici/compare/v6.21.1...v6.21.3) --- updated-dependencies: - dependency-name: undici dependency-version: 6.21.3 dependency-type: indirect dependency-group: npm_and_yarn ... Signed-off-by: dependabot[bot] --- package-lock.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 526220b2ba..b2349ae19b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14143,9 +14143,9 @@ } }, "node_modules/undici": { - "version": "6.21.1", - "resolved": "https://registry.npmjs.org/undici/-/undici-6.21.1.tgz", - "integrity": "sha512-q/1rj5D0/zayJB2FraXdaWxbhWiNKDvu8naDT2dl1yTlvJp4BLtOcp2a5BvgGNQpYYJzau7tf1WgKv3b+7mqpQ==", + "version": "6.21.3", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.21.3.tgz", + "integrity": "sha512-gBLkYIlEnSp8pFbT64yFgGE6UIB9tAkhukC23PmMDCe5Nd+cRqKxSjw5y54MK2AZMgZfJWMaNE4nYUHgi1XEOw==", "dev": true, "license": "MIT", "engines": { @@ -25953,9 +25953,9 @@ } }, "undici": { - "version": "6.21.1", - "resolved": "https://registry.npmjs.org/undici/-/undici-6.21.1.tgz", - "integrity": "sha512-q/1rj5D0/zayJB2FraXdaWxbhWiNKDvu8naDT2dl1yTlvJp4BLtOcp2a5BvgGNQpYYJzau7tf1WgKv3b+7mqpQ==", + "version": "6.21.3", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.21.3.tgz", + "integrity": "sha512-gBLkYIlEnSp8pFbT64yFgGE6UIB9tAkhukC23PmMDCe5Nd+cRqKxSjw5y54MK2AZMgZfJWMaNE4nYUHgi1XEOw==", "dev": true }, "unified-args": { From 50791ef3082fcacce3e9c8acad8860111e6bd605 Mon Sep 17 00:00:00 2001 From: Artur Stolear Date: Tue, 27 May 2025 08:04:17 +0200 Subject: [PATCH 19/35] Adds specific dependabot group Adds a specific dependabot group for Microsoft CodeAnalysis packages. This allows for more granular control and management of updates related to these packages. --- .github/dependabot.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index e3aff17114..83bda9e29e 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -15,6 +15,9 @@ updates: commit-message: prefix: "(deps)" groups: + Microsoft_CodeAnalysis: + patterns: + - "Microsoft.CodeAnalysis.*" microsoft: patterns: - "Microsoft.*" From 726143e371d28d847fff1fe5f61470592794e1e1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 27 May 2025 06:06:50 +0000 Subject: [PATCH 20/35] Update Cake.Http to 5.0.0 --- updated-dependencies: - dependency-name: Cake.Http dependency-version: 5.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- build/Directory.Packages.props | 2 +- build/docker/Tasks/DockerHubReadmePublish.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/Directory.Packages.props b/build/Directory.Packages.props index 849085972c..9a481f2275 100644 --- a/build/Directory.Packages.props +++ b/build/Directory.Packages.props @@ -8,7 +8,7 @@ - + diff --git a/build/docker/Tasks/DockerHubReadmePublish.cs b/build/docker/Tasks/DockerHubReadmePublish.cs index 36a3b3390f..01ce452478 100644 --- a/build/docker/Tasks/DockerHubReadmePublish.cs +++ b/build/docker/Tasks/DockerHubReadmePublish.cs @@ -46,7 +46,7 @@ public override async Task RunAsync(BuildContext context) var token = context.ParseJson(response).Value("token"); settings .SetContentType("application/json") - .SetAuthorization("JWT", token) + .SetAuthorization("JWT", token!) .SetJsonRequestBody(new { full_description = readme }); }); context.Information("README.md updated on DockerHub"); From 388b4a3492c9b0ee4be8532078e8b40e7f30bd3e Mon Sep 17 00:00:00 2001 From: Artur Stolear Date: Tue, 27 May 2025 09:39:59 +0200 Subject: [PATCH 21/35] change order for "Microsoft.CodeAnalysis.*" in dependabot --- .github/dependabot.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 83bda9e29e..87b6a493c0 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -15,13 +15,13 @@ updates: commit-message: prefix: "(deps)" groups: - Microsoft_CodeAnalysis: - patterns: - - "Microsoft.CodeAnalysis.*" microsoft: patterns: - "Microsoft.*" - "System.*" + Microsoft_CodeAnalysis: + patterns: + - "Microsoft.CodeAnalysis.*" analyzers: patterns: - "*Analyzers" From 5d2c2609888035b5495d3794564261fa416169bf Mon Sep 17 00:00:00 2001 From: Artur Stolear Date: Sat, 31 May 2025 22:42:38 +0200 Subject: [PATCH 22/35] Updates help writer to include all arguments Updates the help writer tests to verify that all arguments are present in the help output. This ensures that users have access to comprehensive information about available command-line options. --- src/GitVersion.App.Tests/HelpWriterTests.cs | 28 +++++++++++++++------ src/GitVersion.App/Arguments.cs | 3 +-- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/src/GitVersion.App.Tests/HelpWriterTests.cs b/src/GitVersion.App.Tests/HelpWriterTests.cs index 785f7a8ef6..bf962ea97f 100644 --- a/src/GitVersion.App.Tests/HelpWriterTests.cs +++ b/src/GitVersion.App.Tests/HelpWriterTests.cs @@ -19,21 +19,33 @@ public void AllArgsAreInHelp() { var lookup = new Dictionary { + { nameof(Arguments.IsHelp), "/?" }, + { nameof(Arguments.IsVersion), "/version" }, + { nameof(Arguments.TargetUrl), "/url" }, { nameof(Arguments.TargetBranch), "/b" }, + { nameof(Arguments.ClonePath), "/dynamicRepoLocation" }, + { nameof(Arguments.CommitId), "/c" }, + { nameof(Arguments.LogFilePath) , "/l" }, + { nameof(Arguments.Verbosity), "/verbosity" }, + { nameof(Arguments.Output) , "/output" }, { nameof(Arguments.OutputFile) , "/outputfile" }, - { nameof(Arguments.ClonePath), "/dynamicRepoLocation" }, - { nameof(Arguments.IsHelp), "/?" }, - { nameof(Arguments.IsVersion), "/version" }, + { nameof(Arguments.ShowVariable), "/showvariable" }, + { nameof(Arguments.Format), "/format" }, + { nameof(Arguments.UpdateWixVersionFile), "/updatewixversionfile" }, + { nameof(Arguments.UpdateProjectFiles), "/updateprojectfiles" }, + { nameof(Arguments.UpdateAssemblyInfo), "/updateassemblyinfo" }, + { nameof(Arguments.EnsureAssemblyInfo), "/ensureassemblyinfo" }, + { nameof(Arguments.ConfigurationFile), "/config" }, - { nameof(Arguments.Verbosity), "/verbosity" }, - { nameof(Arguments.CommitId), "/c" }, { nameof(Arguments.ShowConfiguration), "/showconfig" }, { nameof(Arguments.OverrideConfiguration), "/overrideconfig" }, - { nameof(Arguments.ShowVariable), "/showvariable" }, - { nameof(Arguments.Format), "/format" } + + { nameof(Arguments.NoCache), "/nocache" }, + { nameof(Arguments.NoFetch), "/nofetch" }, + { nameof(Arguments.NoNormalize), "/nonormalize" }, }; var helpText = string.Empty; @@ -42,7 +54,7 @@ public void AllArgsAreInHelp() var ignored = new[] { nameof(Arguments.Authentication), - nameof(Arguments.UpdateAssemblyInfoFileName) + nameof(Arguments.UpdateAssemblyInfoFileName), }; typeof(Arguments).GetFields() .Select(p => p.Name) diff --git a/src/GitVersion.App/Arguments.cs b/src/GitVersion.App/Arguments.cs index 8f5f977a67..5d619a5248 100644 --- a/src/GitVersion.App/Arguments.cs +++ b/src/GitVersion.App/Arguments.cs @@ -13,8 +13,6 @@ internal class Arguments public string? TargetPath; - public bool UpdateWixVersionFile; - public string? TargetUrl; public string? TargetBranch; public string? CommitId; @@ -35,6 +33,7 @@ internal class Arguments public ISet Output = new HashSet(); public Verbosity Verbosity = Verbosity.Normal; + public bool UpdateWixVersionFile; public bool UpdateProjectFiles; public bool UpdateAssemblyInfo; public bool EnsureAssemblyInfo; From 272d193bcd8de4037be79616273b49dfc7cb483a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 30 May 2025 13:16:25 +0000 Subject: [PATCH 23/35] Bump testing and 5 others Bumps Microsoft.NET.Test.Sdk from 17.13.0 to 17.14.0 Bumps NUnit.Analyzers from 4.7.0 to 4.8.1 --- updated-dependencies: - dependency-name: Microsoft.NET.Test.Sdk dependency-version: 17.14.0 dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: Microsoft.NET.Test.Sdk dependency-version: 17.14.0 dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: Microsoft.NET.Test.Sdk dependency-version: 17.14.0 dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: Microsoft.NET.Test.Sdk dependency-version: 17.14.0 dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: Microsoft.NET.Test.Sdk dependency-version: 17.14.0 dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: Microsoft.NET.Test.Sdk dependency-version: 17.14.0 dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: Microsoft.NET.Test.Sdk dependency-version: 17.14.0 dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: MSBuild.ProjectCreation dependency-version: 14.0.5 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: NUnit.Analyzers dependency-version: 4.8.1 dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: NUnit.Analyzers dependency-version: 4.8.1 dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: NUnit.Analyzers dependency-version: 4.8.1 dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: NUnit.Analyzers dependency-version: 4.8.1 dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: NUnit.Analyzers dependency-version: 4.8.1 dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: NUnit.Analyzers dependency-version: 4.8.1 dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: NUnit.Analyzers dependency-version: 4.8.1 dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: System.Collections.Immutable dependency-version: 9.0.5 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: System.Collections.Immutable dependency-version: 9.0.5 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: System.Reflection.Metadata dependency-version: 9.0.5 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- src/Directory.Packages.props | 4 ++-- src/GitVersion.MsBuild.Tests/Tasks/TestTaskBase.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index dcfdd35e21..418917bad2 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -30,11 +30,11 @@ - + - + diff --git a/src/GitVersion.MsBuild.Tests/Tasks/TestTaskBase.cs b/src/GitVersion.MsBuild.Tests/Tasks/TestTaskBase.cs index e2f1bbcdd5..c0c7999983 100644 --- a/src/GitVersion.MsBuild.Tests/Tasks/TestTaskBase.cs +++ b/src/GitVersion.MsBuild.Tests/Tasks/TestTaskBase.cs @@ -10,7 +10,7 @@ namespace GitVersion.MsBuild.Tests.Tasks; -public class TestTaskBase : TestBase +public abstract class TestTaskBase : TestBase { protected IFileSystem FileSystem; From 0999a582643cc5877f61287e832e33931ad67594 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Jun 2025 13:05:02 +0000 Subject: [PATCH 24/35] (deps): Bump Microsoft.CodeAnalysis.Common and 4 others Bumps Microsoft.CodeAnalysis.Common to 4.13.0, 4.14.0 Bumps Microsoft.CodeAnalysis.CSharp from 4.13.0 to 4.14.0 Bumps Microsoft.CodeAnalysis.VisualBasic to 4.13.0, 4.14.0 Bumps Microsoft.NET.Test.Sdk from 17.14.0 to 17.14.1 --- updated-dependencies: - dependency-name: Microsoft.CodeAnalysis.Common dependency-version: 4.14.0 dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: Microsoft.CodeAnalysis.CSharp dependency-version: 4.14.0 dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: Microsoft.CodeAnalysis.CSharp dependency-version: 4.14.0 dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: Microsoft.CodeAnalysis.VisualBasic dependency-version: 4.14.0 dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: Microsoft.NET.Test.Sdk dependency-version: 17.14.1 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: Microsoft.NET.Test.Sdk dependency-version: 17.14.1 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: Microsoft.NET.Test.Sdk dependency-version: 17.14.1 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: Microsoft.NET.Test.Sdk dependency-version: 17.14.1 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: Microsoft.NET.Test.Sdk dependency-version: 17.14.1 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: Microsoft.NET.Test.Sdk dependency-version: 17.14.1 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: Microsoft.NET.Test.Sdk dependency-version: 17.14.1 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: MSBuild.ProjectCreation dependency-version: 14.0.5 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: System.Collections.Immutable dependency-version: 9.0.5 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: System.Collections.Immutable dependency-version: 9.0.5 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: System.Reflection.Metadata dependency-version: 9.0.5 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- src/Directory.Packages.props | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index 418917bad2..1f97d44af9 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -7,9 +7,9 @@ - - - + + + @@ -30,7 +30,7 @@ - + @@ -46,4 +46,4 @@ - \ No newline at end of file + From 20ab0c8156b0380c5e66eeef942e8295316a70d1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 5 Jun 2025 13:23:01 +0000 Subject: [PATCH 25/35] (deps): Bump the microsoft group with 7 updates Bumps Microsoft.CodeAnalysis.Analyzers from 3.11.0 to 4.14.0 Bumps Microsoft.CodeAnalysis.CSharp from 4.13.0 to 4.14.0 Bumps Microsoft.CodeAnalysis.PublicApiAnalyzers from 3.3.4 to 4.14.0 Bumps Microsoft.Extensions.DependencyInjection.Abstractions from 9.0.4 to 9.0.5 Bumps Serilog.Extensions.Logging from 9.0.1 to 9.0.2 Bumps System.CommandLine from 2.0.0-beta5.25263.102 to 2.0.0-beta5.25304.106 Bumps System.Text.Json from 9.0.4 to 9.0.5 --- updated-dependencies: - dependency-name: Microsoft.CodeAnalysis.Analyzers dependency-version: 4.14.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: microsoft - dependency-name: Microsoft.CodeAnalysis.CSharp dependency-version: 4.14.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: microsoft - dependency-name: Microsoft.Extensions.DependencyInjection.Abstractions dependency-version: 9.0.5 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: microsoft - dependency-name: Serilog.Extensions.Logging dependency-version: 9.0.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: microsoft - dependency-name: System.CommandLine dependency-version: 2.0.0-beta5.25304.106 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: microsoft - dependency-name: System.Text.Json dependency-version: 9.0.5 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: microsoft - dependency-name: Microsoft.CodeAnalysis.PublicApiAnalyzers dependency-version: 4.14.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: microsoft ... Signed-off-by: dependabot[bot] --- new-cli/Directory.Packages.props | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/new-cli/Directory.Packages.props b/new-cli/Directory.Packages.props index 5bc68e429e..126466c0a7 100644 --- a/new-cli/Directory.Packages.props +++ b/new-cli/Directory.Packages.props @@ -5,23 +5,23 @@ - - + + - + - + - + - + \ No newline at end of file From 28207eda36034f608f3837c79ec4681038284d4f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 4 Jun 2025 12:54:03 +0000 Subject: [PATCH 26/35] (deps): Bump Microsoft.CodeAnalysis.PublicApiAnalyzers from 3.3.4 to 4.14.0 --- updated-dependencies: - dependency-name: Microsoft.CodeAnalysis.PublicApiAnalyzers dependency-version: 4.14.0 dependency-type: direct:production update-type: version-update:semver-major - dependency-name: Microsoft.CodeAnalysis.PublicApiAnalyzers dependency-version: 4.14.0 dependency-type: direct:production update-type: version-update:semver-major - dependency-name: Microsoft.CodeAnalysis.PublicApiAnalyzers dependency-version: 4.14.0 dependency-type: direct:production update-type: version-update:semver-major - dependency-name: Microsoft.CodeAnalysis.PublicApiAnalyzers dependency-version: 4.14.0 dependency-type: direct:production update-type: version-update:semver-major - dependency-name: Microsoft.CodeAnalysis.PublicApiAnalyzers dependency-version: 4.14.0 dependency-type: direct:production update-type: version-update:semver-major - dependency-name: Microsoft.CodeAnalysis.PublicApiAnalyzers dependency-version: 4.14.0 dependency-type: direct:production update-type: version-update:semver-major - dependency-name: Microsoft.CodeAnalysis.PublicApiAnalyzers dependency-version: 4.14.0 dependency-type: direct:production update-type: version-update:semver-major - dependency-name: MSBuild.ProjectCreation dependency-version: 14.0.5 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: System.Collections.Immutable dependency-version: 9.0.5 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: System.Collections.Immutable dependency-version: 9.0.5 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: System.Reflection.Metadata dependency-version: 9.0.5 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- new-cli/Directory.Packages.props | 4 +- src/Directory.Packages.props | 2 +- src/GitVersion.Core/PublicAPI.Unshipped.txt | 147 ++++++++++++++++++++ 3 files changed, 150 insertions(+), 3 deletions(-) diff --git a/new-cli/Directory.Packages.props b/new-cli/Directory.Packages.props index 126466c0a7..2df8f1fc85 100644 --- a/new-cli/Directory.Packages.props +++ b/new-cli/Directory.Packages.props @@ -7,7 +7,7 @@ - + @@ -24,4 +24,4 @@ - \ No newline at end of file + diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index 1f97d44af9..2f53bb1f13 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -10,7 +10,7 @@ - + diff --git a/src/GitVersion.Core/PublicAPI.Unshipped.txt b/src/GitVersion.Core/PublicAPI.Unshipped.txt index 7dc5c58110..0bcbcd8281 100644 --- a/src/GitVersion.Core/PublicAPI.Unshipped.txt +++ b/src/GitVersion.Core/PublicAPI.Unshipped.txt @@ -1 +1,148 @@ #nullable enable +GitVersion.Configuration.EffectiveBranchConfiguration.Deconstruct(out GitVersion.Configuration.EffectiveConfiguration! Value, out GitVersion.Git.IBranch! Branch) -> void +GitVersion.Configuration.EffectiveBranchConfiguration.EffectiveBranchConfiguration(GitVersion.Configuration.EffectiveBranchConfiguration! original) -> void +GitVersion.Configuration.EffectiveConfiguration.EffectiveConfiguration(GitVersion.Configuration.EffectiveConfiguration! original) -> void +GitVersion.ConfigurationInfo.ConfigurationInfo() -> void +GitVersion.ConfigurationInfo.ConfigurationInfo(GitVersion.ConfigurationInfo! original) -> void +GitVersion.FileWriteInfo.$() -> GitVersion.FileWriteInfo! +GitVersion.FileWriteInfo.Deconstruct(out string! WorkingDirectory, out string! FileName, out string! FileExtension) -> void +GitVersion.FileWriteInfo.Equals(GitVersion.FileWriteInfo? other) -> bool +GitVersion.Git.AuthenticationInfo.AuthenticationInfo() -> void +GitVersion.Git.AuthenticationInfo.AuthenticationInfo(GitVersion.Git.AuthenticationInfo! original) -> void +GitVersion.Git.CommitFilter.CommitFilter() -> void +GitVersion.Git.CommitFilter.CommitFilter(GitVersion.Git.CommitFilter! original) -> void +GitVersion.OutputVariables.GitVersionVariables.Deconstruct(out string! Major, out string! Minor, out string! Patch, out string? BuildMetaData, out string? FullBuildMetaData, out string? BranchName, out string? EscapedBranchName, out string? Sha, out string? ShortSha, out string! MajorMinorPatch, out string! SemVer, out string! FullSemVer, out string? AssemblySemVer, out string? AssemblySemFileVer, out string? PreReleaseTag, out string? PreReleaseTagWithDash, out string? PreReleaseLabel, out string? PreReleaseLabelWithDash, out string? PreReleaseNumber, out string! WeightedPreReleaseNumber, out string? InformationalVersion, out string? CommitDate, out string? VersionSourceSha, out string? CommitsSinceVersionSource, out string? UncommittedChanges) -> void +GitVersion.OutputVariables.GitVersionVariables.GitVersionVariables(GitVersion.OutputVariables.GitVersionVariables! original) -> void +GitVersion.RepositoryInfo.RepositoryInfo() -> void +GitVersion.RepositoryInfo.RepositoryInfo(GitVersion.RepositoryInfo! original) -> void +GitVersion.SemanticVersionWithTag.$() -> GitVersion.SemanticVersionWithTag! +GitVersion.SemanticVersionWithTag.Deconstruct(out GitVersion.SemanticVersion! Value, out GitVersion.Git.ITag! Tag) -> void +GitVersion.SemanticVersionWithTag.Equals(GitVersion.SemanticVersionWithTag? other) -> bool +GitVersion.Settings.Settings() -> void +GitVersion.Settings.Settings(GitVersion.Settings! original) -> void +GitVersion.VersionCalculation.BaseVersion.$() -> GitVersion.VersionCalculation.BaseVersion! +GitVersion.VersionCalculation.BaseVersion.Deconstruct(out GitVersion.VersionCalculation.BaseVersionOperand! Operand) -> void +GitVersion.VersionCalculation.BaseVersion.Equals(GitVersion.VersionCalculation.BaseVersion? other) -> bool +GitVersion.VersionCalculation.BaseVersionOperand.$() -> GitVersion.VersionCalculation.BaseVersionOperand! +GitVersion.VersionCalculation.BaseVersionOperand.Deconstruct(out string! Source, out GitVersion.SemanticVersion! SemanticVersion, out GitVersion.Git.ICommit? BaseVersionSource) -> void +GitVersion.VersionCalculation.BaseVersionOperand.Equals(GitVersion.VersionCalculation.BaseVersionOperand? other) -> bool +GitVersion.VersionCalculation.BaseVersionOperator.$() -> GitVersion.VersionCalculation.BaseVersionOperator! +GitVersion.VersionCalculation.BaseVersionOperator.BaseVersionOperator() -> void +GitVersion.VersionCalculation.BaseVersionOperator.Equals(GitVersion.VersionCalculation.BaseVersionOperator? other) -> bool +GitVersion.VersionCalculation.Caching.GitVersionCacheKey.Deconstruct(out string! Value) -> void +GitVersion.VersionCalculation.Caching.GitVersionCacheKey.GitVersionCacheKey(GitVersion.VersionCalculation.Caching.GitVersionCacheKey! original) -> void +GitVersion.WixInfo.WixInfo() -> void +GitVersion.WixInfo.WixInfo(GitVersion.WixInfo! original) -> void +override GitVersion.Configuration.EffectiveBranchConfiguration.Equals(object? obj) -> bool +override GitVersion.Configuration.EffectiveBranchConfiguration.GetHashCode() -> int +override GitVersion.Configuration.EffectiveBranchConfiguration.ToString() -> string! +override GitVersion.Configuration.EffectiveConfiguration.Equals(object? obj) -> bool +override GitVersion.Configuration.EffectiveConfiguration.GetHashCode() -> int +override GitVersion.Configuration.EffectiveConfiguration.ToString() -> string! +override GitVersion.ConfigurationInfo.Equals(object? obj) -> bool +override GitVersion.ConfigurationInfo.GetHashCode() -> int +override GitVersion.ConfigurationInfo.ToString() -> string! +override GitVersion.FileWriteInfo.Equals(object? obj) -> bool +override GitVersion.FileWriteInfo.GetHashCode() -> int +override GitVersion.FileWriteInfo.ToString() -> string! +override GitVersion.Git.AuthenticationInfo.Equals(object? obj) -> bool +override GitVersion.Git.AuthenticationInfo.GetHashCode() -> int +override GitVersion.Git.AuthenticationInfo.ToString() -> string! +override GitVersion.Git.CommitFilter.Equals(object? obj) -> bool +override GitVersion.Git.CommitFilter.GetHashCode() -> int +override GitVersion.Git.CommitFilter.ToString() -> string! +override GitVersion.OutputVariables.GitVersionVariables.Equals(object? obj) -> bool +override GitVersion.OutputVariables.GitVersionVariables.GetHashCode() -> int +override GitVersion.OutputVariables.GitVersionVariables.ToString() -> string! +override GitVersion.RepositoryInfo.Equals(object? obj) -> bool +override GitVersion.RepositoryInfo.GetHashCode() -> int +override GitVersion.RepositoryInfo.ToString() -> string! +override GitVersion.SemanticVersionWithTag.Equals(object? obj) -> bool +override GitVersion.SemanticVersionWithTag.GetHashCode() -> int +override GitVersion.Settings.Equals(object? obj) -> bool +override GitVersion.Settings.GetHashCode() -> int +override GitVersion.Settings.ToString() -> string! +override GitVersion.VersionCalculation.BaseVersion.Equals(object? obj) -> bool +override GitVersion.VersionCalculation.BaseVersion.GetHashCode() -> int +override GitVersion.VersionCalculation.BaseVersionOperand.Equals(object? obj) -> bool +override GitVersion.VersionCalculation.BaseVersionOperand.GetHashCode() -> int +override GitVersion.VersionCalculation.BaseVersionOperator.Equals(object? obj) -> bool +override GitVersion.VersionCalculation.BaseVersionOperator.GetHashCode() -> int +override GitVersion.VersionCalculation.Caching.GitVersionCacheKey.Equals(object? obj) -> bool +override GitVersion.VersionCalculation.Caching.GitVersionCacheKey.GetHashCode() -> int +override GitVersion.VersionCalculation.Caching.GitVersionCacheKey.ToString() -> string! +override GitVersion.WixInfo.Equals(object? obj) -> bool +override GitVersion.WixInfo.GetHashCode() -> int +override GitVersion.WixInfo.ToString() -> string! +static GitVersion.Configuration.EffectiveBranchConfiguration.operator !=(GitVersion.Configuration.EffectiveBranchConfiguration? left, GitVersion.Configuration.EffectiveBranchConfiguration? right) -> bool +static GitVersion.Configuration.EffectiveBranchConfiguration.operator ==(GitVersion.Configuration.EffectiveBranchConfiguration? left, GitVersion.Configuration.EffectiveBranchConfiguration? right) -> bool +static GitVersion.Configuration.EffectiveConfiguration.operator !=(GitVersion.Configuration.EffectiveConfiguration? left, GitVersion.Configuration.EffectiveConfiguration? right) -> bool +static GitVersion.Configuration.EffectiveConfiguration.operator ==(GitVersion.Configuration.EffectiveConfiguration? left, GitVersion.Configuration.EffectiveConfiguration? right) -> bool +static GitVersion.ConfigurationInfo.operator !=(GitVersion.ConfigurationInfo? left, GitVersion.ConfigurationInfo? right) -> bool +static GitVersion.ConfigurationInfo.operator ==(GitVersion.ConfigurationInfo? left, GitVersion.ConfigurationInfo? right) -> bool +static GitVersion.FileWriteInfo.operator !=(GitVersion.FileWriteInfo? left, GitVersion.FileWriteInfo? right) -> bool +static GitVersion.FileWriteInfo.operator ==(GitVersion.FileWriteInfo? left, GitVersion.FileWriteInfo? right) -> bool +static GitVersion.Git.AuthenticationInfo.operator !=(GitVersion.Git.AuthenticationInfo? left, GitVersion.Git.AuthenticationInfo? right) -> bool +static GitVersion.Git.AuthenticationInfo.operator ==(GitVersion.Git.AuthenticationInfo? left, GitVersion.Git.AuthenticationInfo? right) -> bool +static GitVersion.Git.CommitFilter.operator !=(GitVersion.Git.CommitFilter? left, GitVersion.Git.CommitFilter? right) -> bool +static GitVersion.Git.CommitFilter.operator ==(GitVersion.Git.CommitFilter? left, GitVersion.Git.CommitFilter? right) -> bool +static GitVersion.OutputVariables.GitVersionVariables.operator !=(GitVersion.OutputVariables.GitVersionVariables? left, GitVersion.OutputVariables.GitVersionVariables? right) -> bool +static GitVersion.OutputVariables.GitVersionVariables.operator ==(GitVersion.OutputVariables.GitVersionVariables? left, GitVersion.OutputVariables.GitVersionVariables? right) -> bool +static GitVersion.RepositoryInfo.operator !=(GitVersion.RepositoryInfo? left, GitVersion.RepositoryInfo? right) -> bool +static GitVersion.RepositoryInfo.operator ==(GitVersion.RepositoryInfo? left, GitVersion.RepositoryInfo? right) -> bool +static GitVersion.SemanticVersionWithTag.operator !=(GitVersion.SemanticVersionWithTag? left, GitVersion.SemanticVersionWithTag? right) -> bool +static GitVersion.SemanticVersionWithTag.operator ==(GitVersion.SemanticVersionWithTag? left, GitVersion.SemanticVersionWithTag? right) -> bool +static GitVersion.Settings.operator !=(GitVersion.Settings? left, GitVersion.Settings? right) -> bool +static GitVersion.Settings.operator ==(GitVersion.Settings? left, GitVersion.Settings? right) -> bool +static GitVersion.VersionCalculation.BaseVersion.operator !=(GitVersion.VersionCalculation.BaseVersion? left, GitVersion.VersionCalculation.BaseVersion? right) -> bool +static GitVersion.VersionCalculation.BaseVersion.operator ==(GitVersion.VersionCalculation.BaseVersion? left, GitVersion.VersionCalculation.BaseVersion? right) -> bool +static GitVersion.VersionCalculation.BaseVersionOperand.operator !=(GitVersion.VersionCalculation.BaseVersionOperand? left, GitVersion.VersionCalculation.BaseVersionOperand? right) -> bool +static GitVersion.VersionCalculation.BaseVersionOperand.operator ==(GitVersion.VersionCalculation.BaseVersionOperand? left, GitVersion.VersionCalculation.BaseVersionOperand? right) -> bool +static GitVersion.VersionCalculation.BaseVersionOperator.operator !=(GitVersion.VersionCalculation.BaseVersionOperator? left, GitVersion.VersionCalculation.BaseVersionOperator? right) -> bool +static GitVersion.VersionCalculation.BaseVersionOperator.operator ==(GitVersion.VersionCalculation.BaseVersionOperator? left, GitVersion.VersionCalculation.BaseVersionOperator? right) -> bool +static GitVersion.VersionCalculation.Caching.GitVersionCacheKey.operator !=(GitVersion.VersionCalculation.Caching.GitVersionCacheKey? left, GitVersion.VersionCalculation.Caching.GitVersionCacheKey? right) -> bool +static GitVersion.VersionCalculation.Caching.GitVersionCacheKey.operator ==(GitVersion.VersionCalculation.Caching.GitVersionCacheKey? left, GitVersion.VersionCalculation.Caching.GitVersionCacheKey? right) -> bool +static GitVersion.WixInfo.operator !=(GitVersion.WixInfo? left, GitVersion.WixInfo? right) -> bool +static GitVersion.WixInfo.operator ==(GitVersion.WixInfo? left, GitVersion.WixInfo? right) -> bool +virtual GitVersion.Configuration.EffectiveBranchConfiguration.$() -> GitVersion.Configuration.EffectiveBranchConfiguration! +virtual GitVersion.Configuration.EffectiveBranchConfiguration.EqualityContract.get -> System.Type! +virtual GitVersion.Configuration.EffectiveBranchConfiguration.Equals(GitVersion.Configuration.EffectiveBranchConfiguration? other) -> bool +virtual GitVersion.Configuration.EffectiveBranchConfiguration.PrintMembers(System.Text.StringBuilder! builder) -> bool +virtual GitVersion.Configuration.EffectiveConfiguration.$() -> GitVersion.Configuration.EffectiveConfiguration! +virtual GitVersion.Configuration.EffectiveConfiguration.EqualityContract.get -> System.Type! +virtual GitVersion.Configuration.EffectiveConfiguration.Equals(GitVersion.Configuration.EffectiveConfiguration? other) -> bool +virtual GitVersion.Configuration.EffectiveConfiguration.PrintMembers(System.Text.StringBuilder! builder) -> bool +virtual GitVersion.ConfigurationInfo.$() -> GitVersion.ConfigurationInfo! +virtual GitVersion.ConfigurationInfo.EqualityContract.get -> System.Type! +virtual GitVersion.ConfigurationInfo.Equals(GitVersion.ConfigurationInfo? other) -> bool +virtual GitVersion.ConfigurationInfo.PrintMembers(System.Text.StringBuilder! builder) -> bool +virtual GitVersion.Git.AuthenticationInfo.$() -> GitVersion.Git.AuthenticationInfo! +virtual GitVersion.Git.AuthenticationInfo.EqualityContract.get -> System.Type! +virtual GitVersion.Git.AuthenticationInfo.Equals(GitVersion.Git.AuthenticationInfo? other) -> bool +virtual GitVersion.Git.AuthenticationInfo.PrintMembers(System.Text.StringBuilder! builder) -> bool +virtual GitVersion.Git.CommitFilter.$() -> GitVersion.Git.CommitFilter! +virtual GitVersion.Git.CommitFilter.EqualityContract.get -> System.Type! +virtual GitVersion.Git.CommitFilter.Equals(GitVersion.Git.CommitFilter? other) -> bool +virtual GitVersion.Git.CommitFilter.PrintMembers(System.Text.StringBuilder! builder) -> bool +virtual GitVersion.Logging.LogAction.Invoke(GitVersion.Logging.LogActionEntry! actionEntry) -> void +virtual GitVersion.Logging.LogActionEntry.Invoke(string! format, params object![]! args) -> void +virtual GitVersion.OutputVariables.GitVersionVariables.$() -> GitVersion.OutputVariables.GitVersionVariables! +virtual GitVersion.OutputVariables.GitVersionVariables.EqualityContract.get -> System.Type! +virtual GitVersion.OutputVariables.GitVersionVariables.Equals(GitVersion.OutputVariables.GitVersionVariables? other) -> bool +virtual GitVersion.OutputVariables.GitVersionVariables.PrintMembers(System.Text.StringBuilder! builder) -> bool +virtual GitVersion.RepositoryInfo.$() -> GitVersion.RepositoryInfo! +virtual GitVersion.RepositoryInfo.EqualityContract.get -> System.Type! +virtual GitVersion.RepositoryInfo.Equals(GitVersion.RepositoryInfo? other) -> bool +virtual GitVersion.RepositoryInfo.PrintMembers(System.Text.StringBuilder! builder) -> bool +virtual GitVersion.Settings.$() -> GitVersion.Settings! +virtual GitVersion.Settings.EqualityContract.get -> System.Type! +virtual GitVersion.Settings.Equals(GitVersion.Settings? other) -> bool +virtual GitVersion.Settings.PrintMembers(System.Text.StringBuilder! builder) -> bool +virtual GitVersion.VersionCalculation.Caching.GitVersionCacheKey.$() -> GitVersion.VersionCalculation.Caching.GitVersionCacheKey! +virtual GitVersion.VersionCalculation.Caching.GitVersionCacheKey.EqualityContract.get -> System.Type! +virtual GitVersion.VersionCalculation.Caching.GitVersionCacheKey.Equals(GitVersion.VersionCalculation.Caching.GitVersionCacheKey? other) -> bool +virtual GitVersion.VersionCalculation.Caching.GitVersionCacheKey.PrintMembers(System.Text.StringBuilder! builder) -> bool +virtual GitVersion.WixInfo.$() -> GitVersion.WixInfo! +virtual GitVersion.WixInfo.EqualityContract.get -> System.Type! +virtual GitVersion.WixInfo.Equals(GitVersion.WixInfo? other) -> bool +virtual GitVersion.WixInfo.PrintMembers(System.Text.StringBuilder! builder) -> bool From 037d036fc80f3807ebf143e42bd4ec99cb9caaa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Nogueira?= <> Date: Fri, 30 May 2025 11:45:48 +0100 Subject: [PATCH 27/35] feat(preparer): add allowshallow flag --- docs/input/docs/reference/requirements.md | 5 +- docs/input/docs/usage/cli/arguments.md | 4 + docs/input/docs/usage/msbuild.md | 8 +- .../ArgumentParserTests.cs | 46 ++++++++++-- src/GitVersion.App/ArgumentParser.cs | 6 ++ .../ArgumentParserExtensions.cs | 2 +- src/GitVersion.App/Arguments.cs | 4 +- .../Core/GitVersionExecutorTests.cs | 73 +++++++++++++++++++ src/GitVersion.Core/Core/GitPreparer.cs | 9 ++- src/GitVersion.Core/Options/Settings.cs | 1 + src/GitVersion.Core/PublicAPI.Shipped.txt | 1 + .../msbuild/tools/GitVersion.MsBuild.props | 10 ++- 12 files changed, 151 insertions(+), 18 deletions(-) diff --git a/docs/input/docs/reference/requirements.md b/docs/input/docs/reference/requirements.md index 3d950f4e6f..68acfb00d5 100644 --- a/docs/input/docs/reference/requirements.md +++ b/docs/input/docs/reference/requirements.md @@ -14,8 +14,9 @@ build server, needs to adhere to the below requirements. ### Unshallow -The repository needs to be an [unshallow][git-unshallow] clone. This means -that the `fetch-depth` in GitHub Actions needs to be set to `0`, for instance. +The repository should be an [unshallow][git-unshallow] clone. This means +that the `fetch-depth` in GitHub Actions should set to `0`, unless +the `allowshallow` flag is used. Check with your [build server][build-servers] to see how it can be configured appropriately. diff --git a/docs/input/docs/usage/cli/arguments.md b/docs/input/docs/usage/cli/arguments.md index 8b1b8ea5ea..b503a1f899 100644 --- a/docs/input/docs/usage/cli/arguments.md +++ b/docs/input/docs/usage/cli/arguments.md @@ -50,6 +50,10 @@ GitVersion [path] Currently supported config overrides: tag-prefix /nocache Bypasses the cache, result will not be written to the cache. /nonormalize Disables normalize step on a build server. + /allowshallow Allows GitVersion to run on a shallow clone. + This is not recommended, but can be used if you are sure + that the shallow clone contains all the information needed + to calculate the version. /verbosity Specifies the amount of information to be displayed. (Quiet, Minimal, Normal, Verbose, Diagnostic) Default is Normal diff --git a/docs/input/docs/usage/msbuild.md b/docs/input/docs/usage/msbuild.md index 9d812f6a80..5b3c258173 100644 --- a/docs/input/docs/usage/msbuild.md +++ b/docs/input/docs/usage/msbuild.md @@ -18,8 +18,8 @@ version information that is compiled into the resulting artifact. Since version 6.0 only MSBuild running on .NET Core (`dotnet msbuild`) is supported. Unfortunately, up until at least Visual Studio 2022 17.11, Visual Studio runs all builds -using the .NET Framework version of MSBuild, and therefore **Visual Studio is not supported**. -For more information see [this discussion](https://github.com/GitTools/GitVersion/discussions/4130). +using the .NET Framework version of MSBuild, and therefore **Visual Studio is not supported**. +For more information see [this discussion](https://github.com/GitTools/GitVersion/discussions/4130). ## TL;DR @@ -261,7 +261,9 @@ There are properties that correspond to certain In particular, setting `GitVersion_NoFetchEnabled` to `true` disables `git fetch` during version calculation, setting `GitVersion_NoNormalizeEnabled` to `true` disables normalize step on a build server, setting `GitVersion_NoCacheEnabled` to `true` -makes GetVersion ignore cache. All the rest command line arguments can be passed via +makes GetVersion ignore cache, setting `GitVersion_AllowShallowEnabled` to `true` +does not mandate a full clone of the repository to determine the version. +All the rest command line arguments can be passed via `GitVersion_CommandLineArguments` variable. ## My Git repository requires authentication. What should I do? diff --git a/src/GitVersion.App.Tests/ArgumentParserTests.cs b/src/GitVersion.App.Tests/ArgumentParserTests.cs index 5e53ac63a0..42e7c36304 100644 --- a/src/GitVersion.App.Tests/ArgumentParserTests.cs +++ b/src/GitVersion.App.Tests/ArgumentParserTests.cs @@ -629,6 +629,13 @@ public void NoNormalizeTrueWhenDefined() arguments.NoNormalize.ShouldBe(true); } + [Test] + public void AllowshallowTrueWhenDefined() + { + var arguments = this.argumentParser.ParseArguments("-allowshallow"); + arguments.AllowShallow.ShouldBe(true); + } + [Test] public void OtherArgumentsCanBeParsedBeforeNofetch() { @@ -653,18 +660,45 @@ public void OtherArgumentsCanBeParsedBeforeNocache() arguments.NoCache.ShouldBe(true); } - [TestCase("-nofetch -nonormalize -nocache")] - [TestCase("-nofetch -nocache -nonormalize")] - [TestCase("-nocache -nofetch -nonormalize")] - [TestCase("-nocache -nonormalize -nofetch")] - [TestCase("-nonormalize -nocache -nofetch")] - [TestCase("-nonormalize -nofetch -nocache")] + [Test] + public void OtherArgumentsCanBeParsedBeforeAllowshallow() + { + var arguments = this.argumentParser.ParseArguments("targetpath -allowshallow"); + arguments.TargetPath.ShouldBe("targetpath"); + arguments.AllowShallow.ShouldBe(true); + } + + [TestCase("-nofetch -nonormalize -nocache -allowshallow")] + [TestCase("-nofetch -nonormalize -allowshallow -nocache")] + [TestCase("-nofetch -nocache -nonormalize -allowshallow")] + [TestCase("-nofetch -nocache -allowshallow -nonormalize")] + [TestCase("-nofetch -allowshallow -nonormalize -nocache")] + [TestCase("-nofetch -allowshallow -nocache -nonormalize")] + [TestCase("-nonormalize -nofetch -nocache -allowshallow")] + [TestCase("-nonormalize -nofetch -allowshallow -nocache")] + [TestCase("-nonormalize -nocache -nofetch -allowshallow")] + [TestCase("-nonormalize -nocache -allowshallow -nofetch")] + [TestCase("-nonormalize -allowshallow -nofetch -nocache")] + [TestCase("-nonormalize -allowshallow -nocache -nofetch")] + [TestCase("-nocache -nofetch -nonormalize -allowshallow")] + [TestCase("-nocache -nofetch -allowshallow -nonormalize")] + [TestCase("-nocache -nonormalize -nofetch -allowshallow")] + [TestCase("-nocache -nonormalize -allowshallow -nofetch")] + [TestCase("-nocache -allowshallow -nofetch -nonormalize")] + [TestCase("-nocache -allowshallow -nonormalize -nofetch")] + [TestCase("-allowshallow -nofetch -nonormalize -nocache")] + [TestCase("-allowshallow -nofetch -nocache -nonormalize")] + [TestCase("-allowshallow -nonormalize -nofetch -nocache")] + [TestCase("-allowshallow -nonormalize -nocache -nofetch")] + [TestCase("-allowshallow -nocache -nofetch -nonormalize")] + [TestCase("-allowshallow -nocache -nonormalize -nofetch")] public void SeveralSwitchesCanBeParsed(string commandLineArgs) { var arguments = this.argumentParser.ParseArguments(commandLineArgs); arguments.NoCache.ShouldBe(true); arguments.NoNormalize.ShouldBe(true); arguments.NoFetch.ShouldBe(true); + arguments.AllowShallow.ShouldBe(true); } [Test] diff --git a/src/GitVersion.App/ArgumentParser.cs b/src/GitVersion.App/ArgumentParser.cs index d22b63ee31..1f85a1b3d2 100644 --- a/src/GitVersion.App/ArgumentParser.cs +++ b/src/GitVersion.App/ArgumentParser.cs @@ -281,6 +281,12 @@ private static bool ParseSwitches(Arguments arguments, string? name, IReadOnlyLi return true; } + if (name.IsSwitch("allowshallow")) + { + arguments.AllowShallow = true; + return true; + } + if (name.IsSwitch("verbosity")) { ParseVerbosity(arguments, value); diff --git a/src/GitVersion.App/ArgumentParserExtensions.cs b/src/GitVersion.App/ArgumentParserExtensions.cs index 493052fa06..7a5bbfb006 100644 --- a/src/GitVersion.App/ArgumentParserExtensions.cs +++ b/src/GitVersion.App/ArgumentParserExtensions.cs @@ -69,7 +69,7 @@ public static bool IsSwitch(this string? value, string switchName) public static bool ArgumentRequiresValue(this string argument, int argumentIndex) { - var booleanArguments = new[] { "updateassemblyinfo", "ensureassemblyinfo", "nofetch", "nonormalize", "nocache" }; + var booleanArguments = new[] { "updateassemblyinfo", "ensureassemblyinfo", "nofetch", "nonormalize", "nocache", "allowshallow" }; var argumentMightRequireValue = !booleanArguments.Contains(argument[1..], StringComparer.OrdinalIgnoreCase); diff --git a/src/GitVersion.App/Arguments.cs b/src/GitVersion.App/Arguments.cs index 5d619a5248..ee8b86a85c 100644 --- a/src/GitVersion.App/Arguments.cs +++ b/src/GitVersion.App/Arguments.cs @@ -25,6 +25,7 @@ internal class Arguments public bool NoFetch; public bool NoCache; public bool NoNormalize; + public bool AllowShallow; public string? LogFilePath; public string? ShowVariable; @@ -77,7 +78,8 @@ public GitVersionOptions ToOptions() { NoFetch = NoFetch, NoCache = NoCache, - NoNormalize = NoNormalize + NoNormalize = NoNormalize, + AllowShallow = AllowShallow, }, WixInfo = diff --git a/src/GitVersion.Core.Tests/Core/GitVersionExecutorTests.cs b/src/GitVersion.Core.Tests/Core/GitVersionExecutorTests.cs index 77521b0fcf..0852be5681 100644 --- a/src/GitVersion.Core.Tests/Core/GitVersionExecutorTests.cs +++ b/src/GitVersion.Core.Tests/Core/GitVersionExecutorTests.cs @@ -597,6 +597,79 @@ public void CalculateVersionVariables_ShallowFetch_ThrowException() exception?.Message.ShouldBe("Repository is a shallow clone. Git repositories must contain the full history. See https://gitversion.net/docs/reference/requirements#unshallow for more info."); } + [Test] + public void CalculateVersionVariables_ShallowFetch_WithAllowShallow_ShouldNotThrowException() + { + // Setup + using var fixture = new RemoteRepositoryFixture(); + fixture.LocalRepositoryFixture.MakeShallow(); + + using var worktreeFixture = new LocalRepositoryFixture(new(fixture.LocalRepositoryFixture.RepositoryPath)); + var gitVersionOptions = new GitVersionOptions + { + WorkingDirectory = worktreeFixture.RepositoryPath, + Settings = { AllowShallow = true } + }; + + var environment = new TestEnvironment(); + environment.SetEnvironmentVariable(AzurePipelines.EnvironmentVariableName, "true"); + + this.sp = GetServiceProvider(gitVersionOptions, environment: environment); + + sp.DiscoverRepository(); + + var sut = sp.GetRequiredService(); + + // Execute + var version = sut.CalculateVersionVariables(); + + // Verify + version.ShouldNotBeNull(); + var commits = worktreeFixture.Repository.Head.Commits; + version.Sha.ShouldBe(commits.First().Sha); + } + + [Test] + public void CalculateVersionVariables_WithLimitedCloneDepth_AndAllowShallowTrue_ShouldCalculateVersionCorrectly() + { + // Setup + using var fixture = new RemoteRepositoryFixture(); + fixture.LocalRepositoryFixture.MakeShallow(); + + fixture.LocalRepositoryFixture.Repository.MakeACommit("Initial commit"); + fixture.LocalRepositoryFixture.Repository.MakeATaggedCommit("1.0.0"); + var latestCommit = fixture.LocalRepositoryFixture.Repository.MakeACommit("+semver:major"); + + using var worktreeFixture = new LocalRepositoryFixture(new(fixture.LocalRepositoryFixture.RepositoryPath)); + + var gitVersionOptions = new GitVersionOptions + { + WorkingDirectory = worktreeFixture.RepositoryPath, + Settings = { AllowShallow = true } + }; + + var environment = new TestEnvironment(); + environment.SetEnvironmentVariable(AzurePipelines.EnvironmentVariableName, "true"); + + this.sp = GetServiceProvider(gitVersionOptions, environment: environment); + sp.DiscoverRepository(); + var sut = sp.GetRequiredService(); + + // Execute + var version = sut.CalculateVersionVariables(); + + // Verify + version.ShouldNotBeNull(); + + // Verify that the correct commit is used + version.Sha.ShouldBe(latestCommit.Sha); + version.MajorMinorPatch.ShouldBe("2.0.0"); + + // Verify repository is still recognized as shallow + var repository = this.sp.GetRequiredService(); + repository.IsShallow.ShouldBeTrue("Repository should still be shallow after version calculation"); + } + private string GetWorktreePath(EmptyRepositoryFixture fixture) { var worktreePath = FileSystemHelper.Path.Combine(this.fileSystem.Directory.GetParent(fixture.RepositoryPath)?.FullName, Guid.NewGuid().ToString()); diff --git a/src/GitVersion.Core/Core/GitPreparer.cs b/src/GitVersion.Core/Core/GitPreparer.cs index adcad5de05..77f6b27346 100644 --- a/src/GitVersion.Core/Core/GitPreparer.cs +++ b/src/GitVersion.Core/Core/GitPreparer.cs @@ -190,7 +190,14 @@ private void NormalizeGitDirectory(bool noFetch, string? currentBranchName, bool if (this.repository.IsShallow) { - throw new WarningException("Repository is a shallow clone. Git repositories must contain the full history. See https://gitversion.net/docs/reference/requirements#unshallow for more info."); + if (this.options.Value.Settings.AllowShallow) + { + this.log.Info("Repository is a shallow clone. GitVersion will continue, but it is recommended to use a full clone for accurate versioning."); + } + else + { + throw new WarningException("Repository is a shallow clone. Git repositories must contain the full history. See https://gitversion.net/docs/reference/requirements#unshallow for more info."); + } } } diff --git a/src/GitVersion.Core/Options/Settings.cs b/src/GitVersion.Core/Options/Settings.cs index 58ded50c19..cbb9dabc8c 100644 --- a/src/GitVersion.Core/Options/Settings.cs +++ b/src/GitVersion.Core/Options/Settings.cs @@ -6,4 +6,5 @@ public record Settings public bool NoCache; public bool NoNormalize; public bool OnlyTrackedBranches = false; + public bool AllowShallow = false; } diff --git a/src/GitVersion.Core/PublicAPI.Shipped.txt b/src/GitVersion.Core/PublicAPI.Shipped.txt index 38ca63906a..27793f8f08 100644 --- a/src/GitVersion.Core/PublicAPI.Shipped.txt +++ b/src/GitVersion.Core/PublicAPI.Shipped.txt @@ -595,6 +595,7 @@ GitVersion.Settings.NoCache -> bool GitVersion.Settings.NoFetch -> bool GitVersion.Settings.NoNormalize -> bool GitVersion.Settings.OnlyTrackedBranches -> bool +GitVersion.Settings.AllowShallow -> bool GitVersion.VersionCalculation.BaseVersion GitVersion.VersionCalculation.BaseVersion.BaseVersion() -> void GitVersion.VersionCalculation.BaseVersion.BaseVersion(GitVersion.VersionCalculation.BaseVersionOperand! Operand) -> void diff --git a/src/GitVersion.MsBuild/msbuild/tools/GitVersion.MsBuild.props b/src/GitVersion.MsBuild/msbuild/tools/GitVersion.MsBuild.props index e1f335e940..c497718e77 100644 --- a/src/GitVersion.MsBuild/msbuild/tools/GitVersion.MsBuild.props +++ b/src/GitVersion.MsBuild/msbuild/tools/GitVersion.MsBuild.props @@ -11,20 +11,22 @@ false false false + false $(GitVersion_CommandLineArguments) -output file -outputfile "$(GitVersionOutputFile)" $(GitVersion_ToolArgments) -nofetch $(GitVersion_ToolArgments) -nonormalize $(GitVersion_ToolArgments) -nocache + $(GitVersion_ToolArgments) -allowshallow - true - + false From da29dc54b9900c9b05652501d0dd9a524e74905d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Nogueira?= <> Date: Sun, 1 Jun 2025 09:50:23 +0100 Subject: [PATCH 28/35] fix: add missing allowshallow entry to HelpWriterTests --- src/GitVersion.App.Tests/HelpWriterTests.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/GitVersion.App.Tests/HelpWriterTests.cs b/src/GitVersion.App.Tests/HelpWriterTests.cs index bf962ea97f..9005872c44 100644 --- a/src/GitVersion.App.Tests/HelpWriterTests.cs +++ b/src/GitVersion.App.Tests/HelpWriterTests.cs @@ -46,6 +46,7 @@ public void AllArgsAreInHelp() { nameof(Arguments.NoCache), "/nocache" }, { nameof(Arguments.NoFetch), "/nofetch" }, { nameof(Arguments.NoNormalize), "/nonormalize" }, + { nameof(Arguments.AllowShallow), "/allowshallow" }, }; var helpText = string.Empty; From e91cca25f82fa57594c873bff9a57bc07e66e77c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 7 Jun 2025 13:05:46 +0000 Subject: [PATCH 29/35] (deps): Bump the microsoft group with 1 update Bumps System.CommandLine from 2.0.0-beta5.25304.106 to 2.0.0-beta5.25306.101 --- updated-dependencies: - dependency-name: System.CommandLine dependency-version: 2.0.0-beta5.25306.101 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: microsoft ... Signed-off-by: dependabot[bot] --- new-cli/Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/new-cli/Directory.Packages.props b/new-cli/Directory.Packages.props index 2df8f1fc85..d12dbdbe94 100644 --- a/new-cli/Directory.Packages.props +++ b/new-cli/Directory.Packages.props @@ -20,7 +20,7 @@ - + From ace26891fbc8c1bdbfadb65498499cac994db791 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 8 Jun 2025 13:19:41 +0000 Subject: [PATCH 30/35] (deps): Bump the microsoft group with 1 update Bumps JsonSchema.Net.Generation from 5.0.2 to 5.0.3 --- updated-dependencies: - dependency-name: JsonSchema.Net.Generation dependency-version: 5.0.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: microsoft ... Signed-off-by: dependabot[bot] --- src/Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index 2f53bb1f13..2ba810387a 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -20,7 +20,7 @@ - + From 51faa50a276e51d9f9e157bfd38248f9b3c38aaf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 10 Jun 2025 12:41:40 +0000 Subject: [PATCH 31/35] (deps): Bump the microsoft group with 1 update Bumps System.CommandLine from 2.0.0-beta5.25306.101 to 2.0.0-beta5.25309.101 --- updated-dependencies: - dependency-name: System.CommandLine dependency-version: 2.0.0-beta5.25309.101 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: microsoft ... Signed-off-by: dependabot[bot] --- new-cli/Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/new-cli/Directory.Packages.props b/new-cli/Directory.Packages.props index d12dbdbe94..c8113133fa 100644 --- a/new-cli/Directory.Packages.props +++ b/new-cli/Directory.Packages.props @@ -20,7 +20,7 @@ - + From 3aa26642738533df6b0fb69a60686454b65b1274 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Jun 2025 12:38:35 +0000 Subject: [PATCH 32/35] (sdk): Bump dotnet-sdk from 9.0.300 to 9.0.301 Bumps [dotnet-sdk](https://github.com/dotnet/sdk) from 9.0.300 to 9.0.301. - [Release notes](https://github.com/dotnet/sdk/releases) - [Commits](https://github.com/dotnet/sdk/compare/v9.0.300...v9.0.301) --- updated-dependencies: - dependency-name: dotnet-sdk dependency-version: 9.0.301 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index 6e31df06a5..555ee4e443 100644 --- a/global.json +++ b/global.json @@ -5,6 +5,6 @@ "src" ], "sdk": { - "version": "9.0.300" + "version": "9.0.301" } } From ff753d35bb3b94c5486cd0cf2ab55e4a1575fd82 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Jun 2025 13:22:29 +0000 Subject: [PATCH 33/35] (deps): Bump the microsoft group with 12 updates Bumps Microsoft.Bcl.AsyncInterfaces to 9.0.5, 9.0.6 Bumps Microsoft.Extensions.Configuration.CommandLine from 9.0.5 to 9.0.6 Bumps Microsoft.Extensions.DependencyInjection from 9.0.5 to 9.0.6 Bumps Microsoft.Extensions.DependencyInjection.Abstractions to 9.0.6 Bumps Microsoft.Extensions.FileSystemGlobbing from 9.0.5 to 9.0.6 Bumps Microsoft.Extensions.Hosting from 9.0.5 to 9.0.6 Bumps Microsoft.Extensions.Options from 9.0.5 to 9.0.6 Bumps Polly to 8.6.0 Bumps System.CommandLine from 2.0.0-beta5.25309.101 to 2.0.0-beta5.25311.101 Bumps System.Drawing.Common to 9.0.5, 9.0.6 Bumps System.Security.Cryptography.Xml to 9.0.5, 9.0.6 Bumps System.Text.Json to 9.0.6 --- updated-dependencies: - dependency-name: Microsoft.Extensions.DependencyInjection.Abstractions dependency-version: 9.0.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: microsoft - dependency-name: Polly dependency-version: 8.6.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: microsoft - dependency-name: System.CommandLine dependency-version: 2.0.0-beta5.25311.101 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: microsoft - dependency-name: System.Text.Json dependency-version: 9.0.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: microsoft - dependency-name: Microsoft.Bcl.AsyncInterfaces dependency-version: 9.0.5 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: microsoft - dependency-name: Microsoft.Bcl.AsyncInterfaces dependency-version: 9.0.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: microsoft - dependency-name: Microsoft.Extensions.Configuration.CommandLine dependency-version: 9.0.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: microsoft - dependency-name: Microsoft.Extensions.DependencyInjection dependency-version: 9.0.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: microsoft - dependency-name: Microsoft.Extensions.DependencyInjection.Abstractions dependency-version: 9.0.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: microsoft - dependency-name: Microsoft.Extensions.FileSystemGlobbing dependency-version: 9.0.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: microsoft - dependency-name: Microsoft.Extensions.Hosting dependency-version: 9.0.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: microsoft - dependency-name: Microsoft.Extensions.Options dependency-version: 9.0.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: microsoft - dependency-name: System.Text.Json dependency-version: 9.0.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: microsoft - dependency-name: Polly dependency-version: 8.6.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: microsoft - dependency-name: System.Drawing.Common dependency-version: 9.0.5 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: microsoft - dependency-name: System.Drawing.Common dependency-version: 9.0.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: microsoft - dependency-name: System.Security.Cryptography.Xml dependency-version: 9.0.5 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: microsoft - dependency-name: System.Security.Cryptography.Xml dependency-version: 9.0.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: microsoft ... Signed-off-by: dependabot[bot] --- new-cli/Directory.Packages.props | 8 ++++---- src/Directory.Packages.props | 22 +++++++++++----------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/new-cli/Directory.Packages.props b/new-cli/Directory.Packages.props index c8113133fa..309f56e643 100644 --- a/new-cli/Directory.Packages.props +++ b/new-cli/Directory.Packages.props @@ -10,8 +10,8 @@ - - + + @@ -20,8 +20,8 @@ - + - + diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index 2ba810387a..9432e9294e 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -12,10 +12,10 @@ - - + + - + @@ -23,13 +23,13 @@ - + - - - - + + + + @@ -38,11 +38,11 @@ - + - - + + From 928d3c21bd97d53f64120535320e7cacd9e5117d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 12 Jun 2025 13:27:15 +0000 Subject: [PATCH 34/35] (deps): Bump the microsoft group with 2 updates Bumps NUnit.Analyzers from 4.8.1 to 4.9.0 Bumps System.CommandLine from 2.0.0-beta5.25311.101 to 2.0.0-beta5.25311.107 --- updated-dependencies: - dependency-name: System.CommandLine dependency-version: 2.0.0-beta5.25311.107 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: microsoft - dependency-name: NUnit.Analyzers dependency-version: 4.9.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: microsoft ... Signed-off-by: dependabot[bot] --- new-cli/Directory.Packages.props | 2 +- src/Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/new-cli/Directory.Packages.props b/new-cli/Directory.Packages.props index 309f56e643..2409359340 100644 --- a/new-cli/Directory.Packages.props +++ b/new-cli/Directory.Packages.props @@ -20,7 +20,7 @@ - + diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index 9432e9294e..e58359ab95 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -34,7 +34,7 @@ - + From 2c72382612fbcfa9933cba29cf418d17431c22b0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 13 Jun 2025 13:16:05 +0000 Subject: [PATCH 35/35] (deps): Bump the microsoft group with 2 updates Bumps NUnit.Analyzers from 4.9.0 to 4.9.1 Bumps System.CommandLine from 2.0.0-beta5.25311.107 to 2.0.0-beta5.25312.114 --- updated-dependencies: - dependency-name: System.CommandLine dependency-version: 2.0.0-beta5.25312.114 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: microsoft - dependency-name: NUnit.Analyzers dependency-version: 4.9.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: microsoft ... Signed-off-by: dependabot[bot] --- new-cli/Directory.Packages.props | 2 +- src/Directory.Packages.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/new-cli/Directory.Packages.props b/new-cli/Directory.Packages.props index 2409359340..4e05e8cc7a 100644 --- a/new-cli/Directory.Packages.props +++ b/new-cli/Directory.Packages.props @@ -20,7 +20,7 @@ - + diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index e58359ab95..38549fa504 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -34,7 +34,7 @@ - +