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

test: sharness with car fixtures #2

Merged
merged 20 commits into from
Mar 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions .circleci/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -234,15 +234,16 @@ jobs:
at: /tmp/circleci-workspace
- restore_cache:
keys:
- v1-interop-{{ .Branch }}-{{ .Revision }}
- v1-interop-{{ .Branch }}-
- v1-interop-
- v2-interop-{{ .Branch }}-{{ .Revision }}
- v2-interop-{{ .Branch }}-
- v2-interop-
- run:
name: Installing dependencies
command: |
npm init -y
npm install ipfs@^0.61.0
npm install ipfs-interop@^8.0.10
npm install ipfs@^0.66.0
npm install kubo-rpc-client@^3.0.1
npm install ipfs-interop@^10.0.1
npm install mocha-circleci-reporter@0.0.3
working_directory: ~/ipfs/kubo/interop
- run:
Expand All @@ -259,7 +260,7 @@ jobs:
- store_test_results:
path: /tmp/test-results
- save_cache:
key: v1-interop-{{ .Branch }}-{{ .Revision }}
key: v2-interop-{{ .Branch }}-{{ .Revision }}
paths:
- ~/ipfs/kubo/interop/node_modules
go-ipfs-api:
Expand Down Expand Up @@ -292,7 +293,7 @@ jobs:
command: go test -count=1 -v ./...
working_directory: ~/ipfs/kubo/go-ipfs-api
- save_cache:
key: v1-go-api-{{ checksum "~/ipfs/kubo/go-ipfs-api/go.sum" }}
key: v2-go-api-{{ checksum "~/ipfs/kubo/go-ipfs-api/go.sum" }}
paths:
- ~/go/pkg/mod
- ~/.cache/go-build/
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,9 @@ jobs:
- run: mkdir interop
- run: |
npm init -y
npm install ipfs@^0.61.0
npm install ipfs-interop@^8.0.10
npm install ipfs@^0.66.0
npm install kubo-rpc-client@^3.0.1
npm install ipfs-interop@^10.0.1
working-directory: interop
- run: npx ipfs-interop -- -t node $(sed -e 's#[^ ]*#-f test/&.js#g' <<< '${{ matrix.suites }}')
env:
Expand Down
4 changes: 2 additions & 2 deletions cmd/ipfs/dist/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ipfs commandline tool
# ipfs command line tool

This is the [ipfs](http://ipfs.io) commandline tool. It contains a full ipfs node.
This is the [ipfs](http://ipfs.io) command line tool. It contains a full ipfs node.

## Install

Expand Down
4 changes: 3 additions & 1 deletion core/coreapi/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ func (api *BlockAPI) Put(ctx context.Context, src io.Reader, opts ...caopts.Bloc
}

if settings.Pin {
api.pinning.PinWithMode(b.Cid(), pin.Recursive)
if err = api.pinning.PinWithMode(ctx, b.Cid(), pin.Recursive); err != nil {
return nil, err
}
if err := api.pinning.Flush(ctx); err != nil {
return nil, err
}
Expand Down
11 changes: 8 additions & 3 deletions core/coreapi/dag.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ import (
pin "github.com/ipfs/go-ipfs-pinner"
ipld "github.com/ipfs/go-ipld-format"
dag "github.com/ipfs/go-merkledag"
"github.com/ipfs/kubo/tracing"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/trace"

"github.com/ipfs/kubo/tracing"
)

type dagAPI struct {
Expand All @@ -29,7 +30,9 @@ func (adder *pinningAdder) Add(ctx context.Context, nd ipld.Node) error {
return err
}

adder.pinning.PinWithMode(nd.Cid(), pin.Recursive)
if err := adder.pinning.PinWithMode(ctx, nd.Cid(), pin.Recursive); err != nil {
return err
}

return adder.pinning.Flush(ctx)
}
Expand All @@ -48,7 +51,9 @@ func (adder *pinningAdder) AddMany(ctx context.Context, nds []ipld.Node) error {
for _, nd := range nds {
c := nd.Cid()
if cids.Visit(c) {
adder.pinning.PinWithMode(c, pin.Recursive)
if err := adder.pinning.PinWithMode(ctx, c, pin.Recursive); err != nil {
return err
}
}
}

Expand Down
8 changes: 6 additions & 2 deletions core/coreapi/object.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ import (
coreiface "github.com/ipfs/interface-go-ipfs-core"
caopts "github.com/ipfs/interface-go-ipfs-core/options"
ipath "github.com/ipfs/interface-go-ipfs-core/path"
"github.com/ipfs/kubo/tracing"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/trace"

"github.com/ipfs/kubo/tracing"
)

const inputLimit = 2 << 20
Expand Down Expand Up @@ -132,7 +133,10 @@ func (api *ObjectAPI) Put(ctx context.Context, src io.Reader, opts ...caopts.Obj
}

if options.Pin {
api.pinning.PinWithMode(dagnode.Cid(), pin.Recursive)
if err := api.pinning.PinWithMode(ctx, dagnode.Cid(), pin.Recursive); err != nil {
return nil, err
}

err = api.pinning.Flush(ctx)
if err != nil {
return nil, err
Expand Down
7 changes: 6 additions & 1 deletion core/coreunix/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"github.com/ipfs/go-unixfs/importer/trickle"
coreiface "github.com/ipfs/interface-go-ipfs-core"
"github.com/ipfs/interface-go-ipfs-core/path"

"github.com/ipfs/kubo/tracing"
)

Expand Down Expand Up @@ -185,7 +186,11 @@ func (adder *Adder) PinRoot(ctx context.Context, root ipld.Node) error {
adder.tempRoot = rnk
}

adder.pinning.PinWithMode(rnk, pin.Recursive)
err = adder.pinning.PinWithMode(ctx, rnk, pin.Recursive)
if err != nil {
return err
}

return adder.pinning.Flush(ctx)
}

Expand Down
5 changes: 1 addition & 4 deletions core/node/libp2p/relay.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,7 @@ func MaybeAutoRelay(staticRelays []string, cfgPeering config.Peering, enabled bo
}
static = append(static, *addr)
}
opts.Opts = append(opts.Opts, libp2p.EnableAutoRelayWithStaticRelays(
static,
autorelay.WithCircuitV1Support(),
))
opts.Opts = append(opts.Opts, libp2p.EnableAutoRelayWithStaticRelays(static))
}
return
})
Expand Down
6 changes: 3 additions & 3 deletions docs/RELEASE_ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ As usual, this release includes important fixes, some of which may be critical f
Checklist:

- [ ] **Stage 0 - Prerequisites**
- [ ] Open an issue against [bifrost-infra](https://github.com/protocol/bifrost-infra) ahead of the release ([example](https://github.com/protocol/bifrost-infra/issues/2109)). **Idealy, do this multiple days in advance of the RC** to give Bifrost the heads up that asks will be coming their way.
- [ ] Open an issue against [bifrost-infra](https://github.com/protocol/bifrost-infra) ahead of the release ([example](https://github.com/protocol/bifrost-infra/issues/2109)). **Ideally, do this multiple days in advance of the RC** to give Bifrost the heads up that asks will be coming their way.
- [ ] Spell out all that we want updated - gateways, the bootstraper and the cluster/preload nodes
- [ ] Mention @protocol/bifrost-team in the issue and let them know the expected date of the release
- Issue link:
Expand Down Expand Up @@ -74,7 +74,7 @@ Checklist:
- [ ] If it's not a first RC, add new commits to the `release-vX.Y.Z` branch from `master` using `git cherry-pick -x ...`
- Note: `release-*` branches are protected. You can do all needed updates on a separated branch (e.g. `wip-release-vX.Y.Z`) and when everything is settled push to `release-vX.Y.Z`
- [ ] Bump the version in `version.go` in the `release-vX.Y.Z` branch to `vX.Y.Z-rcN`.
- [ ] If it's a first RC, create a draft PR targetting `release` branch if it doesn't exist yet ([example](https://github.com/ipfs/kubo/pull/9306)).
- [ ] If it's a first RC, create a draft PR targeting `release` branch if it doesn't exist yet ([example](https://github.com/ipfs/kubo/pull/9306)).
- [ ] Wait for CI to run and complete PR checks. All checks should pass.
- [ ] Create a signed tag for the release candidate.
- [ ] This is a dangerous operation, as it is difficult to reverse due to Go modules and automated Docker image publishing. Remember to verify the commands you intend to run for items marked with ⚠️ with the release reviewer.
Expand Down Expand Up @@ -144,7 +144,7 @@ Checklist:
- [ ] Commit the changelog changes.
- [ ] Push the `release-vX.Y.Z` branch to GitHub (`git push origin release-vX.Y.Z`)
- [ ] Mark the PR created from `release-vX.Y.Z` as ready for review.
- [ ] Ensure the PR is targetting `release` branch.
- [ ] Ensure the PR is targeting `release` branch.
- [ ] Ensure that CI is green.
- [ ] Have release reviewer review the PR.
- [ ] Merge the PR into `release` branch using the `Create a merge commit` (do **NOT** use `Squash and merge` nor `Rebase and merge` because we need to be able to sign the merge commit).
Expand Down
2 changes: 1 addition & 1 deletion docs/changelogs/v0.10.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ See `ipfs swarm peering --help` for more details.
([ipld/go-ipld-prime#228](https://github.com/ipld/go-ipld-prime/pull/228))
- Fix ExploreRecursive stopAt condition, add tests, add error return to Explore (#229) ([ipld/go-ipld-prime#229](https://github.com/ipld/go-ipld-prime/pull/229))
- selector: add tests which are driven by language-agnostic spec fixtures. ([ipld/go-ipld-prime#231](https://github.com/ipld/go-ipld-prime/pull/231))
- selector: Improve docs for implementors. (#227) ([ipld/go-ipld-prime#227](https://github.com/ipld/go-ipld-prime/pull/227))
- selector: Improve docs for implementers. (#227) ([ipld/go-ipld-prime#227](https://github.com/ipld/go-ipld-prime/pull/227))
- Bindnode fixes of opportunity ([ipld/go-ipld-prime#226](https://github.com/ipld/go-ipld-prime/pull/226))
- node/bindnode: redesign the shape of unions in Go ([ipld/go-ipld-prime#223](https://github.com/ipld/go-ipld-prime/pull/223))
- summary of the v0.11.0 changelog should holler even more about how cool bindnode is.
Expand Down
4 changes: 2 additions & 2 deletions docs/changelogs/v0.11.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ This work was [contributed](https://github.com/ipfs/go-ipfs/pull/8569) by [Ceram
- feat(queryexecutor): merge RunTraversal into QueryExecutor
- feat(responsemanager): QueryExecutor to separate module - use TaskQueue, add tests
- Merge branch 'release/v0.10.5'
- fix(responseassembler): dont hold block data reference in passed on subscribed block link (#268) ([ipfs/go-graphsync#268](https://github.com/ipfs/go-graphsync/pull/268))
- fix(responseassembler): don't hold block data reference in passed on subscribed block link (#268) ([ipfs/go-graphsync#268](https://github.com/ipfs/go-graphsync/pull/268))
- sync: update CI config files (#266) ([ipfs/go-graphsync#266](https://github.com/ipfs/go-graphsync/pull/266))
- Check IPLD context cancellation error type instead of string comparison
- Use `context.CancelFunc` instead of `func()` (#257) ([ipfs/go-graphsync#257](https://github.com/ipfs/go-graphsync/pull/257))
Expand Down Expand Up @@ -622,7 +622,7 @@ This work was [contributed](https://github.com/ipfs/go-ipfs/pull/8569) by [Ceram
- github.com/libp2p/go-libp2p-pubsub (v0.5.4 -> v0.6.0):
- feat: plumb through context changes (#459) ([libp2p/go-libp2p-pubsub#459](https://github.com/libp2p/go-libp2p-pubsub/pull/459))
- support MinTopicSize without a discovery mechanism
- clear peerPromises map when fullfilling a promise
- clear peerPromises map when fulfilling a promise
- README: remove obsolete notice, fix example code for tracing.
- remove peer filter check from subscriptions (#453) ([libp2p/go-libp2p-pubsub#453](https://github.com/libp2p/go-libp2p-pubsub/pull/453))
- Create peer filter option
Expand Down
2 changes: 1 addition & 1 deletion docs/changelogs/v0.12.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ For this migration, if your datastore has fast renames you may want to consider
- Version 1.1.0 (#91) ([ipfs/go-ipfs-blockstore#91](https://github.com/ipfs/go-ipfs-blockstore/pull/91))
- feat: add context to interfaces (#90) ([ipfs/go-ipfs-blockstore#90](https://github.com/ipfs/go-ipfs-blockstore/pull/90))
- sync: update CI config files (#88) ([ipfs/go-ipfs-blockstore#88](https://github.com/ipfs/go-ipfs-blockstore/pull/88))
- add constructor that doesnt mess with datastore keys ([ipfs/go-ipfs-blockstore#83](https://github.com/ipfs/go-ipfs-blockstore/pull/83))
- add constructor that doesn't mess with datastore keys ([ipfs/go-ipfs-blockstore#83](https://github.com/ipfs/go-ipfs-blockstore/pull/83))
- Use bloom filter in GetSize
- fix staticcheck ([ipfs/go-ipfs-blockstore#73](https://github.com/ipfs/go-ipfs-blockstore/pull/73))
- add BenchmarkARCCacheConcurrentOps ([ipfs/go-ipfs-blockstore#70](https://github.com/ipfs/go-ipfs-blockstore/pull/70))
Expand Down
14 changes: 7 additions & 7 deletions docs/changelogs/v0.13.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ View the linked [security advisory](https://github.com/ipfs/go-ipfs/security/adv
- Remove support for `ForEach` enumeration from car-index-sorted
- Use a fix code as the multihash code for `CarIndexSorted`
- Fix testutil assertion logic and update index generation tests
- fix: tighter constraint of singleWidthIndex width, add index recommentation docs
- fix: tighter constraint of singleWidthIndex width, add index recommendation docs
- fix: explicitly disable serialization of insertionindex
- feat: MaxAllowed{Header,Section}Size option
- feat: MaxAllowedSectionSize default to 32M
Expand Down Expand Up @@ -66,7 +66,7 @@ View the linked [security advisory](https://github.com/ipfs/go-ipfs/security/adv
- Traversal-based car creation (#269) ([ipld/go-car#269](https://github.com/ipld/go-car/pull/269))
- Seek to start before index generation in `ReadOnly` blockstore
- support extraction of unixfs content stored in car files (#263) ([ipld/go-car#263](https://github.com/ipld/go-car/pull/263))
- Add a barebones readme to the car CLI (#262) ([ipld/go-car#262](https://github.com/ipld/go-car/pull/262))
- Add a bare bones readme to the car CLI (#262) ([ipld/go-car#262](https://github.com/ipld/go-car/pull/262))
- sync: update CI config files (#261) ([ipld/go-car#261](https://github.com/ipld/go-car/pull/261))
- fix!: use -version=n instead of -v1 for index command
- feat: fix get-dag and add version=1 option
Expand Down Expand Up @@ -223,7 +223,7 @@ Future releases will [add support for dag-json and dag-cbor responses](https://g
There are two ways for requesting CID specific response format:
1. HTTP header: `Accept: application/vnd.ipld.{format}`
- Examples: [application/vnd.ipld.car](https://www.iana.org/assignments/media-types/application/vnd.ipld.car), [application/vnd.ipld.raw](https://www.iana.org/assignments/media-types/application/vnd.ipld.raw)
2. URL paramerer: `?format=`
2. URL parameter: `?format=`
- Useful for creating "Download CAR" links.

*Usage examples:*
Expand Down Expand Up @@ -629,7 +629,7 @@ The more fully featured yamux stream multiplexer is now prioritized over mplex f
- fix: cannot call SetPrimaryCore after using a Tee logger ([ipfs/go-log#121](https://github.com/ipfs/go-log/pull/121))
- Document environment variables ([ipfs/go-log#120](https://github.com/ipfs/go-log/pull/120))
- sync: update CI config files (#119) ([ipfs/go-log#119](https://github.com/ipfs/go-log/pull/119))
- Add WithStacktrace untility ([ipfs/go-log#118](https://github.com/ipfs/go-log/pull/118))
- Add WithStacktrace utility ([ipfs/go-log#118](https://github.com/ipfs/go-log/pull/118))
- In addition to StdOut/Err check the outfile for TTYness ([ipfs/go-log#117](https://github.com/ipfs/go-log/pull/117))
- github.com/ipfs/go-merkledag (v0.5.1 -> v0.6.0):
- v0.6.0
Expand Down Expand Up @@ -659,7 +659,7 @@ The more fully featured yamux stream multiplexer is now prioritized over mplex f
- add AsLargeBytes support to unixfs files (#24) ([ipfs/go-unixfsnode#24](https://github.com/ipfs/go-unixfsnode/pull/24))
- fix: add extra test to span the shard/no-shard boundary
- fix: more Tsize fixes, fix HAMT and make it match go-unixfs output
- fix: encode Tsize correctly everywhere (using wraped LinkSystem)
- fix: encode Tsize correctly everywhere (using wrapped LinkSystem)
- docs(version): tag 1.2.0
- Update deps for ADL selectors ([ipfs/go-unixfsnode#20](https://github.com/ipfs/go-unixfsnode/pull/20))
- add license (#17) ([ipfs/go-unixfsnode#17](https://github.com/ipfs/go-unixfsnode/pull/17))
Expand Down Expand Up @@ -951,7 +951,7 @@ The more fully featured yamux stream multiplexer is now prioritized over mplex f
- disable the incoming streams limit (#49) ([libp2p/go-libp2p-yamux#49](https://github.com/libp2p/go-libp2p-yamux/pull/49))
- Release v0.8.1 ([libp2p/go-libp2p-yamux#48](https://github.com/libp2p/go-libp2p-yamux/pull/48))
- release v0.8.0 (#47) ([libp2p/go-libp2p-yamux#47](https://github.com/libp2p/go-libp2p-yamux/pull/47))
- pass the PeerScope to yamux (satifiying its MemoryManger interface) (#46) ([libp2p/go-libp2p-yamux#46](https://github.com/libp2p/go-libp2p-yamux/pull/46))
- pass the PeerScope to yamux ( satisfying its MemoryManger interface) (#46) ([libp2p/go-libp2p-yamux#46](https://github.com/libp2p/go-libp2p-yamux/pull/46))
- release v0.7.0 (#43) ([libp2p/go-libp2p-yamux#43](https://github.com/libp2p/go-libp2p-yamux/pull/43))
- sync: update CI config files (#42) ([libp2p/go-libp2p-yamux#42](https://github.com/libp2p/go-libp2p-yamux/pull/42))
- reduce the number of max incoming stream to 256 ([libp2p/go-libp2p-yamux#41](https://github.com/libp2p/go-libp2p-yamux/pull/41))
Expand All @@ -973,7 +973,7 @@ The more fully featured yamux stream multiplexer is now prioritized over mplex f
- multiplex: add (*Multiplex).CloseChan ([libp2p/go-mplex#89](https://github.com/libp2p/go-mplex/pull/89))
- add a Go Reference badge to the README ([libp2p/go-mplex#88](https://github.com/libp2p/go-mplex/pull/88))
- sync: update CI config files ([libp2p/go-mplex#85](https://github.com/libp2p/go-mplex/pull/85))
- Fixup tests & vet ([libp2p/go-mplex#84](https://github.com/libp2p/go-mplex/pull/84))
- Fix up tests & vet ([libp2p/go-mplex#84](https://github.com/libp2p/go-mplex/pull/84))
- Bump lodash from 4.17.19 to 4.17.21 in /interop/js ([libp2p/go-mplex#83](https://github.com/libp2p/go-mplex/pull/83))
- github.com/libp2p/go-msgio (v0.1.0 -> v0.2.0):
- release v0.2.0 (#34) ([libp2p/go-msgio#34](https://github.com/libp2p/go-msgio/pull/34))
Expand Down
Loading