Skip to content

Commit 22e781e

Browse files
authored
chore: add /v2 to import module path (coder#9072)
* chore: add /v2 to import module path go mod requires semantic versioning with versions greater than 1.x This was a mechanical update by running: ``` go install github.com/marwan-at-work/mod/cmd/mod@latest mod upgrade ``` Migrate generated files to import /v2 * Fix gen
1 parent 0d40e7f commit 22e781e

File tree

626 files changed

+5834
-5834
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

626 files changed

+5834
-5834
lines changed

Diff for: .swaggo

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// Replace all NullTime with string
2-
replace github.com/coder/coder/codersdk.NullTime string
2+
replace github.com/coder/coder/v2/codersdk.NullTime string
33
// Prevent swaggo from rendering enums for time.Duration
44
replace time.Duration int64
55
// Do not expose "echo" provider
6-
replace github.com/coder/coder/codersdk.ProvisionerType string
6+
replace github.com/coder/coder/v2/codersdk.ProvisionerType string
77
// Do not render netip.Addr
88
replace netip.Addr string

Diff for: Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ provisionerd/proto/provisionerd.pb.go: provisionerd/proto/provisionerd.proto
538538
site/src/api/typesGenerated.ts: scripts/apitypings/main.go $(shell find ./codersdk $(FIND_EXCLUSIONS) -type f -name '*.go')
539539
go run scripts/apitypings/main.go > site/src/api/typesGenerated.ts
540540
cd site
541-
pnpm run format:types
541+
pnpm run format:types ./src/api/typesGenerated.ts
542542

543543
site/e2e/provisionerGenerated.ts:
544544
cd site

Diff for: agent/agent.go

+8-8
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ import (
3434
"tailscale.com/types/netlogtype"
3535

3636
"cdr.dev/slog"
37-
"github.com/coder/coder/agent/agentssh"
38-
"github.com/coder/coder/agent/reconnectingpty"
39-
"github.com/coder/coder/buildinfo"
40-
"github.com/coder/coder/coderd/database"
41-
"github.com/coder/coder/coderd/gitauth"
42-
"github.com/coder/coder/codersdk"
43-
"github.com/coder/coder/codersdk/agentsdk"
44-
"github.com/coder/coder/tailnet"
37+
"github.com/coder/coder/v2/agent/agentssh"
38+
"github.com/coder/coder/v2/agent/reconnectingpty"
39+
"github.com/coder/coder/v2/buildinfo"
40+
"github.com/coder/coder/v2/coderd/database"
41+
"github.com/coder/coder/v2/coderd/gitauth"
42+
"github.com/coder/coder/v2/codersdk"
43+
"github.com/coder/coder/v2/codersdk/agentsdk"
44+
"github.com/coder/coder/v2/tailnet"
4545
"github.com/coder/retry"
4646
)
4747

Diff for: agent/agent_test.go

+11-11
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,17 @@ import (
4242

4343
"cdr.dev/slog"
4444
"cdr.dev/slog/sloggers/slogtest"
45-
"github.com/coder/coder/agent"
46-
"github.com/coder/coder/agent/agentssh"
47-
"github.com/coder/coder/agent/agenttest"
48-
"github.com/coder/coder/coderd/httpapi"
49-
"github.com/coder/coder/codersdk"
50-
"github.com/coder/coder/codersdk/agentsdk"
51-
"github.com/coder/coder/pty"
52-
"github.com/coder/coder/pty/ptytest"
53-
"github.com/coder/coder/tailnet"
54-
"github.com/coder/coder/tailnet/tailnettest"
55-
"github.com/coder/coder/testutil"
45+
"github.com/coder/coder/v2/agent"
46+
"github.com/coder/coder/v2/agent/agentssh"
47+
"github.com/coder/coder/v2/agent/agenttest"
48+
"github.com/coder/coder/v2/coderd/httpapi"
49+
"github.com/coder/coder/v2/codersdk"
50+
"github.com/coder/coder/v2/codersdk/agentsdk"
51+
"github.com/coder/coder/v2/pty"
52+
"github.com/coder/coder/v2/pty/ptytest"
53+
"github.com/coder/coder/v2/tailnet"
54+
"github.com/coder/coder/v2/tailnet/tailnettest"
55+
"github.com/coder/coder/v2/testutil"
5656
)
5757

5858
func TestMain(m *testing.M) {

Diff for: agent/agentssh/agentssh.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ import (
2828

2929
"cdr.dev/slog"
3030

31-
"github.com/coder/coder/agent/usershell"
32-
"github.com/coder/coder/codersdk"
33-
"github.com/coder/coder/codersdk/agentsdk"
34-
"github.com/coder/coder/pty"
31+
"github.com/coder/coder/v2/agent/usershell"
32+
"github.com/coder/coder/v2/codersdk"
33+
"github.com/coder/coder/v2/codersdk/agentsdk"
34+
"github.com/coder/coder/v2/pty"
3535
)
3636

3737
const (

Diff for: agent/agentssh/agentssh_internal_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ import (
1515
"github.com/stretchr/testify/assert"
1616
"github.com/stretchr/testify/require"
1717

18-
"github.com/coder/coder/pty"
19-
"github.com/coder/coder/testutil"
18+
"github.com/coder/coder/v2/pty"
19+
"github.com/coder/coder/v2/testutil"
2020

2121
"cdr.dev/slog/sloggers/slogtest"
2222
)

Diff for: agent/agentssh/agentssh_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ import (
2020

2121
"cdr.dev/slog/sloggers/slogtest"
2222

23-
"github.com/coder/coder/agent/agentssh"
24-
"github.com/coder/coder/codersdk/agentsdk"
25-
"github.com/coder/coder/pty/ptytest"
23+
"github.com/coder/coder/v2/agent/agentssh"
24+
"github.com/coder/coder/v2/codersdk/agentsdk"
25+
"github.com/coder/coder/v2/pty/ptytest"
2626
)
2727

2828
func TestMain(m *testing.M) {

Diff for: agent/agentssh/x11_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ import (
1919

2020
"cdr.dev/slog"
2121
"cdr.dev/slog/sloggers/slogtest"
22-
"github.com/coder/coder/agent/agentssh"
23-
"github.com/coder/coder/codersdk/agentsdk"
24-
"github.com/coder/coder/testutil"
22+
"github.com/coder/coder/v2/agent/agentssh"
23+
"github.com/coder/coder/v2/codersdk/agentsdk"
24+
"github.com/coder/coder/v2/testutil"
2525
)
2626

2727
func TestServer_X11(t *testing.T) {

Diff for: agent/agenttest/client.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ import (
1313
"golang.org/x/xerrors"
1414

1515
"cdr.dev/slog"
16-
"github.com/coder/coder/codersdk"
17-
"github.com/coder/coder/codersdk/agentsdk"
18-
"github.com/coder/coder/tailnet"
19-
"github.com/coder/coder/testutil"
16+
"github.com/coder/coder/v2/codersdk"
17+
"github.com/coder/coder/v2/codersdk/agentsdk"
18+
"github.com/coder/coder/v2/tailnet"
19+
"github.com/coder/coder/v2/testutil"
2020
)
2121

2222
func NewClient(t testing.TB,

Diff for: agent/api.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import (
77

88
"github.com/go-chi/chi/v5"
99

10-
"github.com/coder/coder/coderd/httpapi"
11-
"github.com/coder/coder/codersdk"
10+
"github.com/coder/coder/v2/coderd/httpapi"
11+
"github.com/coder/coder/v2/codersdk"
1212
)
1313

1414
func (a *agent) apiHandler() http.Handler {

Diff for: agent/apphealth.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import (
1010
"golang.org/x/xerrors"
1111

1212
"cdr.dev/slog"
13-
"github.com/coder/coder/codersdk"
14-
"github.com/coder/coder/codersdk/agentsdk"
13+
"github.com/coder/coder/v2/codersdk"
14+
"github.com/coder/coder/v2/codersdk/agentsdk"
1515
"github.com/coder/retry"
1616
)
1717

Diff for: agent/apphealth_test.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ import (
1313

1414
"cdr.dev/slog"
1515
"cdr.dev/slog/sloggers/slogtest"
16-
"github.com/coder/coder/agent"
17-
"github.com/coder/coder/coderd/httpapi"
18-
"github.com/coder/coder/codersdk"
19-
"github.com/coder/coder/codersdk/agentsdk"
20-
"github.com/coder/coder/testutil"
16+
"github.com/coder/coder/v2/agent"
17+
"github.com/coder/coder/v2/coderd/httpapi"
18+
"github.com/coder/coder/v2/codersdk"
19+
"github.com/coder/coder/v2/codersdk/agentsdk"
20+
"github.com/coder/coder/v2/testutil"
2121
)
2222

2323
func TestAppHealth_Healthy(t *testing.T) {

Diff for: agent/metrics.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111

1212
"cdr.dev/slog"
1313

14-
"github.com/coder/coder/codersdk/agentsdk"
14+
"github.com/coder/coder/v2/codersdk/agentsdk"
1515
)
1616

1717
type agentMetrics struct {

Diff for: agent/ports_supported.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"github.com/cakturk/go-netstat/netstat"
99
"golang.org/x/xerrors"
1010

11-
"github.com/coder/coder/codersdk"
11+
"github.com/coder/coder/v2/codersdk"
1212
)
1313

1414
func (lp *listeningPortsHandler) getListeningPorts() ([]codersdk.WorkspaceAgentListeningPort, error) {

Diff for: agent/ports_unsupported.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
package agent
44

5-
import "github.com/coder/coder/codersdk"
5+
import "github.com/coder/coder/v2/codersdk"
66

77
func (lp *listeningPortsHandler) getListeningPorts() ([]codersdk.WorkspaceAgentListeningPort, error) {
88
// Can't scan for ports on non-linux or non-windows_amd64 systems at the

Diff for: agent/reaper/reaper_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ import (
1414
"github.com/hashicorp/go-reap"
1515
"github.com/stretchr/testify/require"
1616

17-
"github.com/coder/coder/agent/reaper"
18-
"github.com/coder/coder/testutil"
17+
"github.com/coder/coder/v2/agent/reaper"
18+
"github.com/coder/coder/v2/testutil"
1919
)
2020

2121
// TestReap checks that's the reaper is successfully reaping

Diff for: agent/reconnectingpty/buffered.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414

1515
"cdr.dev/slog"
1616

17-
"github.com/coder/coder/pty"
17+
"github.com/coder/coder/v2/pty"
1818
)
1919

2020
// bufferedReconnectingPTY provides a reconnectable PTY by using a ring buffer to store

Diff for: agent/reconnectingpty/reconnectingpty.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ import (
1515

1616
"cdr.dev/slog"
1717

18-
"github.com/coder/coder/codersdk"
19-
"github.com/coder/coder/pty"
18+
"github.com/coder/coder/v2/codersdk"
19+
"github.com/coder/coder/v2/pty"
2020
)
2121

2222
// attachTimeout is the initial timeout for attaching and will probably be far

Diff for: agent/reconnectingpty/screen.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"golang.org/x/xerrors"
2121

2222
"cdr.dev/slog"
23-
"github.com/coder/coder/pty"
23+
"github.com/coder/coder/v2/pty"
2424
)
2525

2626
// screenReconnectingPTY provides a reconnectable PTY via `screen`.

Diff for: agent/usershell/usershell_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77

88
"github.com/stretchr/testify/require"
99

10-
"github.com/coder/coder/agent/usershell"
10+
"github.com/coder/coder/v2/agent/usershell"
1111
)
1212

1313
//nolint:paralleltest,tparallel // This test sets an environment variable.

Diff for: buildinfo/buildinfo_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"github.com/stretchr/testify/require"
88
"golang.org/x/mod/semver"
99

10-
"github.com/coder/coder/buildinfo"
10+
"github.com/coder/coder/v2/buildinfo"
1111
)
1212

1313
func TestBuildInfo(t *testing.T) {

Diff for: cli/agent.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ import (
2828
"cdr.dev/slog/sloggers/sloghuman"
2929
"cdr.dev/slog/sloggers/slogjson"
3030
"cdr.dev/slog/sloggers/slogstackdriver"
31-
"github.com/coder/coder/agent"
32-
"github.com/coder/coder/agent/reaper"
33-
"github.com/coder/coder/buildinfo"
34-
"github.com/coder/coder/cli/clibase"
35-
"github.com/coder/coder/codersdk"
36-
"github.com/coder/coder/codersdk/agentsdk"
31+
"github.com/coder/coder/v2/agent"
32+
"github.com/coder/coder/v2/agent/reaper"
33+
"github.com/coder/coder/v2/buildinfo"
34+
"github.com/coder/coder/v2/cli/clibase"
35+
"github.com/coder/coder/v2/codersdk"
36+
"github.com/coder/coder/v2/codersdk/agentsdk"
3737
)
3838

3939
func (r *RootCmd) workspaceAgent() *clibase.Cmd {

Diff for: cli/agent_test.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ import (
1313
"github.com/stretchr/testify/assert"
1414
"github.com/stretchr/testify/require"
1515

16-
"github.com/coder/coder/agent"
17-
"github.com/coder/coder/cli/clitest"
18-
"github.com/coder/coder/coderd/coderdtest"
19-
"github.com/coder/coder/codersdk"
20-
"github.com/coder/coder/provisioner/echo"
21-
"github.com/coder/coder/provisionersdk/proto"
22-
"github.com/coder/coder/pty/ptytest"
16+
"github.com/coder/coder/v2/agent"
17+
"github.com/coder/coder/v2/cli/clitest"
18+
"github.com/coder/coder/v2/coderd/coderdtest"
19+
"github.com/coder/coder/v2/codersdk"
20+
"github.com/coder/coder/v2/provisioner/echo"
21+
"github.com/coder/coder/v2/provisionersdk/proto"
22+
"github.com/coder/coder/v2/pty/ptytest"
2323
)
2424

2525
func TestWorkspaceAgent(t *testing.T) {

Diff for: cli/clibase/cmd.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
"golang.org/x/xerrors"
1616
"gopkg.in/yaml.v3"
1717

18-
"github.com/coder/coder/coderd/util/slice"
18+
"github.com/coder/coder/v2/coderd/util/slice"
1919
)
2020

2121
// Cmd describes an executable command.

Diff for: cli/clibase/cmd_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"github.com/stretchr/testify/require"
1212
"golang.org/x/xerrors"
1313

14-
"github.com/coder/coder/cli/clibase"
14+
"github.com/coder/coder/v2/cli/clibase"
1515
)
1616

1717
// ioBufs is the standard input, output, and error for a command.

Diff for: cli/clibase/env_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"reflect"
55
"testing"
66

7-
"github.com/coder/coder/cli/clibase"
7+
"github.com/coder/coder/v2/cli/clibase"
88
)
99

1010
func TestFilterNamePrefix(t *testing.T) {

Diff for: cli/clibase/option_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55

66
"github.com/stretchr/testify/require"
77

8-
"github.com/coder/coder/cli/clibase"
8+
"github.com/coder/coder/v2/cli/clibase"
99
)
1010

1111
func TestOptionSet_ParseFlags(t *testing.T) {

Diff for: cli/clibase/yaml_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"golang.org/x/exp/slices"
99
"gopkg.in/yaml.v3"
1010

11-
"github.com/coder/coder/cli/clibase"
11+
"github.com/coder/coder/v2/cli/clibase"
1212
)
1313

1414
func TestOptionSet_YAML(t *testing.T) {

Diff for: cli/clitest/clitest.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ import (
1919

2020
"cdr.dev/slog"
2121
"cdr.dev/slog/sloggers/slogtest"
22-
"github.com/coder/coder/cli"
23-
"github.com/coder/coder/cli/clibase"
24-
"github.com/coder/coder/cli/config"
25-
"github.com/coder/coder/codersdk"
26-
"github.com/coder/coder/provisioner/echo"
27-
"github.com/coder/coder/testutil"
22+
"github.com/coder/coder/v2/cli"
23+
"github.com/coder/coder/v2/cli/clibase"
24+
"github.com/coder/coder/v2/cli/config"
25+
"github.com/coder/coder/v2/codersdk"
26+
"github.com/coder/coder/v2/provisioner/echo"
27+
"github.com/coder/coder/v2/testutil"
2828
)
2929

3030
// New creates a CLI instance with a configuration pointed to a

Diff for: cli/clitest/clitest_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import (
55

66
"go.uber.org/goleak"
77

8-
"github.com/coder/coder/cli/clitest"
9-
"github.com/coder/coder/coderd/coderdtest"
10-
"github.com/coder/coder/pty/ptytest"
8+
"github.com/coder/coder/v2/cli/clitest"
9+
"github.com/coder/coder/v2/coderd/coderdtest"
10+
"github.com/coder/coder/v2/pty/ptytest"
1111
)
1212

1313
func TestMain(m *testing.M) {

Diff for: cli/clitest/golden.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ import (
1515
"github.com/muesli/termenv"
1616
"github.com/stretchr/testify/require"
1717

18-
"github.com/coder/coder/cli/clibase"
19-
"github.com/coder/coder/cli/config"
20-
"github.com/coder/coder/coderd/coderdtest"
21-
"github.com/coder/coder/coderd/database/dbtestutil"
22-
"github.com/coder/coder/codersdk"
23-
"github.com/coder/coder/testutil"
18+
"github.com/coder/coder/v2/cli/clibase"
19+
"github.com/coder/coder/v2/cli/config"
20+
"github.com/coder/coder/v2/coderd/coderdtest"
21+
"github.com/coder/coder/v2/coderd/database/dbtestutil"
22+
"github.com/coder/coder/v2/codersdk"
23+
"github.com/coder/coder/v2/testutil"
2424
)
2525

2626
// UpdateGoldenFiles indicates golden files should be updated.

0 commit comments

Comments
 (0)