Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: add /v2 to import module path#9037

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
coryb wants to merge2 commits intocoder:mainfromcoryb:v2
Closed

Conversation

coryb
Copy link
Contributor

go mod requires semantic versioning with versions greater than 1.x

This was a mechanical update by running:

go install github.com/marwan-at-work/mod/cmd/mod@latestmod upgrade

@cdr-botcdr-botbot added the communityPull Requests and issues created by the community. labelAug 11, 2023
@github-actions
Copy link

github-actionsbot commentedAug 11, 2023
edited
Loading

CLA Assistant Lite bot:
Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you all sign ourContributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


1 out of2 committers have signed the CLA.
@kylecarbs
@coryb
You can retrigger this bot by commentingrecheck in this Pull Request

@corybcoryb changed the titleadd /v2 to import module pathchore: add /v2 to import module pathAug 11, 2023
@coryb
Copy link
ContributorAuthor

Not sure how to sign the CLA. We have a corporate CLA for Netflix.

go mod requires semantic versioning with versions greater than 1.xThis was a mechanical update by running:```go install github.com/marwan-at-work/mod/cmd/mod@latestmod upgrade```
@matifali
Copy link
Member

@coryb you have to type a comment with

I have read the CLA Document and I hereby sign the CLA

@Emyrk
Copy link
Member

Do we need this right now?

For thego mod requires semantic versioning with versions greater than 1.x, we are only on v2.x.x to remove any possible confusion with our first version of the product. Semantically, we are on v1.x.x of this repository, but for business reasons, we jump to v2.x.x.

The first version of the product is closed source, so for go module reasons, the two products will never be confused externally.


Additional question,

Does this mean that anyone importinggithub.com/coder/coder might get our v0.x.x version of the code, and not the latest?

@Emyrk
Copy link
Member

Emyrk commentedAug 11, 2023
edited
Loading

Readinghttps://go.dev/ref/mod#major-version-suffixes

If an old package and a new package have the same import path, the new package must be backwards compatible with the old package.

I will defer judgment to others, but these imports are backwards compatible to the previous v0.x.x. I think the only package that is created for external use is thecodersdk package.

@Emyrk
Copy link
Member

I am not blocking this PR btw, just curious

@coryb
Copy link
ContributorAuthor

If an old package and a new package have the same import path, the new package must be backwards compatible with the old package.

I think this only refers to releases within the same major version stream.

That document also says:

Starting with major version 2, module paths must have a major version suffix like /v2 that matches the major version. For example, if a module has the path example.com/mod at v1.0.0, it must have the path example.com/mod/v2 at version v2.0.0.

and

By definition, packages in a new major version of a module are not backwards compatible with the corresponding packages in the previous major version.

I am pretty fuzzy on the go.mod version requirements myself, I just know that we cant import the latest coder release because it fails:

go get github.com/coder/coder@v2.0.2go: github.com/coder/coder@v2.0.2: invalid version: module contains a go.mod file, so module path must match major version ("github.com/coder/coder/v2")
go get github.com/coder/coder/v2@v2.0.2go: github.com/coder/coder@v2.0.2: invalid version: module contains a go.mod file, so module path must match major version ("github.com/coder/coder/v2")

Anyway, it looks like the PR doesn't work because of several other places where the package name is hard-coded in generators. I fixed the protos and some locations in ./scripts, but there seem to be more. I need to fix my dev environment to run these things locally so probably makes sense for someone else to recreate this work, or patch my PR.

@Emyrk
Copy link
Member

I am pretty fuzzy on the go.mod version requirements myself, I just know that we cant import the latest coder release because it fails:

go get github.com/coder/coder@v2.0.2go: github.com/coder/coder@v2.0.2: invalid version: module contains a go.mod file, so module path must match major version ("github.com/coder/coder/v2")
go get github.com/coder/coder/v2@v2.0.2go: github.com/coder/coder@v2.0.2: invalid version: module contains a go.mod file, so module path must match major version ("github.com/coder/coder/v2")

Ooof this is enough validation for me. We have a few generators yea 😢

@kylecarbs
Copy link
Member

Doing#9072 instead

@coryb
Copy link
ContributorAuthor

closing in favor of#9072

@corybcoryb closed thisAug 14, 2023
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsAug 14, 2023
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@kylecarbskylecarbskylecarbs approved these changes

Assignees

@corybcoryb

Labels
communityPull Requests and issues created by the community.
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@coryb@matifali@Emyrk@kylecarbs

[8]ページ先頭

©2009-2025 Movatter.jp