Skip to content
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

Octoversion still requires deprecated tool (OctoVersion.Tool version 0.3.59) #1492

Open
abowen opened this issue Dec 15, 2024 · 1 comment
Open
Labels

Comments

@abowen
Copy link

abowen commented Dec 15, 2024

Usage Information

NUKE 9.0.3 / OctoVersion 1.0.1 / NET Core v8.0 / Windows

Description

We're converting from GitVersion to OctoVersion

After following the instructions, the latest version (1.0.1) of OctoVersion requires the legacy version to be installed

I mentioned it on OctopusDeploy's GitHub but they mentioned this setting was out of date

https://github.com/nuke-build/nuke/blob/develop/source/Nuke.Common/Tools/OctoVersion/OctoVersion.json#L8

I've seen another PR fix a similar problem, so not sure why this LoC was not updated too

#1104

Here's the error log

PowerShell Desktop version 5.1.22621.4391
Microsoft (R) .NET SDK version 8.0.404
...
NUKE Execution Engine version 9.0.3 (Windows,.NETCoreApp,Version=v8.0)

12:57:42 [WRN] Could not inject value for Build.OctoVersionInfo
System.Exception: Missing package reference/download.
Run one of the following commands:
  - nuke :add-package OctoVersion.Tool --version 0.3.59
 ---> System.ArgumentException: Could not find package 'OctoVersion.Tool' using:
 - Project assets file 'C:\Users\me\git\my-project\build\obj\project.assets.json'
 - NuGet packages config 'C:\Users\me\git\my-project\build\_build.csproj'
   at Nuke.Common.Assert.NotNull[T](T obj, String message, String argumentExpression) in /_/source/Nuke.Utilities/Assert.cs:line 73
   at Nuke.Common.Tooling.NuGetToolPathResolver.GetPackageDirectory(String[] packageIds, String version) in /_/source/Nuke.Tooling/NuGetToolPathResolver.cs:line 85
   --- End of inner exception stack trace ---
   at Nuke.Common.Assert.Fail(String message, Exception exception) in /_/source/Nuke.Utilities/Assert.cs:line 28
   at Nuke.Common.Tooling.NuGetToolPathResolver.GetPackageDirectory(String[] packageIds, String version) in /_/source/Nuke.Tooling/NuGetToolPathResolver.cs:line 145
   at Nuke.Common.Tooling.NuGetToolPathResolver.GetPackageExecutable(String packageId, String packageExecutable, String version, String framework) in /_/source/Nuke.Tooling/NuGetToolPathResolver.cs:line 29
   at Nuke.Common.Tooling.NuGetToolAttribute.GetToolPath(ToolOptions options) in /_/source/Nuke.Tooling/ToolTasks.ToolPath.cs:line 120
   at Nuke.Common.Tooling.ToolTasks.GetToolPath(ToolOptions options) in /_/source/Nuke.Tooling/ToolTasks.ToolPath.cs:line 38
   at Nuke.Common.Tooling.ToolTasks.GetToolPathInternal(ToolOptions options) in /_/source/Nuke.Tooling/ToolTasks.ToolPath.cs:line 30
   at Nuke.Common.Tooling.ToolTasks.Run[T](ToolOptions options) in /_/source/Nuke.Tooling/ToolTasks.Run.cs:line 24
   at Nuke.Common.Tooling.ToolTasks.Run[TOptions,TResult](ToolOptions options) in /_/source/Nuke.Tooling/ToolTasks.Run.cs:line 45
   at Nuke.Common.Tools.OctoVersion.OctoVersionTasks.OctoVersionGetVersion(Configure`1 configurator) in /_/source/Nuke.Common/Tools/OctoVersion/OctoVersion.Generated.cs:line 35
   at Nuke.Common.Tools.OctoVersion.OctoVersionAttribute.GetValue(MemberInfo member, Object instance) in /_/source/Nuke.Common/Tools/OctoVersion/OctoVersionAttribute.cs:line 141
   at Nuke.Common.ValueInjection.ValueInjectionAttributeBase.TryGetValue(MemberInfo member, Object instance) in /_/source/Nuke.Build/Execution/Extensibility/ValueInjectionAttributeBase.cs:line 26
Member 'OctoVersionInfo' is required to be not null or empty
​
╬══════════════════════
║ Errors & Warnings
╬═════════════
​
[WRN] : Could not inject value for Build.OctoVersionInfo

Reproduction Steps

As per instructions, in Build.cs

using Nuke.Common.Tools.OctoVersion;
...
    [Required]
    [OctoVersion(AutoDetectBranch = true)]
    readonly OctoVersionInfo OctoVersionInfo;

_build.csproj

  <ItemGroup>
    <PackageDownload Include="Octopus.OctoVersion.Tool" Version="[1.0.1]" />
  </ItemGroup>

Running nuke command from terminal (PowerShell on Windows in my case)

Expected Behavior

Runs and populates the OctoVersion parameter

Actual Behavior

Throws an error that requires the user to install deprecated tool

Regression?

Not that I'm aware of, I'm relatively new to Nuke

Known Workarounds

nuke :add-package OctoVersion.Tool --version 0.3.59

And install .NET 6.0

Could you help with a pull-request?

Yes

@abowen abowen added the bug label Dec 15, 2024
abowen added a commit to abowen/nuke that referenced this issue Dec 15, 2024
@abowen
Copy link
Author

abowen commented Dec 15, 2024

PR - #1493

It feels a bit too simple, so if there's something I've missed / context I'm unaware of, happy to work on the PR with some guidance

abowen added a commit to abowen/nuke that referenced this issue Dec 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant