Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GODRIVER-2690 Set minimum supported Go version to 1.18 in Go Driver v2.0 #1386

Merged
merged 14 commits into from
Sep 25, 2023

Conversation

prestonvasquez
Copy link
Collaborator

@prestonvasquez prestonvasquez commented Sep 14, 2023

GODRIVER-2690

Summary

Migrate the Go imports and module to v2 and set minimum supported Go Version to 1.18. Additionally, updating to 1.18 allows us to remove the vendor directory.

Background & Motivation

The Go Driver team intends for the master branch to work as the "development" branch. Therefore, a "v1" branch has been cut where v1.x-focused tickets will be development on the "v1" branch and then cherry-picked , as needed, to the master branch.

This ticket updates the master branch to reflect the "development" branch as v2-focused.

README.md Outdated Show resolved Hide resolved
@prestonvasquez prestonvasquez marked this pull request as ready for review September 14, 2023 23:24
@prestonvasquez prestonvasquez requested a review from a team as a code owner September 14, 2023 23:24
@prestonvasquez prestonvasquez requested review from blink1073 and matthewdale and removed request for a team September 14, 2023 23:24
@@ -41,7 +41,7 @@ func BenchmarkClientWrite(b *testing.B) {
if err != nil {
b.Fatalf("error connecting: %v", err)
}
defer client.Disconnect(context.Background())
defer func() { _ = client.Disconnect(context.Background()) }()
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

golangci-lint wants us to check errors.

@@ -11,7 +11,7 @@ import (
"io/ioutil"
"path/filepath"

"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/v2/bson"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm concerned that doing this package major version bump now is going to make keeping v1 and master in-sync difficult for the duration of v2 development. That may cause every v1 --> master sync to hit a merge conflict or require manual modification of the import path. Is it possible to defer making the module version change until later?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, this makes sense. I will revert those changes.

@matthewdale
Copy link
Collaborator

That's quite a diff summary
Screenshot 2023-09-15 at 3 22 41 PM

🎉

@github-actions
Copy link

API Change Report

No changes found!

matthewdale
matthewdale previously approved these changes Sep 18, 2023
Copy link
Collaborator

@matthewdale matthewdale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍

Makefile Outdated
.PHONY: check-modules
check-modules:
go mod tidy -v
go mod vendor
git diff --exit-code go.mod go.sum ./vendor
go mod verify
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional: go mod verify seems to conflict with using Go workspaces in some cases (see golang/go#62663). When I run that command on my workstation, I get an error:

❯ go mod verify
go.mongodb.org/mongo-driver : missing ziphash: open hash: no such file or directory

Consider removing go mod verify.

Copy link
Collaborator

@matthewdale matthewdale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍

@prestonvasquez prestonvasquez enabled auto-merge (squash) September 25, 2023 20:55
@prestonvasquez prestonvasquez merged commit 3e34fa3 into mongodb:master Sep 25, 2023
@prestonvasquez prestonvasquez deleted the GODRIVER-2690 branch September 25, 2023 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants