Skip to content

feat(spanner): add support for Queues in mutations - #16549

Merged
scotthart merged 2 commits into
googleapis:mainfrom
scotthart:spanner_queues_1
Oct 8, 2026
Merged

scotthart merged 2 commits into
googleapis:mainfrom
scotthart:spanner_queues_1

Conversation

@scotthart

@scotthart scotthart commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

Adds C++ client library support for Cloud Spanner Queues (Mutation::Send and Mutation::Ack):

  • Introduces spanner::SendMutationBuilder and spanner::MakeSendMutation (supporting optional deliver_time) to enqueue messages into a Spanner queue.
  • Introduces spanner::AckMutationBuilder and spanner::MakeAckMutation (supporting optional ignore_not_found) to acknowledge messages in a Spanner queue.
  • Adds unit tests in mutations_test.cc and end-to-end Enterprise edition integration tests in queue_integration_test.cc.

@product-auto-label product-auto-label Bot added the api: spanner Issues related to the Spanner API. label Oct 7, 2026

@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 adds support for Spanner Queues by introducing SendMutationBuilder, AckMutationBuilder, and helper functions, along with unit and integration tests. The review feedback points out a potential undefined behavior issue in mutations.cc where a StatusOr is dereferenced without checking .ok(), recommending the use of .value() instead. In queue_integration_test.cc, the feedback suggests replacing raw pointers with std::optional for safer lifetime management, and replacing several instances of auto in loops with explicit types to comply with the style guide regarding obscured StatusOr types.

Comment thread google/cloud/spanner/mutations.cc Outdated
Comment thread google/cloud/spanner/integration_tests/queue_integration_test.cc Outdated
Comment thread google/cloud/spanner/integration_tests/queue_integration_test.cc Outdated
Comment thread google/cloud/spanner/integration_tests/queue_integration_test.cc Outdated
Comment thread google/cloud/spanner/integration_tests/queue_integration_test.cc Outdated
Comment thread google/cloud/spanner/integration_tests/queue_integration_test.cc Outdated
@codecov

codecov Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 45.18519% with 148 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.33%. Comparing base (d1a2175) to head (91ea6c4).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
...panner/integration_tests/queue_integration_test.cc 5.12% 148 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #16549      +/-   ##
==========================================
- Coverage   92.39%   92.33%   -0.07%     
==========================================
  Files        2262     2263       +1     
  Lines      218382   218652     +270     
==========================================
+ Hits       201775   201893     +118     
- Misses      16607    16759     +152     

☔ 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.

@scotthart
scotthart marked this pull request as ready for review October 8, 2026 13:42
@scotthart
scotthart requested a review from a team as a code owner October 8, 2026 13:42
@scotthart
scotthart merged commit ce4cd44 into googleapis:main Oct 8, 2026
71 checks passed

This branch was successfully deployed

1 active deployment
false — 91ea6c43 Deployed Oct 8, 2026 by scotthart via Save PR ref #12332
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: spanner Issues related to the Spanner API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants