GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(storagecontrol): add Rapid Cache samples by sahusneha2004 · Pull Request #14724 · GoogleCloudPlatform/python-docs-samples

Conversation

@sahusneha2004

@sahusneha2004 sahusneha2004 commented Nov 2, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Description

Adds Python samples for the Storage Control API Rapid Cache operations:

Region tag File
storage_control_create_rapid_cache storagecontrol/create_rapid_cache.py
storage_control_get_rapid_cache storagecontrol/get_rapid_cache.py
storage_control_list_rapid_caches storagecontrol/list_rapid_caches.py
storage_control_update_rapid_cache storagecontrol/update_rapid_cache.py
storage_control_disable_rapid_cache storagecontrol/disable_rapid_cache.py

Also:

  • Bumps google-cloud-storage-control to 1.17.0, the first released version with the Rapid Cache RPCs.
  • Adds rapid_cache_test.py, a system test that runs create → get → list → update → disable.
  • Adds three fixtures to conftest.py:
    • rapid_cache_zone: defaults to us-central1-a, can be overridden with RAPID_CACHE_ZONE, and checks the zone format.
    • regional_hns_enabled_bucket
    • rapid_cache_id

Refs b/482946642

Sample behavior

  • create: sets only zone and cache_type="rapid-cache-ultra". It does not set name or ttl; the TTL uses the server default. Rapid Cache Ultra requires a regional bucket with hierarchical namespace enabled. The sample waits for the create operation and prints the name, state and cache type.
  • get: prints the name, zone, state, cache type and, when set, the TTL.
  • list: prints the name of each cache on the bucket.
  • update: sets ttl with update_mask=["ttl"] and prints the new TTL.
  • disable: starts the long-running operation without waiting and prints the cache path and operation name. The cache moves to disabled quickly. The operation only completes once the cache is fully removed, which can take more than an hour. Use get_rapid_cache to check the state.

Tests

  • Opt-in: rapid_cache_test.py is skipped unless RUN_RAPID_CACHE_TESTS=True, the same way zonal_snippets_test.py is gated. Rapid Cache Ultra needs an allowlisted project, and test buckets stay behind until the cache removal finishes.
  • After disable, the test checks the printed output. It then calls get and checks for State: disabled, and accepts NotFound in case removal already finished.
  • Teardown: disables any cache on the bucket that is not already disabled, without waiting. Then it tries to delete the bucket once. If that fails (for example 409 ... has Rapid Cache Ultra), it logs a warning and leaves the bucket. The test project needs periodic cleanup of leftover storagecontrol-samples-* buckets.

Checklist

  • Please merge this PR for me once it is approved
  • Tests pass: with RUN_RAPID_CACHE_TESTS=True, rapid_cache_test.py passed against an allowlisted project (storage-prober-prelaunch-acv2, us-central1-a) in about 17s. It is skipped when the variable is not set.
  • Lint passes: the changed files pass black and flake8 with the GitHub Actions Lint config (.github/scripts/noxfile-lint.py via lint-changed.sh). The older per-directory nox -s lint also reports existing I100/I201 errors in snippets_test.py and managed_folder_list_test.py, which this PR does not touch.
  • Region tags wrap only imports and sample logic
  • Type hints on all new functions (enforce_type_hints=True)

Generated with the storage-sample-architect workflow.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gemini-code-assist[bot] reacted with eyes emoji
All reactions
  • 👀 1 reaction
@sahusneha2004
feat(storagecontrol): add Rapid Cache samples
9b02da0
Adds samples for the Storage Control Rapid Cache CRUD APIs: storage_control_create_rapid_cache, storage_control_get_rapid_cache, storage_control_list_rapid_caches, storage_control_update_rapid_cache, storage_control_disable_rapid_cache. Bumps google-cloud-storage-control to 1.17.0. Refs b/482946642

[Generated-by: AI]
@sahusneha2004 sahusneha2004 added ai-generated storage-sample-architect labels Nov 2, 2026
@product-auto-label product-auto-label Bot added the samples Issues that are directly related to samples. label Nov 2, 2026
gemini-code-assist[bot]
gemini-code-assist Bot reviewed Nov 2, 2026
View reviewed changes

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

Copy link
Copy Markdown
Contributor

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.

Code Review

This pull request introduces support for managing Rapid Caches in Google Cloud Storage Control. It adds scripts to create, disable, get, list, and update Rapid Caches, along with corresponding integration tests and test fixtures in conftest.py. Additionally, the google-cloud-storage-control dependency in requirements.txt is updated to version 1.17.0. There are no review comments to address, and I have no further feedback to provide.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@sahusneha2004 sahusneha2004 mentioned this pull request Nov 2, 2026
feat(storage): add Storage Control Rapid Cache samples GoogleCloudPlatform/golang-samples#5891
Merged
6 of 9 tasks
sahusneha2004 added 2 commits November 2, 2026 18:23
@sahusneha2004
docs(storage): align rapid cache samples with reference integration test
9716a32
Set the explicit cache name (ID = zone), cache_type rapid-cache-ultra and ttl 24h on create; wait for the disable LRO; tests assert running state, cache type, list membership and the updated ttl, and bound the disable wait. Aligns with googleapis/google-cloud-java#14529. b/482946642

[Generated-by: AI]
@sahusneha2004
fix(storagecontrol): resolve flake8 import-order lint failures
8a8bf91
Reorder imports in storagecontrol/conftest.py and storagecontrol/rapid_cache_test.py to match the repository-root flake8-import-order configuration used by the GitHub Actions Lint workflow.

[Generated-by: AI]
@sahusneha2004
sahusneha2004 requested a review from nidhiii-27 November 3, 2026 06:28
@sahusneha2004
fix(storagecontrol): address rapid cache sample review comments
27487d8
- create_rapid_cache: set only the required fields (name, zone, cache_type) and leave TTL to the update sample; use a cache_id variable consistent with get/update.
- tests: move cleanup into a rapid_cache_id fixture that disables the cache on teardown if it is still active, so cleanup runs even when assertions fail; keep the test flow linear without nested try/except/finally; bound the disable wait with the native operation timeout.
- disable_rapid_cache: document that the operation completes only after the cache is fully removed.

[Generated-by: AI]
@sahusneha2004
sahusneha2004 marked this pull request as ready for review November 6, 2026 11:15
@sahusneha2004
sahusneha2004 requested review from a team as code owners November 6, 2026 11:15
@snippet-bot

snippet-bot Bot commented Nov 6, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Here is the summary of changes.

You are about to add 5 region tags.
  • storagecontrol/create_rapid_cache.py:17, tag storage_control_create_rapid_cache
  • storagecontrol/disable_rapid_cache.py:17, tag storage_control_disable_rapid_cache
  • storagecontrol/get_rapid_cache.py:17, tag storage_control_get_rapid_cache
  • storagecontrol/list_rapid_caches.py:17, tag storage_control_list_rapid_caches
  • storagecontrol/update_rapid_cache.py:17, tag storage_control_update_rapid_cache

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sahusneha2004
sahusneha2004 requested a review from chandra-siri November 9, 2026 15:14
@sahusneha2004

sahusneha2004 commented Nov 10, 2026

Copy link
Copy Markdown
Contributor Author

CI triage: Kokoro failures are not caused by this PR

All eight failing Kokoro CI checks (Lint, Python 3.8 to 3.14) fail before any build step runs. They fail while Kokoro reads the job config:

UserException: ... ReadBuildConfig; no file found at path
'src/github/python-docs-samples/.kokoro/lint/presubmit' or with allowed extensions

(The Python 3.x jobs show the same error for .kokoro/python3.x/presubmit.)

  • On main, the Kokoro presubmit configs are disabled (.kokoro/lint/presubmit.cfg.disabled, .kokoro/python3.12/presubmit.cfg.disabled, and so on). So no nox lint or pytest session runs at all.
  • Recently merged PRs show the same 8 failing Kokoro checks (for example feat(cloud_scheduler): add sample that prevents duplicate work from job requests #14772 and docs(cloud_scheduler): trim sample comments #14771).
  • The active lint gate is the GitHub Actions Lint workflow, which runs .github/scripts/lint-changed.sh. It passes on this PR, along with CodeQL, header-check, snippet-bot and cla/google.

No code changes are needed for these checks. A maintainer can merge once reviews are done, or retire the leftover Kokoro status contexts in the repo's required-checks settings.

[Generated-by: AI]

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

shradhakatyal
shradhakatyal requested changes Nov 16, 2026
View reviewed changes

@shradhakatyal shradhakatyal left a comment

Copy link
Copy Markdown

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.

Thanks for adding the Rapid Cache samples. Overall structure and region tags look good.

I have a few comments below, mainly around:

  • Avoid blocking indefinitely in disable_rapid_cache.py.
  • Fix a 404 edge case and gate rapid_cache_test.py for non-allowlisted projects.
  • Clean up create_rapid_cache.py and test fixture teardown/waits in conftest.py.

Also, please update the PR description to reflect only the final code. Several notes currently contradict HEAD (such as ttl on create, fixture count, and lint behavior).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread storagecontrol/disable_rapid_cache.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread storagecontrol/rapid_cache_test.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread storagecontrol/rapid_cache_test.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread storagecontrol/create_rapid_cache.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread storagecontrol/get_rapid_cache.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread storagecontrol/conftest.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread storagecontrol/conftest.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread storagecontrol/conftest.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread storagecontrol/conftest.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@sahusneha2004
fix(storagecontrol): address Rapid Cache sample review feedback
0baeaeb
- disable_rapid_cache: start the LRO without waiting; print the cache path
  and operation name and point users to get_rapid_cache.
- create_rapid_cache: drop the unused RapidCache.name; note that Rapid
  Cache Ultra requires a regional HNS bucket.
- get_rapid_cache: print the TTL when set.
- Soften cache ID comments; the ID is not guaranteed to equal the zone.
- rapid_cache_test: opt-in via RUN_RAPID_CACHE_TESTS=True; assert the
  disable output and tolerate NotFound when checking the disabled state.
- conftest: validate RAPID_CACHE_ZONE, remove the 20s sleep, use a single
  best-effort bucket delete, and disable caches by name on teardown.

[Generated-by: AI]
@sahusneha2004
sahusneha2004 requested a review from shradhakatyal November 16, 2026 18:17
shradhakatyal
shradhakatyal approved these changes Nov 18, 2026
View reviewed changes
@sahusneha2004
sahusneha2004 merged commit 5bdfda6 into main Nov 18, 2026
14 of 19 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@sahusneha2004
sahusneha2004 deleted the storagecontrol-rapid-cache-samples-python branch November 18, 2026 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@shradhakatyal shradhakatyal shradhakatyal approved these changes
@nidhiii-27 nidhiii-27 Awaiting requested review from nidhiii-27
@chandra-siri chandra-siri Awaiting requested review from chandra-siri
+1 more reviewer
@gemini-code-assist gemini-code-assist[bot] gemini-code-assist[bot] left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

ai-generated samples Issues that are directly related to samples. storage-sample-architect

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@sahusneha2004 @shradhakatyal
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.