Skip to content

CBG-5213 implement private API for rosmar bucket deletion#8158

Open
torcolvin wants to merge 8 commits intomainfrom
CBG-5213
Open

CBG-5213 implement private API for rosmar bucket deletion#8158
torcolvin wants to merge 8 commits intomainfrom
CBG-5213

Conversation

@torcolvin
Copy link
Copy Markdown
Collaborator

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/bucketname but 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 of bucket.scope.collection in the way that Couchbase Server uses the term keyspace but not in the way that Sync Gateway does of database.scope.collection

In 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

  • Removed debug logging (fmt.Print, log.Print, ...)
  • Logging sensitive data? Make sure it's tagged (e.g. base.UD(docID), base.MD(dbName))
  • Updated relevant information in the API specifications (such as endpoint descriptions, schemas, ...) in docs/api

Copilot AI review requested due to automatic review settings April 8, 2026 21:47
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

Redocly previews

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

torcolvin and others added 5 commits April 8, 2026 17:55
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

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.

3 participants