Skip to content

chore: add /v2 to import module path #9037

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .swaggo
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Replace all NullTime with string
replace github.com/coder/coder/codersdk.NullTime string
replace github.com/coder/coder/v2/codersdk.NullTime string
// Prevent swaggo from rendering enums for time.Duration
replace time.Duration int64
// Do not expose "echo" provider
replace github.com/coder/coder/codersdk.ProvisionerType string
replace github.com/coder/coder/v2/codersdk.ProvisionerType string
// Do not render netip.Addr
replace netip.Addr string
16 changes: 8 additions & 8 deletions agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ import (
"tailscale.com/types/netlogtype"

"cdr.dev/slog"
"github.com/coder/coder/agent/agentssh"
"github.com/coder/coder/buildinfo"
"github.com/coder/coder/coderd/database"
"github.com/coder/coder/coderd/gitauth"
"github.com/coder/coder/codersdk"
"github.com/coder/coder/codersdk/agentsdk"
"github.com/coder/coder/pty"
"github.com/coder/coder/tailnet"
"github.com/coder/coder/v2/agent/agentssh"
"github.com/coder/coder/v2/buildinfo"
"github.com/coder/coder/v2/coderd/database"
"github.com/coder/coder/v2/coderd/gitauth"
"github.com/coder/coder/v2/codersdk"
"github.com/coder/coder/v2/codersdk/agentsdk"
"github.com/coder/coder/v2/pty"
"github.com/coder/coder/v2/tailnet"
"github.com/coder/retry"
)

Expand Down
22 changes: 11 additions & 11 deletions agent/agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,17 @@ import (

"cdr.dev/slog"
"cdr.dev/slog/sloggers/slogtest"
"github.com/coder/coder/agent"
"github.com/coder/coder/agent/agentssh"
"github.com/coder/coder/agent/agenttest"
"github.com/coder/coder/coderd/httpapi"
"github.com/coder/coder/codersdk"
"github.com/coder/coder/codersdk/agentsdk"
"github.com/coder/coder/pty"
"github.com/coder/coder/pty/ptytest"
"github.com/coder/coder/tailnet"
"github.com/coder/coder/tailnet/tailnettest"
"github.com/coder/coder/testutil"
"github.com/coder/coder/v2/agent"
"github.com/coder/coder/v2/agent/agentssh"
"github.com/coder/coder/v2/agent/agenttest"
"github.com/coder/coder/v2/coderd/httpapi"
"github.com/coder/coder/v2/codersdk"
"github.com/coder/coder/v2/codersdk/agentsdk"
"github.com/coder/coder/v2/pty"
"github.com/coder/coder/v2/pty/ptytest"
"github.com/coder/coder/v2/tailnet"
"github.com/coder/coder/v2/tailnet/tailnettest"
"github.com/coder/coder/v2/testutil"
)

func TestMain(m *testing.M) {
Expand Down
8 changes: 4 additions & 4 deletions agent/agentssh/agentssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ import (

"cdr.dev/slog"

"github.com/coder/coder/agent/usershell"
"github.com/coder/coder/codersdk"
"github.com/coder/coder/codersdk/agentsdk"
"github.com/coder/coder/pty"
"github.com/coder/coder/v2/agent/usershell"
"github.com/coder/coder/v2/codersdk"
"github.com/coder/coder/v2/codersdk/agentsdk"
"github.com/coder/coder/v2/pty"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions agent/agentssh/agentssh_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/coder/coder/pty"
"github.com/coder/coder/testutil"
"github.com/coder/coder/v2/pty"
"github.com/coder/coder/v2/testutil"

"cdr.dev/slog/sloggers/slogtest"
)
Expand Down
6 changes: 3 additions & 3 deletions agent/agentssh/agentssh_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import (

"cdr.dev/slog/sloggers/slogtest"

"github.com/coder/coder/agent/agentssh"
"github.com/coder/coder/codersdk/agentsdk"
"github.com/coder/coder/pty/ptytest"
"github.com/coder/coder/v2/agent/agentssh"
"github.com/coder/coder/v2/codersdk/agentsdk"
"github.com/coder/coder/v2/pty/ptytest"
)

func TestMain(m *testing.M) {
Expand Down
6 changes: 3 additions & 3 deletions agent/agentssh/x11_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import (

"cdr.dev/slog"
"cdr.dev/slog/sloggers/slogtest"
"github.com/coder/coder/agent/agentssh"
"github.com/coder/coder/codersdk/agentsdk"
"github.com/coder/coder/testutil"
"github.com/coder/coder/v2/agent/agentssh"
"github.com/coder/coder/v2/codersdk/agentsdk"
"github.com/coder/coder/v2/testutil"
)

func TestServer_X11(t *testing.T) {
Expand Down
8 changes: 4 additions & 4 deletions agent/agenttest/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import (
"golang.org/x/xerrors"

"cdr.dev/slog"
"github.com/coder/coder/codersdk"
"github.com/coder/coder/codersdk/agentsdk"
"github.com/coder/coder/tailnet"
"github.com/coder/coder/testutil"
"github.com/coder/coder/v2/codersdk"
"github.com/coder/coder/v2/codersdk/agentsdk"
"github.com/coder/coder/v2/tailnet"
"github.com/coder/coder/v2/testutil"
)

func NewClient(t testing.TB,
Expand Down
4 changes: 2 additions & 2 deletions agent/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (

"github.com/go-chi/chi"

"github.com/coder/coder/coderd/httpapi"
"github.com/coder/coder/codersdk"
"github.com/coder/coder/v2/coderd/httpapi"
"github.com/coder/coder/v2/codersdk"
)

func (a *agent) apiHandler() http.Handler {
Expand Down
4 changes: 2 additions & 2 deletions agent/apphealth.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"golang.org/x/xerrors"

"cdr.dev/slog"
"github.com/coder/coder/codersdk"
"github.com/coder/coder/codersdk/agentsdk"
"github.com/coder/coder/v2/codersdk"
"github.com/coder/coder/v2/codersdk/agentsdk"
"github.com/coder/retry"
)

Expand Down
10 changes: 5 additions & 5 deletions agent/apphealth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ import (

"cdr.dev/slog"
"cdr.dev/slog/sloggers/slogtest"
"github.com/coder/coder/agent"
"github.com/coder/coder/coderd/httpapi"
"github.com/coder/coder/codersdk"
"github.com/coder/coder/codersdk/agentsdk"
"github.com/coder/coder/testutil"
"github.com/coder/coder/v2/agent"
"github.com/coder/coder/v2/coderd/httpapi"
"github.com/coder/coder/v2/codersdk"
"github.com/coder/coder/v2/codersdk/agentsdk"
"github.com/coder/coder/v2/testutil"
)

func TestAppHealth_Healthy(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion agent/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

"cdr.dev/slog"

"github.com/coder/coder/codersdk/agentsdk"
"github.com/coder/coder/v2/codersdk/agentsdk"
)

type agentMetrics struct {
Expand Down
2 changes: 1 addition & 1 deletion agent/ports_supported.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/cakturk/go-netstat/netstat"
"golang.org/x/xerrors"

"github.com/coder/coder/codersdk"
"github.com/coder/coder/v2/codersdk"
)

func (lp *listeningPortsHandler) getListeningPorts() ([]codersdk.WorkspaceAgentListeningPort, error) {
Expand Down
2 changes: 1 addition & 1 deletion agent/ports_unsupported.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

package agent

import "github.com/coder/coder/codersdk"
import "github.com/coder/coder/v2/codersdk"

func (lp *listeningPortsHandler) getListeningPorts() ([]codersdk.WorkspaceAgentListeningPort, error) {
// Can't scan for ports on non-linux or non-windows_amd64 systems at the
Expand Down
4 changes: 2 additions & 2 deletions agent/reaper/reaper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
"github.com/hashicorp/go-reap"
"github.com/stretchr/testify/require"

"github.com/coder/coder/agent/reaper"
"github.com/coder/coder/testutil"
"github.com/coder/coder/v2/agent/reaper"
"github.com/coder/coder/v2/testutil"
)

// TestReap checks that's the reaper is successfully reaping
Expand Down
2 changes: 1 addition & 1 deletion agent/usershell/usershell_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"github.com/stretchr/testify/require"

"github.com/coder/coder/agent/usershell"
"github.com/coder/coder/v2/agent/usershell"
)

//nolint:paralleltest,tparallel // This test sets an environment variable.
Expand Down
2 changes: 1 addition & 1 deletion buildinfo/buildinfo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/stretchr/testify/require"
"golang.org/x/mod/semver"

"github.com/coder/coder/buildinfo"
"github.com/coder/coder/v2/buildinfo"
)

func TestBuildInfo(t *testing.T) {
Expand Down
12 changes: 6 additions & 6 deletions cli/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ import (
"cdr.dev/slog/sloggers/sloghuman"
"cdr.dev/slog/sloggers/slogjson"
"cdr.dev/slog/sloggers/slogstackdriver"
"github.com/coder/coder/agent"
"github.com/coder/coder/agent/reaper"
"github.com/coder/coder/buildinfo"
"github.com/coder/coder/cli/clibase"
"github.com/coder/coder/codersdk"
"github.com/coder/coder/codersdk/agentsdk"
"github.com/coder/coder/v2/agent"
"github.com/coder/coder/v2/agent/reaper"
"github.com/coder/coder/v2/buildinfo"
"github.com/coder/coder/v2/cli/clibase"
"github.com/coder/coder/v2/codersdk"
"github.com/coder/coder/v2/codersdk/agentsdk"
)

func (r *RootCmd) workspaceAgent() *clibase.Cmd {
Expand Down
14 changes: 7 additions & 7 deletions cli/agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/coder/coder/agent"
"github.com/coder/coder/cli/clitest"
"github.com/coder/coder/coderd/coderdtest"
"github.com/coder/coder/codersdk"
"github.com/coder/coder/provisioner/echo"
"github.com/coder/coder/provisionersdk/proto"
"github.com/coder/coder/pty/ptytest"
"github.com/coder/coder/v2/agent"
"github.com/coder/coder/v2/cli/clitest"
"github.com/coder/coder/v2/coderd/coderdtest"
"github.com/coder/coder/v2/codersdk"
"github.com/coder/coder/v2/provisioner/echo"
"github.com/coder/coder/v2/provisionersdk/proto"
"github.com/coder/coder/v2/pty/ptytest"
)

func TestWorkspaceAgent(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion cli/clibase/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"golang.org/x/xerrors"
"gopkg.in/yaml.v3"

"github.com/coder/coder/coderd/util/slice"
"github.com/coder/coder/v2/coderd/util/slice"
)

// Cmd describes an executable command.
Expand Down
2 changes: 1 addition & 1 deletion cli/clibase/cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/stretchr/testify/require"
"golang.org/x/xerrors"

"github.com/coder/coder/cli/clibase"
"github.com/coder/coder/v2/cli/clibase"
)

// ioBufs is the standard input, output, and error for a command.
Expand Down
2 changes: 1 addition & 1 deletion cli/clibase/env_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"reflect"
"testing"

"github.com/coder/coder/cli/clibase"
"github.com/coder/coder/v2/cli/clibase"
)

func TestFilterNamePrefix(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion cli/clibase/option_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/stretchr/testify/require"

"github.com/coder/coder/cli/clibase"
"github.com/coder/coder/v2/cli/clibase"
)

func TestOptionSet_ParseFlags(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion cli/clibase/yaml_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"golang.org/x/exp/slices"
"gopkg.in/yaml.v3"

"github.com/coder/coder/cli/clibase"
"github.com/coder/coder/v2/cli/clibase"
)

func TestOptionSet_YAML(t *testing.T) {
Expand Down
12 changes: 6 additions & 6 deletions cli/clitest/clitest.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ import (

"cdr.dev/slog"
"cdr.dev/slog/sloggers/slogtest"
"github.com/coder/coder/cli"
"github.com/coder/coder/cli/clibase"
"github.com/coder/coder/cli/config"
"github.com/coder/coder/codersdk"
"github.com/coder/coder/provisioner/echo"
"github.com/coder/coder/testutil"
"github.com/coder/coder/v2/cli"
"github.com/coder/coder/v2/cli/clibase"
"github.com/coder/coder/v2/cli/config"
"github.com/coder/coder/v2/codersdk"
"github.com/coder/coder/v2/provisioner/echo"
"github.com/coder/coder/v2/testutil"
)

// New creates a CLI instance with a configuration pointed to a
Expand Down
6 changes: 3 additions & 3 deletions cli/clitest/clitest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (

"go.uber.org/goleak"

"github.com/coder/coder/cli/clitest"
"github.com/coder/coder/coderd/coderdtest"
"github.com/coder/coder/pty/ptytest"
"github.com/coder/coder/v2/cli/clitest"
"github.com/coder/coder/v2/coderd/coderdtest"
"github.com/coder/coder/v2/pty/ptytest"
)

func TestMain(m *testing.M) {
Expand Down
12 changes: 6 additions & 6 deletions cli/clitest/golden.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ import (
"github.com/muesli/termenv"
"github.com/stretchr/testify/require"

"github.com/coder/coder/cli/clibase"
"github.com/coder/coder/cli/config"
"github.com/coder/coder/coderd/coderdtest"
"github.com/coder/coder/coderd/database/dbtestutil"
"github.com/coder/coder/codersdk"
"github.com/coder/coder/testutil"
"github.com/coder/coder/v2/cli/clibase"
"github.com/coder/coder/v2/cli/config"
"github.com/coder/coder/v2/coderd/coderdtest"
"github.com/coder/coder/v2/coderd/database/dbtestutil"
"github.com/coder/coder/v2/codersdk"
"github.com/coder/coder/v2/testutil"
)

// UpdateGoldenFiles indicates golden files should be updated.
Expand Down
2 changes: 1 addition & 1 deletion cli/clitest/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package clitest
import (
"testing"

"github.com/coder/coder/cli/clibase"
"github.com/coder/coder/v2/cli/clibase"
)

// HandlersOK asserts that all commands have a handler.
Expand Down
2 changes: 1 addition & 1 deletion cli/cliui/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/google/uuid"
"golang.org/x/xerrors"

"github.com/coder/coder/codersdk"
"github.com/coder/coder/v2/codersdk"
)

var errAgentShuttingDown = xerrors.New("agent is shutting down")
Expand Down
12 changes: 6 additions & 6 deletions cli/cliui/agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ import (
"github.com/stretchr/testify/require"
"golang.org/x/xerrors"

"github.com/coder/coder/cli/clibase"
"github.com/coder/coder/cli/clitest"
"github.com/coder/coder/cli/cliui"
"github.com/coder/coder/coderd/util/ptr"
"github.com/coder/coder/codersdk"
"github.com/coder/coder/testutil"
"github.com/coder/coder/v2/cli/clibase"
"github.com/coder/coder/v2/cli/clitest"
"github.com/coder/coder/v2/cli/cliui"
"github.com/coder/coder/v2/coderd/util/ptr"
"github.com/coder/coder/v2/codersdk"
"github.com/coder/coder/v2/testutil"
)

func TestAgent(t *testing.T) {
Expand Down
Loading