Closed rauljordan closed 2 years ago
Fix our ./hack/update-go-pbs.sh file so it works without generating a big changelog
How is this achieved? I think that big change log is due to dependencies or changes included that didn't run update-go-pbs.sh so all of that data is stale. I ran it on develop with no change and i see changes like a dependency was updated but none of the pbs updated.
diff --git a/proto/eth/service/node_service.pb.go b/proto/eth/service/node_service.pb.go
index 992a6ad1e..348419a69 100755
--- a/proto/eth/service/node_service.pb.go
+++ b/proto/eth/service/node_service.pb.go
@@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
-// protoc-gen-go v1.25.0
+// protoc-gen-go v1.27.1
It might be system-dependent. On my linux machine, running the scripts always ends with a huge change-log. However, I think the more important issue is in how difficult it is to modify the BUILD files manually and how someone making small changes, adding a dep, etc. would have to deal with the intricacies of the BUILD files in our proto/ folder
The go pbs script is no longer as annoying as it used to be. Closing
🚀 Feature Request
Description
It is really hard to add a new API endpoint, add a new protobuf type, or change anything about our existing protobuf schemas. Adding a simple, new message in protobuf in a regular file such as
proto/prysm/v1alpha1/attestation.proto
leads to massive changelog of files when generating Go code for the diff...leads to:
Most of these edits affect imports and minor formatting issues, but they happen every time one wants to edit a protobuf. Moreover, adding new files is non-trivial because our build system, Bazel, relies on special configuration files called
BUILD.bazel
in every directory to figure out how to build the associated protobufs. These require manual edits, where we a developer has to update the associatedBUILD.bazel
file when creating a.proto
file. Adding dependencies is non-trivial, and is error-prone. This makes it really hard for someone to add or modify endpoints, types, and API schemas in Prysm.Describe the solution you'd like
./hack/update-go-pbs.sh
file so it works without generating a big changelogupdate-go-pbs.sh
script.proto
files and generate Go code using ourupdate-go-pbs.sh
scriptBUILD.bazel
To solve the last point, (4), we can probably add thorough documentation on
BUILD.bazel
files areBUILD.bazel
files in ourproto/
directory and their common elementsBUILD.bazel
files when you are adding (a) a new .proto file, or (b) adding Go or protobuf dependencies to your file