Skip to content

Commit d408d17

Browse files
committed
Migrate generated files to import /v2
1 parent 7c1cd57 commit d408d17

29 files changed

+3565
-3468
lines changed

.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

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) {

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

cli/server_slim.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import (
88
"io"
99
"os"
1010

11-
"github.com/coder/coder/cli/clibase"
12-
"github.com/coder/coder/cli/cliui"
13-
"github.com/coder/coder/coderd"
11+
"github.com/coder/coder/v2/cli/clibase"
12+
"github.com/coder/coder/v2/cli/cliui"
13+
"github.com/coder/coder/v2/coderd"
1414
)
1515

1616
func (r *RootCmd) Server(_ func(context.Context, *coderd.Options) (*coderd.API, io.Closer, error)) *clibase.Cmd {

coderd/database/db_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ import (
1111
"github.com/lib/pq"
1212
"github.com/stretchr/testify/require"
1313

14-
"github.com/coder/coder/coderd/database"
15-
"github.com/coder/coder/coderd/database/migrations"
16-
"github.com/coder/coder/coderd/database/postgres"
14+
"github.com/coder/coder/v2/coderd/database"
15+
"github.com/coder/coder/v2/coderd/database/migrations"
16+
"github.com/coder/coder/v2/coderd/database/postgres"
1717
)
1818

1919
func TestSerializedRetry(t *testing.T) {

coderd/database/dbmock/dbmock.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/dbmock/doc.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
// package dbmock contains a mocked implementation of the database.Store interface for use in tests
22
package dbmock
33

4-
//go:generate mockgen -destination ./dbmock.go -package dbmock github.com/coder/coder/coderd/database Store
4+
//go:generate mockgen -destination ./dbmock.go -package dbmock github.com/coder/coder/v2/coderd/database Store

coderd/database/migrations/migrate_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ import (
2222
"golang.org/x/exp/slices"
2323
"golang.org/x/sync/errgroup"
2424

25-
"github.com/coder/coder/coderd/database/migrations"
26-
"github.com/coder/coder/coderd/database/postgres"
27-
"github.com/coder/coder/testutil"
25+
"github.com/coder/coder/v2/coderd/database/migrations"
26+
"github.com/coder/coder/v2/coderd/database/postgres"
27+
"github.com/coder/coder/v2/testutil"
2828
)
2929

3030
func TestMain(m *testing.M) {

coderd/database/postgres/postgres_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"github.com/stretchr/testify/require"
1111
"go.uber.org/goleak"
1212

13-
"github.com/coder/coder/coderd/database/postgres"
13+
"github.com/coder/coder/v2/coderd/database/postgres"
1414
)
1515

1616
func TestMain(m *testing.M) {

coderd/database/pubsub/pubsub_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ import (
1515
"github.com/stretchr/testify/require"
1616
"golang.org/x/xerrors"
1717

18-
"github.com/coder/coder/coderd/database/postgres"
19-
"github.com/coder/coder/coderd/database/pubsub"
20-
"github.com/coder/coder/testutil"
18+
"github.com/coder/coder/v2/coderd/database/postgres"
19+
"github.com/coder/coder/v2/coderd/database/pubsub"
20+
"github.com/coder/coder/v2/testutil"
2121
)
2222

2323
// nolint:tparallel,paralleltest

coderd/database/querier_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ import (
1313
"github.com/google/uuid"
1414
"github.com/stretchr/testify/require"
1515

16-
"github.com/coder/coder/coderd/database"
17-
"github.com/coder/coder/coderd/database/dbgen"
18-
"github.com/coder/coder/coderd/database/migrations"
19-
"github.com/coder/coder/testutil"
16+
"github.com/coder/coder/v2/coderd/database"
17+
"github.com/coder/coder/v2/coderd/database/dbgen"
18+
"github.com/coder/coder/v2/coderd/database/migrations"
19+
"github.com/coder/coder/v2/testutil"
2020
)
2121

2222
func TestGetDeploymentWorkspaceAgentStats(t *testing.T) {

coderd/userpassword/userpassword_test.go

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

1010
"github.com/stretchr/testify/require"
1111

12-
"github.com/coder/coder/coderd/userpassword"
12+
"github.com/coder/coder/v2/coderd/userpassword"
1313
)
1414

1515
func TestUserPassword(t *testing.T) {

docs/admin/audit-logs.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ In the Coder UI you can filter your audit logs using the pre-defined filter or b
3434

3535
The supported filters are:
3636

37-
- `resource_type` - The type of the resource. It can be a workspace, template, user, etc. You can [find here](https://pkg.go.dev/github.com/coder/coder/codersdk#ResourceType) all the resource types that are supported.
37+
- `resource_type` - The type of the resource. It can be a workspace, template, user, etc. You can [find here](https://pkg.go.dev/github.com/coder/coder/v2/codersdk#ResourceType) all the resource types that are supported.
3838
- `resource_id` - The ID of the resource.
3939
- `resource_target` - The name of the resource. Can be used instead of `resource_id`.
40-
- `action`- The action applied to a resource. You can [find here](https://pkg.go.dev/github.com/coder/coder/codersdk#AuditAction) all the actions that are supported.
40+
- `action`- The action applied to a resource. You can [find here](https://pkg.go.dev/github.com/coder/coder/v2/codersdk#AuditAction) all the actions that are supported.
4141
- `username` - The username of the user who triggered the action. You can also use `me` as a convenient alias for the logged-in user.
4242
- `email` - The email of the user who triggered the action.
4343
- `date_from` - The inclusive start date with format `YYYY-MM-DD`.
4444
- `date_to` - The inclusive end date with format `YYYY-MM-DD`.
45-
- `build_reason` - To be used with `resource_type:workspace_build`, the [initiator](https://pkg.go.dev/github.com/coder/coder/codersdk#BuildReason) behind the build start or stop.
45+
- `build_reason` - To be used with `resource_type:workspace_build`, the [initiator](https://pkg.go.dev/github.com/coder/coder/v2/codersdk#BuildReason) behind the build start or stop.
4646

4747
## Capturing/Exporting Audit Logs
4848

docs/admin/automation.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ All actions possible through the Coder dashboard can also be automated as it uti
44

55
- [CLI](../cli.md)
66
- [REST API](../api/)
7-
- [Coder SDK](https://pkg.go.dev/github.com/coder/coder/codersdk)
7+
- [Coder SDK](https://pkg.go.dev/github.com/coder/coder/v2/codersdk)
88

99
## Quickstart
1010

docs/admin/users.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,4 +162,4 @@ In the Coder UI, you can filter your users using pre-defined filters or by utili
162162
The following filters are supported:
163163

164164
- `status` - Indicates the status of the user. It can be either `active`, `dormant` or `suspended`.
165-
- `role` - Represents the role of the user. You can refer to the [TemplateRole documentation](https://pkg.go.dev/github.com/coder/coder/codersdk#TemplateRole) for a list of supported user roles.
165+
- `role` - Represents the role of the user. You can refer to the [TemplateRole documentation](https://pkg.go.dev/github.com/coder/coder/v2/codersdk#TemplateRole) for a list of supported user roles.

docs/contributing/feature-stages.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ coder server --experiments=feature1,feature2
2222
# Alternatively, use the `CODER_EXPERIMENTS` environment variable.
2323
```
2424

25-
For a list of all experiments, refer to the [codersdk reference](https://pkg.go.dev/github.com/coder/coder/codersdk#Experiment).
25+
For a list of all experiments, refer to the [codersdk reference](https://pkg.go.dev/github.com/coder/coder/v2/codersdk#Experiment).

docs/workspaces.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ The following filters are supported:
108108

109109
- `owner` - Represents the `username` of the owner. You can also use `me` as a convenient alias for the logged-in user.
110110
- `template` - Specifies the name of the template.
111-
- `status` - Indicates the status of the workspace. For a list of supported statuses, please refer to the [WorkspaceStatus documentation](https://pkg.go.dev/github.com/coder/coder/codersdk#WorkspaceStatus).
111+
- `status` - Indicates the status of the workspace. For a list of supported statuses, please refer to the [WorkspaceStatus documentation](https://pkg.go.dev/github.com/coder/coder/v2/codersdk#WorkspaceStatus).
112112

113113
---
114114

enterprise/audit/table_internal_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func TestAuditableResources(t *testing.T) {
4848
expectedList := make([]string, 0)
4949
// Now we check we have all the resources in the AuditableResources
5050
for i := 0; i < unionType.Len(); i++ {
51-
// All types come across like 'github.com/coder/coder/coderd/database.<type>'
51+
// All types come across like 'github.com/coder/coder/v2/coderd/database.<type>'
5252
typeName := unionType.Term(i).Type().String()
5353
_, ok := AuditableResources[typeName]
5454
assert.True(t, ok, "missing resource %q from AuditableResources", typeName)

enterprise/cli/proxyserver_slim.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import (
77
"io"
88
"os"
99

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

1414
func (r *RootCmd) proxyServer() *clibase.Cmd {

enterprise/cli/server_slim.go

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

99
"golang.org/x/xerrors"
1010

11-
"github.com/coder/coder/cli/clibase"
12-
agplcoderd "github.com/coder/coder/coderd"
11+
"github.com/coder/coder/v2/cli/clibase"
12+
agplcoderd "github.com/coder/coder/v2/coderd"
1313
)
1414

1515
func (r *RootCmd) server() *clibase.Cmd {

provisionersdk/proto/provisioner.pb.go

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/apitypings/main.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -754,15 +754,15 @@ func (g *Generator) typescriptType(ty types.Type) (TypescriptType, error) {
754754

755755
// These are external named types that we handle uniquely.
756756
switch n.String() {
757-
case "github.com/coder/coder/cli/clibase.String":
757+
case "github.com/coder/coder/v2/cli/clibase.String":
758758
return TypescriptType{ValueType: "string"}, nil
759-
case "github.com/coder/coder/cli/clibase.Strings":
759+
case "github.com/coder/coder/v2/cli/clibase.Strings":
760760
return TypescriptType{ValueType: "string[]"}, nil
761-
case "github.com/coder/coder/cli/clibase.Int64":
761+
case "github.com/coder/coder/v2/cli/clibase.Int64":
762762
return TypescriptType{ValueType: "number"}, nil
763-
case "github.com/coder/coder/cli/clibase.Bool":
763+
case "github.com/coder/coder/v2/cli/clibase.Bool":
764764
return TypescriptType{ValueType: "boolean"}, nil
765-
case "github.com/coder/coder/cli/clibase.Duration":
765+
case "github.com/coder/coder/v2/cli/clibase.Duration":
766766
return TypescriptType{ValueType: "number"}, nil
767767
case "net/url.URL":
768768
return TypescriptType{ValueType: "string"}, nil
@@ -773,15 +773,15 @@ func (g *Generator) typescriptType(ty types.Type) (TypescriptType, error) {
773773
return TypescriptType{ValueType: "number"}, nil
774774
case "database/sql.NullTime":
775775
return TypescriptType{ValueType: "string", Optional: true}, nil
776-
case "github.com/coder/coder/codersdk.NullTime":
776+
case "github.com/coder/coder/v2/codersdk.NullTime":
777777
return TypescriptType{ValueType: "string", Optional: true}, nil
778778
case "github.com/google/uuid.NullUUID":
779779
return TypescriptType{ValueType: "string", Optional: true}, nil
780780
case "github.com/google/uuid.UUID":
781781
return TypescriptType{ValueType: "string"}, nil
782782
case "encoding/json.RawMessage":
783783
return TypescriptType{ValueType: "Record<string, string>"}, nil
784-
case "github.com/coder/coder/cli/clibase.URL":
784+
case "github.com/coder/coder/v2/cli/clibase.URL":
785785
return TypescriptType{ValueType: "string"}, nil
786786
}
787787

0 commit comments

Comments
 (0)