Skip to content

Commit 591523a

Browse files
authored
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
1 parent 6be949a commit 591523a

File tree

98 files changed

+155
-155
lines changed

Some content is hidden

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

98 files changed

+155
-155
lines changed

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Generated files
2-
database/dump.sql linguist-generated=true
2+
coderd/database/dump.sql linguist-generated=true
33
peerbroker/proto/*.go linguist-generated=true
44
provisionerd/proto/*.go linguist-generated=true
55
provisionersdk/proto/*.go linguist-generated=true

Makefile

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ build: site/out bin
1010
.PHONY: build
1111

1212
# Runs migrations to output a dump of the database.
13-
database/dump.sql: $(wildcard database/migrations/*.sql)
14-
go run database/dump/main.go
13+
coderd/database/dump.sql: $(wildcard coderd/database/migrations/*.sql)
14+
go run coderd/database/dump/main.go
1515

1616
# Generates Go code for querying the database.
17-
database/generate: fmt/sql database/dump.sql database/query.sql
18-
cd database && sqlc generate && rm db_tmp.go
19-
cd database && gofmt -w -r 'Querier -> querier' *.go
20-
cd database && gofmt -w -r 'Queries -> sqlQuerier' *.go
21-
.PHONY: database/generate
17+
coderd/database/generate: fmt/sql coderd/database/dump.sql coderd/database/query.sql
18+
cd coderd/database && sqlc generate && rm db_tmp.go
19+
cd coderd/database && gofmt -w -r 'Querier -> querier' *.go
20+
cd coderd/database && gofmt -w -r 'Queries -> sqlQuerier' *.go
21+
.PHONY: coderd/database/generate
2222

2323
fmt/prettier:
2424
@echo "--- prettier"
@@ -30,18 +30,18 @@ else
3030
endif
3131
.PHONY: fmt/prettier
3232

33-
fmt/sql: ./database/query.sql
33+
fmt/sql: ./coderd/database/query.sql
3434
npx sql-formatter \
3535
--language postgresql \
3636
--lines-between-queries 2 \
37-
./database/query.sql \
38-
--output ./database/query.sql
39-
sed -i 's/@ /@/g' ./database/query.sql
37+
./coderd/database/query.sql \
38+
--output ./coderd/database/query.sql
39+
sed -i 's/@ /@/g' ./coderd/database/query.sql
4040

4141
fmt: fmt/prettier fmt/sql
4242
.PHONY: fmt
4343

44-
gen: database/generate peerbroker/proto provisionersdk/proto provisionerd/proto
44+
gen: coderd/database/generate peerbroker/proto provisionersdk/proto provisionerd/proto
4545
.PHONY: gen
4646

4747
install: bin

cli/cliui/job.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import (
1010
"github.com/charmbracelet/lipgloss"
1111
"github.com/spf13/cobra"
1212

13+
"github.com/coder/coder/coderd/database"
1314
"github.com/coder/coder/codersdk"
14-
"github.com/coder/coder/database"
1515
)
1616

1717
type JobOptions struct {

cli/parametercreate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import (
66
"github.com/spf13/cobra"
77
"golang.org/x/xerrors"
88

9+
"github.com/coder/coder/coderd/database"
910
"github.com/coder/coder/codersdk"
10-
"github.com/coder/coder/database"
1111
)
1212

1313
func parameterCreate() *cobra.Command {

cli/projectcreate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ import (
1515
"golang.org/x/xerrors"
1616

1717
"github.com/coder/coder/cli/cliui"
18+
"github.com/coder/coder/coderd/database"
1819
"github.com/coder/coder/codersdk"
19-
"github.com/coder/coder/database"
2020
"github.com/coder/coder/provisionerd"
2121
"github.com/coder/coder/provisionersdk"
2222
)

cli/projectcreate_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77

88
"github.com/coder/coder/cli/clitest"
99
"github.com/coder/coder/coderd/coderdtest"
10-
"github.com/coder/coder/database"
10+
"github.com/coder/coder/coderd/database"
1111
"github.com/coder/coder/provisioner/echo"
1212
"github.com/coder/coder/pty/ptytest"
1313
)

cli/projects.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import (
88
"github.com/spf13/cobra"
99

1010
"github.com/coder/coder/cli/cliui"
11+
"github.com/coder/coder/coderd/database"
1112
"github.com/coder/coder/codersdk"
12-
"github.com/coder/coder/database"
1313
)
1414

1515
func projects() *cobra.Command {

cli/projectupdate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import (
99
"github.com/spf13/cobra"
1010
"golang.org/x/xerrors"
1111

12+
"github.com/coder/coder/coderd/database"
1213
"github.com/coder/coder/codersdk"
13-
"github.com/coder/coder/database"
1414
"github.com/coder/coder/provisionersdk"
1515
)
1616

cli/ssh.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import (
88
"golang.org/x/term"
99
"golang.org/x/xerrors"
1010

11+
"github.com/coder/coder/coderd/database"
1112
"github.com/coder/coder/codersdk"
12-
"github.com/coder/coder/database"
1313
)
1414

1515
func workspaceSSH() *cobra.Command {

cli/start.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ import (
2828
"github.com/coder/coder/cli/cliui"
2929
"github.com/coder/coder/cli/config"
3030
"github.com/coder/coder/coderd"
31+
"github.com/coder/coder/coderd/database"
32+
"github.com/coder/coder/coderd/database/databasefake"
3133
"github.com/coder/coder/coderd/tunnel"
3234
"github.com/coder/coder/codersdk"
33-
"github.com/coder/coder/database"
34-
"github.com/coder/coder/database/databasefake"
3535
"github.com/coder/coder/provisioner/terraform"
3636
"github.com/coder/coder/provisionerd"
3737
"github.com/coder/coder/provisionersdk"

0 commit comments

Comments
 (0)