Create protobuf generation GitHub action #938
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is in preparation for automatically generating updated protobuf-derived
*.pb.go
files from a specific version ofhttps://github.com/open-telemetry/opentelemetry-proto
checked in as a git submodule ininternal/opentelemetry-proto
(coming in a subsequent PR). This allows source files in this repo to avoid having any direct dependency on*.pb.go
files fromgithub.com/open-telemetry/opentelemetry-proto/go/gen
and thus should resolve #793. Any sources within this repo which depend on the location of the protobuf generated files will need to be updated to reflect their new location which will be atgo.opentelemetry.io/otel/internal/opentelemetry-proto-gen/
.Synopsis of Github Action
Whenever a PR with an update to
internal/opentelemetry-proto
is created, this github action will be invoked on the PR and willhttps://github.com/open-telemetry/opentelemetry-proto
make -f Makefile.proto protobuf
, whichoption go_package = ...
lines in the.proto
files to a package which resides atgo.opentelemetry.io/otel/internal/opentelemetry-proto-gen
, i.e. inside this repo.namely/protoc-all
to generate the new and changed*.pb.go
files, copying them into theinternal/opentelemetry-proto-gen
directory.stefanzweifel/git-auto-commit-action@v4
github action to commit any changes to these files as a new commit in the PR.The existing build action in CircleCI will run unchanged, but unlike this github action, will not populate the git submodule. Similarly, developers should run
make precommit
at the top-level of the repo with the git submodule atinternal/opentelemetry-proto
left unpopulated in all cases except when testing out an update to the .proto files. This avoidsgo test ./...
pulling in dependencies needed in theopentelemetry-proto
repo, but not needed for this repo.