Skip to content

Add tool package format version metadata to packed tool in settings file #9179

Closed

Description

@wli3

To support better error message when future version come.

@KathleenDollard should it be SettingsVersion? it is really not about settings file. It is the format or structure(folder structure + setting file content). Maybe ToolPackageFormatVersion ?

example:

<?xml version="1.0" encoding="utf-8"?>
<DotNetCliTool>
  <Commands>
    <Command Name="mytool" EntryPoint="mytool.dll" Runner="dotnet" />
  </Commands>

  <SettingsVersion>1.0.0</SettingsVersion>
</DotNetCliTool>

And also, warning when it is not compatible (start with 1.)

cc @dotnet/dotnet-cli

  • change on CLI to warning when major version is different
  • change on SDK to put version on packtool

Activity

  1. self-assigned this
    on Mar 15, 2018
  2. peterhuene commented on Mar 15, 2018

    @peterhuene
    Contributor

    Perhaps a Version or SettingsVersion attribute on DotNetCliTool rather than a sub-element?

  3. wli3 commented on Mar 15, 2018

    @wli3
    Author

    That's also good. A little vague. But better than settingsVersion since settingsVersion won't cover all

  4. KathleenDollard commented on Mar 15, 2018

    @KathleenDollard
  5. wli3 commented on Mar 22, 2018

    @wli3
    Author

    Do you think we should warning the user as long as minor version is bigger?

    If we use semver, when tool package format 1.2.0 come out in the future. It will require more feature, say support self contain, but back compat. That means, if the consumer has a SDK support 1.0.0 format, that SDK cannot support the self contain tools.

  6. wli3 commented on Mar 22, 2018

    @wli3
    Author

    @nguerrera @KathleenDollard

    Let's move the discussion on PR here. Since it is more of a general issue #2074 (comment)

    Nick:

    I don't have a huge opinion on this, but if the sole purpose is to mark a breaking boundary for older consumers, we could just use a single number: "1" -> "2" -> "3".

    I just wonder when we're expected to change major, minor, patch if there are 3 parts.

    Whatever scheme we use, we should be documenting when to change it.

  7. wli3 commented on Mar 22, 2018

    @wli3
    Author

    I think either way are fine, since it won't change that dramatic. However, i think semver is well known enough, and it fits here:

    If the package format version is 1.2, it may not work on SDK that only support 1.0 - 1.1 since it asks for more feature. It is fine for SDK Support 1.2 - 1.9999. But it should warning again for SDK supporting 2.0+

  8. wli3 commented on Mar 22, 2018

    @wli3
    Author

    Maybe the problem is the hammer is too big?

  9. nguerrera commented on Mar 22, 2018

    @nguerrera
    Contributor

    If the package format version is 1.2, it may not work on SDK that only support 1.0 - 1.1 since it asks for more feature. It is fine for SDK Support 1.2 - 1.9999. But it should warning again for SDK supporting 2.0+

    I'm having trouble interpreting this. Really the only meaningful thing is to poison the package so that old consumers break cleanly instead of unexpectedly. I think we only need one dimension for that.

    int formatVersion = 1; // bump whenever the format changes such that it will break old consumers

    Right now, when do we change it? Do we need to evaluate if every single change to the format is major, minor, or patch?

    If we can come up with clear guidance and document it, I'm fine with a semantic version, but I think the risk is that we won't actually update it to follow such guidelines because they are necessarily more complicated with 3 dimensions.

  10. KathleenDollard commented on Mar 22, 2018

    @KathleenDollard

    There is no implementation, so there is no need for a patch.

    The first major represents a change where we think an older version of the SDK will not be able to install or run the version of the tool created with a later version of the SDK.

    Those two sound OK?

    The question is whether we want to mark a change in the settings structure that is clearly a change, but we do not expect to be a problem for older versions of the SDK.

    On the one hand, I think we do because it's a dandy way to keep track of versions. On the other hand, this is only available at install time (correct?) and if we were interested in a new non-breaking feature we would look for the feature not the version number (correct?), so the only reason this exists is to give the warning to avoid attempting forwards compatibility in the tool structure. If that is the only reason we are doing this, yep, one digit does it.

    Can we add a second digit in the future if we are wrong about this very narrow usage?

    If all that lines up. Yep, one digit does it.

    Do we have docs on the settings.xml file that I need to update.

  11. wli3 commented on Mar 22, 2018

    @wli3
    Author

    On the other hand, this is only available at install time (correct?)

    It is in the disk. But it is only checked during install time.

    if we were interested in a new non-breaking feature we would look for the feature not the version number (correct?)

    This part I think I may misunderstood from the mail. So there is a feature that is absent. Today the code in master will error out due to the missing feature, say only support any. But do we also want to warn user to update SDK during install time?

  12. wli3 commented on Mar 22, 2018

    @wli3
    Author

    if not, the version number only bump with breaking change. And 1 digit is enough

  13. KathleenDollard commented on Mar 23, 2018

    @KathleenDollard

    Can you write the code so it ignores all but the first digit, but doesn't crash if we need two digit numbers later.

    If we don't prepare for the possibility of two digits, then we would be forced to add another number if we are wrong and it matters what the version is, even when the change is additive and non-breaking.

    Does that make sense? Otherwise I will be here a bit longer if you want to come by.

  14. transferred this issue fromdotnet/clion Jan 31, 2020
  15. added this to the 2.1.3xx milestone on Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions