-
Notifications
You must be signed in to change notification settings - Fork 137
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
Show protos some love #345
Conversation
Codecov Report
@@ Coverage Diff @@
## master #345 +/- ##
=======================================
Coverage 23.79% 23.79%
=======================================
Files 14 14
Lines 1244 1244
=======================================
Hits 296 296
Misses 928 928
Partials 20 20
Continue to review full report at Codecov.
|
e5a4db3
to
47c3e87
Compare
47c3e87
to
755d06d
Compare
755d06d
to
a28a160
Compare
a28a160
to
57732cf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you have a buf.yaml
file in here, but I didn't see buf
being run anywhere? did i miss it?
@@ -0,0 +1,12 @@ | |||
// +build tools |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would the relationship be between this file and go.mod? Is this adding versioned dependencies that would be pruned by go mod tidy
when not making a tools
build?
Could tools.go
live in the protoc/
directory with an isolated go.mod in that directory? (go list -m all
could be used to list the dependencies if that were the case.)
We run into the problem that users will have the dependencies already installed, but at the wrong versions of those dependencies, resulting in proto file jitter depending on the committer.
The biggest potential benefit of this change is that the protobuf tooling version used to create the generated files would match the ones that are used in other parts of this project. If that is the goal, then the containerized protoc.sh approach should be removed.
The proto builds must be repeatable. I would like to see a protoc build added to the Github actions to look for proto file diffs that were not incorporated in a commit.
If controlling the local version of the proto tools is problematic, I would recommend that we use our own Dockerfile to control the tooling used in the proto file builds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would the relationship be between this file and go.mod? Is this adding versioned dependencies that would be pruned by
go mod tidy
when not making atools
build?
This file is used in harmony with go.mod. This is coming from one of the options in the Go Wiki, https://github.com/golang/go/wiki/Modules#how-can-i-track-tool-dependencies-for-a-module.
Could
tools.go
live in theprotoc/
directory with an isolated go.mod in that directory? (go list -m all
could be used to list the dependencies if that were the case.)
I'd prefer not to do that. For one it seems weird to define a mod in a sub directory since mods are meant to be at a repo root right? Having these deps in the top-level mod also ensures they are always being used.
We run into the problem that users will have the dependencies already installed, but at the wrong versions of those dependencies, resulting in proto file jitter depending on the committer.
This takes care of that since we'd be using the pinned versions of the tools from the go.mod file.
The biggest potential benefit of this change is that the protobuf tooling version used to create the generated files would match the ones that are used in other parts of this project. If that is the goal, then the containerized protoc.sh approach should be removed.
I meant to do this, but forgot. This PR still doesn't deal with protoc
versions/installations. I deal with that with shell.nix
personally, the build-in-docker approach in protoc.sh also helps there too.
The proto builds must be repeatable. I would like to see a protoc build added to the Github actions to look for proto file diffs that were not incorporated in a commit.
Can do.
If controlling the local version of the proto tools is problematic, I would recommend that we use our own Dockerfile to control the tooling used in the proto file builds.
I don't particularly like leaning so much on docker for all dev tooling, though I think the happy medium is a nix docker image that reads the shell.nix file and uses those versions :D.
Not in an automated fashion. I used it locally to run some lint checks. I'm not personally ready to introduce that yet. I think we'd also need a layout change to make |
actually @displague I'd like to do that in a follow up PR. This one doesn't make things any worse wrt CI and is already pretty big. |
57732cf
to
38aa4ff
Compare
gotest.tools v2.2.0+incompatible // indirect | ||
) | ||
|
||
replace github.com/stormcat24/protodep => github.com/ackintosh/protodep v0.0.0-20200728152107-abf8eb579d6c |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replaced with stormcat24/protodep#49, otherwise I was only able to make it work with a bogus -i
ssh identity file
@mmlb if you are experimenting with |
Overall I like what I see and I think we have to merge this PR pretty soon, it is big and will require a lot of work in order to keep it up to date with the codebase and I would like to avoid that. @mmlb I think you should write a note in Thanks |
Yep, I have one more thing to check and make sure isn't broken as it failed for me in some tests yesterday.
I'll do that in a follow up PR to avoid growing this one more. |
38aa4ff
to
9bc6003
Compare
@displague @jacobweinstock @gianarb PTAL, I've rebased on top of master to pull the |
Follow up PR for documentation scares me so much xD Often they never arrive! xD |
:D especially with me :D. Ok I'll whip something up then. |
hmm we don't even have a CONTRIBUTING.md doc, grabbing from .github. |
9bc6003
to
f165a16
Compare
This way matches the docs and is easier to reason about. Signed-off-by: Manuel Mendez <manny@packet.com>
Using setup from https://github.com/golang/go/wiki/Modules#how-can-i-track-tool-dependencies-for-a-module Signed-off-by: Manuel Mendez <manny@packet.com>
gnused gets us `sed` which will be used in protoc.sh in a following commit. protobuf gets us protoc. Signed-off-by: Manuel Mendez <manny@packet.com>
This way we can control the versions of all the tools. Signed-off-by: Manuel Mendez <manny@packet.com>
Its just easier this way to always expect to be at the root. Signed-off-by: Manuel Mendez <manny@packet.com>
Signed-off-by: Manuel Mendez <manny@packet.com>
Using the jaegertracing container method would make it hard to have reproducible builds as we can't use the pinned version of the protoc plugins we are using. Using protodeb and pinned versions in tools.go all we need is awk, go, and protoc. Signed-off-by: Manuel Mendez <manny@packet.com>
Signed-off-by: Manuel Mendez <manny@packet.com>
https://developers.google.com/protocol-buffers/docs/style Signed-off-by: Manuel Mendez <manny@packet.com>
Signed-off-by: Manuel Mendez <manny@packet.com>
Signed-off-by: Manuel Mendez <manny@packet.com>
It was mostly a 1:1 of enum State anyway. Signed-off-by: Manuel Mendez <manny@packet.com>
Signed-off-by: Manuel Mendez <manny@packet.com>
Signed-off-by: Manuel Mendez <manny@packet.com>
protoc-gen-go was throwing a warning: > Generating protos/workflow/workflow.pb.go... > 2020/10/19 16:57:11 WARNING: Deprecated use of 'go_package' option without a full import path in "workflow/workflow.proto", please specify: > option go_package = "workflow"; > A future release of protoc-gen-go will require the import path be specified. > See https://developers.google.com/protocol-buffers/docs/reference/go-generated#package for more information. Signed-off-by: Manuel Mendez <manny@packet.com>
Taken from boots and added info for building the protobuf generated files. Signed-off-by: Manuel Mendez <manny@packet.com>
f165a16
to
87ab907
Compare
Alright @gianarb I threw in CONTRIBUTING.md over from boots and added a bit about protobuf files: https://github.com/mmlb/tink/blob/show-protos-some-love/CONTRIBUTING.md @displague I dropped the use of jaegertracing/protobuf too |
Signed-off-by: Kelly Deng <kelly@packet.com> ## Description <!--- Please describe what this PR is going to change --> Following the merge of tinkerbell/tink#345, the `github/tinkerbell/tink` dependency in `go.mod` needs to be updated to point to the latest master. ## Why is this needed <!--- Link to issue you have raised --> The PR tinkerbell/tink#345 updated the protobuf files and as a result, hegel (still importing an older version of tink) can no longer properly communicate with the latest version of tink. Fixes: # ## How Has This Been Tested? <!--- Please describe in detail how you tested your changes. --> <!--- Include details of your testing environment, and the tests you ran to --> <!--- see how your change affects other areas of the code, etc. --> * Tests pass * Tested manually ## How are existing users impacted? What migration steps/scripts do we need? <!--- Fixes a bug, unblocks installation, removes a component of the stack etc --> <!--- Requires a DB migration script, etc. --> ## Checklist: I have: - [ ] updated the documentation and/or roadmap (if required) - [ ] added unit or e2e tests - [ ] provided instructions on how to upgrade
Signed-off-by: Kelly Deng <kelly@packet.com> ## Description <!--- Please describe what this PR is going to change --> Following the merge of tinkerbell/tink#345, the `github/tinkerbell/tink` dependency in `go.mod` needs to be updated to point to the latest master. ## Why is this needed <!--- Link to issue you have raised --> The PR tinkerbell/tink#345 updated the protobuf files and as a result, boots (still importing an older version of tink) can no longer properly communicate with the latest version of tink. Fixes: # ## How Has This Been Tested? <!--- Please describe in detail how you tested your changes. --> <!--- Include details of your testing environment, and the tests you ran to --> <!--- see how your change affects other areas of the code, etc. --> * Tests pass * Tested manually ## How are existing users impacted? What migration steps/scripts do we need? <!--- Fixes a bug, unblocks installation, removes a component of the stack etc --> <!--- Requires a DB migration script, etc. --> ## Checklist: I have: - [ ] updated the documentation and/or roadmap (if required) - [ ] added unit or e2e tests - [ ] provided instructions on how to upgrade
Description
This overhauls and fixes a bunch of warnings/nits in our protobufs. Also, I wasn't able to build the protobufs because of version mismatches and what not.
Why is this needed
I was not happy with the state of our protobuf build setup, managing protobuf dependencies and general protobuf lint/style issues.
Also,
Fixes: #319
How Has This Been Tested?
Builds and
go test ./...
works.How are existing users impacted? What migration steps/scripts do we need?
Custom clients using our protobuf files will need to be updated, I don't know of any such clients.