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

fix: build .proto files like any cosmos project #2462

Closed
wants to merge 57 commits into from

Conversation

faddat
Copy link
Contributor

@faddat faddat commented May 3, 2023

Description

Gaia's proto build setup will produce different results if run on different machines. This is why the cosmos-sdk distributes a docker container for building protos inside of. This PR adopts that docker container.

https://github.com/faddat/proto-builder

is a docker image I made that contains:

  • the latest buf
  • the latest go

If you'd like, I can add that to this PR, and we can make a second PR that removes the reference to faddat/proto-builder


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • Included the correct type prefix in the PR title
  • Added ! to the type prefix if API or client breaking change
  • Targeted the correct branch (see PR Targeting)
  • Provided a link to the relevant issue or specification
  • Followed the guidelines for building SDK modules
  • Included the necessary unit and integration tests
  • Added a changelog entry to CHANGELOG.md
  • Included comments for documenting Go code
  • Updated the relevant documentation or specification
  • Reviewed "Files changed" and left comments if necessary
  • Confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage

@faddat
Copy link
Contributor Author

faddat commented Jun 14, 2023

It uses buf registry, where that can apply.

It doesn't use the buf registry to replace the sdk for example

I think that the way to get this in, per @jtremback comments on the image builder, is to make a PR into gaia with an image builder that self-publishes to ghcr.io/cosmos/gaia -- wdyt?

Copy link
Contributor

@MSalopek MSalopek 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 your contribution!

This PR contains changes other than the changes outlined in the description.

Could please revert any changes to version checking, linter installing and linting process in the Makefile?

Other than that, no concrete issues with accepting the PR.

Very soon the tooling written here will be superceeded by what's needed for cosmos-sdk > 0.45.x. This could actually make the transition easier.

@faddat
Copy link
Contributor Author

faddat commented Jul 3, 2023

sure thing, will address this later today @MSalopek thanks for the review!

@faddat faddat requested review from zmanian and a team as code owners July 3, 2023 00:13
@codecov
Copy link

codecov bot commented Jul 3, 2023

Codecov Report

Merging #2462 (dbe0782) into main (1c8b069) will not change coverage.
Report is 51 commits behind head on main.
The diff coverage is n/a.

❗ Current head dbe0782 differs from pull request most recent head 73eafab. Consider uploading reports for the commit 73eafab to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2462   +/-   ##
=======================================
  Coverage   85.16%   85.16%           
=======================================
  Files          23       23           
  Lines        1604     1604           
=======================================
  Hits         1366     1366           
  Misses        192      192           
  Partials       46       46           

see 5 files with indirect coverage changes

@@ -6,7 +6,7 @@ package types
import (
context "context"
fmt "fmt"
_ "github.com/gogo/protobuf/gogoproto"
_ "github.com/cosmos/gogoproto/gogoproto"
Copy link
Member

@julienrbrt julienrbrt Jul 3, 2023

Choose a reason for hiding this comment

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

Chiming in here. If this is for v0.45, the gogo-proto version in buf.yaml should be pinned to bee5511075b7499da6178d9e4aaa628b. (https://buf.build/cosmos/gogo-proto/file/bee5511075b7499da6178d9e4aaa628b:gogoproto/gogo.proto#L36). Latest uses our fork (https://buf.build/cosmos/gogo-proto/file/34d970b699f84aa382f3c29773a60836:gogoproto/gogo.proto#L36) and is only needed from v0.47+.

Copy link
Contributor Author

@faddat faddat Jul 9, 2023

Choose a reason for hiding this comment

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

thank you very much! I wasn't aware that there was an incompatiblity.

@mmulji-ic
Copy link
Contributor

mmulji-ic commented Jul 5, 2023

@faddat can you address the comments above.

@faddat
Copy link
Contributor Author

faddat commented Jul 9, 2023

@mmulji-ic & @jtremback -- concerning Jehan's comment -- should I move that builder into this repository?

@faddat faddat mentioned this pull request Jul 10, 2023
18 tasks
@faddat
Copy link
Contributor Author

faddat commented Jul 10, 2023

This should be simple to merge once Gaia is publishing her own proto builder image :)

@MSalopek
Copy link
Contributor

Following up on this:
Would you mind addressing the comments above and not removing any existing jobs from the makefile?

Other than that the changes seem to do the job!

@mpoke
Copy link
Contributor

mpoke commented Aug 9, 2023

@faddat could you please address the comments above?

@mpoke
Copy link
Contributor

mpoke commented Aug 22, 2023

Converting to draft until the comments are addressed.

@mpoke mpoke marked this pull request as draft August 22, 2023 14:20
@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Oct 16, 2023
@github-actions github-actions bot closed this Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants