Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 36c50c0

Browse files
committed
Merge branch 'main' into david/easter-egg
2 parents 781fab9 + f5693df commit 36c50c0

File tree

389 files changed

+38455
-4269
lines changed

Some content is hidden

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

389 files changed

+38455
-4269
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
site @coder/frontend
1+
site/ @coder/frontend
22
site/src/xServices @presleyp

.github/workflows/coder.yaml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,12 @@ jobs:
9494
- name: Install Protoc
9595
uses: arduino/setup-protoc@v1
9696
with:
97-
version: "3.19.4"
97+
version: "3.20.0"
9898
- uses: actions/setup-go@v3
9999
with:
100100
go-version: "~1.18"
101101
- run: curl -sSL
102-
https://github.com/kyleconroy/sqlc/releases/download/v1.11.0/sqlc_1.11.0_linux_amd64.tar.gz
102+
https://github.com/kyleconroy/sqlc/releases/download/v1.13.0/sqlc_1.13.0_linux_amd64.tar.gz
103103
| sudo tar -C /usr/bin -xz sqlc
104104

105105
- run: go install google.golang.org/protobuf/cmd/[email protected]
@@ -172,14 +172,14 @@ jobs:
172172
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
173173

174174
- name: Install goreleaser
175-
uses: jaxxstorm/action-install-gh-release@v1.4.0
175+
uses: jaxxstorm/action-install-gh-release@v1.5.0
176176
env:
177177
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
178178
with:
179179
repo: gotestyourself/gotestsum
180180
tag: v1.7.0
181181

182-
- uses: hashicorp/setup-terraform@v1
182+
- uses: hashicorp/setup-terraform@v2
183183
with:
184184
terraform_version: 1.1.2
185185
terraform_wrapper: false
@@ -241,14 +241,14 @@ jobs:
241241
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
242242

243243
- name: Install goreleaser
244-
uses: jaxxstorm/action-install-gh-release@v1.4.0
244+
uses: jaxxstorm/action-install-gh-release@v1.5.0
245245
env:
246246
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
247247
with:
248248
repo: gotestyourself/gotestsum
249249
tag: v1.7.0
250250

251-
- uses: hashicorp/setup-terraform@v1
251+
- uses: hashicorp/setup-terraform@v2
252252
with:
253253
terraform_version: 1.1.2
254254
terraform_wrapper: false
@@ -354,8 +354,14 @@ jobs:
354354
restore-keys: |
355355
js-${{ runner.os }}-
356356
357+
- name: Build site
358+
run: make site/out/index.html
359+
357360
- name: Build Release
358-
run: make release
361+
uses: goreleaser/[email protected]
362+
with:
363+
version: latest
364+
args: release --snapshot --rm-dist --skip-sign
359365

360366
- uses: actions/upload-artifact@v3
361367
with:
@@ -449,7 +455,7 @@ jobs:
449455
with:
450456
go-version: "~1.18"
451457

452-
- uses: hashicorp/setup-terraform@v1
458+
- uses: hashicorp/setup-terraform@v2
453459
with:
454460
terraform_version: 1.1.2
455461
terraform_wrapper: false
@@ -482,7 +488,7 @@ jobs:
482488

483489
- name: Build
484490
run: |
485-
make site/out
491+
make site/out/index.html
486492
487493
- run: yarn playwright:install
488494
working-directory: site

.github/workflows/release.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,11 @@ jobs:
5454
restore-keys: |
5555
js-${{ runner.os }}-
5656
57+
- name: Install make
58+
run: brew install make
59+
5760
- name: Build Site
58-
run: make site/out
61+
run: make site/out/index.html
5962

6063
- name: Run GoReleaser
6164
uses: goreleaser/[email protected]

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,5 @@ site/out/
3535
*.tfplan
3636
*.lock.hcl
3737
.terraform/
38+
39+
.vscode/*.log

.goreleaser.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ builds:
2929
- id: coder-slim
3030
dir: cmd/coder
3131
ldflags:
32-
["-s -w -X github.com/coder/coder/cli/buildinfo.tag={{ .Version }}"]
32+
["-s -w -X github.com/coder/coder/buildinfo.tag={{ .Version }}"]
3333
env: [CGO_ENABLED=0]
3434
goos: [darwin, linux, windows]
3535
goarch: [amd64]
@@ -42,7 +42,7 @@ builds:
4242
dir: cmd/coder
4343
flags: [-tags=embed]
4444
ldflags:
45-
["-s -w -X github.com/coder/coder/cli/buildinfo.tag={{ .Version }}"]
45+
["-s -w -X github.com/coder/coder/buildinfo.tag={{ .Version }}"]
4646
env: [CGO_ENABLED=0]
4747
goos: [linux]
4848
goarch: [amd64, arm64]
@@ -51,7 +51,7 @@ builds:
5151
dir: cmd/coder
5252
flags: [-tags=embed]
5353
ldflags:
54-
["-s -w -X github.com/coder/coder/cli/buildinfo.tag={{ .Version }}"]
54+
["-s -w -X github.com/coder/coder/buildinfo.tag={{ .Version }}"]
5555
env: [CGO_ENABLED=0]
5656
goos: [windows]
5757
goarch: [amd64, arm64]
@@ -60,7 +60,7 @@ builds:
6060
dir: cmd/coder
6161
flags: [-tags=embed]
6262
ldflags:
63-
["-s -w -X github.com/coder/coder/cli/buildinfo.tag={{ .Version }}"]
63+
["-s -w -X github.com/coder/coder/buildinfo.tag={{ .Version }}"]
6464
env: [CGO_ENABLED=0]
6565
goos: [darwin]
6666
goarch: [amd64, arm64]

.vscode/settings.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"cSpell.words": [
3+
"circbuf",
34
"cliflag",
45
"cliui",
56
"coderd",
@@ -16,6 +17,7 @@
1617
"gographviz",
1718
"goleak",
1819
"gossh",
20+
"gsyslog",
1921
"hashicorp",
2022
"hclsyntax",
2123
"httpmw",
@@ -35,6 +37,7 @@
3537
"nolint",
3638
"nosec",
3739
"ntqry",
40+
"OIDC",
3841
"oneof",
3942
"parameterscopeid",
4043
"pqtype",
@@ -45,19 +48,24 @@
4548
"ptty",
4649
"ptytest",
4750
"retrier",
51+
"rpty",
4852
"sdkproto",
53+
"Signup",
4954
"stretchr",
5055
"TCGETS",
5156
"tcpip",
5257
"TCSETS",
5358
"tfexec",
59+
"tfjson",
5460
"tfstate",
5561
"trimprefix",
5662
"unconvert",
5763
"Untar",
5864
"VMID",
65+
"weblinks",
5966
"webrtc",
6067
"xerrors",
68+
"xstate",
6169
"yamux"
6270
],
6371
"emeraldwalk.runonsave": {

Makefile

Lines changed: 23 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,27 @@
1+
.DEFAULT_GOAL := build
2+
13
INSTALL_DIR=$(shell go env GOPATH)/bin
24
GOOS=$(shell go env GOOS)
35
GOARCH=$(shell go env GOARCH)
46

5-
bin:
6-
goreleaser build --snapshot --rm-dist
7-
.PHONY: bin
7+
bin: $(shell find . -not -path './vendor/*' -type f -name '*.go') go.mod go.sum
8+
@echo "== This builds binaries for command-line usage."
9+
@echo "== Use \"make build\" to embed the site."
10+
goreleaser build --snapshot --rm-dist --single-target
811

9-
build: site/out bin
12+
build: dist/artifacts.json
1013
.PHONY: build
1114

1215
# Runs migrations to output a dump of the database.
1316
coderd/database/dump.sql: $(wildcard coderd/database/migrations/*.sql)
1417
go run coderd/database/dump/main.go
15-
.PHONY: coderd/database/dump.sql
1618

1719
# Generates Go code for querying the database.
18-
coderd/database/generate: fmt/sql coderd/database/dump.sql $(wildcard coderd/database/queries/*.sql)
20+
coderd/database/querier.go: coderd/database/dump.sql $(wildcard coderd/database/queries/*.sql)
1921
coderd/database/generate.sh
20-
.PHONY: coderd/database/generate
2122

22-
apitypings/generate: site/src/api/types.ts
23-
go run scripts/apitypings/main.go > site/src/api/types-generated.ts
24-
cd site && yarn run format:types
25-
.PHONY: apitypings/generate
23+
dist/artifacts.json: site/out/index.html $(shell find . -not -path './vendor/*' -type f -name '*.go') go.mod go.sum
24+
goreleaser release --snapshot --rm-dist --skip-sign
2625

2726
fmt/prettier:
2827
@echo "--- prettier"
@@ -34,76 +33,59 @@ else
3433
endif
3534
.PHONY: fmt/prettier
3635

37-
fmt/sql: $(wildcard coderd/database/queries/*.sql)
38-
# TODO: this is slightly slow
39-
for fi in coderd/database/queries/*.sql; do \
40-
npx sql-formatter \
41-
--language postgresql \
42-
--lines-between-queries 2 \
43-
--tab-indent \
44-
$$fi \
45-
--output $$fi; \
46-
done
47-
48-
sed -i 's/@ /@/g' ./coderd/database/queries/*.sql
49-
5036
fmt/terraform: $(wildcard *.tf)
5137
terraform fmt -recursive
38+
.PHONY: fmt/terraform
5239

53-
fmt: fmt/prettier fmt/sql fmt/terraform
40+
fmt: fmt/prettier fmt/terraform
5441
.PHONY: fmt
5542

56-
gen: coderd/database/generate peerbroker/proto provisionersdk/proto provisionerd/proto apitypings/generate
57-
.PHONY: gen
43+
gen: coderd/database/querier.go peerbroker/proto/peerbroker.pb.go provisionersdk/proto/provisioner.pb.go provisionerd/proto/provisionerd.pb.go site/src/api/typesGenerated.ts
5844

59-
install: bin
45+
install: build
6046
@echo "--- Copying from bin to $(INSTALL_DIR)"
61-
cp -r ./dist/coder_$(GOOS)_$(GOARCH)/* $(INSTALL_DIR)
47+
cp -r ./dist/coder-$(GOOS)_$(GOOS)_$(GOARCH)*/* $(INSTALL_DIR)
6248
@echo "-- CLI available at $(shell ls $(INSTALL_DIR)/coder*)"
6349
.PHONY: install
6450

6551
lint:
6652
golangci-lint run
6753
.PHONY: lint
6854

69-
peerbroker/proto: peerbroker/proto/peerbroker.proto
55+
peerbroker/proto/peerbroker.pb.go: peerbroker/proto/peerbroker.proto
7056
protoc \
7157
--go_out=. \
7258
--go_opt=paths=source_relative \
7359
--go-drpc_out=. \
7460
--go-drpc_opt=paths=source_relative \
7561
./peerbroker/proto/peerbroker.proto
76-
.PHONY: peerbroker/proto
7762

78-
provisionerd/proto: provisionerd/proto/provisionerd.proto
63+
provisionerd/proto/provisionerd.pb.go: provisionerd/proto/provisionerd.proto
7964
protoc \
8065
--go_out=. \
8166
--go_opt=paths=source_relative \
8267
--go-drpc_out=. \
8368
--go-drpc_opt=paths=source_relative \
8469
./provisionerd/proto/provisionerd.proto
85-
.PHONY: provisionerd/proto
8670

87-
provisionersdk/proto: provisionersdk/proto/provisioner.proto
71+
provisionersdk/proto/provisioner.pb.go: provisionersdk/proto/provisioner.proto
8872
protoc \
8973
--go_out=. \
9074
--go_opt=paths=source_relative \
9175
--go-drpc_out=. \
9276
--go-drpc_opt=paths=source_relative \
9377
./provisionersdk/proto/provisioner.proto
94-
.PHONY: provisionersdk/proto
9578

96-
release:
97-
goreleaser release --snapshot --rm-dist --skip-sign
98-
.PHONY: release
99-
100-
site/out:
79+
site/out/index.html: $(shell find ./site -not -path './site/node_modules/*' -type f -name '*.tsx') $(shell find ./site -not -path './site/node_modules/*' -type f -name '*.ts') site/package.json
10180
./scripts/yarn_install.sh
10281
cd site && yarn typegen
10382
cd site && yarn build
10483
# Restores GITKEEP files!
10584
git checkout HEAD site/out
106-
.PHONY: site/out
85+
86+
site/src/api/typesGenerated.ts: $(shell find codersdk -type f -name '*.go')
87+
go run scripts/apitypings/main.go > site/src/api/typesGenerated.ts
88+
cd site && yarn run format:types
10789

10890
test:
10991
gotestsum -- -v -short ./...

0 commit comments

Comments
 (0)