Skip to content

feat(Spanner): Add support for Cloud Queues - #15850

Open
efevans wants to merge 2 commits into
googleapis:mainfrom
efevans:spanner-queues
Open

feat(Spanner): Add support for Cloud Queues#15850
efevans wants to merge 2 commits into
googleapis:mainfrom
efevans:spanner-queues

Conversation

@efevans

@efevans efevans commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

b/422231498

Suggested path for reviewing

  1. Take a look at the doc describing public surface changes, link to it in the issue. You can skip the Background section and focus on the others.
  2. Peek at the public Send and Ack methods in SpannerConnection.cs, and then look at the first test of QueueTests.cs` in the integration test project to see a basic usage.
  3. Look at the changes big block change in SpannerCommand.ExecutableCommand around lines 400. This is the portion of code that packages the Send and Ack mutations into the protobuf message wire type
  4. The remainder of the code is simple enough and is largely wiring up the CreateSendCommand public method down to the part that prepares the mutation protobuf types from above

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

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

Copy link
Copy Markdown
Contributor

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 introduces support for Spanner queues by adding Send and Ack command types, updating the command builder and connection classes, and introducing queue-related test fixtures and integration tests. Feedback on the changes highlights syntax errors in the queue creation SQL statement, an integration test that defines commands but never executes or disposes of them, and a public field that should be private and readonly. Additionally, there is a copy-paste error in the XML documentation for CreateSendCommand, and a potential NullReferenceException in a SpannerCommand constructor because the null check on key is executed after the constructor initializer.

Comment thread apis/Google.Cloud.Spanner.Data/Google.Cloud.Spanner.Data/SpannerConnection.cs Outdated
Comment thread apis/Google.Cloud.Spanner.Data/Google.Cloud.Spanner.Data/SpannerCommand.cs Outdated
@efevans
efevans force-pushed the spanner-queues branch 16 times, most recently from 6fde46a to d858058 Compare August 26, 2026 21:22
@efevans

efevans commented Aug 26, 2026

Copy link
Copy Markdown
Contributor Author

/gemini review

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

Copy link
Copy Markdown
Contributor

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 introduces support for Spanner Queues by adding Send and Ack commands, updating SpannerCommand and SpannerConnection to handle queue operations, and adding integration tests. The review feedback highlights several issues to address, including a syntax error from a trailing comma in the CREATE QUEUE DDL, a code smell from calling an abstract method in a constructor, timezone-related issues from using DateTime.Now instead of DateTime.UtcNow, hardcoded personal test configurations, a potential NullReferenceException when validating Payload, and various copy-paste errors in exception messages and XML documentation.

Comment thread apis/Google.Cloud.Spanner.Data/Google.Cloud.Spanner.Data/SpannerConnection.cs Outdated
Comment thread apis/Google.Cloud.Spanner.Data/Google.Cloud.Spanner.Data/SpannerConnection.cs Outdated
@googleapis googleapis deleted a comment from gemini-code-assist Bot Aug 27, 2026
@efevans
efevans force-pushed the spanner-queues branch 2 times, most recently from 085d8cc to e83cef5 Compare August 27, 2026 17:01
@efevans

efevans commented Aug 27, 2026

Copy link
Copy Markdown
Contributor Author

/gemini review

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

Copy link
Copy Markdown
Contributor

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 introduces support for Spanner queues by adding 'Send' and 'Ack' command types to SpannerCommand, along with corresponding integration tests and fixtures. The review feedback highlights several critical issues and improvement opportunities: a syntax error (trailing comma) in the queue creation DDL, synchronous blocking in the test fixture setup, a lack of validation for single-key constraints on Send and Ack commands, a potential runtime failure when validating inferred payload types, and missing property copies in the SpannerCommand copy constructor which would break cloning.

Comment thread apis/Google.Cloud.Spanner.Data/Google.Cloud.Spanner.Data/SpannerCommand.cs Outdated
@efevans
efevans force-pushed the spanner-queues branch 2 times, most recently from f2a5bc7 to e848450 Compare August 27, 2026 19:25
@efevans

efevans commented Aug 27, 2026

Copy link
Copy Markdown
Contributor Author

/gemini review

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

Copy link
Copy Markdown
Contributor

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 introduces support for Spanner database queues by adding Send and Ack command types, along with corresponding connection helper methods, test fixtures, and unit/integration tests. However, there are critical issues in the implementation: the state checks validating that exactly one key is provided for Send and Ack mutations are inverted, which will cause runtime failures when valid inputs are provided. Additionally, a trailing comma in the CREATE QUEUE DDL statement in MutationsQueueFixture.cs will result in a syntax error at runtime.

@efevans
efevans force-pushed the spanner-queues branch 2 times, most recently from c93a96d to f57689a Compare August 27, 2026 19:41
@efevans
efevans marked this pull request as ready for review August 27, 2026 19:48
@efevans
efevans requested a review from a team as a code owner August 27, 2026 19:48
@amanda-tarafa
amanda-tarafa self-requested a review August 29, 2026 18:11
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.

1 participant