-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GitVersion 6.0.0 is not supported due to breaking changes #477
Comments
Workaround is to install 5.12.0 in Azure Pipelines, e.g.:
|
Can use |
As mentioned by @gaelcolas offline is that we need to pad the preview string number with zeros, e.g. 'preview0001'. This so sorting in certain NuGet repositories work as expected, it is an OData issue with NuGet. To prevent that Also, any dot ( This is an example from GitVersion's docs (link above): {
"Major": 3,
"Minor": 22,
"Patch": 11,
"PreReleaseTag": "beta.99",
"PreReleaseTagWithDash": "-beta.99",
"PreReleaseLabel": "beta",
"PreReleaseLabelWithDash": "-beta",
"PreReleaseNumber": 99,
"WeightedPreReleaseNumber": 1099,
"BuildMetaData": 88,
"FullBuildMetaData": "99.Branch.release/3.22.11.Sha.28c853159a46b5a87e6cc9c4f6e940c59d6bc68a",
"MajorMinorPatch": "3.22.11",
"SemVer": "3.22.11-beta.99",
"AssemblySemVer": "3.22.11.0",
"AssemblySemFileVer": "3.22.11.0",
"InformationalVersion": "3.22.11-beta.99+88.Branch.release/3.022.011.Sha.28c853159a46b5a87e6cc9c4f6e940c59d6bc68a",
"FullSemVer": "3.22.11-beta.99+88",
"BranchName": "release/3.022.011",
"EscapedBranchName": "release-3.022.011",
"Sha": "28c853159a46b5a87e6cc9c4f6e940c59d6bc68a",
"ShortSha": "28c8531",
"VersionSourceSha": "28c853159a46b5a87e6cc9c4f6e940c59d6bc68a",
"CommitsSinceVersionSource": 7,
"CommitDate": "2021-12-31",
"UncommittedChanges": 0
} My thoughts:
|
Maybe we should introduce a a command that has several purposes (maybe we already have one)
The command can return different values depending on passed parameters. |
Another option I'm using is to add a build task to install GitVersion if needed: param (
# Build Configuration object
[Parameter()]
[System.Collections.Hashtable]
$BuildInfo = (property BuildInfo @{ })
)
# Synopsis: Installs GitVersion as a .NET Global Tool if needed
task Install_GitVersion -if ($BuildInfo.GitVersion.Version) {
$gitVersionAvailable = Get-Command -Name 'gitversion' -ErrorAction 'SilentlyContinue'
$dotNetGitVersionAvailable = Get-Command -Name 'dotnet-gitversion' -ErrorAction 'SilentlyContinue'
# If neither dotnet-gitversion nor gitversion are available, install dotnet-gitversion.
if (-not $dotNetGitVersionAvailable -and -not $gitVersionAvailable) {
Write-Build -Color Green -Text "Installing GitVersion $($BuildInfo.GitVersion.Version) as a .NET Global Tool"
$null = dotnet tool install --global GitVersion.Tool --version $BuildInfo.GitVersion.Version
}
}
Once Sampler is updated to support both versions when determining the module version, you can selectively update a given project to use 6.x, which might also include updating GitVersion.yml as the schema has changed too. |
Downside to this is that we shouldn't change the users machine which will happen if the user runs the task locally. Currently Sampler expects correct version to be installed on the users machine. Is it possible to save it just for the project without installing it, like portable so it can be easily removed? |
For macOS and It is possible to run I currently need to do that on my macOS which updated to v6, where it is not possible to revert to 5.x version using |
If you install the tool in a custom path (which I am currently doing), you can invoke from there. So maybe the tool is installed in |
I wonder what is required to get |
Problem description
There are breaking changes in GitVersion that fails builds in projects using Sampler. Workaround is to pin an older version.
Notable breaking changes are configuration properties that has changed name, and output properties (
NuGetVersionV2
) that no longer exist.Configuration documentation: https://gitversion.net/docs/reference/configuration
Output variables: https://gitversion.net/docs/reference/variables
Verbose logs
How to reproduce
Build a project using GitVersion v6.0.0
Expected behavior
Sampler supports v6.0.0
Current behavior
Fails if GitVersion 6.0.0 is installeed.
Suggested solution
Update all tasks and configuration (and templates) to use another property than
NuGetVersionV2
.Did a quick test in another project to see what was needed when I realized that we have hardcoded
NuGetVersionV2
in the tasks. This PR shows the needed config changes: viscalyx/PesterConverter#28Also, the property used cannot contain '.' in the prerelease string since it is not supported in module manifest. 🤔
Operating system the target node is running
PowerShell version and build the target node is running
Module version used
The text was updated successfully, but these errors were encountered: