Skip to content

chore: update code to be compatible with protobuf v36 - #16342

Draft
scotthart wants to merge 8 commits into
googleapis:mainfrom
scotthart:protobuf_v36_updates
Draft

chore: update code to be compatible with protobuf v36#16342
scotthart wants to merge 8 commits into
googleapis:mainfrom
scotthart:protobuf_v36_updates

Conversation

@scotthart

Copy link
Copy Markdown
Member

No description provided.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request upgrades the Protobuf dependency to version 36.0-rc2 across Bazel configurations, Dockerfiles, and workspace files, and casts several Protobuf method calls to (void) to ignore their return values. The reviewer feedback correctly notes that casting any.UnpackTo(&result) to (void) in extract_long_running_result.cc silently swallows unpacking errors, violating the repository's 'Demand Explosive Correctness' principle, and suggests returning an error status if unpacking fails.

Comment on lines +47 to 48
(void)any.UnpackTo(&result);
return Status{};

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Silently ignoring the return value of UnpackTo by casting it to (void) swallows potential errors when unpacking the operation metadata. If unpacking fails, we should return an appropriate error status instead of proceeding with a success status, in accordance with the repository style guide's 'Demand Explosive Correctness' principle.

  if (!any.UnpackTo(&result)) {
    return Status(StatusCode::kInvalidArgument,
                  "Failed to unpack operation metadata in operation " + op->name(),
                  GCP_ERROR_INFO());
  }
  return Status{};
References
  1. Never swallow errors or ignore Status types. Fail loudly and explicitly when appropriate. (link)

Comment on lines +74 to 75
(void)any.UnpackTo(&result);
return Status{};

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Silently ignoring the return value of UnpackTo by casting it to (void) swallows potential errors when unpacking the operation response. If unpacking fails, we should return an appropriate error status instead of proceeding with a success status, in accordance with the repository style guide's 'Demand Explosive Correctness' principle.

  if (!any.UnpackTo(&result)) {
    return Status(StatusCode::kInvalidArgument,
                  "Failed to unpack operation response in operation " + op->name(),
                  GCP_ERROR_INFO());
  }
  return Status{};
References
  1. Never swallow errors or ignore Status types. Fail loudly and explicitly when appropriate. (link)

@codecov

codecov Bot commented Aug 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.00000% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.23%. Comparing base (154f9ef) to head (b852f97).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
google/cloud/spanner/samples/samples.cc 0.00% 6 Missing ⚠️
generator/internal/descriptor_utils.cc 50.00% 1 Missing ⚠️
google/cloud/pubsub/samples/samples.cc 0.00% 1 Missing ⚠️
...cloud/spanner/testing/database_integration_test.cc 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #16342      +/-   ##
==========================================
- Coverage   92.23%   92.23%   -0.01%     
==========================================
  Files        2227     2227              
  Lines      209283   209275       -8     
==========================================
- Hits       193026   193017       -9     
- Misses      16257    16258       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant