Skip to content

Commit 7d8fc83

Browse files
committed
Merge branch 'main' into asher/monitoring
2 parents bdc2144 + e3a1cd3 commit 7d8fc83

File tree

518 files changed

+19447
-6218
lines changed

Some content is hidden

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

518 files changed

+19447
-6218
lines changed

.editorconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
charset = utf-8
6+
trim_trailing_whitespace = true
7+
insert_final_newline = true
8+
indent_style = tab
9+
10+
[*.{md,json,yaml,tf,tfvars}]
11+
indent_style = space
12+
indent_size = 2
13+
14+
[coderd/database/dump.sql]
15+
indent_style = space
16+
indent_size = 4

.gitattributes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,7 @@ 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
6+
*.tfplan.json linguist-generated=true
7+
*.tfstate.json linguist-generated=true
8+
*.tfstate.dot linguist-generated=true
9+
*.tfplan.dot linguist-generated=true

.github/ISSUE_TEMPLATE/bug-report.md

Lines changed: 0 additions & 37 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/config.yaml

Lines changed: 0 additions & 5 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/doc.md

Lines changed: 0 additions & 12 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/feature.md

Lines changed: 0 additions & 14 deletions
This file was deleted.

.github/codecov.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
codecov:
22
require_ci_to_pass: false
3+
notify:
4+
after_n_builds: 5
35

46
comment: false
57

@@ -19,7 +21,7 @@ coverage:
1921
ignore:
2022
# This is generated code.
2123
- coderd/database/models.go
22-
- coderd/database/query.sql.go
24+
- coderd/database/queries.sql.go
2325
- coderd/database/databasefake
2426
# These are generated or don't require tests.
2527
- cmd
@@ -29,6 +31,6 @@ ignore:
2931
- peerbroker/proto
3032
- provisionerd/proto
3133
- provisionersdk/proto
32-
- scripts/datadog-cireport
34+
- scripts
3335
- site/.storybook
3436
- rules.go

.github/dependabot.yaml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ updates:
66
interval: "weekly"
77
time: "06:00"
88
timezone: "America/Chicago"
9+
labels: []
910
commit-message:
1011
prefix: "chore"
1112
ignore:
@@ -32,9 +33,7 @@ updates:
3233
timezone: "America/Chicago"
3334
commit-message:
3435
prefix: "chore"
35-
labels:
36-
- "dependencies"
37-
- "go"
36+
labels: []
3837

3938
- package-ecosystem: "npm"
4039
directory: "/site/"
@@ -44,9 +43,7 @@ updates:
4443
timezone: "America/Chicago"
4544
commit-message:
4645
prefix: "chore"
47-
labels:
48-
- "dependencies"
49-
- "typescript/js"
46+
labels: []
5047
ignore:
5148
# Ignore major updates to Node.js types, because they need to
5249
# correspond to the Node.js engine version
@@ -62,9 +59,7 @@ updates:
6259
timezone: "America/Chicago"
6360
commit-message:
6461
prefix: "chore"
65-
labels:
66-
- "dependencies"
67-
- "terraform"
62+
labels: []
6863
ignore:
6964
# We likely want to update this ourselves.
7065
- dependency-name: "coder/coder"

.github/workflows/coder.yaml

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,19 @@ jobs:
4444
with:
4545
version: v1.46.0
4646

47+
style-lint-shellcheck:
48+
name: style/lint/shellcheck
49+
timeout-minutes: 5
50+
runs-on: ubuntu-latest
51+
steps:
52+
- uses: actions/checkout@v3
53+
- name: Run ShellCheck
54+
uses: ludeeus/action-shellcheck@1.1.0
55+
env:
56+
SHELLCHECK_OPTS: --external-sources
57+
with:
58+
ignore: node_modules
59+
4760
style-lint-typescript:
4861
name: "style/lint/typescript"
4962
timeout-minutes: 5
@@ -133,7 +146,12 @@ jobs:
133146
- name: Install node_modules
134147
run: ./scripts/yarn_install.sh
135148

136-
- run: "make --output-sync -j -B fmt"
149+
- name: Install shfmt
150+
run: go install mvdan.cc/sh/v3/cmd/shfmt@v3.5.0
151+
152+
- run: |
153+
export PATH=${PATH}:$(go env GOPATH)/bin
154+
make --output-sync -j -B fmt
137155
138156
test-go:
139157
name: "test/go"
@@ -337,21 +355,21 @@ jobs:
337355
path: ${{ steps.go-cache-paths.outputs.go-mod }}
338356
key: ${{ runner.os }}-release-go-mod-${{ hashFiles('**/go.sum') }}
339357

340-
- uses: goreleaser/goreleaser-action@v3
341-
with:
342-
install-only: true
343-
344358
- name: Cache Node
345359
id: cache-node
346360
uses: actions/cache@v3
347361
with:
348362
path: |
349363
**/node_modules
350364
.eslintcache
351-
key: js-${{ runner.os }}-test-${{ hashFiles('**/yarn.lock') }}
365+
key: js-${{ runner.os }}-release-node-${{ hashFiles('**/yarn.lock') }}
352366
restore-keys: |
353367
js-${{ runner.os }}-
354368
369+
- uses: goreleaser/goreleaser-action@v3
370+
with:
371+
install-only: true
372+
355373
- name: Build site
356374
run: make -B site/out/index.html
357375

@@ -361,18 +379,6 @@ jobs:
361379
version: latest
362380
args: release --snapshot --rm-dist --skip-sign
363381

364-
- uses: actions/upload-artifact@v3
365-
with:
366-
name: coder_windows_amd64.zip
367-
path: ./dist/coder_*_windows_amd64.zip
368-
retention-days: 7
369-
370-
- uses: actions/upload-artifact@v3
371-
with:
372-
name: coder_linux_amd64.tar.gz
373-
path: ./dist/coder_*_linux_amd64.tar.gz
374-
retention-days: 7
375-
376382
- name: Install Release
377383
run: |
378384
gcloud config set project coder-dogfood
@@ -384,6 +390,14 @@ jobs:
384390
- name: Start
385391
run: gcloud compute ssh coder -- sudo service coder restart
386392

393+
- uses: actions/upload-artifact@v3
394+
with:
395+
name: coder
396+
path: |
397+
./dist/coder_*_linux_amd64.tar.gz
398+
./dist/coder_*_windows_amd64.zip
399+
retention-days: 7
400+
387401
test-js:
388402
name: "test/js"
389403
runs-on: ubuntu-latest

.goreleaser.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,9 @@ nfpms:
9494
- src: coder.service
9595
dst: /usr/lib/systemd/system/coder.service
9696

97+
# Image templates are empty on snapshots to avoid lengthy builds for development.
9798
dockers:
98-
- image_templates: ["ghcr.io/coder/coder:{{ .Tag }}-amd64"]
99+
- image_templates: ["{{ if not .IsSnapshot }}ghcr.io/coder/coder:{{ .Tag }}-amd64{{ end }}"]
99100
id: coder-linux
100101
dockerfile: Dockerfile
101102
use: buildx
@@ -108,7 +109,7 @@ dockers:
108109
- --label=org.opencontainers.image.version={{ .Version }}
109110
- --label=org.opencontainers.image.revision={{ .FullCommit }}
110111
- --label=org.opencontainers.image.licenses=AGPL-3.0
111-
- image_templates: ["ghcr.io/coder/coder:{{ .Tag }}-arm64"]
112+
- image_templates: ["{{ if not .IsSnapshot }}ghcr.io/coder/coder:{{ .Tag }}-arm64{{ end }}"]
112113
goarch: arm64
113114
dockerfile: Dockerfile
114115
use: buildx
@@ -121,7 +122,7 @@ dockers:
121122
- --label=org.opencontainers.image.version={{ .Tag }}
122123
- --label=org.opencontainers.image.revision={{ .FullCommit }}
123124
- --label=org.opencontainers.image.licenses=AGPL-3.0
124-
- image_templates: ["ghcr.io/coder/coder:{{ .Tag }}-armv7"]
125+
- image_templates: ["{{ if not .IsSnapshot }}ghcr.io/coder/coder:{{ .Tag }}-armv7{{ end }}"]
125126
goarch: arm
126127
goarm: "7"
127128
dockerfile: Dockerfile

.vscode/settings.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{
22
"cSpell.words": [
3+
"apps",
4+
"awsidentity",
5+
"buildinfo",
36
"buildname",
47
"circbuf",
58
"cliflag",
@@ -16,6 +19,7 @@
1619
"Dsts",
1720
"fatih",
1821
"Formik",
22+
"gitsshkey",
1923
"goarch",
2024
"gographviz",
2125
"goleak",
@@ -30,9 +34,11 @@
3034
"incpatch",
3135
"isatty",
3236
"Jobf",
37+
"Keygen",
3338
"kirsle",
3439
"ldflags",
3540
"manifoldco",
41+
"mapstructure",
3642
"mattn",
3743
"mitchellh",
3844
"moby",
@@ -54,24 +60,35 @@
5460
"retrier",
5561
"rpty",
5662
"sdkproto",
63+
"sdktrace",
5764
"Signup",
5865
"sourcemapped",
66+
"Srcs",
5967
"stretchr",
6068
"TCGETS",
6169
"tcpip",
6270
"TCSETS",
6371
"templateversions",
72+
"testdata",
6473
"testid",
6574
"tfexec",
6675
"tfjson",
76+
"tfplan",
6777
"tfstate",
6878
"trimprefix",
79+
"turnconn",
6980
"typegen",
7081
"unconvert",
7182
"Untar",
7283
"VMID",
7384
"weblinks",
7485
"webrtc",
86+
"workspaceagent",
87+
"workspaceapp",
88+
"workspaceapps",
89+
"workspacebuilds",
90+
"workspacename",
91+
"wsconncache",
7592
"xerrors",
7693
"xstate",
7794
"yamux"

Makefile

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,37 @@ fmt/terraform: $(wildcard *.tf)
4141
terraform fmt -recursive
4242
.PHONY: fmt/terraform
4343

44-
fmt: fmt/prettier fmt/terraform
44+
fmt/shfmt: $(shell shfmt -f .)
45+
@echo "--- shfmt"
46+
# Only do diff check in CI, errors on diff.
47+
ifdef CI
48+
shfmt -d $(shell shfmt -f .)
49+
else
50+
shfmt -w $(shell shfmt -f .)
51+
endif
52+
53+
fmt: fmt/prettier fmt/terraform fmt/shfmt
4554
.PHONY: fmt
4655

4756
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
4857

4958
install: build
59+
mkdir -p $(INSTALL_DIR)
5060
@echo "--- Copying from bin to $(INSTALL_DIR)"
5161
cp -r ./dist/coder-$(GOOS)_$(GOOS)_$(GOARCH)*/* $(INSTALL_DIR)
5262
@echo "-- CLI available at $(shell ls $(INSTALL_DIR)/coder*)"
5363
.PHONY: install
5464

55-
lint:
65+
lint: lint/shellcheck lint/go
66+
67+
lint/go:
5668
golangci-lint run
57-
.PHONY: lint
69+
.PHONY: lint/go
70+
71+
# Use shfmt to determine the shell files, takes editorconfig into consideration.
72+
lint/shellcheck: $(shell shfmt -f .)
73+
@echo "--- shellcheck"
74+
shellcheck --external-sources $(shell shfmt -f .)
5875

5976
peerbroker/proto/peerbroker.pb.go: peerbroker/proto/peerbroker.proto
6077
protoc \

0 commit comments

Comments
 (0)