Skip to content
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

Closed
wants to merge 4 commits into from
Closed

feat: plumb through context changes #268

wants to merge 4 commits into from

Conversation

guseggert
Copy link

No description provided.

Copy link
Contributor

@mvdan mvdan left a 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?

selectivecar.go Outdated Show resolved Hide resolved
@aschmahmann
Copy link
Contributor

Sounds fine with me - I assume you're also taking care of the users of the root-level v0 module?

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.

Also, just to double-check, did you check if the v2 module needs any changes?

Ah, thanks missed that one

@guseggert guseggert force-pushed the feat/context branch 5 times, most recently from 8ad68a4 to ecfc006 Compare November 22, 2021 22:44
@guseggert guseggert requested a review from mvdan November 23, 2021 15:51
@guseggert
Copy link
Author

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?

@@ -18,13 +18,15 @@ import (
"github.com/stretchr/testify/require"
)

var bg = context.Background()
Copy link
Contributor

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.

@@ -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()
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

@@ -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]))
Copy link
Contributor

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.

@guseggert
Copy link
Author

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.

@mvdan
Copy link
Contributor

mvdan commented Dec 9, 2021

FYI @willscott @warpfork

@whyrusleeping
Copy link
Contributor

I didnt see this PR, but i redid it here: #273

and it compiles and the tests pass and stuff

@mvdan
Copy link
Contributor

mvdan commented Dec 10, 2021

It's not equivalent, we'll still want this one - it deals with the v2 module as well.

@arajasek
Copy link
Contributor

v2 landed here #275

@guseggert guseggert closed this Jan 7, 2022
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.

6 participants