go-grpc-middleware icon indicating copy to clipboard operation
go-grpc-middleware copied to clipboard

go get-ing v2 version requires commit hash.

Open cayden-uw opened this issue 4 years ago • 4 comments

Steps to reproduce

  1. go get -u github.com/grpc-ecosystem/go-grpc-middleware/providers/zap/v2

Outcome

go get: module github.com/grpc-ecosystem/go-grpc-middleware@upgrade found (v1.3.0), but does not contain package github.com/grpc-ecosystem/go-grpc-middleware/providers/zap/v2

Expected Behavior

Module is installed

Notes

  • I was able to install all other v2 modules including auth
  • https://pkg.go.dev/github.com/grpc-ecosystem/go-grpc-middleware/providers notes that v2 modules are avaiable apart from zap

cayden-uw avatar Jun 16 '21 04:06 cayden-uw

@bwplotka what happened here 😁?

johanbrandhorst avatar Jun 18 '21 02:06 johanbrandhorst

There's no tag starting by providers/zap/v2 (v2.0.0-rc* have been tagged only for the main module and for providers/zerolog) so go get cannot use tags.

Furthermore, go get will not use the branch v2 (cf https://golang.org/ref/mod#version-queries: Note that branches and tags with names matched by other version queries cannot be selected this way. For example, the query v2 selects the latest version starting with v2, not the branch named v2.)

That's why go get fails to get the module, even if you try to specify a tag or a branch.

Instead, you currently have to select the last commit on the v2 branch, e.g. for today:

go get github.com/grpc-ecosystem/go-grpc-middleware/providers/zap/v2@49d9c0d5b43c36b4511bad106591313ff57f32e4

This will be translated to a pseudo-version: v2.0.0-20210710195107-49d9c0d5b43c

olivierlemasle avatar Jul 11 '21 22:07 olivierlemasle

Thank you so much @olivierlemasle that go me in a working state and provided some useful background on the branch vs tag confusion I had!

I will leave this issue open as it seems a tag for the v2 version for zap would be useful as it is for zerolog and the main module.

cayden-uw avatar Jul 11 '21 23:07 cayden-uw

Yes, before tagging major version v2 we have to work on commits. Thank you @olivierlemasle for explaining all well 👍🏽

Let's keep this issue open until this works. Changed title too (:

bwplotka avatar Jul 12 '21 11:07 bwplotka

This is now fixed. The actual problem was lack of proper release for submodule as explained https://github.com/grpc-ecosystem/go-grpc-middleware#for-maintainers-release-process (we need prefix of path of sub module). This should be now fixed. Also loggers were removed - See https://github.com/grpc-ecosystem/go-grpc-middleware#changes-compared-to-v1 for rationales.

bwplotka avatar Apr 13 '23 10:04 bwplotka