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

chore: update to v2 go mod #3217

Merged
merged 15 commits into from
Apr 4, 2024
Merged

chore: update to v2 go mod #3217

merged 15 commits into from
Apr 4, 2024

Conversation

cmwaters
Copy link
Contributor

@cmwaters cmwaters commented Mar 27, 2024

We should make sure that our use of go mods matches our git versioning numbers i.e. v2.0.0 needs to be for a v2 module

Closes #3174

Copy link

PR Preview Action v1.4.7
🚀 Deployed preview to https://celestiaorg.github.io/celestia-app/pr-preview/pr-3217/
on branch gh-pages at 2024-03-27 10:32 UTC

evan-forbes
evan-forbes previously approved these changes Mar 27, 2024
Copy link
Collaborator

@rootulp rootulp left a comment

Choose a reason for hiding this comment

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

I only looked at the first 3 files in the diff but it looks like a lot of links were modified that shouldn't have been modified

.github/workflows/github-pages.yml Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@celestia-bot celestia-bot requested a review from a team March 27, 2024 15:00
@cmwaters
Copy link
Contributor Author

Should have reverted all the replaces to non go/proto files

@cmwaters cmwaters requested review from rootulp and evan-forbes March 27, 2024 15:02
Copy link
Collaborator

@rootulp rootulp left a comment

Choose a reason for hiding this comment

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

One non-blocking question: how do we verify the proto Go package strings are correct?

[blocking] I think test/e2e/node.go broke during merge resolution

app/default_overrides.go Outdated Show resolved Hide resolved
app/prepare_proposal.go Outdated Show resolved Hide resolved
pkg/proof/proof_test.go Outdated Show resolved Hide resolved
@@ -1,7 +1,7 @@
syntax = "proto3";
package celestia.core.v1.da;

option go_package = "github.com/celestiaorg/celestia-app/proto/celestia/core/v1/da";
option go_package = "github.com/celestiaorg/celestia-app/v2/proto/celestia/core/v1/da";
Copy link
Collaborator

Choose a reason for hiding this comment

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

[no change needed] is there a way to sanity check that that this name is correct? I guess I'm asking if any of the proto CI checks would fail if this line pointed to an incorrect Go package

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So I'm not sure if the path is really used. I just know that for buf it needs to be set

test/txsim/run_test.go Outdated Show resolved Hide resolved
x/blob/client/cli/payforblob.go Outdated Show resolved Hide resolved
x/blobstream/types/attestation.go Outdated Show resolved Hide resolved
x/blobstream/types/query.pb.go Outdated Show resolved Hide resolved
x/blobstream/types/types.pb.go Outdated Show resolved Hide resolved
x/blobstream/types/types.pb.go Outdated Show resolved Hide resolved
@celestia-bot celestia-bot requested a review from a team March 27, 2024 15:50
@cmwaters cmwaters requested a review from rootulp April 2, 2024 12:16
rootulp
rootulp previously approved these changes Apr 2, 2024
Copy link
Collaborator

@rootulp rootulp left a comment

Choose a reason for hiding this comment

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

Thanks for reverting all the GH issue links. I just scanned the diff from the last review and it looks good to me. I wonder if there's any manual testing we can do before / after this merges to verify everything was ported over to v2 correctly.

The Go compiler gives us confidence that the import statements are correct. Manual review gives us confidence the GH issues are still correct. My only concern is around the Protobuf definitions so I'm 🤞 hoping that the proto-* CI jobs would fail if we broke something.

Comment on lines 2 to 4
package celestia.blob.v1;

option go_package = "github.com/celestiaorg/celestia-app/v2/x/blob/types";
option go_package = "github.com/celestiaorg/celestia-app/x/blob/types";
Copy link
Collaborator

Choose a reason for hiding this comment

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

[question] when do we bump the version number v1 in package celestia.blob.v1?

You can add an optional package specifier to a .proto file to prevent name clashes between protocol message types.

In Go, the package directive is ignored, and the generated .pb.go file is in the package named after the corresponding go_proto_library Bazel rule. For open source projects, you must provide either a go_package option or set the Bazel -M flag.

Ref: https://protobuf.dev/programming-guides/proto3/#packages

It seems like the package statement is optional so I wonder if we should consider removing them to avoid confusion especially if they're not doing anything. Can definitely be a separate issue to investigate.

@cmwaters
Copy link
Contributor Author

cmwaters commented Apr 3, 2024

My only concern is around the Protobuf definitions so I'm 🤞 hoping that the proto-* CI jobs would fail if we broke something.

They actually were failing before hand as being breaking. I have a hunch however that buf doesn't use the go_package for working out where to output the generated files but instead relies on the buf yaml files. It could be if you're using protoc directly that they are needed.

ninabarbakadze
ninabarbakadze previously approved these changes Apr 3, 2024
Copy link
Member

@ninabarbakadze ninabarbakadze left a comment

Choose a reason for hiding this comment

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

🚢

@cmwaters cmwaters dismissed stale reviews from ninabarbakadze and rootulp via 0ca72ad April 4, 2024 11:23
@celestia-bot celestia-bot requested a review from a team April 4, 2024 11:23
@rootulp
Copy link
Collaborator

rootulp commented Apr 4, 2024

Markdown link check is failing on:

  ERROR: 1 dead links found!
  [✖] https://pkg.go.dev/github.com/celestiaorg/celestia-app/v2 → Status: 404

@celestia-bot celestia-bot requested a review from a team April 4, 2024 16:34
@cmwaters cmwaters merged commit a92de72 into main Apr 4, 2024
32 of 33 checks passed
@cmwaters cmwaters deleted the cal/v2-go-mod branch April 4, 2024 17:49
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.

Add /v2 suffix to module name
4 participants