Skip to content

Conversation

@prathmeshcc
Copy link
Collaborator

@prathmeshcc prathmeshcc commented Jan 22, 2026

docs(spanner): add sample for snapshot isolation level

Add a new sample demonstrating how to set and override transaction isolation levels (Repeatable Read vs Serializable). This includes the required documentation snippet tags and integration with the samples binary.

@product-auto-label product-auto-label bot added the samples Issues that are directly related to samples. label Jan 22, 2026
@prathmeshcc prathmeshcc changed the title Change test case terminology and create sample for snapshot isolation feat(spanner): add sample for snapshot isolation level Jan 22, 2026
@gemini-code-assist
Copy link

Summary of Changes

Hello @prathmeshcc, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the Google Cloud Spanner client library by providing a new sample that illustrates the usage and configuration of transaction isolation levels. Users can now see how to set a default isolation level at the client level and how to override it for specific transactions, offering greater control over transaction behavior. Additionally, minor terminology adjustments have been made in existing code and tests to improve readability.

Highlights

  • New Isolation Level Sample: Introduced a new sample demonstrating how to configure and override transaction isolation levels (Repeatable Read vs Serializable) in Google Cloud Spanner.
  • Documentation Updates: Added corresponding documentation for the new isolation level sample, including snippet tags and integration into the samples binary.
  • Terminology Refinement: Updated terminology within the Transaction class definition and related test cases for improved clarity and consistency.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@prathmeshcc prathmeshcc changed the title feat(spanner): add sample for snapshot isolation level docs(spanner): add sample for snapshot isolation level Jan 22, 2026
@prathmeshcc prathmeshcc force-pushed the feat/spanner-snapshot-isolation-sample branch from ab517da to 9cf7892 Compare January 22, 2026 03:10
Copy link

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

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 a helpful new sample demonstrating transaction isolation levels. The implementation is well done, but I've found a minor syntax error in one of the new documentation tags that would cause a compilation failure. Please see the specific comment for the fix.

@codecov
Copy link

codecov bot commented Jan 22, 2026

Codecov Report

❌ Patch coverage is 91.17647% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.96%. Comparing base (b5bad6b) to head (69f202f).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
google/cloud/spanner/samples/samples.cc 91.17% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #15899      +/-   ##
==========================================
- Coverage   92.96%   92.96%   -0.01%     
==========================================
  Files        2460     2460              
  Lines      228864   228898      +34     
==========================================
+ Hits       212770   212784      +14     
- Misses      16094    16114      +20     

☔ View full report in Codecov by Sentry.
📢 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.

@product-auto-label product-auto-label bot added the api: spanner Issues related to the Spanner API. label Jan 22, 2026
@prathmeshcc prathmeshcc marked this pull request as ready for review January 22, 2026 21:11
@prathmeshcc prathmeshcc requested a review from a team as a code owner January 22, 2026 21:11
@prathmeshcc prathmeshcc enabled auto-merge (squash) January 23, 2026 19:37
@prathmeshcc prathmeshcc merged commit 9694430 into googleapis:main Jan 23, 2026
55 of 58 checks passed
SampleBanner("spanner_directed_read");
DirectedRead(project_id, instance_id, database_id);

SampleBanner("isolation-level-setting");
Copy link
Contributor

Choose a reason for hiding this comment

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

The argument to SampleBanner() should be the sample tag, which, according to the START/END annotations you added, would be "spanner_isolation_level".

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. samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants