Skip to content

feat: fix RenameFolder signature and implementation#786

Open
gargnitingoogle wants to merge 4 commits intogoogleapis:mainfrom
gargnitingoogle:gargnitin/ctrl-client-support/v2
Open

feat: fix RenameFolder signature and implementation#786
gargnitingoogle wants to merge 4 commits intogoogleapis:mainfrom
gargnitingoogle:gargnitin/ctrl-client-support/v2

Conversation

@gargnitingoogle
Copy link
Copy Markdown
Contributor

@gargnitingoogle gargnitingoogle commented Apr 7, 2026

  • Adds on top of feat: Add support for control-client stall support #776
  • Fixes the implementation of the RenameFolder interface in control-client in storage-testbench
    • Earlier assumption was that RenameFolder returns a folder object, but RenameFolder in GCS returns an operation object for the long-running folder-rename operation
    • So, storage-tesetbench needs to support the exact same interface,
    • for this, GCS longrunning module has to be imported and used to define the correct response-type for RenameFolder
  • There are also corresponding change in the unit tests for RenameFolder API.

Fixes b/493729540

It's a good idea to open an issue first for discussion.

  • Tests pass
  • Appropriate changes to README are included in PR

@gargnitingoogle gargnitingoogle changed the title Gargnitin/ctrl client support/v2 feat: fix RenameFolder signature and implementation Apr 7, 2026
The insert_folder and rename_folder methods were incorrectly passing a custom string message to testbench.error.already_exists(), which only accepts a single 'context' argument. This caused the testbench to crash with a TypeError instead of returning a gRPC ALREADY_EXISTS status.

Also fixes a NoneType error in GetStorageLayout during mocked unit tests by ensuring a default test bucket is initialized in setUp().
- Updated `update-protos.sh` to fetch `google/longrunning/operations.proto`
- Regenerated Python protobuf bindings
- Updated `grpc_server.py`'s `RenameFolder` to pack the resulting `Folder` into a `google.longrunning.Operation` to match production API behavior and resolve mismatched message type errors.
- Added and updated comprehensive unit tests in `test_storage_control_stall.py` to verify LRO extraction.
@gargnitingoogle gargnitingoogle force-pushed the gargnitin/ctrl-client-support/v2 branch from c1aa7f0 to 911389d Compare April 7, 2026 06:57
@gargnitingoogle gargnitingoogle marked this pull request as ready for review April 7, 2026 06:59
@gargnitingoogle gargnitingoogle requested a review from a team as a code owner April 7, 2026 06:59
Comment thread testbench/grpc_server.py Outdated
@gargnitingoogle gargnitingoogle marked this pull request as draft April 7, 2026 07:57
@gargnitingoogle gargnitingoogle marked this pull request as ready for review April 8, 2026 10:42
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.

2 participants