question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

GitVersion Tool: Rename verbosity values to match GitVersion values

See original GitHub issue

Follow-up from #3281

Background

The Verbosity argument of GitVersion changed in more recent releases and the existing values in Cake’s enumeration no longer match the accepted values by GitVersion.

Proposal

Update/rename the values in the Cake enumeration to match the exact values values expected in newer versions of GitVersion. This would be a breaking change in the Cake’s API and would be included in a future major version of Cake.

Cake Rename to GitVersion
None ➡️ Quiet
Error ➡️ Minimal
Warn ➡️ Normal
Info ➡️ Verbose
Debug ➡️ Diagnostic

Workaround

The current workaround is to use ArgumentCustomization to pass in custom values:

var result = GitVersion(new GitVersionSettings
{
    // ...
    ArgumentCustomization = args => args
        .Append("-verbosity")
        .Append("Quiet")
});

Related:

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
augustoproietecommented, Apr 24, 2021

This has been resolved by #3321 and will be released with Cake v2.0

1reaction
augustoproietecommented, Apr 24, 2021

why have a distinct GetVersionVerbosity when there is an app-level Verbosity already, and the GitVersionRunner is just transpiling? if merging the verbosity classes is better long-term then I’m willing to give that a look as well.

Hey @joshuacookdev thanks for your interest in helping with this one!

For context, GitVersion is a separate open-source project that is not part of Cake (it’s an external tool that can be executed from Cake), and what we’re doing is just adding some “helper” methods to make it easy for Cake users to execute the GitVersion tool.

It’s important to have a separation between GitVersionVerbosity and Verbosity because both GitVersion and Cake might modify its verbosity options at any point in the future as they are independent projects.

We want users of GitVersion to be able to leverage all the options that GitVersion offers without having to compromise on the options offered by Cake, and we want to reserve the right to modify Cake’s verbosity options without worrying about it having side-effects to GitVersion (or other tools).

When you use GitVersion from Cake, you can explicitly set the verbosity level, e.g.:

GitVersion(new GitVersionSettings
{
    Verbosity = GitVersionVerbosity.Diagnostic,
});

That means GitVersionVerbosity should always reflect all the options that GitVersion understands.

The options of GitVersion for Verbosity now happen to match with the options that Cake uses for Verbosity but that was not the case before and we can’t guarantee it will continue that way in the future.

If tomorrow they (GitVersion) add a new option, say, Information, all we have to do is to update GitVersionVerbosity and users can start leveraging this new option, without us having to change the Verbosity enumeration of Cake.

Likewise, if Cake adds a new option that GitVersion doesn’t understand, the execution of the tool would fail.

Does that make sense?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configuration
The special value Inherit means that GitVersion should find the parent branch (i.e. the branch where the current branch was branched from), and...
Read more >
Git - git-config Documentation
Regular expression matching is currently case-sensitive and done against a canonicalized version of the key in which section and variable names are lowercased, ......
Read more >
Cake v2.0.0 released
#3282 GitVersion Tool: Rename verbosity values to match GitVersion values. #3222 Add Xamarin.iOS platform targets to MSBuildSettings ...
Read more >
GitVersion not respecting tag-prefix
I was misunderstanding the use of the settings. I've found a work around for my specific use case that I'm going to reply...
Read more >
bcftools(1) Manual Page
This option controls how overlapping records are determined: set to pos or 0 if the VCF record has to have POS inside a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found