You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Isn't that a breaking change in terms of API? I am not sure its cool everyone that don't do vendoring. Also, current api and implementation is battle tested, v2 is not.
Isn't that a breaking change in terms of API? I am not sure its cool everyone that don't do vendoring.
My understanding of the go community is that the vast majority of people install from a tag, eg. 1.2.4 - and don't install from the default branch, eg master. So there's no API compatibility guarantee around the master branch.
Got a comment via Stephen Houston in the gophers general channel on slack
Traditionally I would say you keep master based off your current stable with bugfixes added in to prepare for point releases ... I.e. if your current stable is 1.0 ... master is on 1.0 but with bugfixes added in to be able to tag 1.1 etc... you have a develop branch that is for features/future releases... when you get ready to do a new major release, i.e. v1 -> v2... master becomes develop and you tag... and then master follows 2.0 and gets bugfixes for 2.0 in order to do point releases 2.1 etc... and develop moves on to new features/future releases.
Right, eventually (and hopefully sooner rather than later) the v2 branch should be merged into master branch.
But note that Go Modules completely doesn't care about either branches when you have git tags that are proper semver (which we do)
So my suggestion is the following:
you add a go.mod to the master branch with the following header module github.com/urfave/cli and then creating a new git tag: v1.22.0
and this way anyone issuing a go get github.com/urfave/cli will get the latest version (v1.22.0).
If someone wanted to get a version not yet tagged, they can still do go get github.com/urfave/cli@master and that should still work.
Now, once we merge v2 into master, anyone trying to do go get github.com/urfave/cli@master should fail since v2 is the default master branch and v2 is by definition a breaking change. I think that's totally okay, because anyone still wanting to get the regular v1 even after we merge v2 into master, can still do go get github.com/urfave/cli@latest or go get github.com/urfave/cli or even go get github.com/urfave/[email protected] (x being whatever number they wish)
Furthermore, once we have v2 merged into master, we need to tag a new release, probably v2.0.0. But we MUST change the go.mod file BEFORE we tag the new release to be module github.com/urfave/cli/v2 so that we maintain semantic import versioning.
And finally, everything should work. The master is the latest v2 version (which is what you suggested above), people can remain to use v1 as they wish (because Go Modules uses regular semver tags, and doesn't care about what's in the master branch). and people can also use v2 through the import path itself since it will have a v2 suffix.
The only thing missing in this process is patch branches, which we can create on the fly (if we know the exact commit before a major bump in master), or we can create stale version branches.
Now, once we merge v2 into master, anyone trying to do go get github.com/urfave/cli@master should fail since v2 is the default master branch
Presumably this requires go.mod to be updated with a /v2 suffix?
I guess go get github.com/urfave/cli with go version prior to module support would fetch v2 by default?
Presumably this requires go.mod to be updated with a /v2 suffix?
Yes, and also because I imagine the v2 has a different API than v1. Otherwise it wouldn't be v2, it would just be v1.x.x.
I guess go get github.com/urfave/cli with go version prior to module support would fetch v2 by default?
Yes, but since urfave/cli does not have sub-packages that it imports, it should continue to work. Though I'd be a fan of telling users to use modules if they want to use v2 since it'll be the default convention in 1.14 and onwards.
I'm available at around 5 hours a day over the next ~9 days to do any fast follow IC work on potential v2 bugs, if we find any 👀 I'm going to try migrating one of my CLIs, see what I find.
Activity
coilysiren commentedon Aug 3, 2019
I'm thinking that I'll keep the current 2.0 branch as release 2.0 forever, and the very next release I make will be 2.1.
coilysiren commentedon Aug 3, 2019
I'm also going to try to merge 2.0 into master ASAP. I may keep maintaining a 1.0 branch with bugfixes? If people are interested in that.
AudriusButkevicius commentedon Aug 3, 2019
Isn't that a breaking change in terms of API? I am not sure its cool everyone that don't do vendoring. Also, current api and implementation is battle tested, v2 is not.
coilysiren commentedon Aug 3, 2019
My understanding of the go community is that the vast majority of people install from a tag, eg.
1.2.4- and don't install from the default branch, egmaster. So there's no API compatibility guarantee around themasterbranch.That said, I just checked the
yamlpackage and apparently they changed their default branch to bev2https://github.com/go-yaml/yaml. So that may be the way to go here.That's true! Are you suggesting we have a beta release period, or similar?
coilysiren commentedon Aug 3, 2019
Got a comment via Stephen Houston in the gophers general channel on slack
coilysiren commentedon Aug 3, 2019
to echo @tsingson's comment here
#824 (comment)
coilysiren commentedon Aug 6, 2019
There's some really good discussion in this thread about go packaging and release a V2 #840 (comment)
AudriusButkevicius commentedon Aug 6, 2019
I am not sure what the plan is here.
I am not a fan of the current "there are two different incarnations of the library in a single repo" stuff.
Ideally we'd have only one library that is the right library for everyone, and that would be on master.
marwan-at-work commentedon Aug 6, 2019
Right, eventually (and hopefully sooner rather than later) the
v2branch should be merged intomasterbranch.But note that Go Modules completely doesn't care about either branches when you have git tags that are proper semver (which we do)
So my suggestion is the following:
you add a go.mod to the master branch with the following header
module github.com/urfave/cliand then creating a new git tag:v1.22.0and this way anyone issuing a
go get github.com/urfave/cliwill get the latest version (v1.22.0).If someone wanted to get a version not yet tagged, they can still do
go get github.com/urfave/cli@masterand that should still work.Now, once we merge
v2intomaster, anyone trying to dogo get github.com/urfave/cli@mastershould fail since v2 is the default master branch and v2 is by definition a breaking change. I think that's totally okay, because anyone still wanting to get the regularv1even after we merge v2 into master, can still dogo get github.com/urfave/cli@latestorgo get github.com/urfave/clior evengo get github.com/urfave/[email protected](x being whatever number they wish)Furthermore, once we have
v2merged intomaster, we need to tag a new release, probablyv2.0.0. But we MUST change the go.mod file BEFORE we tag the new release to bemodule github.com/urfave/cli/v2so that we maintain semantic import versioning.And finally, everything should work. The
masteris the latest v2 version (which is what you suggested above), people can remain to use v1 as they wish (because Go Modules uses regular semver tags, and doesn't care about what's in the master branch). and people can also use v2 through the import path itself since it will have av2suffix.The only thing missing in this process is patch branches, which we can create on the fly (if we know the exact commit before a major bump in master), or we can create stale version branches.
coilysiren commentedon Aug 6, 2019
I agree 👍
AudriusButkevicius commentedon Aug 6, 2019
Presumably this requires go.mod to be updated with a /v2 suffix?
I guess
go get github.com/urfave/cliwith go version prior to module support would fetch v2 by default?marwan-at-work commentedon Aug 6, 2019
@AudriusButkevicius
Yes, and also because I imagine the v2 has a different API than v1. Otherwise it wouldn't be v2, it would just be v1.x.x.
Yes, but since urfave/cli does not have sub-packages that it imports, it should continue to work. Though I'd be a fan of telling users to use modules if they want to use v2 since it'll be the default convention in 1.14 and onwards.
AudriusButkevicius commentedon Aug 6, 2019
Seems like we're ok to merge v2 into master then.
I guess we need to compare feature parity and make sure we are happy with the API before we do that.
coilysiren commentedon Aug 6, 2019
In case it's not clear - we will make explicitly sure that V2 has all the same features that V1 has currently 🙂
24 remaining items
coilysiren commentedon Nov 9, 2019
I'm available at around 5 hours a day over the next ~9 days to do any fast follow IC work on potential v2 bugs, if we find any 👀 I'm going to try migrating one of my CLIs, see what I find.
coilysiren commentedon Nov 9, 2019
@marwan-at-work
v2is now in master! I know you've been waiting for that for a while 🙏marwan-at-work commentedon Nov 9, 2019
@lynncyrin that's awesome, great work 💯💯💯 👏
upgrade to github.com/urfave/cli@master
upgrade to github.com/urfave/cli@master
coilysiren commentedon Nov 16, 2019
I'm going to release the current
masterversion as2.0.0today ✅asahasrabuddhe commentedon Nov 16, 2019
So excited for this to happen!
coilysiren commentedon Nov 21, 2019
Here's the ✨Official Git Tag ✨for v2 => https://github.com/urfave/cli/tree/v2.0.0
It's now available via
go get ... @v2.0.0[-]Release 2.X[/-][+]maint: release 2.X[/+]coilysiren commentedon Jan 18, 2020
2.0 is looking pretty stable now, so I'ma close this ♻️