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

Containerized Protobuf generation #304

Merged
merged 6 commits into from
Nov 11, 2020
Merged

Containerized Protobuf generation #304

merged 6 commits into from
Nov 11, 2020

Conversation

alpe
Copy link
Contributor

@alpe alpe commented Nov 10, 2020

Resolves #295

This PR contains:

  • New docker container: cosmwasm/prototools-docker -> contrib/prototools-docker/Dockerfile
  • Support for make proto-gen for generation and make proto-lint for Buf linter
  • Better comments in Protobuf files
  • Linted protobuf files
  • Re-generated Go files
  • Generated doc from protobuf -> /doc/proto.md

@codecov
Copy link

codecov bot commented Nov 10, 2020

Codecov Report

Merging #304 (02948d3) into master (4fb3a50) will increase coverage by 0.01%.
The diff coverage is 36.36%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #304      +/-   ##
==========================================
+ Coverage   17.49%   17.51%   +0.01%     
==========================================
  Files          35       35              
  Lines       10505    10505              
==========================================
+ Hits         1838     1840       +2     
+ Misses       8566     8565       -1     
+ Partials      101      100       -1     
Impacted Files Coverage Δ
x/wasm/internal/keeper/querier.go 50.37% <ø> (ø)
x/wasm/internal/types/genesis.pb.go 0.66% <ø> (ø)
x/wasm/internal/types/msg.pb.go 0.55% <ø> (ø)
x/wasm/internal/types/proposal.pb.go 0.42% <ø> (ø)
x/wasm/internal/types/query.pb.go 0.71% <0.00%> (ø)
x/wasm/internal/types/query.pb.gw.go 0.00% <0.00%> (ø)
x/wasm/internal/types/types.go 23.76% <0.00%> (ø)
x/wasm/internal/types/types.pb.go 0.76% <ø> (ø)
x/wasm/internal/types/params.go 60.97% <100.00%> (ø)
x/wasm/internal/keeper/keeper.go 90.30% <0.00%> (+0.60%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4fb3a50...cccd69a. Read the comment docs.

@@ -198,16 +203,19 @@ format:
###############################################################################

proto-all: proto-gen proto-lint proto-check-breaking
.PHONY: proto-all
Copy link
Member

Choose a reason for hiding this comment

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

Nice. Much better maintainable than a one-line .PHONY. Did now know you can specily multiple .PHONY. But people on the internet say this is how you do it (https://stackoverflow.com/questions/4156382/is-it-possible-to-have-multiple-phony-targets-in-a-gnu-makefile)

contrib/prototools-docker/Dockerfile Outdated Show resolved Hide resolved
contrib/prototools-docker/Dockerfile Outdated Show resolved Hide resolved
--grpc-gateway_opt paths=Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types,Mgoogle/protobuf/empty.proto=github.com/gogo/protobuf/types,paths=source_relative \
--doc_out=./doc \
--doc_opt=markdown,proto.md \
$(find "${PROJECT_PROTO_DIR}" -maxdepth 1 -name '*.proto')
Copy link
Member

Choose a reason for hiding this comment

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

This script is executed by the developer who changes the .proto files and the docs are checked-in along with the proto changes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, generated files are checked into the repo.

x/wasm/internal/types/msg.proto Outdated Show resolved Hide resolved
x/wasm/internal/types/types.proto Outdated Show resolved Hide resolved
alpe and others added 4 commits November 11, 2020 12:11
Co-authored-by: Simon Warta <2603011+webmaster128@users.noreply.github.com>
Co-authored-by: Simon Warta <2603011+webmaster128@users.noreply.github.com>
Co-authored-by: Simon Warta <2603011+webmaster128@users.noreply.github.com>
Co-authored-by: Simon Warta <2603011+webmaster128@users.noreply.github.com>
@alpe alpe merged commit 550c6f5 into master Nov 11, 2020
@alpe alpe deleted the proto_gen branch November 11, 2020 11:13
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.

Generate protobuf outputs in a container
2 participants