@cryptotaxi247 / kubo / commits / 1530cd2ce

Rename migrations from ipfs-x-to-y to fs-repo-x-to-y (#8002)

* rename migrations from ipfs-x-to-y to fs-repo-x-to-y * update current ipfs dist to one with migrations v1.0.0

Andrew Gillis committed Mar 25, 2021 at 10:10 UTC 1530cd2ceab3925d0203972869b0cbf296ecea72
4 files changed +6 -6
repo/fsrepo/migrations/fetch.go
+2 -2
@@ -27,8 +27,8 @@ import (
27 // same name it has inside the archive. Otherwise, the binary file is written
28 // to the file named by out.
29 func FetchBinary(ctx context.Context, fetcher Fetcher, dist, ver, binName, out string) (string, error) {
30 - // The archive file name is the base of dist to support possible subdir in
31 - // dist, for example: "ipfs-repo-migrations/ipfs-11-to-12"
30 + // The archive file name is the base of dist. This is to support a possible subdir in
31 + // dist, for example: "ipfs-repo-migrations/fs-repo-11-to-12"
32 arcName := path.Base(dist)
33 // If binary base name is not specified, then it is same as archive base name.
34 if binName == "" {
repo/fsrepo/migrations/fetcher.go
+1 -1
@@ -8,7 +8,7 @@ import (
8
9 const (
10 // Current dirstibution to fetch migrations from
11 - CurrentIpfsDist = "/ipfs/Qme8pJhBidEUXRdpcWLGR2fkG5kdwVnaMh3kabjfP8zz7Y"
11 + CurrentIpfsDist = "/ipfs/QmZqzacg5Q8WpDL7SymogoaSZYw6RZT2kgPavymCmMwWse"
12 // Latest distribution path. Default for fetchers.
13 LatestIpfsDist = "/ipns/dist.ipfs.io"
14
repo/fsrepo/migrations/migrations.go
+1 -1
@@ -105,7 +105,7 @@ func ExeName(name string) string {
105 }
106
107 func migrationName(from, to int) string {
108 - return fmt.Sprintf("ipfs-%d-to-%d", from, to)
108 + return fmt.Sprintf("fs-repo-%d-to-%d", from, to)
109 }
110
111 // findMigrations returns a list of migrations, ordered from first to last
repo/fsrepo/migrations/migrations_test.go
+2 -2
@@ -125,7 +125,7 @@ func TestFetchMigrations(t *testing.T) {
125 }
126 defer os.RemoveAll(tmpDir)
127
128 - needed := []string{"ipfs-1-to-2", "ipfs-2-to-3"}
128 + needed := []string{"fs-repo-1-to-2", "fs-repo-2-to-3"}
129 fetched, err := fetchMigrations(ctx, fetcher, needed, tmpDir)
130 if err != nil {
131 t.Fatal(err)
@@ -177,7 +177,7 @@ func TestRunMigrations(t *testing.T) {
177
178 err = RunMigration(ctx, fetcher, targetVer, fakeIpfs, true)
179 if err != nil {
180 - if !strings.HasPrefix(err.Error(), "migration ipfs-10-to-11 failed") {
180 + if !strings.HasPrefix(err.Error(), "migration fs-repo-10-to-11 failed") {
181 t.Fatal(err)
182 }
183 }