Conversation
1 task
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the sgbucket public interfaces to thread context.Context through additional API entrypoints, aligning bucket/query/view/feed operations with context-aware cancellation/logging patterns.
Changes:
- Added
ctx context.Contextparameters to multiple core interfaces (BucketStore,KVStore,ViewStore,QueryableStore,MutationFeed, and related callback types). - Updated
ViewResult’s iterator methods to match the updatedQueryResultIteratorinterface (NextBytes(ctx),Close(ctx)), and propagatedctxinto view doc-loading (ds.Get(ctx, ...)). - Updated callback types used by DCP feed handling to include
ctx.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| bucket.go | Adds context.Context to many bucket/datastore/KV interfaces and callback types. |
| queries.go | Makes query capability + iterators context-aware (incl. NextBytes(ctx) / Close(ctx)). |
| views.go | Threads ctx through view processing and iterator API; uses ctx for doc fetch via DataStore. |
| tap.go | Makes mutation feed interface + event callback context-aware. |
Comments suppressed due to low confidence (1)
queries.go:71
- The doc comment says QueryResultIterator is implemented by gocb.ViewResults and gocb.QueryResults, but adding ctx parameters to NextBytes/Close means the upstream gocb types will no longer satisfy this interface. Update the comment (and/or introduce adapter wrappers) so consumers aren’t misled about compatibility.
// Common query iterator interface,
// implemented by sgbucket.ViewResult, gocb.ViewResults, and gocb.QueryResults
type QueryResultIterator interface {
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
3 tasks
The ctx parameter was being ignored by every caller — drop it from the callback signature. Callers can still log via the ctx passed to KVStore.Update itself, or via closure capture. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Same rationale as the previous UpdateFunc commit: ctx was being ignored by every caller. Drop it from the callback signatures uniformly. Callers can still log via the ctx passed to the surrounding API call, or via closure capture. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
torcolvin
approved these changes
May 11, 2026
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
Pass context through all sg-bucket API methods