ory / hydra-client-go

Apache License 2.0
39 stars 23 forks source link

Version 2 not installable/published correctly #16

Open apexskier opened 2 years ago

apexskier commented 2 years ago

Preflight checklist

Describe the bug

Version 2 of this package is not installable, as it's not published according to go's requirements (https://go.dev/blog/v2-go-modules).

...major version of a module must have a different module path than the previous version. Starting with v2, the major version must appear at the end of the module path (declared in the module statement in the go.mod file).

I think the fix will be as simple as updating the module in https://github.com/ory/hydra-client-go/blob/f558e85344c8c9ee053662f40f42fecc85dc3488/go.mod#L1 to github.com/ory/hydra-client-go/v2

Reproducing the bug

cameron@...
❯ go get -u github.com/ory/hydra-client-go@v2.0.1
go get: github.com/ory/hydra-client-go@v2.0.1: invalid version: module contains a go.mod file, so module path must match major version ("github.com/ory/hydra-client-go/v2")
↩ 1 (ERROR)
cameron@...
❯ go get -u github.com/ory/hydra-client-go/v2
go get: module github.com/ory/hydra-client-go@upgrade found (v1.11.8), but does not contain package github.com/ory/hydra-client-go/v2
↩ 1 (ERROR)

Relevant log output

No response

Relevant configuration

No response

Version

Upgrading from v1.11.8 to v2.0.1

On which operating system are you observing this issue?

macOS

In which environment are you deploying?

Kubernetes

Additional Context

No response

niwla23 commented 2 years ago

Same issue here

apexskier commented 2 years ago

FYI, a workaround is to install by SHA, instead of by version. You can grab the sha associated with the release

e.g.

go get -u github.com/ory/hydra-client-go@76cf2d374d54a15b27ea0d7f9570069ceed30abc

results in a diff of

-       github.com/ory/hydra-client-go v1.11.8
+       github.com/ory/hydra-client-go v1.11.9-0.20221027120355-76cf2d374d54

(the version being 1.11.9 is expected, as go's basically saying it's the next greatest release, I think)

aeneasr commented 2 years ago

ack

aeneasr commented 2 years ago

https://github.com/ory/sdk/pull/225

apexskier commented 2 years ago

This doesn't appear fixed? Both project go.mod files still are missing v2 suffixes. https://github.com/ory/hydra-client-go/blob/f558e85344c8c9ee053662f40f42fecc85dc3488/go.mod#L1, https://github.com/ory/sdk/blob/5711942bbd989c6b6d82ec27a00bd63ebbe19649/clients/hydra/go/go.mod#L1?

aeneasr commented 2 years ago

We still need to release a new version of ory hydra

JeffLabonte commented 5 months ago

I believe they did not communicate it. Their documentation still gives the wrong string that gives 1.18.

If you want to install the latest version, I figured out in the code they changed the package's name to the following: github.com/ory/hydra-client-go/v2.

go get github.com/ory/hydra-client-go/v2

image

aeneasr commented 5 months ago

That is correct!