Skip to content

Commit 09dae97

Browse files
committed
Merge branch 'main' into management-settings
2 parents aadff9a + 5a0afd8 commit 09dae97

File tree

193 files changed

+6600
-1325
lines changed

Some content is hidden

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

193 files changed

+6600
-1325
lines changed

.github/actions/setup-go/action.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ description: |
44
inputs:
55
version:
66
description: "The Go version to use."
7-
default: "1.22.3"
7+
default: "1.22.4"
88
runs:
99
using: "composite"
1010
steps:
1111
- name: Setup Go
12-
uses: buildjet/setup-go@v5
12+
uses: actions/setup-go@v5
1313
with:
1414
go-version: ${{ inputs.version }}
1515

.github/actions/setup-node/action.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ runs:
1515
with:
1616
version: 8
1717
- name: Setup Node
18-
uses: buildjet/setup-node@v4.0.1
18+
uses: actions/setup-node@v4.0.1
1919
with:
2020
node-version: 18.19.0
2121
# See https://github.com/actions/setup-node#caching-global-packages-data

.github/workflows/ci.yaml

+67-23
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ jobs:
120120
update-flake:
121121
needs: changes
122122
if: needs.changes.outputs.gomod == 'true'
123-
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
123+
runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }}
124124
steps:
125125
- name: Checkout
126126
uses: actions/checkout@v4
@@ -139,7 +139,7 @@ jobs:
139139
lint:
140140
needs: changes
141141
if: needs.changes.outputs.offlinedocs-only == 'false' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main'
142-
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
142+
runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }}
143143
steps:
144144
- name: Checkout
145145
uses: actions/checkout@v4
@@ -160,7 +160,7 @@ jobs:
160160
echo "LINT_CACHE_DIR=$dir" >> $GITHUB_ENV
161161
162162
- name: golangci-lint cache
163-
uses: buildjet/cache@v4
163+
uses: actions/cache@v4
164164
with:
165165
path: |
166166
${{ env.LINT_CACHE_DIR }}
@@ -170,7 +170,7 @@ jobs:
170170
171171
# Check for any typos
172172
- name: Check for typos
173-
uses: crate-ci/typos@v1.22.7
173+
uses: crate-ci/typos@v1.22.9
174174
with:
175175
config: .github/workflows/typos.toml
176176

@@ -191,9 +191,15 @@ jobs:
191191
run: |
192192
make --output-sync=line -j lint
193193
194+
- name: Check workflow files
195+
run: |
196+
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) 1.6.22
197+
./actionlint -color -shellcheck= -ignore "set-output"
198+
shell: bash
199+
194200
gen:
195201
timeout-minutes: 8
196-
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
202+
runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }}
197203
needs: changes
198204
if: needs.changes.outputs.docs-only == 'false' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main'
199205
steps:
@@ -243,7 +249,7 @@ jobs:
243249
fmt:
244250
needs: changes
245251
if: needs.changes.outputs.offlinedocs-only == 'false' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main'
246-
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
252+
runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }}
247253
timeout-minutes: 7
248254
steps:
249255
- name: Checkout
@@ -254,12 +260,9 @@ jobs:
254260
- name: Setup Node
255261
uses: ./.github/actions/setup-node
256262

263+
# Use default Go version
257264
- name: Setup Go
258-
uses: buildjet/setup-go@v5
259-
with:
260-
# This doesn't need caching. It's super fast anyways!
261-
cache: false
262-
go-version: 1.21.9
265+
uses: ./.github/actions/setup-go
263266

264267
- name: Install shfmt
265268
run: go install mvdan.cc/sh/v3/cmd/shfmt@v3.7.0
@@ -273,7 +276,7 @@ jobs:
273276
run: ./scripts/check_unstaged.sh
274277

275278
test-go:
276-
runs-on: ${{ matrix.os == 'ubuntu-latest' && github.repository_owner == 'coder' && 'buildjet-4vcpu-ubuntu-2204' || matrix.os == 'macos-latest' && github.repository_owner == 'coder' && 'macos-latest-xlarge' || matrix.os == 'windows-2022' && github.repository_owner == 'coder' && 'windows-latest-16-cores' || matrix.os }}
279+
runs-on: ${{ matrix.os == 'ubuntu-latest' && github.repository_owner == 'coder' && 'depot-ubuntu-22.04-4' || matrix.os == 'macos-latest' && github.repository_owner == 'coder' && 'macos-latest-xlarge' || matrix.os == 'windows-2022' && github.repository_owner == 'coder' && 'windows-latest-16-cores' || matrix.os }}
277280
needs: changes
278281
if: needs.changes.outputs.go == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main'
279282
timeout-minutes: 20
@@ -329,7 +332,7 @@ jobs:
329332
api-key: ${{ secrets.DATADOG_API_KEY }}
330333

331334
test-go-pg:
332-
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
335+
runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }}
333336
needs:
334337
- changes
335338
if: needs.changes.outputs.go == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main'
@@ -351,8 +354,50 @@ jobs:
351354
uses: ./.github/actions/setup-tf
352355

353356
- name: Test with PostgreSQL Database
357+
env:
358+
POSTGRES_VERSION: "13"
359+
TS_DEBUG_DISCO: "true"
360+
run: |
361+
make test-postgres
362+
363+
- name: Upload test stats to Datadog
364+
timeout-minutes: 1
365+
continue-on-error: true
366+
uses: ./.github/actions/upload-datadog
367+
if: success() || failure()
368+
with:
369+
api-key: ${{ secrets.DATADOG_API_KEY }}
370+
371+
# NOTE: this could instead be defined as a matrix strategy, but we want to
372+
# only block merging if tests on postgres 13 fail. Using a matrix strategy
373+
# here makes the check in the above `required` job rather complicated.
374+
test-go-pg-16:
375+
runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }}
376+
needs:
377+
- changes
378+
if: needs.changes.outputs.go == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main'
379+
# This timeout must be greater than the timeout set by `go test` in
380+
# `make test-postgres` to ensure we receive a trace of running
381+
# goroutines. Setting this to the timeout +5m should work quite well
382+
# even if some of the preceding steps are slow.
383+
timeout-minutes: 25
384+
steps:
385+
- name: Checkout
386+
uses: actions/checkout@v4
387+
with:
388+
fetch-depth: 1
389+
390+
- name: Setup Go
391+
uses: ./.github/actions/setup-go
392+
393+
- name: Setup Terraform
394+
uses: ./.github/actions/setup-tf
395+
396+
- name: Test with PostgreSQL Database
397+
env:
398+
POSTGRES_VERSION: "16"
399+
TS_DEBUG_DISCO: "true"
354400
run: |
355-
export TS_DEBUG_DISCO=true
356401
make test-postgres
357402
358403
- name: Upload test stats to Datadog
@@ -364,7 +409,7 @@ jobs:
364409
api-key: ${{ secrets.DATADOG_API_KEY }}
365410

366411
test-go-race:
367-
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
412+
runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }}
368413
needs: changes
369414
if: needs.changes.outputs.go == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main'
370415
timeout-minutes: 25
@@ -399,7 +444,7 @@ jobs:
399444
# These tests are skipped in the main go test jobs because they require root
400445
# and mess with networking.
401446
test-go-tailnet-integration:
402-
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
447+
runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }}
403448
needs: changes
404449
# Unnecessary to run on main for now
405450
if: needs.changes.outputs.tailnet-integration == 'true' || needs.changes.outputs.ci == 'true'
@@ -421,7 +466,7 @@ jobs:
421466
run: make test-tailnet-integration
422467

423468
test-js:
424-
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
469+
runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }}
425470
needs: changes
426471
if: needs.changes.outputs.ts == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main'
427472
timeout-minutes: 20
@@ -438,7 +483,7 @@ jobs:
438483
working-directory: site
439484

440485
test-e2e:
441-
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-16vcpu-ubuntu-2204' || 'ubuntu-latest' }}
486+
runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-16' || 'ubuntu-latest' }}
442487
needs: changes
443488
if: needs.changes.outputs.go == 'true' || needs.changes.outputs.ts == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main'
444489
timeout-minutes: 20
@@ -582,7 +627,7 @@ jobs:
582627
offlinedocs:
583628
name: offlinedocs
584629
needs: changes
585-
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
630+
runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }}
586631
if: needs.changes.outputs.offlinedocs == 'true' || needs.changes.outputs.ci == 'true' || needs.changes.outputs.docs == 'true'
587632

588633
steps:
@@ -680,11 +725,10 @@ jobs:
680725
681726
build:
682727
# This builds and publishes ghcr.io/coder/coder-preview:main for each commit
683-
# to main branch. We are only building this for amd64 platform. (>95% pulls
684-
# are for amd64)
728+
# to main branch.
685729
needs: changes
686730
if: github.ref == 'refs/heads/main' && needs.changes.outputs.docs-only == 'false' && !github.event.pull_request.head.repo.fork
687-
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
731+
runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }}
688732
env:
689733
DOCKER_CLI_EXPERIMENTAL: "enabled"
690734
outputs:
@@ -890,7 +934,7 @@ jobs:
890934
# runs sqlc-vet to ensure all queries are valid. This catches any mistakes
891935
# in migrations or sqlc queries that makes a query unable to be prepared.
892936
sqlc-vet:
893-
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
937+
runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }}
894938
needs: changes
895939
if: needs.changes.outputs.db == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main'
896940
steps:

.github/workflows/nightly-gauntlet.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
# While GitHub's toaster runners are likelier to flake, we want consistency
1212
# between this environment and the regular test environment for DataDog
1313
# statistics and to only show real workflow threats.
14-
runs-on: "buildjet-8vcpu-ubuntu-2204"
14+
runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }}
1515
# This runner costs 0.016 USD per minute,
1616
# so 0.016 * 240 = 3.84 USD per run.
1717
timeout-minutes: 240
@@ -40,7 +40,7 @@ jobs:
4040

4141
go-timing:
4242
# We run these tests with p=1 so we don't need a lot of compute.
43-
runs-on: "buildjet-2vcpu-ubuntu-2204"
43+
runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04' || 'ubuntu-latest' }}
4444
timeout-minutes: 10
4545
steps:
4646
- name: Checkout

.github/workflows/pr-deploy.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ jobs:
189189
needs: get_info
190190
# Run build job only if there are changes in the files that we care about or if the workflow is manually triggered with --build flag
191191
if: needs.get_info.outputs.BUILD == 'true'
192-
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
192+
runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }}
193193
# This concurrency only cancels build jobs if a new build is triggred. It will avoid cancelling the current deployemtn in case of docs chnages.
194194
concurrency:
195195
group: build-${{ github.workflow }}-${{ github.ref }}-${{ needs.get_info.outputs.BUILD }}

.github/workflows/release.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ env:
3939
jobs:
4040
release:
4141
name: Build and publish
42-
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
42+
runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }}
4343
env:
4444
# Necessary for Docker manifest
4545
DOCKER_CLI_EXPERIMENTAL: "enabled"

.github/workflows/security.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ concurrency:
2323

2424
jobs:
2525
codeql:
26-
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
26+
runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }}
2727
steps:
2828
- name: Checkout
2929
uses: actions/checkout@v4
@@ -56,7 +56,7 @@ jobs:
5656
"${{ secrets.SLACK_SECURITY_FAILURE_WEBHOOK_URL }}"
5757
5858
trivy:
59-
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
59+
runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }}
6060
steps:
6161
- name: Checkout
6262
uses: actions/checkout@v4
@@ -114,7 +114,7 @@ jobs:
114114
echo "image=$(cat "$image_job")" >> $GITHUB_OUTPUT
115115
116116
- name: Run Trivy vulnerability scanner
117-
uses: aquasecurity/trivy-action@595be6a0f6560a0a8fc419ddf630567fc623531d
117+
uses: aquasecurity/trivy-action@7c2007bcb556501da015201bcba5aa14069b74e2
118118
with:
119119
image-ref: ${{ steps.build.outputs.image }}
120120
format: sarif

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,6 @@ result
6868

6969
# Filebrowser.db
7070
**/filebrowser.db
71+
72+
# pnpm
73+
.pnpm-store/

.prettierignore

+3
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ result
7171

7272
# Filebrowser.db
7373
**/filebrowser.db
74+
75+
# pnpm
76+
.pnpm-store/
7477
# .prettierignore.include:
7578
# Helm templates contain variables that are invalid YAML and can't be formatted
7679
# by Prettier.

Makefile

+8-3
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ GOOS := $(shell go env GOOS)
3636
GOARCH := $(shell go env GOARCH)
3737
GOOS_BIN_EXT := $(if $(filter windows, $(GOOS)),.exe,)
3838
VERSION := $(shell ./scripts/version.sh)
39+
POSTGRES_VERSION ?= 16
3940

4041
# Use the highest ZSTD compression level in CI.
4142
ifdef CI
@@ -814,19 +815,19 @@ test-migrations: test-postgres-docker
814815

815816
# NOTE: we set --memory to the same size as a GitHub runner.
816817
test-postgres-docker:
817-
docker rm -f test-postgres-docker || true
818+
docker rm -f test-postgres-docker-${POSTGRES_VERSION} || true
818819
docker run \
819820
--env POSTGRES_PASSWORD=postgres \
820821
--env POSTGRES_USER=postgres \
821822
--env POSTGRES_DB=postgres \
822823
--env PGDATA=/tmp \
823824
--tmpfs /tmp \
824825
--publish 5432:5432 \
825-
--name test-postgres-docker \
826+
--name test-postgres-docker-${POSTGRES_VERSION} \
826827
--restart no \
827828
--detach \
828829
--memory 16GB \
829-
gcr.io/coder-dev-1/postgres:13 \
830+
gcr.io/coder-dev-1/postgres:${POSTGRES_VERSION} \
830831
-c shared_buffers=1GB \
831832
-c work_mem=1GB \
832833
-c effective_cache_size=1GB \
@@ -865,3 +866,7 @@ test-tailnet-integration:
865866
test-clean:
866867
go clean -testcache
867868
.PHONY: test-clean
869+
870+
.PHONY: test-e2e
871+
test-e2e:
872+
cd ./site && DEBUG=pw:api pnpm playwright:test --forbid-only --workers 1

0 commit comments

Comments
 (0)