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 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Migrate generated files to import /v2
  • Loading branch information
kylecarbs committed Aug 13, 2023
commit d408d175056c67389e00f952f6e78e375742d4ea
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
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
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
6 changes: 3 additions & 3 deletions cli/server_slim.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"io"
"os"

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

func (r *RootCmd) Server(_ func(context.Context, *coderd.Options) (*coderd.API, io.Closer, error)) *clibase.Cmd {
Expand Down
6 changes: 3 additions & 3 deletions coderd/database/db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (
"github.com/lib/pq"
"github.com/stretchr/testify/require"

"github.com/coder/coder/coderd/database"
"github.com/coder/coder/coderd/database/migrations"
"github.com/coder/coder/coderd/database/postgres"
"github.com/coder/coder/v2/coderd/database"
"github.com/coder/coder/v2/coderd/database/migrations"
"github.com/coder/coder/v2/coderd/database/postgres"
)

func TestSerializedRetry(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion coderd/database/dbmock/dbmock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion coderd/database/dbmock/doc.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// package dbmock contains a mocked implementation of the database.Store interface for use in tests
package dbmock

//go:generate mockgen -destination ./dbmock.go -package dbmock github.com/coder/coder/coderd/database Store
//go:generate mockgen -destination ./dbmock.go -package dbmock github.com/coder/coder/v2/coderd/database Store
6 changes: 3 additions & 3 deletions coderd/database/migrations/migrate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ import (
"golang.org/x/exp/slices"
"golang.org/x/sync/errgroup"

"github.com/coder/coder/coderd/database/migrations"
"github.com/coder/coder/coderd/database/postgres"
"github.com/coder/coder/testutil"
"github.com/coder/coder/v2/coderd/database/migrations"
"github.com/coder/coder/v2/coderd/database/postgres"
"github.com/coder/coder/v2/testutil"
)

func TestMain(m *testing.M) {
Expand Down
2 changes: 1 addition & 1 deletion coderd/database/postgres/postgres_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/stretchr/testify/require"
"go.uber.org/goleak"

"github.com/coder/coder/coderd/database/postgres"
"github.com/coder/coder/v2/coderd/database/postgres"
)

func TestMain(m *testing.M) {
Expand Down
6 changes: 3 additions & 3 deletions coderd/database/pubsub/pubsub_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import (
"github.com/stretchr/testify/require"
"golang.org/x/xerrors"

"github.com/coder/coder/coderd/database/postgres"
"github.com/coder/coder/coderd/database/pubsub"
"github.com/coder/coder/testutil"
"github.com/coder/coder/v2/coderd/database/postgres"
"github.com/coder/coder/v2/coderd/database/pubsub"
"github.com/coder/coder/v2/testutil"
)

// nolint:tparallel,paralleltest
Expand Down
8 changes: 4 additions & 4 deletions coderd/database/querier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import (
"github.com/google/uuid"
"github.com/stretchr/testify/require"

"github.com/coder/coder/coderd/database"
"github.com/coder/coder/coderd/database/dbgen"
"github.com/coder/coder/coderd/database/migrations"
"github.com/coder/coder/testutil"
"github.com/coder/coder/v2/coderd/database"
"github.com/coder/coder/v2/coderd/database/dbgen"
"github.com/coder/coder/v2/coderd/database/migrations"
"github.com/coder/coder/v2/testutil"
)

func TestGetDeploymentWorkspaceAgentStats(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion coderd/userpassword/userpassword_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"github.com/stretchr/testify/require"

"github.com/coder/coder/coderd/userpassword"
"github.com/coder/coder/v2/coderd/userpassword"
)

func TestUserPassword(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions docs/admin/audit-logs.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ In the Coder UI you can filter your audit logs using the pre-defined filter or b

The supported filters are:

- `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.
- `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.
- `resource_id` - The ID of the resource.
- `resource_target` - The name of the resource. Can be used instead of `resource_id`.
- `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.
- `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.
- `username` - The username of the user who triggered the action. You can also use `me` as a convenient alias for the logged-in user.
- `email` - The email of the user who triggered the action.
- `date_from` - The inclusive start date with format `YYYY-MM-DD`.
- `date_to` - The inclusive end date with format `YYYY-MM-DD`.
- `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.
- `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.

## Capturing/Exporting Audit Logs

Expand Down
2 changes: 1 addition & 1 deletion docs/admin/automation.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ All actions possible through the Coder dashboard can also be automated as it uti

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

## Quickstart

Expand Down
2 changes: 1 addition & 1 deletion docs/admin/users.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,4 @@ In the Coder UI, you can filter your users using pre-defined filters or by utili
The following filters are supported:

- `status` - Indicates the status of the user. It can be either `active`, `dormant` or `suspended`.
- `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.
- `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.
2 changes: 1 addition & 1 deletion docs/contributing/feature-stages.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ coder server --experiments=feature1,feature2
# Alternatively, use the `CODER_EXPERIMENTS` environment variable.
```

For a list of all experiments, refer to the [codersdk reference](https://pkg.go.dev/github.com/coder/coder/codersdk#Experiment).
For a list of all experiments, refer to the [codersdk reference](https://pkg.go.dev/github.com/coder/coder/v2/codersdk#Experiment).
2 changes: 1 addition & 1 deletion docs/workspaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ The following filters are supported:

- `owner` - Represents the `username` of the owner. You can also use `me` as a convenient alias for the logged-in user.
- `template` - Specifies the name of the template.
- `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).
- `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).

---

Expand Down
2 changes: 1 addition & 1 deletion enterprise/audit/table_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func TestAuditableResources(t *testing.T) {
expectedList := make([]string, 0)
// Now we check we have all the resources in the AuditableResources
for i := 0; i < unionType.Len(); i++ {
// All types come across like 'github.com/coder/coder/coderd/database.<type>'
// All types come across like 'github.com/coder/coder/v2/coderd/database.<type>'
typeName := unionType.Term(i).Type().String()
_, ok := AuditableResources[typeName]
assert.True(t, ok, "missing resource %q from AuditableResources", typeName)
Expand Down
4 changes: 2 additions & 2 deletions enterprise/cli/proxyserver_slim.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"io"
"os"

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

func (r *RootCmd) proxyServer() *clibase.Cmd {
Expand Down
4 changes: 2 additions & 2 deletions enterprise/cli/server_slim.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (

"golang.org/x/xerrors"

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

func (r *RootCmd) server() *clibase.Cmd {
Expand Down
6 changes: 3 additions & 3 deletions provisionersdk/proto/provisioner.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions scripts/apitypings/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -754,15 +754,15 @@ func (g *Generator) typescriptType(ty types.Type) (TypescriptType, error) {

// These are external named types that we handle uniquely.
switch n.String() {
case "github.com/coder/coder/cli/clibase.String":
case "github.com/coder/coder/v2/cli/clibase.String":
return TypescriptType{ValueType: "string"}, nil
case "github.com/coder/coder/cli/clibase.Strings":
case "github.com/coder/coder/v2/cli/clibase.Strings":
return TypescriptType{ValueType: "string[]"}, nil
case "github.com/coder/coder/cli/clibase.Int64":
case "github.com/coder/coder/v2/cli/clibase.Int64":
return TypescriptType{ValueType: "number"}, nil
case "github.com/coder/coder/cli/clibase.Bool":
case "github.com/coder/coder/v2/cli/clibase.Bool":
return TypescriptType{ValueType: "boolean"}, nil
case "github.com/coder/coder/cli/clibase.Duration":
case "github.com/coder/coder/v2/cli/clibase.Duration":
return TypescriptType{ValueType: "number"}, nil
case "net/url.URL":
return TypescriptType{ValueType: "string"}, nil
Expand All @@ -773,15 +773,15 @@ func (g *Generator) typescriptType(ty types.Type) (TypescriptType, error) {
return TypescriptType{ValueType: "number"}, nil
case "database/sql.NullTime":
return TypescriptType{ValueType: "string", Optional: true}, nil
case "github.com/coder/coder/codersdk.NullTime":
case "github.com/coder/coder/v2/codersdk.NullTime":
return TypescriptType{ValueType: "string", Optional: true}, nil
case "github.com/google/uuid.NullUUID":
return TypescriptType{ValueType: "string", Optional: true}, nil
case "github.com/google/uuid.UUID":
return TypescriptType{ValueType: "string"}, nil
case "encoding/json.RawMessage":
return TypescriptType{ValueType: "Record<string, string>"}, nil
case "github.com/coder/coder/cli/clibase.URL":
case "github.com/coder/coder/v2/cli/clibase.URL":
return TypescriptType{ValueType: "string"}, nil
}

Expand Down
Loading