-
Notifications
You must be signed in to change notification settings - Fork 375
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
fix: substitute build metadata (git commit) in bazel builds #7378
Conversation
- Use bazel's `workspace_status_command` to report the git commit. - Substitute it into `google::cloud::internal::build_metadata()`. - Test that `build_metadata()` does not contain a "@" delimiter. Fixes googleapis#4035.
Google Cloud Build Logs
ℹ️ NOTE: Kokoro logs are linked from "Details" below. |
Codecov Report
@@ Coverage Diff @@
## main #7378 +/- ##
=======================================
Coverage 93.64% 93.64%
=======================================
Files 1351 1351
Lines 117314 117315 +1
=======================================
+ Hits 109864 109865 +1
Misses 7450 7450
Continue to review full report at Codecov.
|
@@ -21,6 +21,14 @@ build --copt=-DGRPC_BAZEL_BUILD | |||
# inside a docker image. | |||
build --experimental_convenience_symlinks=ignore | |||
|
|||
# Use host-OS-specific config lines from bazelrc files. |
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.
AFAIK, this file is not loaded if google-cloud-cpp
is built as part of a larger project. That is not a blocker for this change, but maybe we should document the limitations somewhere?
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.
Added such a note.
[Indeed, if this code was part of a bigger project they may not be using bazel
or git
, so they'd have to figure out how to generate their own build identifier.]
is built as part of a larger project.
Google Cloud Build Logs
ℹ️ NOTE: Kokoro logs are linked from "Details" below. |
…oogleapis#7378)" This reverts commit 92e742f.
workspace_status_command
to report the git commit.google::cloud::internal::build_metadata()
.build_metadata()
does not contain a "@" delimiter.Fixes #4035.
This change is