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: add commands for generating go types #16

Merged
merged 4 commits into from
Jan 16, 2024
Merged

Conversation

cmwaters
Copy link
Collaborator

Closes: #13

@cmwaters cmwaters requested review from a team as code owners January 10, 2024 06:39
@cmwaters cmwaters requested review from staheri14, ninabarbakadze, distractedm1nd and Wondertan and removed request for a team January 10, 2024 06:39
@celestia-bot celestia-bot requested review from a team January 10, 2024 06:39
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.

Note: I'm observing that when I run make proto-gen-docker or make proto-gen, there are changes to these files:

	modified:   merkle/proto/proof.pb.go
	modified:   pkg/blob/blob.pb.go

buf.yaml Outdated Show resolved Hide resolved
Makefile Outdated
Comment on lines 4 to 14
## proto-gen-docker: Generate protobuf files. Requires docker.
proto-gen-docker:
@echo "--> Generating Protobuf files"
$(DOCKER_BUF) generate
.PHONY: proto-gen-docker

## proto-gen: Generate protobuf files. Requires buf.
proto-gen:
@echo "--> Generating Protobuf files"
@buf generate
.PHONY: proto-gen
Copy link
Collaborator

@rootulp rootulp Jan 10, 2024

Choose a reason for hiding this comment

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

[question] do we want to support two different ways to generate the Protobuf files? I think it may be easier to maintain just one option and if that option is used in CI as well as locally. Since the make proto-gen command depends on a locally installed Buf CLI, preference for the Docker approach.

Ideally the Docker approach uses the same version of Buf locally and in CI.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We could probably look to enforce it somehow. The docker image also isn't versioned (I actually had a problem where it wasn't working because I had an old image.

I think some people don't like using docker, hence why I added the other option, but it's simple enough that it probably doesn't need a make command so I will remove it

Copy link
Collaborator

@rootulp rootulp Jan 10, 2024

Choose a reason for hiding this comment

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

Yea I think the Docker approach should also be versioned but not blocking on it.

staheri14
staheri14 previously approved these changes Jan 10, 2024
Copy link
Contributor

@staheri14 staheri14 left a comment

Choose a reason for hiding this comment

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

LGTM!

@cmwaters
Copy link
Collaborator Author

Note: I'm observing that when I run make proto-gen-docker or make proto-gen, there are changes to these files:

We might have different versions - let me dig into it

Co-authored-by: Rootul P <[email protected]>
@celestia-bot celestia-bot requested a review from a team January 10, 2024 20:28
@rootulp
Copy link
Collaborator

rootulp commented Jan 10, 2024

If it helps debug:

$ buf --version
1.28.1
docker images

bufbuild/buf                                  latest    5085a683a6ba   3 months ago    55.4MB

@staheri14
Copy link
Contributor

Note: I'm observing that when I run make proto-gen-docker or make proto-gen, there are changes to these files:

	modified:   merkle/proto/proof.pb.go
	modified:   pkg/blob/blob.pb.go

It is the case for me too.

@cmwaters
Copy link
Collaborator Author

Okay I had an older version of buf. I'm going to hardcode the version to 1.28.1 in the Makefile so hopefully that produces constant results

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.

make proto-gen results in no changes and make proto-lint results in no issues. Thanks!

@rootulp
Copy link
Collaborator

rootulp commented Jan 15, 2024

Hmm we need to update settings on this repo so that new commits dismiss previous PR approvals.

@cmwaters
Copy link
Collaborator Author

Hmm we need to update settings on this repo so that new commits dismiss previous PR approvals.

Done. I've also made it require two reviews like the other repos

@cmwaters cmwaters merged commit 414d7f7 into main Jan 16, 2024
11 checks passed
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 command to generate Go types from .proto files
3 participants