Conversation
There was a problem hiding this comment.
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.Contextinsg-bucketinterface 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.
3 tasks
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>
torcolvin
approved these changes
May 11, 2026
| serial: serial, | ||
| } | ||
| bucket.expManager = newExpirationManager(bucket.doExpiration) | ||
| bucket.expManager = newExpirationManager(context.Background(), bucket.doExpiration) |
Collaborator
There was a problem hiding this comment.
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.
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-5290
Context-enabled sg-bucket APIs
Dependencies