Repository: kopia/kopia
Pull request #3968 (2024-07-08 23:41:21)

build(deps): bump github.com/klauspost/reedsolomon from 1.12.1 to 1.12.2
Bumps [github.com/klauspost/reedsolomon](https://github.com/klauspost/reedsolomon) from 1.12.1 to 1.12.2.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/klauspost/reedsolomon/releases">github.com/klauspost/reedsolomon's releases</a>.</em></p>
<blockquote>
<h2>v1.12.2</h2>
<h2>What's Changed</h2>
<ul>
<li>Support for ARM SVE and better performance for NEON by <a href="https://github.com/fwessels"><code>@​fwessels</code></a> in <a href="https://redirect.github.com/klauspost/reedsolomon/pull/281">klauspost/reedsolomon#281</a></li>
<li>benchmark: Add CSV header by <a href="https://github.com/klauspost"><code>@​klauspost</code></a> in <a href="https://redirect.github.com/klauspost/reedsolomon/pull/277">klauspost/reedsolomon#277</a></li>
<li>Remove double load on 64 byte loop init by <a href="https://github.com/klauspost"><code>@​klauspost</code></a> in <a href="https://redirect.github.com/klauspost/reedsolomon/pull/279">klauspost/reedsolomon#279</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/AndersTrier"><code>@​AndersTrier</code></a> made their first contribution in <a href="https://redirect.github.com/klauspost/reedsolomon/pull/275">klauspost/reedsolomon#275</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a href="https://github.com/klauspost/reedsolomon/compare/v1.12.1...v1.12.2">https://github.com/klauspost/reedsolomon/compare/v1.12.1...v1.12.2</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/klauspost/reedsolomon/commit/7202dfc08cf2b466f803ca6adaefbeb22726d50d"><code>7202dfc</code></a> Support for ARM SVE and better performance for NEON (<a href="https://redirect.github.com/klauspost/reedsolomon/issues/281">#281</a>)</li>
<li><a href="https://github.com/klauspost/reedsolomon/commit/d4574a5be5062e5a07ffae17ad59789976baf674"><code>d4574a5</code></a> tests: Bump CI to Go 1.22 (<a href="https://redirect.github.com/klauspost/reedsolomon/issues/280">#280</a>)</li>
<li><a href="https://github.com/klauspost/reedsolomon/commit/ea0a106c8f50b260e7fcec62736541a178b64bf3"><code>ea0a106</code></a> Remove double load on 64 byte loop init (<a href="https://redirect.github.com/klauspost/reedsolomon/issues/279">#279</a>)</li>
<li><a href="https://github.com/klauspost/reedsolomon/commit/465e91ab8ed7ac6ec8c018a8a0513a2a3c092ee0"><code>465e91a</code></a> benchmark: Add CSV header (<a href="https://redirect.github.com/klauspost/reedsolomon/issues/277">#277</a>)</li>
<li><a href="https://github.com/klauspost/reedsolomon/commit/85a5e93f8057fbef2758ba5110f7742ccc3bab72"><code>85a5e93</code></a> Remove dead code in fwht (<a href="https://redirect.github.com/klauspost/reedsolomon/issues/275">#275</a>)</li>
<li><a href="https://github.com/klauspost/reedsolomon/commit/fd7f7a5141313bab7d5122bc53bba82cfc869e0e"><code>fd7f7a5</code></a> Update README.md</li>
<li><a href="https://github.com/klauspost/reedsolomon/commit/4e91954739f00400b1c60e81096cb56fa2aea207"><code>4e91954</code></a> Update link in README.md (<a href="https://redirect.github.com/klauspost/reedsolomon/issues/273">#273</a>)</li>
<li>See full diff in <a href="https://github.com/klauspost/reedsolomon/compare/v1.12.1...v1.12.2">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/klauspost/reedsolomon&package-manager=go_modules&previous-version=1.12.1&new-version=1.12.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>

julio-lopez: @dependabot update

Patch:
diff --git a/.github/workflows/make.yml b/.github/workflows/make.yml
index a1ceeeee..a47992f7 100644
--- a/.github/workflows/make.yml
+++ b/.github/workflows/make.yml
@@ -59,9 +59,6 @@ jobs:
     - name: Install macOS-specific packages
       run: "sudo xcode-select -r"
       if: ${{ contains(matrix.os, 'macos') }}
-    - name: Install Linux-specific packages
-      run: "sudo apt-get install -y createrepo-c"
-      if: ${{ contains(matrix.os, 'ubuntu') }}
     - name: Setup
       run: make -j4 ci-setup
     - name: Install macOS certificates
@@ -147,6 +144,8 @@ jobs:
       uses: docker/setup-qemu-action@5927c834f5b4fdf503fca6f4c7eccda82949e1ee # v3.1.0
     - name: Set up Docker Buildx
       uses: docker/setup-buildx-action@4fd812986e6c8c2a69e18311145f9371337f27d4 # v3.4.0
+    - name: Install Linux-specific packages
+      run: "sudo apt-get install -y createrepo-c"
     - name: Download Artifacts
       uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
       with:
diff --git a/cli/command_server_start.go b/cli/command_server_start.go
index d92c4d43..5e7211a5 100644
--- a/cli/command_server_start.go
+++ b/cli/command_server_start.go
@@ -4,6 +4,7 @@
 	"context"
 	"crypto/rand"
 	"encoding/hex"
+	stderrors "errors"
 	"fmt"
 	"io"
 	"net"
@@ -178,7 +179,7 @@ func (c *commandServerStart) initRepositoryPossiblyAsync(ctx context.Context, sr
 	return nil
 }
 
-func (c *commandServerStart) run(ctx context.Context) error {
+func (c *commandServerStart) run(ctx context.Context) (reterr error) {
 	opts, err := c.serverStartOptions(ctx)
 	if err != nil {
 		return err
@@ -193,6 +194,13 @@ func (c *commandServerStart) run(ctx context.Context) error {
 		return errors.Wrap(err, "unable to initialize repository")
 	}
 
+	defer func() {
+		// cleanup: disconnect repository
+		if err := srv.SetRepository(ctx, nil); err != nil {
+			reterr = stderrors.Join(reterr, errors.Wrap(err, "error disconnecting repository"))
+		}
+	}()
+
 	httpServer := &http.Server{
 		ReadHeaderTimeout: 15 * time.Second, //nolint:mnd
 		Addr:              stripProtocol(c.sf.serverAddress),
@@ -262,7 +270,7 @@ func (c *commandServerStart) run(ctx context.Context) error {
 		return err
 	}
 
-	return errors.Wrap(srv.SetRepository(ctx, nil), "error setting active repository")
+	return nil
 }
 
 func shutdownHTTPServer(ctx context.Context, httpServer *http.Server) {
diff --git a/go.mod b/go.mod
index bf2defd2..1c21a371 100644
--- a/go.mod
+++ b/go.mod
@@ -29,7 +29,7 @@ require (
 	github.com/hashicorp/cronexpr v1.1.2
 	github.com/klauspost/compress v1.17.9
 	github.com/klauspost/pgzip v1.2.6
-	github.com/klauspost/reedsolomon v1.12.1
+	github.com/klauspost/reedsolomon v1.12.2
 	github.com/kopia/htmluibuild v0.0.1-0.20240701232248-2fbad5a561f8
 	github.com/kylelemons/godebug v1.1.0
 	github.com/mattn/go-colorable v0.1.13
diff --git a/go.sum b/go.sum
index 3be1b4f2..fa8b4c52 100644
--- a/go.sum
+++ b/go.sum
@@ -174,8 +174,8 @@ github.com/klauspost/cpuid/v2 v2.2.8 h1:+StwCXwm9PdpiEkPyzBXIy+M9KUb4ODm0Zarf1kS
 github.com/klauspost/cpuid/v2 v2.2.8/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
 github.com/klauspost/pgzip v1.2.6 h1:8RXeL5crjEUFnR2/Sn6GJNWtSQ3Dk8pq4CL3jvdDyjU=
 github.com/klauspost/pgzip v1.2.6/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs=
-github.com/klauspost/reedsolomon v1.12.1 h1:NhWgum1efX1x58daOBGCFWcxtEhOhXKKl1HAPQUp03Q=
-github.com/klauspost/reedsolomon v1.12.1/go.mod h1:nEi5Kjb6QqtbofI6s+cbG/j1da11c96IBYBSnVGtuBs=
+github.com/klauspost/reedsolomon v1.12.2 h1:TC0hlL/tTRxiMNnqHCzKsY11E0fIIKGCoZ2vQoPKIEM=
+github.com/klauspost/reedsolomon v1.12.2/go.mod h1:nEi5Kjb6QqtbofI6s+cbG/j1da11c96IBYBSnVGtuBs=
 github.com/kopia/htmluibuild v0.0.1-0.20240701232248-2fbad5a561f8 h1:fOL97sehrUUUQB3YTVUVYFGY7Z192OEct78tI4aDEvo=
 github.com/kopia/htmluibuild v0.0.1-0.20240701232248-2fbad5a561f8/go.mod h1:h53A5JM3t2qiwxqxusBe+PFgGcgZdS+DWCQvG5PTlto=
 github.com/kr/fs v0.1.0 h1:Jskdu9ieNAYnjxsi0LbQp1ulIKZV1LAFgK1tWhpZgl8=
diff --git a/internal/feature/feature.go b/internal/feature/feature.go
index 10f32763..e1788520 100644
--- a/internal/feature/feature.go
+++ b/internal/feature/feature.go
@@ -6,9 +6,6 @@
 	"fmt"
 )
 
-// Behavior specifies how kopia should behave if it encounters a Feature it does not understand.
-type Behavior string
-
 // IfNotUnderstood describes the behavior of Kopia when a required feature is not understood.
 type IfNotUnderstood struct {
 	Warn             bool   `json:"warn"`                       // warn instead of failing


Test patch:
diff --git a/cli/terminate_signal_test.go b/cli/terminate_signal_test.go
index 4813a0ea..5669f508 100644
--- a/cli/terminate_signal_test.go
+++ b/cli/terminate_signal_test.go
@@ -1,26 +1,23 @@
 package cli_test
 
 import (
-	"strings"
 	"syscall"
 	"testing"
 
 	"github.com/stretchr/testify/require"
 
+	"github.com/kopia/kopia/internal/testutil"
 	"github.com/kopia/kopia/tests/testenv"
 )
 
-// Waits until the server advertises its address on the line.
-func serverStarted(line string) bool {
-	return !strings.HasPrefix(line, "SERVER ADDRESS: ")
-}
-
 func TestTerminate(t *testing.T) {
 	env := testenv.NewCLITest(t, testenv.RepoFormatNotImportant, testenv.NewExeRunner(t))
 
 	env.RunAndExpectSuccess(t, "repo", "create", "filesystem", "--path", env.RepoDir)
 
-	wait, interrupt := env.RunAndProcessStderrInt(t, serverStarted, "server", "start",
+	var sp testutil.ServerParameters
+
+	wait, interrupt := env.RunAndProcessStderrInt(t, sp.ProcessOutput, "server", "start",
 		"--address=localhost:0",
 		"--insecure")
 
diff --git a/tests/end_to_end_test/server_start_test.go b/tests/end_to_end_test/server_start_test.go
index f858bb6f..c22786da 100644
--- a/tests/end_to_end_test/server_start_test.go
+++ b/tests/end_to_end_test/server_start_test.go
@@ -529,12 +529,12 @@ func TestServerStartInsecure(t *testing.T) {
 
 	waitUntilServerStarted(ctx, t, cli)
 
-	// server fails to start without a password but with TLS.
-	e.RunAndExpectFailure(t, "server", "start", "--ui", "--address=localhost:0", "--tls-generate-cert", "--without-password")
+	// server fails to start with --without-password when `--insecure` is not specified
+	e.RunAndExpectFailure(t, "server", "start", "--ui", "--address=localhost:0", "--without-password")                        // without TLS
+	e.RunAndExpectFailure(t, "server", "start", "--ui", "--address=localhost:0", "--without-password", "--tls-generate-cert") // with TLS
 
-	// server fails to start with TLS but without password.
-	e.RunAndExpectFailure(t, "server", "start", "--ui", "--address=localhost:0", "--password=foo")
-	e.RunAndExpectFailure(t, "server", "start", "--ui", "--address=localhost:0", "--without-password")
+	// server fails to start when TLS is not configured and `--insecure` is not specified
+	e.RunAndExpectFailure(t, "server", "start", "--ui", "--address=localhost:0")
 }
 
 func verifyServerConnected(t *testing.T, cli *apiclient.KopiaAPIClient, want bool) *serverapi.StatusResponse {