Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

GH4278: Update Spectre.Console to 0.49.1 #4279

Merged
merged 5 commits into from
Sep 26, 2024

Conversation

devlead
Copy link
Member

@devlead devlead commented Nov 24, 2023

@devlead devlead enabled auto-merge November 24, 2023 15:14
@devlead devlead disabled auto-merge November 24, 2023 16:21
@devlead
Copy link
Member Author

devlead commented Nov 24, 2023

It would seem Spectre.Console 0.48.0 has a breaking change with settings like

[CommandOption("--version|--ver")]
[Description("Displays version information.")]
public bool ShowVersion { get; set; }

This test fails

[Theory]
[InlineData("--version")]
[InlineData("--ver")]
public async Task The_Version_Option_Should_Call_Version_Feature(params string[] args)

only the last --ver works.

image

not investigated the root cause fully.

@devlead
Copy link
Member Author

devlead commented Nov 24, 2023

Found the issue Spectre.Console.Cli no longer allows default commands to have a --version parameter, which Cake relied on to have it's own custom version command.

spectreconsole/spectre.console@131b37f#diff-d38c9fa48d9c39f8eec58957b2333d13943f2cbe1adee26f30325e527a56f600L26-R41

Will see if I can find away around that, can't use the default Spectre version command as it will produce a version string that will break Cake cli contract. Overriding command settings ApplicationVersion and removing cake version feature should probably achieve the same result for end user.

@devlead
Copy link
Member Author

devlead commented Nov 24, 2023

As it's by design breaking change in Spectre.Console.Cli, I just added a workaround to opt-out of this behavior for Cake.Tool.

@devlead devlead enabled auto-merge November 24, 2023 20:19
@devlead devlead disabled auto-merge November 24, 2023 20:21
src/Cake/Program.cs Outdated Show resolved Hide resolved
@devlead devlead marked this pull request as draft November 24, 2023 20:35
@devlead devlead changed the title GH4278: Update Spectre.Console to 0.48.0 GH4278: Update Spectre.Console to 0.49.1 Sep 25, 2024
@devlead
Copy link
Member Author

devlead commented Sep 25, 2024

The breaking --version change was revered in Spectre.Console 0.49.1

@devlead
Copy link
Member Author

devlead commented Sep 25, 2024

Ah would seem remaining arguments has changed in Specre.Console.Cli will investigate, PR still WIP.

@devlead devlead marked this pull request as ready for review September 26, 2024 14:35
@devlead devlead enabled auto-merge September 26, 2024 14:35
@devlead
Copy link
Member Author

devlead commented Sep 26, 2024

@cake-build/cake-team this should be ready for review now.

Copy link
Member

@patriksvensson patriksvensson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@devlead devlead merged commit 9b171c0 into cake-build:develop Sep 26, 2024
15 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update Spectre.Console to 0.49.1
2 participants