-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: plumb through context changes #268
Conversation
6a25639
to
8e4ba02
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds fine with me - I assume you're also taking care of the users of the root-level v0 module?
Also, just to double-check, did you check if the v2 module needs any changes?
We're pulling things up through every dependency of the go-ipfs and hydra-booster binaries. Any other consumers (e.g. lotus, estuary, indexer, ...) will have to fend for themselves.
Ah, thanks missed that one |
8ad68a4
to
ecfc006
Compare
I've updated v2. And also the CLI, by plumbing through the first commit of this PR to the CLI in a second commit using pseudoversions...is that the preferred approach? |
v2/blockstore/readonly_test.go
Outdated
@@ -18,13 +18,15 @@ import ( | |||
"github.com/stretchr/testify/require" | |||
) | |||
|
|||
var bg = context.Background() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please don't use a global context; I know it's a no-op and just used in tests, but I would rather avoid sharing any form of state between tests.
v2/blockstore/readwrite_test.go
Outdated
@@ -32,6 +32,7 @@ var ( | |||
rng = rand.New(rand.NewSource(1413)) | |||
oneTestBlockWithCidV1 = merkledag.NewRawNode([]byte("fish")).Block | |||
anotherTestBlockWithCidV0 = blocks.NewBlock([]byte("barreleye")) | |||
bg = context.Background() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
v2/example_test.go
Outdated
@@ -61,7 +62,7 @@ func ExampleWrapV1File() { | |||
if err != nil { | |||
panic(err) | |||
} | |||
fmt.Println(bs.Get(roots[0])) | |||
fmt.Println(bs.Get(context.Background(), roots[0])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for examples, I wonder if we should use context.TODO()
instead, to highlight to the user that they should probably replace the context with something more useful - or consciously use a background context.
I guess it's not super important here, since the CAR blockstore doesn't yet use the context at all, but it might in the future.
ecfc006
to
adf6d8a
Compare
This PR Is currently blocked b/c of a new change on master which adds a dependency on https://github.com/ipld/go-ipld-prime/tree/master/storage/bsadapter which uses the old datastore, causing the build to fail. We'll need to upgrade that and plumb it through first before this can be merged. |
FYI @willscott @warpfork |
I didnt see this PR, but i redid it here: #273 and it compiles and the tests pass and stuff |
It's not equivalent, we'll still want this one - it deals with the v2 module as well. |
v2 landed here #275 |
No description provided.