From 97e5e6b543f42ec7fd54cfcbc0aeec36d3f7595c Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Mon, 27 May 2024 10:43:29 +0000 Subject: [PATCH 1/4] chore: update version --- version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.go b/version.go index bd6f8183a..ee76d8ed1 100644 --- a/version.go +++ b/version.go @@ -11,7 +11,7 @@ import ( var CurrentCommit string // CurrentVersionNumber is the current application's version literal. -const CurrentVersionNumber = "0.29.0-dev" +const CurrentVersionNumber = "0.30.0-dev" const ApiVersion = "/kubo/" + CurrentVersionNumber + "/" //nolint From 2fdb997bc5f5ce0be1d7e3d2109f081ed5e3b863 Mon Sep 17 00:00:00 2001 From: looklose <166388131+looklose@users.noreply.github.com> Date: Mon, 3 Jun 2024 23:17:58 +0800 Subject: [PATCH 2/4] chore: fix some typos (#10396) Signed-off-by: looklose --- Rules.mk | 2 +- client/rpc/errors.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Rules.mk b/Rules.mk index c3e662aa0..ef88bee0f 100644 --- a/Rules.mk +++ b/Rules.mk @@ -123,7 +123,7 @@ help: @echo ' build - Build binary at ./cmd/ipfs/ipfs' @echo ' nofuse - Build binary with no fuse support' @echo ' install - Build binary and install into $$GOBIN' - @echo ' mod_tidy - Remove unused dependencis from go.mod files' + @echo ' mod_tidy - Remove unused dependencies from go.mod files' # @echo ' dist_install - TODO: c.f. ./cmd/ipfs/dist/README.md' @echo '' @echo 'CLEANING TARGETS:' diff --git a/client/rpc/errors.go b/client/rpc/errors.go index 6c136ebef..29f5487d4 100644 --- a/client/rpc/errors.go +++ b/client/rpc/errors.go @@ -68,11 +68,11 @@ func parseErrNotFound(msg string) (error, bool) { // Assume CIDs break on: // - Whitespaces: " \t\n\r\v\f" // - Semicolon: ";" this is to parse ipld.ErrNotFound wrapped in multierr -// - Double Quotes: "\"" this is for parsing %q and %#v formating. +// - Double Quotes: "\"" this is for parsing %q and %#v formatting. const cidBreakSet = " \t\n\r\v\f;\"" func parseIPLDErrNotFound(msg string) (error, bool) { - // The patern we search for is: + // The pattern we search for is: const ipldErrNotFoundKey = "ipld: could not find " /*CID*/ // We try to parse the CID, if it's invalid we give up and return a simple text error. // We also accept "node" in place of the CID because that means it's an Undefined CID. From 40cf630874a3fc0c6ad9e1dc3045f67319dae402 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Luk=C3=A1=C4=8D?= Date: Mon, 3 Jun 2024 21:13:30 +0200 Subject: [PATCH 3/4] fix(libp2p): streams config validation in resource manager (#10435) --- core/node/libp2p/rcmgr.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/node/libp2p/rcmgr.go b/core/node/libp2p/rcmgr.go index 2a7d67575..ab6e72940 100644 --- a/core/node/libp2p/rcmgr.go +++ b/core/node/libp2p/rcmgr.go @@ -491,7 +491,7 @@ resource manager System.ConnsInbound (%d) must be bigger than ConnMgr.HighWater See: https://github.com/ipfs/kubo/blob/master/docs/libp2p-resource-management.md#how-does-the-resource-manager-resourcemgr-relate-to-the-connection-manager-connmgr `, rcm.System.ConnsInbound, highWater) } - if rcm.System.Streams > rcmgr.DefaultLimit || rcm.System.Streams == rcmgr.BlockAllLimit && int64(rcm.System.Streams) <= highWater { + if (rcm.System.Streams > rcmgr.DefaultLimit || rcm.System.Streams == rcmgr.BlockAllLimit) && int64(rcm.System.Streams) <= highWater { // nolint return fmt.Errorf(` Unable to initialize libp2p due to conflicting resource manager limit configuration. From a07852a3f0294974b802923fb136885ad077384e Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Thu, 6 Jun 2024 22:19:23 +0200 Subject: [PATCH 4/4] fix(cli): unify --name param in ls and add (#10439) This is a cosmetic fix for bug found during testing 0.29.0-rc2. pin add --name had shorthand -n pin ls --name had no shorthand, and --names had -n This unifies -n making it a shorthand for the same parameter in both `pin ls` and `pin add`. --- core/commands/pin/pin.go | 6 +++--- docs/changelogs/v0.29.md | 9 +++++++-- test/cli/pins_test.go | 41 +++++++++++++++++++++------------------- 3 files changed, 32 insertions(+), 24 deletions(-) diff --git a/core/commands/pin/pin.go b/core/commands/pin/pin.go index b27b1e2bf..b87760aaf 100644 --- a/core/commands/pin/pin.go +++ b/core/commands/pin/pin.go @@ -359,10 +359,10 @@ Example: }, Options: []cmds.Option{ cmds.StringOption(pinTypeOptionName, "t", "The type of pinned keys to list. Can be \"direct\", \"indirect\", \"recursive\", or \"all\".").WithDefault("all"), - cmds.BoolOption(pinQuietOptionName, "q", "Write just hashes of objects."), + cmds.BoolOption(pinQuietOptionName, "q", "Output only the CIDs of pins."), + cmds.StringOption(pinNameOptionName, "n", "Limit returned pins to ones with names that contain the value provided (case-sensitive, partial match). Implies --names=true."), cmds.BoolOption(pinStreamOptionName, "s", "Enable streaming of pins as they are discovered."), - cmds.BoolOption(pinNamesOptionName, "n", "Enable displaying pin names (slower)."), - cmds.StringOption(pinNameOptionName, "Display pins with names that contain the value provided (case-sensitive, partial match)."), + cmds.BoolOption(pinNamesOptionName, "Include pin names in the output (slower, disabled by default)."), }, Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { api, err := cmdenv.GetApi(env, req) diff --git a/docs/changelogs/v0.29.md b/docs/changelogs/v0.29.md index 632c47b15..a7c6f2608 100644 --- a/docs/changelogs/v0.29.md +++ b/docs/changelogs/v0.29.md @@ -17,7 +17,12 @@ #### Add search functionality for pin names -It is now possible to search for pins by name. To do so, use `ipfs pin ls --name "SomeName"`. The search is case-sensitive and will return all pins having a name which contains the exact word provided. +It is now possible to search for pins by name via `ipfs pin ls --name "SomeName"`. +The search is case-sensitive and will return all pins that contain the specified substring in their name. + +> [!TIP] +> The `ipfs pin ls -n` is now a shorthand for `ipfs pin ls --name`, mirroring the behavior of `ipfs pin add`. +> See `ipfs pin ls --help` for more information. #### Customizing `ipfs add` defaults @@ -27,7 +32,7 @@ The hash function, CID version, or UnixFS raw leaves and chunker behaviors can b > [!TIP] > As a convenience, two CID [profiles](../config.md#profile) are provided: `legacy-cid-v0` and `test-cid-v1`. > A test profile that defaults to modern CIDv1 can be applied via `ipfs config profile apply test-cid-v1`. -> We encourage users to try it and report any issues. +> We encourage users to try it and report any issues in [kubo#4143](https://github.com/ipfs/kubo/issues/4143). ### 📝 Changelog diff --git a/test/cli/pins_test.go b/test/cli/pins_test.go index 88da250b1..3e3325a01 100644 --- a/test/cli/pins_test.go +++ b/test/cli/pins_test.go @@ -242,7 +242,7 @@ func TestPins(t *testing.T) { require.NotContains(t, lsOut, outADetailed) }) - t.Run("test listing pins which contains specific name", func(t *testing.T) { + t.Run("test listing pins with names that contain specific string", func(t *testing.T) { t.Parallel() node := harness.NewT(t).NewNode().Init() @@ -254,27 +254,30 @@ func TestPins(t *testing.T) { outB := cidBStr + " recursive testPin" outC := cidCStr + " recursive randPin" - _ = node.IPFS("pin", "add", "--name", "testPin", cidAStr) - lsOut := pinLs(node, "-t=recursive", "--name=test") - require.Contains(t, lsOut, outA) - lsOut = pinLs(node, "-t=recursive", "--name=randomLabel") - require.NotContains(t, lsOut, outA) + // make sure both -n and --name work + for _, nameParam := range []string{"--name", "-n"} { + _ = node.IPFS("pin", "add", "--name", "testPin", cidAStr) + lsOut := pinLs(node, "-t=recursive", nameParam+"=test") + require.Contains(t, lsOut, outA) + lsOut = pinLs(node, "-t=recursive", nameParam+"=randomLabel") + require.NotContains(t, lsOut, outA) - _ = node.IPFS("pin", "add", "--name", "testPin", cidBStr) - lsOut = pinLs(node, "-t=recursive", "--name=test") - require.Contains(t, lsOut, outA) - require.Contains(t, lsOut, outB) + _ = node.IPFS("pin", "add", "--name", "testPin", cidBStr) + lsOut = pinLs(node, "-t=recursive", nameParam+"=test") + require.Contains(t, lsOut, outA) + require.Contains(t, lsOut, outB) - _ = node.IPFS("pin", "add", "--name", "randPin", cidCStr) - lsOut = pinLs(node, "-t=recursive", "--name=rand") - require.NotContains(t, lsOut, outA) - require.NotContains(t, lsOut, outB) - require.Contains(t, lsOut, outC) + _ = node.IPFS("pin", "add", "--name", "randPin", cidCStr) + lsOut = pinLs(node, "-t=recursive", nameParam+"=rand") + require.NotContains(t, lsOut, outA) + require.NotContains(t, lsOut, outB) + require.Contains(t, lsOut, outC) - lsOut = pinLs(node, "-t=recursive", "--name=testPin") - require.Contains(t, lsOut, outA) - require.Contains(t, lsOut, outB) - require.NotContains(t, lsOut, outC) + lsOut = pinLs(node, "-t=recursive", nameParam+"=testPin") + require.Contains(t, lsOut, outA) + require.Contains(t, lsOut, outB) + require.NotContains(t, lsOut, outC) + } }) t.Run("test overwriting pin with name", func(t *testing.T) {