Skip to content

Commit

Permalink
Do not put migrations under their own root
Browse files Browse the repository at this point in the history
Since the migrations are not displayed on the dirtributions, there is not need to organize them under their own root to reduce visual clutter.  Having each migration follow the same path as all other distributions makes each easier to find in the absence of a link displayed on the distributions web page.  It also avoids complicating the distribution deployment scripts and allows each migration distribution to be treated the same as any other distribution.
  • Loading branch information
gammazero committed Jan 12, 2021
1 parent dbb497b commit bc5ef0c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
4 changes: 2 additions & 2 deletions repo/fsrepo/migrations/migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
)

const (
// Migrations distribution
distMigsRoot = "go-ipfs-repo-migrations"
// Migrations subdirectory in distribution. Empty for root (no subdir).
distMigsRoot = ""
distFSRM = "fs-repo-migrations"
)

Expand Down
16 changes: 12 additions & 4 deletions repo/fsrepo/migrations/migrations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ package migrations
import (
"context"
"io/ioutil"
"net/http"
"os"
"path"
"strings"
"testing"
)

Expand Down Expand Up @@ -57,17 +59,23 @@ func TestFindMigrations(t *testing.T) {
}

func TestFetchMigrations(t *testing.T) {
t.Skip("skip - migrations not available on distribution site yet")
ctx, cancel := context.WithCancel(context.Background())
defer cancel()

_, err := LatestDistVersion(ctx, "ipfs-1-to-2")
if err != nil {
if strings.Contains(err.Error(), http.StatusText(http.StatusNotFound)) {
t.Skip("skip - migrations not yet available on distribution site")
}
t.Fatal(err)
}

tmpDir, err := ioutil.TempDir("", "migratetest")
if err != nil {
panic(err)
}
defer os.RemoveAll(tmpDir)

ctx, cancel := context.WithCancel(context.Background())
defer cancel()

needed := []string{"ipfs-1-to-2", "ipfs-2-to-3"}
fetched, err := fetchMigrations(ctx, needed, tmpDir)
if err != nil {
Expand Down

0 comments on commit bc5ef0c

Please sign in to comment.