Skip to content
This repository has been archived by the owner on Jun 19, 2023. It is now read-only.

fix: remove context from HashOnRead #93

Merged
merged 2 commits into from
Nov 22, 2021
Merged

fix: remove context from HashOnRead #93

merged 2 commits into from
Nov 22, 2021

Conversation

guseggert
Copy link
Contributor

This is so that v0 and v1 have identical interfaces, which is required
to avoid massive pain for consumers like estuary. Since we have
already plumbed v0 all the way through, it's easiest to just remove
the probably-unnecessary context from HashOnRead.

Copy link
Contributor

@aschmahmann aschmahmann left a comment

Choose a reason for hiding this comment

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

Thanks. Also, I don't think this is just about not dealing with bubbling through more v0 changes, but HashOnRead feels like a weird function to take a context as well.

This is so that v0 and v1 have identical interfaces, which is required
to avoid massive pain for consumers like estuary. Since we have
already plumbed v0 all the way through, it's easiest to just remove
the probably-unnecessary context from HashOnRead.
@github-actions
Copy link

Suggested version: v1.1.1
Comparing to: v1.1.0 (diff)

Changes in go.mod file(s):

diff --git a/go.mod b/go.mod
index 69b4d7d..3c2825c 100644
--- a/go.mod
+++ b/go.mod
@@ -5,8 +5,8 @@ require (
 	github.com/ipfs/bbloom v0.0.4
 	github.com/ipfs/go-block-format v0.0.3
 	github.com/ipfs/go-cid v0.0.7
-	github.com/ipfs/go-datastore v0.4.7-0.20211013204805-28a3721c2e66
-	github.com/ipfs/go-ipfs-ds-help v1.0.0
+	github.com/ipfs/go-datastore v0.5.0
+	github.com/ipfs/go-ipfs-ds-help v1.1.0
 	github.com/ipfs/go-ipfs-util v0.0.2
 	github.com/ipfs/go-log v0.0.1
 	github.com/ipfs/go-metrics-interface v0.0.1

gorelease says:

# github.com/ipfs/go-ipfs-blockstore
## incompatible changes
Blockstore.AllKeysChan: changed from func(context.Context) (<-chan github.com/ipfs/go-cid.Cid, error) to func(context.Context) (<-chan github.com/ipfs/go-cid.Cid, error)
Blockstore.DeleteBlock: changed from func(context.Context, github.com/ipfs/go-cid.Cid) error to func(context.Context, github.com/ipfs/go-cid.Cid) error
Blockstore.Get: changed from func(context.Context, github.com/ipfs/go-cid.Cid) (github.com/ipfs/go-block-format.Block, error) to func(context.Context, github.com/ipfs/go-cid.Cid) (github.com/ipfs/go-block-format.Block, error)
Blockstore.GetSize: changed from func(context.Context, github.com/ipfs/go-cid.Cid) (int, error) to func(context.Context, github.com/ipfs/go-cid.Cid) (int, error)
Blockstore.Has: changed from func(context.Context, github.com/ipfs/go-cid.Cid) (bool, error) to func(context.Context, github.com/ipfs/go-cid.Cid) (bool, error)
Blockstore.HashOnRead: changed from func(context.Context, bool) to func(bool)
Blockstore.Put: changed from func(context.Context, github.com/ipfs/go-block-format.Block) error to func(context.Context, github.com/ipfs/go-block-format.Block) error
Blockstore.PutMany: changed from func(context.Context, []github.com/ipfs/go-block-format.Block) error to func(context.Context, []github.com/ipfs/go-block-format.Block) error
CachedBlockstore: changed from func(context.Context, Blockstore, CacheOpts) (Blockstore, error) to func(context.Context, Blockstore, CacheOpts) (Blockstore, error)
Context: changed from interface{Deadline() (deadline time.Time, ok bool); Done() <-chan struct{}; Err() error; Value(key interface{}) interface{}} to bool
GCLocker.GCLock: changed from func(context.Context) Unlocker to func(context.Context) Unlocker
GCLocker.GCRequested: changed from func(context.Context) bool to func(context.Context) bool
GCLocker.PinLock: changed from func(context.Context) Unlocker to func(context.Context) Unlocker
Unlocker.Unlock: changed from func(context.Context) to func(context.Context)
Viewer.View: changed from func(context.Context, github.com/ipfs/go-cid.Cid, func([]byte) error) error to func(context.Context, github.com/ipfs/go-cid.Cid, func([]byte) error) error

# summary
Cannot suggest a release version.
Incompatible changes were detected.

gocompat says:

"github.com/ipfs/go-ipfs-blockstore".GCBlockstore InterfaceChanged
"github.com/ipfs/go-ipfs-blockstore".Blockstore InterfaceChanged

@guseggert guseggert merged commit 01f69f1 into master Nov 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants