Conversation
Redocly previews |
Contributor
There was a problem hiding this comment.
Pull request overview
Implements an unsupported (private) admin REST API to manage Rosmar buckets to support e2e tests that reuse bucket names across runs.
Changes:
- Adds gated admin endpoints to list Rosmar buckets/scopes/collections and delete a bucket/scope/collection.
- Introduces handler implementation plus unit tests for the new Rosmar management API.
- Extends unsupported startup config and updates OpenAPI documentation for the new endpoints.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| rest/routing.go | Wires new _rosmar admin routes behind an unsupported config flag. |
| rest/rosmar_api.go | Implements GET listing and DELETE deletion logic for Rosmar bucket keyspaces. |
| rest/rosmar_api_test.go | Adds tests covering list and delete behaviors for bucket/scope/collection. |
| rest/config_startup.go | Adds unsupported config toggle rosmar_bucket_management. |
| docs/api/paths/admin/_rosmar.yaml | Documents the GET listing endpoint. |
| docs/api/paths/admin/_rosmar-bucketkeyspace.yaml | Documents the DELETE endpoint semantics. |
| docs/api/admin.yaml | Registers the new OpenAPI paths under the admin spec. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
CBG-5213 implement private API for rosmar bucket deletion
The purpose is to support running couchbase-lite-tests e2e tests, which reuse bucket names between test runs and there is no ability to clear out buckets. This code is hidden behind unsupported API flag.
Written with gemini code assist and tested with a small change couchbase-lite-tests - all e2e tests pass. The only API that is actually used is
DELETE /_rosmar/bucketnamebut I added ability to list buckets/collections. I'm neutral/negative on the API support to delete a scope or collection in rosmar. This is not needed for couchbase-lite-tests so I can remove this if it's complicated. It's a keyspace ofbucket.scope.collectionin the way that Couchbase Server uses the term keyspace but not in the way that Sync Gateway does ofdatabase.scope.collectionIn rosmar, scopes are implicitly if a collection exists, and collections are created on the fly if they don't exist, so there is no need to manually create one.
Pre-review checklist
fmt.Print,log.Print, ...)base.UD(docID),base.MD(dbName))docs/api