biscuit-auth / biscuit-go

Apache License 2.0
75 stars 22 forks source link

Fix v2 release #106

Closed guregu closed 1 year ago

guregu commented 2 years ago

As outlined in #104, it's currently impossible to import v2 of this package. This PR fixes the issue with the "release version in go.mod URL" strategy.

I've tested this at https://github.com/guregu/biscuit-go and it looks like it works well.

Geal commented 1 year ago

from what I understand of that versioning model, we should have v1 from the root, and v2 in the v2/ folder?, both in the same tree? Or we could have only v2 in the repository, since v1 should not be used anymore

guregu commented 1 year ago

It's pretty confusing, but my understanding is you have two options:

  1. Leave v1 in the root, add v2 folder (this is the "recommended" way)
  2. Change go.mod to include the /v2 suffix (this is the way I did it in this PR, as in here)

AFAIK, both of these should work. I went with the 2nd option because it was closer to what the current state of the main branch is, but the 1st approach should also be fine I think.

Geal commented 1 year ago

thanks!

jvatic commented 1 year ago

I believe this also requires there to be a git tag of >= v2.0.0 applied to the latest commit that belongs in this version, currently go is complaining about having a v1 version with a v2 module path:

github.com/biscuit-auth/biscuit-go@v1.0.1-0.20221212205437-370cd7c6a478: invalid version: go.mod has post-v1 module path "github.com/biscuit-auth/biscuit-go/v2" at revision 370cd7c6a478