Skip to content

fix: protobuf generation process #800

@guillaumemichel

Description

@guillaumemichel

Follow up to #794

The protobuf code (.pb.go) has to be generated only once after a change in the .proto file, then the .pb.go file is pushed to the repo and nodes never need to generate. Even when not depending on make the protobuf code still has a dependency on protoc for go generate ./... to work.

IMO it is better that the protobuf code gets updated only after a conscious decision from the person modifying the .proto file. Being able to overwrite all .pb.go files using go generate ./... at the root of the repo could have unintended side effects, such as changing the protoc version with which the code was generated, depending on the version that is installed on the machine running go generate ./....

It may possible to avoid non-go dependencies (make, protoc) by depending directly on protobuf-go, but then we would need a dedicated package for the protobuf code generation.

Since protobuf code is very rarely generated, IMO it is fine to use either go generate, a Makefile, or even a dedicated go code, but we should prevent accidental generation. Generating the protobuf code only from the pb directory should be simple and convenient enough.

cc: @gammazero

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium: Good to have, but can wait until someone steps updif/easySomeone with a little familiarity can pick upeffort/hoursEstimated to take one or several hourskind/maintenanceWork required to avoid breaking changes or harm to project's status quo

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions