Conversation
- Create CouchbaseCloud.drop_bucket function since this might be a Sync Gateway operation or a server operation - Change the behavior when creating the database to make sure all databases that are backed by a given bucket are actually gone. If you had multiple databases on the same bucket using different collections, then dropping all of them is necessary to avoid issues creating a database if the new databases targets different collections than the dropped one. - Add special rosmar option to sync gateway config support dropping rosmar buckets - Make sure to stop sync gateway if it was already running
| await self.__sync_gateway.load_dataset(dataset_name, data_filepath) | ||
|
|
||
| async def drop_bucket(self, bucket_name: str, *, wait_for_deleted=False): | ||
| """Drop the bucket from the backing cluster. This is an asynchronous operation unless wait_for_deleted is set to True.""" |
There was a problem hiding this comment.
Is it? I don't see anywhere that it is consulted....
There was a problem hiding this comment.
This is part of a subsequent PR, and the code was buggy so I removed it.
borrrden
left a comment
There was a problem hiding this comment.
wait_for_deleted looks suspicious to me...
There was a problem hiding this comment.
Pull request overview
This PR adds support for cleaning up Rosmar-backed buckets/databases during dataset setup, so local and e2e runs can reliably recreate Sync Gateway databases even when prior runs left state behind.
Changes:
- Added
CouchbaseCloud.drop_bucket()to abstract bucket deletion across Couchbase Server vs Rosmar. - Updated dataset (re)configuration flow to drop the backing bucket and wait until no databases reference it before recreating.
- Enabled Rosmar bucket management in the local Sync Gateway config and ensured local
run_sync_gateway.pyrestarts cleanly.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
uv.lock |
Adds tenacity to the resolved dependency set. |
pyproject.toml |
Adds tenacity==9.1.4 as a direct dependency. |
environment/local/sync_gateway_config/basic_sync_gateway_rosmar.json |
Enables unsupported.rosmar_bucket_management to allow Rosmar bucket deletion. |
environment/local/run_sync_gateway.py |
Stops any existing local Sync Gateway process before starting a new one. |
client/src/cbltest/api/syncgateway.py |
Adds wait_for_no_databases() with retry logic; adjusts logging import/level. |
client/src/cbltest/api/cloud.py |
Introduces drop_bucket() and uses it during dataset reconfiguration on HTTP 412. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
borrrden
left a comment
There was a problem hiding this comment.
Probably just fix this tiny thing before merging
Testing done:
And with Couchbase Server: