Skip to content

CBG-5290: Context-enabled sg-bucket APIs#72

Merged
bbrks merged 7 commits into
mainfrom
CBG-5290
May 11, 2026
Merged

CBG-5290: Context-enabled sg-bucket APIs#72
bbrks merged 7 commits into
mainfrom
CBG-5290

Conversation

@bbrks

@bbrks bbrks commented May 7, 2026

Copy link
Copy Markdown
Member

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates Rosmar’s sg-bucket integration to use context-enabled APIs, aligning bucket/collection operations, feeds, views, queries, and tests with the new context.Context-passing method signatures.

Changes:

  • Updated Rosmar bucket/collection implementations to accept context.Context in sg-bucket interface methods (CRUD, query, design docs, subdoc, feeds, vbno, etc.).
  • Updated feed callback signatures and internal feed/checkpoint operations to pass context through.
  • Updated tests to use t.Context() and to call the new context-aware APIs.

Reviewed changes

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

Show a summary per file
File Description
xattrs_test.go Updates xattrs tests to use t.Context() and new context-aware datastore APIs/callback signatures.
views.go Passes ctx into view result processing (ProcessParsed).
views_test.go Updates view/design-doc tests to use context-aware APIs.
query_test.go Updates query/index tests to use context-aware query APIs and iterator methods.
hlc_test.go Updates CAS write calls to include context in concurrent bucket tests.
go.sum Bumps github.com/couchbase/sg-bucket pseudo-version checksums.
go.mod Bumps github.com/couchbase/sg-bucket dependency version.
feeds.go Updates DCP feed wiring (callbacks, default collection lookup, checkpoints) for context-aware APIs.
feeds_test.go Updates feed tests for context-aware datastore APIs and feed callback signature.
designdoc.go Updates design-doc APIs (GetDDocs/GetDDoc/DeleteDDoc) to accept context.
collection+xattrs.go Passes ctx into xattr write-update callback.
collection+subdoc.go Updates subdoc APIs to accept and propagate context.
collection+query.go Updates query/index APIs and iterators to accept context and pass it through.
collection.go Updates core datastore APIs to accept context and passes it to callbacks/operations where applicable.
collection_test.go Updates collection tests/helpers for context-aware APIs (mostly using t.Context()).
bucket_test.go Removes testCtx helper; updates bucket tests to use t.Context() and context-aware bucket APIs.
bucket_registry_test.go Updates registry tests for context-aware bucket/datastore APIs.
bucket_api.go Updates bucket APIs (UUID, datastore accessors, list/drop, vbno) to accept context; expiry path now calls context-aware methods.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread bucket_api.go Outdated
Comment thread collection.go Outdated
Comment thread collection_test.go Outdated
bbrks and others added 6 commits May 8, 2026 19:08
UpdateFunc no longer accepts ctx — drop it from the rosmar Update
callback invocation.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Drop ctx from the callback invocation/closure sites in rosmar's xattr
write-update path and DCP feeds, plus tests, to match the sg-bucket
signature change.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Comment thread bucket.go
serial: serial,
}
bucket.expManager = newExpirationManager(bucket.doExpiration)
bucket.expManager = newExpirationManager(context.Background(), bucket.doExpiration)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

there's already a context.TODO() above so you don't have to do context.Background() . I'd be fine if you want to actually add a context here and change the API, but I don't think it would gain much.

@bbrks bbrks merged commit d9eb548 into main May 11, 2026
15 checks passed
@bbrks bbrks deleted the CBG-5290 branch May 11, 2026 15:09
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.

4 participants