From 591523a07882c13e7a68b28d03ca89a15fc63fcf Mon Sep 17 00:00:00 2001 From: Steven Masley Date: Fri, 25 Mar 2022 16:07:45 -0500 Subject: [PATCH] chore: Move httpapi, httpmw, & database into `coderd` (#568) * chore: Move httpmw to /coderd directory httpmw is specific to coderd and should be scoped under coderd * chore: Move httpapi to /coderd directory httpapi is specific to coderd and should be scoped under coderd * chore: Move database to /coderd directory database is specific to coderd and should be scoped under coderd * chore: Update codecov & gitattributes for generated files * chore: Update Makefile --- .gitattributes | 2 +- Makefile | 24 +++++++++---------- cli/cliui/job.go | 2 +- cli/parametercreate.go | 2 +- cli/projectcreate.go | 2 +- cli/projectcreate_test.go | 2 +- cli/projects.go | 2 +- cli/projectupdate.go | 2 +- cli/ssh.go | 2 +- cli/start.go | 4 ++-- cli/start_test.go | 2 +- cli/workspacecreate.go | 2 +- cli/workspacedelete.go | 2 +- cli/workspacestart.go | 2 +- cli/workspacestop.go | 2 +- cmd/cliui/main.go | 2 +- cmd/templater/main.go | 4 ++-- codecov.yml | 10 ++++---- coderd/coderd.go | 6 ++--- coderd/coderdtest/coderdtest.go | 6 ++--- .../database}/databasefake/databasefake.go | 2 +- {database => coderd/database}/db.go | 4 ++-- {database => coderd/database}/dump.sql | 2 +- {database => coderd/database}/dump/main.go | 6 ++--- {database => coderd/database}/migrate.go | 0 {database => coderd/database}/migrate_test.go | 4 ++-- .../database}/migrations/000001_base.down.sql | 0 .../database}/migrations/000001_base.up.sql | 0 .../migrations/000002_projects.down.sql | 0 .../migrations/000002_projects.up.sql | 0 .../migrations/000003_workspaces.down.sql | 0 .../migrations/000003_workspaces.up.sql | 0 .../database}/migrations/000004_jobs.down.sql | 0 .../database}/migrations/000004_jobs.up.sql | 0 .../database}/migrations/create_migration.sh | 0 {database => coderd/database}/models.go | 0 .../database}/postgres/postgres.go | 0 .../database}/postgres/postgres_test.go | 2 +- {database => coderd/database}/pubsub.go | 0 .../database}/pubsub_memory.go | 0 .../database}/pubsub_memory_test.go | 2 +- {database => coderd/database}/pubsub_test.go | 4 ++-- {database => coderd/database}/querier.go | 0 {database => coderd/database}/query.sql | 0 {database => coderd/database}/query.sql.go | 0 {database => coderd/database}/sqlc.yaml | 0 {database => coderd/database}/time.go | 0 coderd/files.go | 6 ++--- {httpapi => coderd/httpapi}/httpapi.go | 0 {httpapi => coderd/httpapi}/httpapi_test.go | 2 +- {httpmw => coderd/httpmw}/apikey.go | 4 ++-- {httpmw => coderd/httpmw}/apikey_test.go | 8 +++---- {httpmw => coderd/httpmw}/httpmw.go | 2 +- .../httpmw}/organizationparam.go | 4 ++-- .../httpmw}/organizationparam_test.go | 6 ++--- {httpmw => coderd/httpmw}/projectparam.go | 4 ++-- .../httpmw}/projectparam_test.go | 6 ++--- .../httpmw}/projectversionparam.go | 4 ++-- .../httpmw}/projectversionparam_test.go | 6 ++--- {httpmw => coderd/httpmw}/userparam.go | 4 ++-- {httpmw => coderd/httpmw}/userparam_test.go | 6 ++--- {httpmw => coderd/httpmw}/workspaceagent.go | 4 ++-- .../httpmw}/workspaceagent_test.go | 6 ++--- .../httpmw}/workspacebuildparam.go | 4 ++-- .../httpmw}/workspacebuildparam_test.go | 6 ++--- {httpmw => coderd/httpmw}/workspaceparam.go | 4 ++-- .../httpmw}/workspaceparam_test.go | 6 ++--- .../httpmw}/workspaceresourceparam.go | 4 ++-- .../httpmw}/workspaceresourceparam_test.go | 6 ++--- coderd/organizations.go | 6 ++--- coderd/organizations_test.go | 2 +- coderd/parameter/compute.go | 2 +- coderd/parameter/compute_test.go | 4 ++-- coderd/parameters.go | 4 ++-- coderd/parameters_test.go | 2 +- coderd/projects.go | 6 ++--- coderd/projectversions.go | 6 ++--- coderd/provisionerdaemons.go | 4 ++-- coderd/provisionerjobs.go | 4 ++-- coderd/provisionerjobs_test.go | 2 +- coderd/users.go | 6 ++--- coderd/users_test.go | 2 +- coderd/workspacebuilds.go | 6 ++--- coderd/workspaceresourceauth.go | 4 ++-- coderd/workspaceresources.go | 6 ++--- coderd/workspaces.go | 6 ++--- coderd/workspaces_test.go | 2 +- codersdk/client.go | 4 ++-- codersdk/organizations.go | 2 +- codersdk/parameters.go | 2 +- codersdk/projects.go | 2 +- codersdk/projectversions.go | 2 +- codersdk/provisionerdaemons.go | 2 +- codersdk/workspacebuilds.go | 2 +- codersdk/workspaceresources.go | 4 ++-- codersdk/workspaces.go | 2 +- peerbroker/proxy.go | 2 +- peerbroker/proxy_test.go | 2 +- 98 files changed, 155 insertions(+), 155 deletions(-) rename {database => coderd/database}/databasefake/databasefake.go (99%) rename {database => coderd/database}/db.go (91%) rename {database => coderd/database}/dump.sql (99%) rename {database => coderd/database}/dump/main.go (88%) rename {database => coderd/database}/migrate.go (100%) rename {database => coderd/database}/migrate_test.go (92%) rename {database => coderd/database}/migrations/000001_base.down.sql (100%) rename {database => coderd/database}/migrations/000001_base.up.sql (100%) rename {database => coderd/database}/migrations/000002_projects.down.sql (100%) rename {database => coderd/database}/migrations/000002_projects.up.sql (100%) rename {database => coderd/database}/migrations/000003_workspaces.down.sql (100%) rename {database => coderd/database}/migrations/000003_workspaces.up.sql (100%) rename {database => coderd/database}/migrations/000004_jobs.down.sql (100%) rename {database => coderd/database}/migrations/000004_jobs.up.sql (100%) rename {database => coderd/database}/migrations/create_migration.sh (100%) rename {database => coderd/database}/models.go (100%) rename {database => coderd/database}/postgres/postgres.go (100%) rename {database => coderd/database}/postgres/postgres_test.go (91%) rename {database => coderd/database}/pubsub.go (100%) rename {database => coderd/database}/pubsub_memory.go (100%) rename {database => coderd/database}/pubsub_memory_test.go (94%) rename {database => coderd/database}/pubsub_test.go (94%) rename {database => coderd/database}/querier.go (100%) rename {database => coderd/database}/query.sql (100%) rename {database => coderd/database}/query.sql.go (100%) rename {database => coderd/database}/sqlc.yaml (100%) rename {database => coderd/database}/time.go (100%) rename {httpapi => coderd/httpapi}/httpapi.go (100%) rename {httpapi => coderd/httpapi}/httpapi_test.go (98%) rename {httpmw => coderd/httpmw}/apikey.go (98%) rename {httpmw => coderd/httpmw}/apikey_test.go (98%) rename {httpmw => coderd/httpmw}/httpmw.go (94%) rename {httpmw => coderd/httpmw}/organizationparam.go (97%) rename {httpmw => coderd/httpmw}/organizationparam_test.go (96%) rename {httpmw => coderd/httpmw}/projectparam.go (94%) rename {httpmw => coderd/httpmw}/projectparam_test.go (96%) rename {httpmw => coderd/httpmw}/projectversionparam.go (95%) rename {httpmw => coderd/httpmw}/projectversionparam_test.go (96%) rename {httpmw => coderd/httpmw}/userparam.go (94%) rename {httpmw => coderd/httpmw}/userparam_test.go (95%) rename {httpmw => coderd/httpmw}/workspaceagent.go (95%) rename {httpmw => coderd/httpmw}/workspaceagent_test.go (91%) rename {httpmw => coderd/httpmw}/workspacebuildparam.go (95%) rename {httpmw => coderd/httpmw}/workspacebuildparam_test.go (96%) rename {httpmw => coderd/httpmw}/workspaceparam.go (95%) rename {httpmw => coderd/httpmw}/workspaceparam_test.go (96%) rename {httpmw => coderd/httpmw}/workspaceresourceparam.go (96%) rename {httpmw => coderd/httpmw}/workspaceresourceparam_test.go (95%) diff --git a/.gitattributes b/.gitattributes index 5e22932239..13cf2256a0 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,5 +1,5 @@ # Generated files -database/dump.sql linguist-generated=true +coderd/database/dump.sql linguist-generated=true peerbroker/proto/*.go linguist-generated=true provisionerd/proto/*.go linguist-generated=true provisionersdk/proto/*.go linguist-generated=true diff --git a/Makefile b/Makefile index 4fb7dd9d3f..1feec75653 100644 --- a/Makefile +++ b/Makefile @@ -10,15 +10,15 @@ build: site/out bin .PHONY: build # Runs migrations to output a dump of the database. -database/dump.sql: $(wildcard database/migrations/*.sql) - go run database/dump/main.go +coderd/database/dump.sql: $(wildcard coderd/database/migrations/*.sql) + go run coderd/database/dump/main.go # Generates Go code for querying the database. -database/generate: fmt/sql database/dump.sql database/query.sql - cd database && sqlc generate && rm db_tmp.go - cd database && gofmt -w -r 'Querier -> querier' *.go - cd database && gofmt -w -r 'Queries -> sqlQuerier' *.go -.PHONY: database/generate +coderd/database/generate: fmt/sql coderd/database/dump.sql coderd/database/query.sql + cd coderd/database && sqlc generate && rm db_tmp.go + cd coderd/database && gofmt -w -r 'Querier -> querier' *.go + cd coderd/database && gofmt -w -r 'Queries -> sqlQuerier' *.go +.PHONY: coderd/database/generate fmt/prettier: @echo "--- prettier" @@ -30,18 +30,18 @@ else endif .PHONY: fmt/prettier -fmt/sql: ./database/query.sql +fmt/sql: ./coderd/database/query.sql npx sql-formatter \ --language postgresql \ --lines-between-queries 2 \ - ./database/query.sql \ - --output ./database/query.sql - sed -i 's/@ /@/g' ./database/query.sql + ./coderd/database/query.sql \ + --output ./coderd/database/query.sql + sed -i 's/@ /@/g' ./coderd/database/query.sql fmt: fmt/prettier fmt/sql .PHONY: fmt -gen: database/generate peerbroker/proto provisionersdk/proto provisionerd/proto +gen: coderd/database/generate peerbroker/proto provisionersdk/proto provisionerd/proto .PHONY: gen install: bin diff --git a/cli/cliui/job.go b/cli/cliui/job.go index ed8d04f1c9..bd7983a5cf 100644 --- a/cli/cliui/job.go +++ b/cli/cliui/job.go @@ -10,8 +10,8 @@ import ( "github.com/charmbracelet/lipgloss" "github.com/spf13/cobra" + "github.com/coder/coder/coderd/database" "github.com/coder/coder/codersdk" - "github.com/coder/coder/database" ) type JobOptions struct { diff --git a/cli/parametercreate.go b/cli/parametercreate.go index f98445aef6..4cd285311f 100644 --- a/cli/parametercreate.go +++ b/cli/parametercreate.go @@ -6,8 +6,8 @@ import ( "github.com/spf13/cobra" "golang.org/x/xerrors" + "github.com/coder/coder/coderd/database" "github.com/coder/coder/codersdk" - "github.com/coder/coder/database" ) func parameterCreate() *cobra.Command { diff --git a/cli/projectcreate.go b/cli/projectcreate.go index 46191cf768..232b8f571f 100644 --- a/cli/projectcreate.go +++ b/cli/projectcreate.go @@ -15,8 +15,8 @@ import ( "golang.org/x/xerrors" "github.com/coder/coder/cli/cliui" + "github.com/coder/coder/coderd/database" "github.com/coder/coder/codersdk" - "github.com/coder/coder/database" "github.com/coder/coder/provisionerd" "github.com/coder/coder/provisionersdk" ) diff --git a/cli/projectcreate_test.go b/cli/projectcreate_test.go index 900d379582..e0639de638 100644 --- a/cli/projectcreate_test.go +++ b/cli/projectcreate_test.go @@ -7,7 +7,7 @@ import ( "github.com/coder/coder/cli/clitest" "github.com/coder/coder/coderd/coderdtest" - "github.com/coder/coder/database" + "github.com/coder/coder/coderd/database" "github.com/coder/coder/provisioner/echo" "github.com/coder/coder/pty/ptytest" ) diff --git a/cli/projects.go b/cli/projects.go index e4e2e94db7..5da3262768 100644 --- a/cli/projects.go +++ b/cli/projects.go @@ -8,8 +8,8 @@ import ( "github.com/spf13/cobra" "github.com/coder/coder/cli/cliui" + "github.com/coder/coder/coderd/database" "github.com/coder/coder/codersdk" - "github.com/coder/coder/database" ) func projects() *cobra.Command { diff --git a/cli/projectupdate.go b/cli/projectupdate.go index 239dd381d4..26bccd9877 100644 --- a/cli/projectupdate.go +++ b/cli/projectupdate.go @@ -9,8 +9,8 @@ import ( "github.com/spf13/cobra" "golang.org/x/xerrors" + "github.com/coder/coder/coderd/database" "github.com/coder/coder/codersdk" - "github.com/coder/coder/database" "github.com/coder/coder/provisionersdk" ) diff --git a/cli/ssh.go b/cli/ssh.go index 358644bac9..ab9fa14847 100644 --- a/cli/ssh.go +++ b/cli/ssh.go @@ -8,8 +8,8 @@ import ( "golang.org/x/term" "golang.org/x/xerrors" + "github.com/coder/coder/coderd/database" "github.com/coder/coder/codersdk" - "github.com/coder/coder/database" ) func workspaceSSH() *cobra.Command { diff --git a/cli/start.go b/cli/start.go index bdae6aa0f9..00e4996dc6 100644 --- a/cli/start.go +++ b/cli/start.go @@ -28,10 +28,10 @@ import ( "github.com/coder/coder/cli/cliui" "github.com/coder/coder/cli/config" "github.com/coder/coder/coderd" + "github.com/coder/coder/coderd/database" + "github.com/coder/coder/coderd/database/databasefake" "github.com/coder/coder/coderd/tunnel" "github.com/coder/coder/codersdk" - "github.com/coder/coder/database" - "github.com/coder/coder/database/databasefake" "github.com/coder/coder/provisioner/terraform" "github.com/coder/coder/provisionerd" "github.com/coder/coder/provisionersdk" diff --git a/cli/start_test.go b/cli/start_test.go index 9c7b5bbaf7..2a35f2ca1e 100644 --- a/cli/start_test.go +++ b/cli/start_test.go @@ -22,8 +22,8 @@ import ( "github.com/coder/coder/cli/clitest" "github.com/coder/coder/coderd/coderdtest" + "github.com/coder/coder/coderd/database/postgres" "github.com/coder/coder/codersdk" - "github.com/coder/coder/database/postgres" ) func TestStart(t *testing.T) { diff --git a/cli/workspacecreate.go b/cli/workspacecreate.go index fac1f35825..93b1997047 100644 --- a/cli/workspacecreate.go +++ b/cli/workspacecreate.go @@ -13,8 +13,8 @@ import ( "golang.org/x/xerrors" "github.com/coder/coder/cli/cliui" + "github.com/coder/coder/coderd/database" "github.com/coder/coder/codersdk" - "github.com/coder/coder/database" ) func workspaceCreate() *cobra.Command { diff --git a/cli/workspacedelete.go b/cli/workspacedelete.go index 63b3e18f74..4dfd59a57b 100644 --- a/cli/workspacedelete.go +++ b/cli/workspacedelete.go @@ -6,8 +6,8 @@ import ( "github.com/spf13/cobra" "github.com/coder/coder/cli/cliui" + "github.com/coder/coder/coderd/database" "github.com/coder/coder/codersdk" - "github.com/coder/coder/database" ) func workspaceDelete() *cobra.Command { diff --git a/cli/workspacestart.go b/cli/workspacestart.go index eeed3d8147..f19ceb2aea 100644 --- a/cli/workspacestart.go +++ b/cli/workspacestart.go @@ -6,8 +6,8 @@ import ( "github.com/spf13/cobra" "github.com/coder/coder/cli/cliui" + "github.com/coder/coder/coderd/database" "github.com/coder/coder/codersdk" - "github.com/coder/coder/database" ) func workspaceStart() *cobra.Command { diff --git a/cli/workspacestop.go b/cli/workspacestop.go index b665bb15b9..4b07b478d7 100644 --- a/cli/workspacestop.go +++ b/cli/workspacestop.go @@ -6,8 +6,8 @@ import ( "github.com/spf13/cobra" "github.com/coder/coder/cli/cliui" + "github.com/coder/coder/coderd/database" "github.com/coder/coder/codersdk" - "github.com/coder/coder/database" ) func workspaceStop() *cobra.Command { diff --git a/cmd/cliui/main.go b/cmd/cliui/main.go index af4e522e36..bd8829cc1b 100644 --- a/cmd/cliui/main.go +++ b/cmd/cliui/main.go @@ -11,8 +11,8 @@ import ( "golang.org/x/xerrors" "github.com/coder/coder/cli/cliui" + "github.com/coder/coder/coderd/database" "github.com/coder/coder/codersdk" - "github.com/coder/coder/database" ) func main() { diff --git a/cmd/templater/main.go b/cmd/templater/main.go index dd587a25c8..aedb9a5d20 100644 --- a/cmd/templater/main.go +++ b/cmd/templater/main.go @@ -19,10 +19,10 @@ import ( "cdr.dev/slog" "cdr.dev/slog/sloggers/sloghuman" "github.com/coder/coder/coderd" + "github.com/coder/coder/coderd/database" + "github.com/coder/coder/coderd/database/databasefake" "github.com/coder/coder/coderd/tunnel" "github.com/coder/coder/codersdk" - "github.com/coder/coder/database" - "github.com/coder/coder/database/databasefake" "github.com/coder/coder/provisioner/terraform" "github.com/coder/coder/provisionerd" "github.com/coder/coder/provisionersdk" diff --git a/codecov.yml b/codecov.yml index dcc1472525..db1a9afa06 100644 --- a/codecov.yml +++ b/codecov.yml @@ -24,14 +24,14 @@ coverage: ignore: # This is generated code. - - database/models.go - - database/query.sql.go - - database/databasefake + - coderd/database/models.go + - coderd/database/query.sql.go + - coderd/database/databasefake # These are generated or don't require tests. - cmd - coderd/tunnel - - database/dump - - database/postgres + - coderd/database/dump + - coderd/database/postgres - peerbroker/proto - provisionerd/proto - provisionersdk/proto diff --git a/coderd/coderd.go b/coderd/coderd.go index 090dc99579..e1137c6dd4 100644 --- a/coderd/coderd.go +++ b/coderd/coderd.go @@ -10,9 +10,9 @@ import ( "google.golang.org/api/idtoken" "cdr.dev/slog" - "github.com/coder/coder/database" - "github.com/coder/coder/httpapi" - "github.com/coder/coder/httpmw" + "github.com/coder/coder/coderd/database" + "github.com/coder/coder/coderd/httpapi" + "github.com/coder/coder/coderd/httpmw" "github.com/coder/coder/site" ) diff --git a/coderd/coderdtest/coderdtest.go b/coderd/coderdtest/coderdtest.go index ccce26571c..72a2af177d 100644 --- a/coderd/coderdtest/coderdtest.go +++ b/coderd/coderdtest/coderdtest.go @@ -31,11 +31,11 @@ import ( "cdr.dev/slog" "cdr.dev/slog/sloggers/slogtest" "github.com/coder/coder/coderd" + "github.com/coder/coder/coderd/database" + "github.com/coder/coder/coderd/database/databasefake" + "github.com/coder/coder/coderd/database/postgres" "github.com/coder/coder/codersdk" "github.com/coder/coder/cryptorand" - "github.com/coder/coder/database" - "github.com/coder/coder/database/databasefake" - "github.com/coder/coder/database/postgres" "github.com/coder/coder/provisioner/echo" "github.com/coder/coder/provisionerd" "github.com/coder/coder/provisionersdk" diff --git a/database/databasefake/databasefake.go b/coderd/database/databasefake/databasefake.go similarity index 99% rename from database/databasefake/databasefake.go rename to coderd/database/databasefake/databasefake.go index a6b955a922..82d1c4a472 100644 --- a/database/databasefake/databasefake.go +++ b/coderd/database/databasefake/databasefake.go @@ -8,7 +8,7 @@ import ( "github.com/google/uuid" - "github.com/coder/coder/database" + "github.com/coder/coder/coderd/database" ) // New returns an in-memory fake of the database. diff --git a/database/db.go b/coderd/database/db.go similarity index 91% rename from database/db.go rename to coderd/database/db.go index a4399ee953..5236b18d65 100644 --- a/database/db.go +++ b/coderd/database/db.go @@ -4,8 +4,8 @@ // // To modify the database schema: // 1. Add a new migration using "create_migration.sh" in database/migrations/ -// 2. Run "make database/generate" in the root to generate models. -// 3. Add/Edit queries in "query.sql" and run "make database/generate" to create Go code. +// 2. Run "make coderd/database/generate" in the root to generate models. +// 3. Add/Edit queries in "query.sql" and run "make coderd/database/generate" to create Go code. package database import ( diff --git a/database/dump.sql b/coderd/database/dump.sql similarity index 99% rename from database/dump.sql rename to coderd/database/dump.sql index b43f00df80..dc3d6a7c6e 100644 --- a/database/dump.sql +++ b/coderd/database/dump.sql @@ -1,4 +1,4 @@ --- Code generated by 'make database/generate'. DO NOT EDIT. +-- Code generated by 'make coderd/database/generate'. DO NOT EDIT. CREATE TYPE log_level AS ENUM ( 'trace', diff --git a/database/dump/main.go b/coderd/database/dump/main.go similarity index 88% rename from database/dump/main.go rename to coderd/database/dump/main.go index a9e3098ccd..c6a8457635 100644 --- a/database/dump/main.go +++ b/coderd/database/dump/main.go @@ -10,8 +10,8 @@ import ( "path/filepath" "runtime" - "github.com/coder/coder/database" - "github.com/coder/coder/database/postgres" + "github.com/coder/coder/coderd/database" + "github.com/coder/coder/coderd/database/postgres" ) func main() { @@ -76,7 +76,7 @@ func main() { } } - dump := fmt.Sprintf("-- Code generated by 'make database/generate'. DO NOT EDIT.\n%s", output.Bytes()) + dump := fmt.Sprintf("-- Code generated by 'make coderd/database/generate'. DO NOT EDIT.\n%s", output.Bytes()) _, mainPath, _, ok := runtime.Caller(0) if !ok { panic("couldn't get caller path") diff --git a/database/migrate.go b/coderd/database/migrate.go similarity index 100% rename from database/migrate.go rename to coderd/database/migrate.go diff --git a/database/migrate_test.go b/coderd/database/migrate_test.go similarity index 92% rename from database/migrate_test.go rename to coderd/database/migrate_test.go index d43b6813f6..8bd9c41f0c 100644 --- a/database/migrate_test.go +++ b/coderd/database/migrate_test.go @@ -9,8 +9,8 @@ import ( "github.com/stretchr/testify/require" "go.uber.org/goleak" - "github.com/coder/coder/database" - "github.com/coder/coder/database/postgres" + "github.com/coder/coder/coderd/database" + "github.com/coder/coder/coderd/database/postgres" ) func TestMain(m *testing.M) { diff --git a/database/migrations/000001_base.down.sql b/coderd/database/migrations/000001_base.down.sql similarity index 100% rename from database/migrations/000001_base.down.sql rename to coderd/database/migrations/000001_base.down.sql diff --git a/database/migrations/000001_base.up.sql b/coderd/database/migrations/000001_base.up.sql similarity index 100% rename from database/migrations/000001_base.up.sql rename to coderd/database/migrations/000001_base.up.sql diff --git a/database/migrations/000002_projects.down.sql b/coderd/database/migrations/000002_projects.down.sql similarity index 100% rename from database/migrations/000002_projects.down.sql rename to coderd/database/migrations/000002_projects.down.sql diff --git a/database/migrations/000002_projects.up.sql b/coderd/database/migrations/000002_projects.up.sql similarity index 100% rename from database/migrations/000002_projects.up.sql rename to coderd/database/migrations/000002_projects.up.sql diff --git a/database/migrations/000003_workspaces.down.sql b/coderd/database/migrations/000003_workspaces.down.sql similarity index 100% rename from database/migrations/000003_workspaces.down.sql rename to coderd/database/migrations/000003_workspaces.down.sql diff --git a/database/migrations/000003_workspaces.up.sql b/coderd/database/migrations/000003_workspaces.up.sql similarity index 100% rename from database/migrations/000003_workspaces.up.sql rename to coderd/database/migrations/000003_workspaces.up.sql diff --git a/database/migrations/000004_jobs.down.sql b/coderd/database/migrations/000004_jobs.down.sql similarity index 100% rename from database/migrations/000004_jobs.down.sql rename to coderd/database/migrations/000004_jobs.down.sql diff --git a/database/migrations/000004_jobs.up.sql b/coderd/database/migrations/000004_jobs.up.sql similarity index 100% rename from database/migrations/000004_jobs.up.sql rename to coderd/database/migrations/000004_jobs.up.sql diff --git a/database/migrations/create_migration.sh b/coderd/database/migrations/create_migration.sh similarity index 100% rename from database/migrations/create_migration.sh rename to coderd/database/migrations/create_migration.sh diff --git a/database/models.go b/coderd/database/models.go similarity index 100% rename from database/models.go rename to coderd/database/models.go diff --git a/database/postgres/postgres.go b/coderd/database/postgres/postgres.go similarity index 100% rename from database/postgres/postgres.go rename to coderd/database/postgres/postgres.go diff --git a/database/postgres/postgres_test.go b/coderd/database/postgres/postgres_test.go similarity index 91% rename from database/postgres/postgres_test.go rename to coderd/database/postgres/postgres_test.go index 30d027559c..8efac0f99a 100644 --- a/database/postgres/postgres_test.go +++ b/coderd/database/postgres/postgres_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/require" "go.uber.org/goleak" - "github.com/coder/coder/database/postgres" + "github.com/coder/coder/coderd/database/postgres" _ "github.com/lib/pq" ) diff --git a/database/pubsub.go b/coderd/database/pubsub.go similarity index 100% rename from database/pubsub.go rename to coderd/database/pubsub.go diff --git a/database/pubsub_memory.go b/coderd/database/pubsub_memory.go similarity index 100% rename from database/pubsub_memory.go rename to coderd/database/pubsub_memory.go diff --git a/database/pubsub_memory_test.go b/coderd/database/pubsub_memory_test.go similarity index 94% rename from database/pubsub_memory_test.go rename to coderd/database/pubsub_memory_test.go index cc69df51bd..e5913aa702 100644 --- a/database/pubsub_memory_test.go +++ b/coderd/database/pubsub_memory_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/coder/coder/database" + "github.com/coder/coder/coderd/database" ) func TestPubsubMemory(t *testing.T) { diff --git a/database/pubsub_test.go b/coderd/database/pubsub_test.go similarity index 94% rename from database/pubsub_test.go rename to coderd/database/pubsub_test.go index 55f3489618..9a4eb72999 100644 --- a/database/pubsub_test.go +++ b/coderd/database/pubsub_test.go @@ -10,8 +10,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/coder/coder/database" - "github.com/coder/coder/database/postgres" + "github.com/coder/coder/coderd/database" + "github.com/coder/coder/coderd/database/postgres" ) func TestPubsub(t *testing.T) { diff --git a/database/querier.go b/coderd/database/querier.go similarity index 100% rename from database/querier.go rename to coderd/database/querier.go diff --git a/database/query.sql b/coderd/database/query.sql similarity index 100% rename from database/query.sql rename to coderd/database/query.sql diff --git a/database/query.sql.go b/coderd/database/query.sql.go similarity index 100% rename from database/query.sql.go rename to coderd/database/query.sql.go diff --git a/database/sqlc.yaml b/coderd/database/sqlc.yaml similarity index 100% rename from database/sqlc.yaml rename to coderd/database/sqlc.yaml diff --git a/database/time.go b/coderd/database/time.go similarity index 100% rename from database/time.go rename to coderd/database/time.go diff --git a/coderd/files.go b/coderd/files.go index ca176322ae..351bc666b7 100644 --- a/coderd/files.go +++ b/coderd/files.go @@ -12,10 +12,10 @@ import ( "github.com/go-chi/chi/v5" "github.com/go-chi/render" + "github.com/coder/coder/coderd/database" + "github.com/coder/coder/coderd/httpapi" + "github.com/coder/coder/coderd/httpmw" "github.com/coder/coder/codersdk" - "github.com/coder/coder/database" - "github.com/coder/coder/httpapi" - "github.com/coder/coder/httpmw" ) func (api *api) postFile(rw http.ResponseWriter, r *http.Request) { diff --git a/httpapi/httpapi.go b/coderd/httpapi/httpapi.go similarity index 100% rename from httpapi/httpapi.go rename to coderd/httpapi/httpapi.go diff --git a/httpapi/httpapi_test.go b/coderd/httpapi/httpapi_test.go similarity index 98% rename from httpapi/httpapi_test.go rename to coderd/httpapi/httpapi_test.go index 46cd85e960..87ce03f51d 100644 --- a/httpapi/httpapi_test.go +++ b/coderd/httpapi/httpapi_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/coder/coder/httpapi" + "github.com/coder/coder/coderd/httpapi" ) func TestWrite(t *testing.T) { diff --git a/httpmw/apikey.go b/coderd/httpmw/apikey.go similarity index 98% rename from httpmw/apikey.go rename to coderd/httpmw/apikey.go index 45a93c2f91..1b18bc56bc 100644 --- a/httpmw/apikey.go +++ b/coderd/httpmw/apikey.go @@ -13,8 +13,8 @@ import ( "golang.org/x/oauth2" - "github.com/coder/coder/database" - "github.com/coder/coder/httpapi" + "github.com/coder/coder/coderd/database" + "github.com/coder/coder/coderd/httpapi" ) // AuthCookie represents the name of the cookie the API key is stored in. diff --git a/httpmw/apikey_test.go b/coderd/httpmw/apikey_test.go similarity index 98% rename from httpmw/apikey_test.go rename to coderd/httpmw/apikey_test.go index 309c3917de..2d4e7c3a6b 100644 --- a/httpmw/apikey_test.go +++ b/coderd/httpmw/apikey_test.go @@ -12,11 +12,11 @@ import ( "github.com/stretchr/testify/require" "golang.org/x/oauth2" + "github.com/coder/coder/coderd/database" + "github.com/coder/coder/coderd/database/databasefake" + "github.com/coder/coder/coderd/httpapi" + "github.com/coder/coder/coderd/httpmw" "github.com/coder/coder/cryptorand" - "github.com/coder/coder/database" - "github.com/coder/coder/database/databasefake" - "github.com/coder/coder/httpapi" - "github.com/coder/coder/httpmw" ) func randomAPIKeyParts() (id string, secret string) { diff --git a/httpmw/httpmw.go b/coderd/httpmw/httpmw.go similarity index 94% rename from httpmw/httpmw.go rename to coderd/httpmw/httpmw.go index 655cfbd716..0c215edab8 100644 --- a/httpmw/httpmw.go +++ b/coderd/httpmw/httpmw.go @@ -7,7 +7,7 @@ import ( "github.com/go-chi/chi/v5" "github.com/google/uuid" - "github.com/coder/coder/httpapi" + "github.com/coder/coder/coderd/httpapi" ) // parseUUID consumes a url parameter and parses it as a UUID. diff --git a/httpmw/organizationparam.go b/coderd/httpmw/organizationparam.go similarity index 97% rename from httpmw/organizationparam.go rename to coderd/httpmw/organizationparam.go index 6937e060a1..b59855f864 100644 --- a/httpmw/organizationparam.go +++ b/coderd/httpmw/organizationparam.go @@ -9,8 +9,8 @@ import ( "github.com/go-chi/chi/v5" - "github.com/coder/coder/database" - "github.com/coder/coder/httpapi" + "github.com/coder/coder/coderd/database" + "github.com/coder/coder/coderd/httpapi" ) type organizationParamContextKey struct{} diff --git a/httpmw/organizationparam_test.go b/coderd/httpmw/organizationparam_test.go similarity index 96% rename from httpmw/organizationparam_test.go rename to coderd/httpmw/organizationparam_test.go index b957950f45..c21ddb4df5 100644 --- a/httpmw/organizationparam_test.go +++ b/coderd/httpmw/organizationparam_test.go @@ -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/databasefake" + "github.com/coder/coder/coderd/httpmw" "github.com/coder/coder/cryptorand" - "github.com/coder/coder/database" - "github.com/coder/coder/database/databasefake" - "github.com/coder/coder/httpmw" ) func TestOrganizationParam(t *testing.T) { diff --git a/httpmw/projectparam.go b/coderd/httpmw/projectparam.go similarity index 94% rename from httpmw/projectparam.go rename to coderd/httpmw/projectparam.go index 15d258b5df..9239dfb996 100644 --- a/httpmw/projectparam.go +++ b/coderd/httpmw/projectparam.go @@ -9,8 +9,8 @@ import ( "github.com/go-chi/chi/v5" - "github.com/coder/coder/database" - "github.com/coder/coder/httpapi" + "github.com/coder/coder/coderd/database" + "github.com/coder/coder/coderd/httpapi" ) type projectParamContextKey struct{} diff --git a/httpmw/projectparam_test.go b/coderd/httpmw/projectparam_test.go similarity index 96% rename from httpmw/projectparam_test.go rename to coderd/httpmw/projectparam_test.go index c8ea119a25..7e84d46211 100644 --- a/httpmw/projectparam_test.go +++ b/coderd/httpmw/projectparam_test.go @@ -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/databasefake" + "github.com/coder/coder/coderd/httpmw" "github.com/coder/coder/cryptorand" - "github.com/coder/coder/database" - "github.com/coder/coder/database/databasefake" - "github.com/coder/coder/httpmw" ) func TestProjectParam(t *testing.T) { diff --git a/httpmw/projectversionparam.go b/coderd/httpmw/projectversionparam.go similarity index 95% rename from httpmw/projectversionparam.go rename to coderd/httpmw/projectversionparam.go index c506a05107..e2c00d37ac 100644 --- a/httpmw/projectversionparam.go +++ b/coderd/httpmw/projectversionparam.go @@ -9,8 +9,8 @@ import ( "github.com/go-chi/chi/v5" - "github.com/coder/coder/database" - "github.com/coder/coder/httpapi" + "github.com/coder/coder/coderd/database" + "github.com/coder/coder/coderd/httpapi" ) type projectVersionParamContextKey struct{} diff --git a/httpmw/projectversionparam_test.go b/coderd/httpmw/projectversionparam_test.go similarity index 96% rename from httpmw/projectversionparam_test.go rename to coderd/httpmw/projectversionparam_test.go index 2e9e47e2e8..bf6c683c6a 100644 --- a/httpmw/projectversionparam_test.go +++ b/coderd/httpmw/projectversionparam_test.go @@ -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/databasefake" + "github.com/coder/coder/coderd/httpmw" "github.com/coder/coder/cryptorand" - "github.com/coder/coder/database" - "github.com/coder/coder/database/databasefake" - "github.com/coder/coder/httpmw" ) func TestProjectVersionParam(t *testing.T) { diff --git a/httpmw/userparam.go b/coderd/httpmw/userparam.go similarity index 94% rename from httpmw/userparam.go rename to coderd/httpmw/userparam.go index 0ce3f67144..22fd223f3e 100644 --- a/httpmw/userparam.go +++ b/coderd/httpmw/userparam.go @@ -7,8 +7,8 @@ import ( "github.com/go-chi/chi/v5" - "github.com/coder/coder/database" - "github.com/coder/coder/httpapi" + "github.com/coder/coder/coderd/database" + "github.com/coder/coder/coderd/httpapi" ) type userParamContextKey struct{} diff --git a/httpmw/userparam_test.go b/coderd/httpmw/userparam_test.go similarity index 95% rename from httpmw/userparam_test.go rename to coderd/httpmw/userparam_test.go index 4a83084d01..99fd0f0407 100644 --- a/httpmw/userparam_test.go +++ b/coderd/httpmw/userparam_test.go @@ -12,9 +12,9 @@ import ( "github.com/go-chi/chi/v5" "github.com/stretchr/testify/require" - "github.com/coder/coder/database" - "github.com/coder/coder/database/databasefake" - "github.com/coder/coder/httpmw" + "github.com/coder/coder/coderd/database" + "github.com/coder/coder/coderd/database/databasefake" + "github.com/coder/coder/coderd/httpmw" ) func TestUserParam(t *testing.T) { diff --git a/httpmw/workspaceagent.go b/coderd/httpmw/workspaceagent.go similarity index 95% rename from httpmw/workspaceagent.go rename to coderd/httpmw/workspaceagent.go index 13fbf556b0..f90d8ff79f 100644 --- a/httpmw/workspaceagent.go +++ b/coderd/httpmw/workspaceagent.go @@ -9,8 +9,8 @@ import ( "github.com/google/uuid" - "github.com/coder/coder/database" - "github.com/coder/coder/httpapi" + "github.com/coder/coder/coderd/database" + "github.com/coder/coder/coderd/httpapi" ) type workspaceAgentContextKey struct{} diff --git a/httpmw/workspaceagent_test.go b/coderd/httpmw/workspaceagent_test.go similarity index 91% rename from httpmw/workspaceagent_test.go rename to coderd/httpmw/workspaceagent_test.go index fc14db017a..650e68436b 100644 --- a/httpmw/workspaceagent_test.go +++ b/coderd/httpmw/workspaceagent_test.go @@ -10,9 +10,9 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/require" - "github.com/coder/coder/database" - "github.com/coder/coder/database/databasefake" - "github.com/coder/coder/httpmw" + "github.com/coder/coder/coderd/database" + "github.com/coder/coder/coderd/database/databasefake" + "github.com/coder/coder/coderd/httpmw" ) func TestWorkspaceAgent(t *testing.T) { diff --git a/httpmw/workspacebuildparam.go b/coderd/httpmw/workspacebuildparam.go similarity index 95% rename from httpmw/workspacebuildparam.go rename to coderd/httpmw/workspacebuildparam.go index 29e88d8f20..62d4a00efd 100644 --- a/httpmw/workspacebuildparam.go +++ b/coderd/httpmw/workspacebuildparam.go @@ -9,8 +9,8 @@ import ( "github.com/go-chi/chi/v5" - "github.com/coder/coder/database" - "github.com/coder/coder/httpapi" + "github.com/coder/coder/coderd/database" + "github.com/coder/coder/coderd/httpapi" ) type workspaceBuildParamContextKey struct{} diff --git a/httpmw/workspacebuildparam_test.go b/coderd/httpmw/workspacebuildparam_test.go similarity index 96% rename from httpmw/workspacebuildparam_test.go rename to coderd/httpmw/workspacebuildparam_test.go index 7ef913770a..d4a7ae1e59 100644 --- a/httpmw/workspacebuildparam_test.go +++ b/coderd/httpmw/workspacebuildparam_test.go @@ -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/databasefake" + "github.com/coder/coder/coderd/httpmw" "github.com/coder/coder/cryptorand" - "github.com/coder/coder/database" - "github.com/coder/coder/database/databasefake" - "github.com/coder/coder/httpmw" ) func TestWorkspaceBuildParam(t *testing.T) { diff --git a/httpmw/workspaceparam.go b/coderd/httpmw/workspaceparam.go similarity index 95% rename from httpmw/workspaceparam.go rename to coderd/httpmw/workspaceparam.go index e37589aa32..3e12dc7a58 100644 --- a/httpmw/workspaceparam.go +++ b/coderd/httpmw/workspaceparam.go @@ -7,8 +7,8 @@ import ( "fmt" "net/http" - "github.com/coder/coder/database" - "github.com/coder/coder/httpapi" + "github.com/coder/coder/coderd/database" + "github.com/coder/coder/coderd/httpapi" ) type workspaceParamContextKey struct{} diff --git a/httpmw/workspaceparam_test.go b/coderd/httpmw/workspaceparam_test.go similarity index 96% rename from httpmw/workspaceparam_test.go rename to coderd/httpmw/workspaceparam_test.go index e68cc80920..3c528ae44e 100644 --- a/httpmw/workspaceparam_test.go +++ b/coderd/httpmw/workspaceparam_test.go @@ -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/databasefake" + "github.com/coder/coder/coderd/httpmw" "github.com/coder/coder/cryptorand" - "github.com/coder/coder/database" - "github.com/coder/coder/database/databasefake" - "github.com/coder/coder/httpmw" ) func TestWorkspaceParam(t *testing.T) { diff --git a/httpmw/workspaceresourceparam.go b/coderd/httpmw/workspaceresourceparam.go similarity index 96% rename from httpmw/workspaceresourceparam.go rename to coderd/httpmw/workspaceresourceparam.go index a02d556866..1ac1d3904a 100644 --- a/httpmw/workspaceresourceparam.go +++ b/coderd/httpmw/workspaceresourceparam.go @@ -9,8 +9,8 @@ import ( "github.com/go-chi/chi/v5" - "github.com/coder/coder/database" - "github.com/coder/coder/httpapi" + "github.com/coder/coder/coderd/database" + "github.com/coder/coder/coderd/httpapi" ) type workspaceResourceParamContextKey struct{} diff --git a/httpmw/workspaceresourceparam_test.go b/coderd/httpmw/workspaceresourceparam_test.go similarity index 95% rename from httpmw/workspaceresourceparam_test.go rename to coderd/httpmw/workspaceresourceparam_test.go index 8ac404f84b..1c0000b434 100644 --- a/httpmw/workspaceresourceparam_test.go +++ b/coderd/httpmw/workspaceresourceparam_test.go @@ -10,9 +10,9 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/require" - "github.com/coder/coder/database" - "github.com/coder/coder/database/databasefake" - "github.com/coder/coder/httpmw" + "github.com/coder/coder/coderd/database" + "github.com/coder/coder/coderd/database/databasefake" + "github.com/coder/coder/coderd/httpmw" ) func TestWorkspaceResourceParam(t *testing.T) { diff --git a/coderd/organizations.go b/coderd/organizations.go index 1bca4d2839..8dde91903b 100644 --- a/coderd/organizations.go +++ b/coderd/organizations.go @@ -12,10 +12,10 @@ import ( "github.com/moby/moby/pkg/namesgenerator" "golang.org/x/xerrors" + "github.com/coder/coder/coderd/database" + "github.com/coder/coder/coderd/httpapi" + "github.com/coder/coder/coderd/httpmw" "github.com/coder/coder/codersdk" - "github.com/coder/coder/database" - "github.com/coder/coder/httpapi" - "github.com/coder/coder/httpmw" ) func (*api) organization(rw http.ResponseWriter, r *http.Request) { diff --git a/coderd/organizations_test.go b/coderd/organizations_test.go index 5633717306..d405e88b3a 100644 --- a/coderd/organizations_test.go +++ b/coderd/organizations_test.go @@ -9,8 +9,8 @@ import ( "github.com/stretchr/testify/require" "github.com/coder/coder/coderd/coderdtest" + "github.com/coder/coder/coderd/database" "github.com/coder/coder/codersdk" - "github.com/coder/coder/database" "github.com/coder/coder/provisioner/echo" ) diff --git a/coderd/parameter/compute.go b/coderd/parameter/compute.go index ef3f624b14..f5960a3585 100644 --- a/coderd/parameter/compute.go +++ b/coderd/parameter/compute.go @@ -8,7 +8,7 @@ import ( "github.com/google/uuid" "golang.org/x/xerrors" - "github.com/coder/coder/database" + "github.com/coder/coder/coderd/database" ) // ComputeScope targets identifiers to pull parameters from. diff --git a/coderd/parameter/compute_test.go b/coderd/parameter/compute_test.go index 660be35997..3ad01d4f5f 100644 --- a/coderd/parameter/compute_test.go +++ b/coderd/parameter/compute_test.go @@ -7,10 +7,10 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/require" + "github.com/coder/coder/coderd/database" + "github.com/coder/coder/coderd/database/databasefake" "github.com/coder/coder/coderd/parameter" "github.com/coder/coder/cryptorand" - "github.com/coder/coder/database" - "github.com/coder/coder/database/databasefake" ) func TestCompute(t *testing.T) { diff --git a/coderd/parameters.go b/coderd/parameters.go index 3330d5db14..e7eb7fb389 100644 --- a/coderd/parameters.go +++ b/coderd/parameters.go @@ -10,9 +10,9 @@ import ( "github.com/go-chi/render" "github.com/google/uuid" + "github.com/coder/coder/coderd/database" + "github.com/coder/coder/coderd/httpapi" "github.com/coder/coder/codersdk" - "github.com/coder/coder/database" - "github.com/coder/coder/httpapi" ) func (api *api) postParameter(rw http.ResponseWriter, r *http.Request) { diff --git a/coderd/parameters_test.go b/coderd/parameters_test.go index 674adec078..2c2f292c0e 100644 --- a/coderd/parameters_test.go +++ b/coderd/parameters_test.go @@ -8,8 +8,8 @@ import ( "github.com/stretchr/testify/require" "github.com/coder/coder/coderd/coderdtest" + "github.com/coder/coder/coderd/database" "github.com/coder/coder/codersdk" - "github.com/coder/coder/database" ) func TestPostParameter(t *testing.T) { diff --git a/coderd/projects.go b/coderd/projects.go index 8884e6bfba..70b3817ea5 100644 --- a/coderd/projects.go +++ b/coderd/projects.go @@ -10,10 +10,10 @@ import ( "github.com/go-chi/render" "github.com/google/uuid" + "github.com/coder/coder/coderd/database" + "github.com/coder/coder/coderd/httpapi" + "github.com/coder/coder/coderd/httpmw" "github.com/coder/coder/codersdk" - "github.com/coder/coder/database" - "github.com/coder/coder/httpapi" - "github.com/coder/coder/httpmw" ) // Returns a single project. diff --git a/coderd/projectversions.go b/coderd/projectversions.go index 8886424975..d1396a0e64 100644 --- a/coderd/projectversions.go +++ b/coderd/projectversions.go @@ -8,11 +8,11 @@ import ( "github.com/go-chi/render" + "github.com/coder/coder/coderd/database" + "github.com/coder/coder/coderd/httpapi" + "github.com/coder/coder/coderd/httpmw" "github.com/coder/coder/coderd/parameter" "github.com/coder/coder/codersdk" - "github.com/coder/coder/database" - "github.com/coder/coder/httpapi" - "github.com/coder/coder/httpmw" ) func (api *api) projectVersion(rw http.ResponseWriter, r *http.Request) { diff --git a/coderd/provisionerdaemons.go b/coderd/provisionerdaemons.go index b34f235d36..ce203c283b 100644 --- a/coderd/provisionerdaemons.go +++ b/coderd/provisionerdaemons.go @@ -23,9 +23,9 @@ import ( "cdr.dev/slog" + "github.com/coder/coder/coderd/database" + "github.com/coder/coder/coderd/httpapi" "github.com/coder/coder/coderd/parameter" - "github.com/coder/coder/database" - "github.com/coder/coder/httpapi" "github.com/coder/coder/provisionerd/proto" "github.com/coder/coder/provisionersdk" sdkproto "github.com/coder/coder/provisionersdk/proto" diff --git a/coderd/provisionerjobs.go b/coderd/provisionerjobs.go index aefd678fe5..7e5682e65b 100644 --- a/coderd/provisionerjobs.go +++ b/coderd/provisionerjobs.go @@ -15,9 +15,9 @@ import ( "cdr.dev/slog" + "github.com/coder/coder/coderd/database" + "github.com/coder/coder/coderd/httpapi" "github.com/coder/coder/codersdk" - "github.com/coder/coder/database" - "github.com/coder/coder/httpapi" ) // Returns provisioner logs based on query parameters. diff --git a/coderd/provisionerjobs_test.go b/coderd/provisionerjobs_test.go index 0265d5097b..c4aef5c755 100644 --- a/coderd/provisionerjobs_test.go +++ b/coderd/provisionerjobs_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/require" "github.com/coder/coder/coderd/coderdtest" - "github.com/coder/coder/database" + "github.com/coder/coder/coderd/database" "github.com/coder/coder/provisioner/echo" "github.com/coder/coder/provisionersdk/proto" ) diff --git a/coderd/users.go b/coderd/users.go index 13060f9998..e5db601ad2 100644 --- a/coderd/users.go +++ b/coderd/users.go @@ -15,12 +15,12 @@ import ( "github.com/moby/moby/pkg/namesgenerator" "golang.org/x/xerrors" + "github.com/coder/coder/coderd/database" + "github.com/coder/coder/coderd/httpapi" + "github.com/coder/coder/coderd/httpmw" "github.com/coder/coder/coderd/userpassword" "github.com/coder/coder/codersdk" "github.com/coder/coder/cryptorand" - "github.com/coder/coder/database" - "github.com/coder/coder/httpapi" - "github.com/coder/coder/httpmw" ) // Returns whether the initial user has been created or not. diff --git a/coderd/users_test.go b/coderd/users_test.go index 841ed7dc5c..116fb1d4a2 100644 --- a/coderd/users_test.go +++ b/coderd/users_test.go @@ -9,8 +9,8 @@ import ( "github.com/stretchr/testify/require" "github.com/coder/coder/coderd/coderdtest" + "github.com/coder/coder/coderd/httpmw" "github.com/coder/coder/codersdk" - "github.com/coder/coder/httpmw" ) func TestFirstUser(t *testing.T) { diff --git a/coderd/workspacebuilds.go b/coderd/workspacebuilds.go index 45bf221e56..489cb1d7a0 100644 --- a/coderd/workspacebuilds.go +++ b/coderd/workspacebuilds.go @@ -7,10 +7,10 @@ import ( "github.com/go-chi/render" + "github.com/coder/coder/coderd/database" + "github.com/coder/coder/coderd/httpapi" + "github.com/coder/coder/coderd/httpmw" "github.com/coder/coder/codersdk" - "github.com/coder/coder/database" - "github.com/coder/coder/httpapi" - "github.com/coder/coder/httpmw" ) func (api *api) workspaceBuild(rw http.ResponseWriter, r *http.Request) { diff --git a/coderd/workspaceresourceauth.go b/coderd/workspaceresourceauth.go index 5165079f14..14a8742f79 100644 --- a/coderd/workspaceresourceauth.go +++ b/coderd/workspaceresourceauth.go @@ -9,9 +9,9 @@ import ( "github.com/go-chi/render" + "github.com/coder/coder/coderd/database" + "github.com/coder/coder/coderd/httpapi" "github.com/coder/coder/codersdk" - "github.com/coder/coder/database" - "github.com/coder/coder/httpapi" "github.com/mitchellh/mapstructure" ) diff --git a/coderd/workspaceresources.go b/coderd/workspaceresources.go index 1a2c7321bb..7126982169 100644 --- a/coderd/workspaceresources.go +++ b/coderd/workspaceresources.go @@ -15,10 +15,10 @@ import ( "cdr.dev/slog" + "github.com/coder/coder/coderd/database" + "github.com/coder/coder/coderd/httpapi" + "github.com/coder/coder/coderd/httpmw" "github.com/coder/coder/codersdk" - "github.com/coder/coder/database" - "github.com/coder/coder/httpapi" - "github.com/coder/coder/httpmw" "github.com/coder/coder/peerbroker" "github.com/coder/coder/peerbroker/proto" "github.com/coder/coder/provisionersdk" diff --git a/coderd/workspaces.go b/coderd/workspaces.go index e97710f6a0..19fd48187c 100644 --- a/coderd/workspaces.go +++ b/coderd/workspaces.go @@ -13,10 +13,10 @@ import ( "github.com/moby/moby/pkg/namesgenerator" "golang.org/x/xerrors" + "github.com/coder/coder/coderd/database" + "github.com/coder/coder/coderd/httpapi" + "github.com/coder/coder/coderd/httpmw" "github.com/coder/coder/codersdk" - "github.com/coder/coder/database" - "github.com/coder/coder/httpapi" - "github.com/coder/coder/httpmw" ) func (api *api) workspace(rw http.ResponseWriter, r *http.Request) { diff --git a/coderd/workspaces_test.go b/coderd/workspaces_test.go index 7bcc003cca..84de75af91 100644 --- a/coderd/workspaces_test.go +++ b/coderd/workspaces_test.go @@ -9,8 +9,8 @@ import ( "github.com/stretchr/testify/require" "github.com/coder/coder/coderd/coderdtest" + "github.com/coder/coder/coderd/database" "github.com/coder/coder/codersdk" - "github.com/coder/coder/database" "github.com/coder/coder/provisioner/echo" "github.com/coder/coder/provisionersdk/proto" ) diff --git a/codersdk/client.go b/codersdk/client.go index 61d9e20512..d98f2ff3c1 100644 --- a/codersdk/client.go +++ b/codersdk/client.go @@ -13,8 +13,8 @@ import ( "golang.org/x/xerrors" - "github.com/coder/coder/httpapi" - "github.com/coder/coder/httpmw" + "github.com/coder/coder/coderd/httpapi" + "github.com/coder/coder/coderd/httpmw" ) // New creates a Coder client for the provided URL. diff --git a/codersdk/organizations.go b/codersdk/organizations.go index 8a55a38d21..c21314937b 100644 --- a/codersdk/organizations.go +++ b/codersdk/organizations.go @@ -9,7 +9,7 @@ import ( "github.com/google/uuid" - "github.com/coder/coder/database" + "github.com/coder/coder/coderd/database" ) // Organization is the JSON representation of a Coder organization. diff --git a/codersdk/parameters.go b/codersdk/parameters.go index 185e2917ae..e2a2992d5c 100644 --- a/codersdk/parameters.go +++ b/codersdk/parameters.go @@ -9,7 +9,7 @@ import ( "github.com/google/uuid" - "github.com/coder/coder/database" + "github.com/coder/coder/coderd/database" ) type ParameterScope string diff --git a/codersdk/projects.go b/codersdk/projects.go index fe28afc155..03d5bc2ee0 100644 --- a/codersdk/projects.go +++ b/codersdk/projects.go @@ -9,7 +9,7 @@ import ( "github.com/google/uuid" - "github.com/coder/coder/database" + "github.com/coder/coder/coderd/database" ) // Project is the JSON representation of a Coder project. diff --git a/codersdk/projectversions.go b/codersdk/projectversions.go index 215a14a835..f5417789b3 100644 --- a/codersdk/projectversions.go +++ b/codersdk/projectversions.go @@ -9,8 +9,8 @@ import ( "github.com/google/uuid" + "github.com/coder/coder/coderd/database" "github.com/coder/coder/coderd/parameter" - "github.com/coder/coder/database" ) // ProjectVersion represents a single version of a project. diff --git a/codersdk/provisionerdaemons.go b/codersdk/provisionerdaemons.go index f8080dcc8a..6530dab33c 100644 --- a/codersdk/provisionerdaemons.go +++ b/codersdk/provisionerdaemons.go @@ -15,7 +15,7 @@ import ( "golang.org/x/xerrors" "nhooyr.io/websocket" - "github.com/coder/coder/database" + "github.com/coder/coder/coderd/database" "github.com/coder/coder/provisionerd/proto" "github.com/coder/coder/provisionersdk" ) diff --git a/codersdk/workspacebuilds.go b/codersdk/workspacebuilds.go index 916ed2e60b..b71e1d52a6 100644 --- a/codersdk/workspacebuilds.go +++ b/codersdk/workspacebuilds.go @@ -9,7 +9,7 @@ import ( "github.com/google/uuid" - "github.com/coder/coder/database" + "github.com/coder/coder/coderd/database" ) // WorkspaceBuild is an at-point representation of a workspace state. diff --git a/codersdk/workspaceresources.go b/codersdk/workspaceresources.go index bfbbda4e34..07bffb9293 100644 --- a/codersdk/workspaceresources.go +++ b/codersdk/workspaceresources.go @@ -16,8 +16,8 @@ import ( "nhooyr.io/websocket" "github.com/coder/coder/agent" - "github.com/coder/coder/database" - "github.com/coder/coder/httpmw" + "github.com/coder/coder/coderd/database" + "github.com/coder/coder/coderd/httpmw" "github.com/coder/coder/peer" "github.com/coder/coder/peerbroker" "github.com/coder/coder/peerbroker/proto" diff --git a/codersdk/workspaces.go b/codersdk/workspaces.go index 0615ba9754..0724b735bb 100644 --- a/codersdk/workspaces.go +++ b/codersdk/workspaces.go @@ -9,7 +9,7 @@ import ( "github.com/google/uuid" - "github.com/coder/coder/database" + "github.com/coder/coder/coderd/database" ) // Workspace is a per-user deployment of a project. It tracks diff --git a/peerbroker/proxy.go b/peerbroker/proxy.go index e732eb295c..ecaf135863 100644 --- a/peerbroker/proxy.go +++ b/peerbroker/proxy.go @@ -17,7 +17,7 @@ import ( "storj.io/drpc/drpcserver" "cdr.dev/slog" - "github.com/coder/coder/database" + "github.com/coder/coder/coderd/database" "github.com/coder/coder/peerbroker/proto" ) diff --git a/peerbroker/proxy_test.go b/peerbroker/proxy_test.go index 8ad5b01ff6..f036305b46 100644 --- a/peerbroker/proxy_test.go +++ b/peerbroker/proxy_test.go @@ -10,7 +10,7 @@ import ( "cdr.dev/slog" "cdr.dev/slog/sloggers/slogtest" - "github.com/coder/coder/database" + "github.com/coder/coder/coderd/database" "github.com/coder/coder/peer" "github.com/coder/coder/peerbroker" "github.com/coder/coder/peerbroker/proto"