Skip to content

Commit 93cc918

Browse files
committed
Merge remote-tracking branch 'origin/main' into inactivity-modal/kira-pilot
2 parents a08a0c9 + 175561b commit 93cc918

File tree

254 files changed

+6902
-3168
lines changed

Some content is hidden

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

254 files changed

+6902
-3168
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ runs:
77
- uses: buildjet/setup-go@v4
88
with:
99
cache: true
10-
go-version: "~1.20"
10+
go-version: "1.20.5"
1111
- name: Install gotestsum
1212
uses: jaxxstorm/action-install-gh-release@v1.10.0
1313
with:

.github/dependabot.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ updates:
4747
interval: "weekly"
4848
time: "06:00"
4949
timezone: "America/Chicago"
50+
commit-message:
51+
prefix: "chore"
52+
labels: []
5053
ignore:
5154
# We need to coordinate terraform updates with the version hardcoded in
5255
# our Go code.
@@ -86,3 +89,26 @@ updates:
8689
ignore:
8790
# We likely want to update this ourselves.
8891
- dependency-name: "coder/coder"
92+
93+
# Update dogfood.
94+
- package-ecosystem: "docker"
95+
directory: "/dogfood/"
96+
schedule:
97+
interval: "weekly"
98+
time: "06:00"
99+
timezone: "America/Chicago"
100+
commit-message:
101+
prefix: "chore"
102+
labels: []
103+
104+
- package-ecosystem: "terraform"
105+
directory: "/dogfood/"
106+
schedule:
107+
interval: "weekly"
108+
time: "06:00"
109+
timezone: "America/Chicago"
110+
commit-message:
111+
prefix: "chore"
112+
labels: []
113+
ignore:
114+
- dependency-name: "coder/coder"

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ jobs:
181181
run: ./scripts/check_unstaged.sh
182182

183183
test-go:
184-
runs-on: ${{ matrix.os == 'ubuntu-latest' && github.repository_owner == 'coder' && 'buildjet-4vcpu-ubuntu-2204' || matrix.os == 'windows-2019' && github.repository_owner == 'coder' && 'windows-latest-8-cores'|| matrix.os }}
184+
runs-on: ${{ matrix.os == 'ubuntu-latest' && github.repository_owner == 'coder' && 'buildjet-4vcpu-ubuntu-2204' || matrix.os == 'macos-latest' && github.repository_owner == 'coder' && 'macos-latest-xl' || matrix.os == 'windows-2019' && github.repository_owner == 'coder' && 'windows-latest-8-cores' || matrix.os }}
185185
timeout-minutes: 20
186186
strategy:
187187
matrix:

.github/workflows/dogfood.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,17 @@ on:
66
- main
77
paths:
88
- "dogfood/**"
9+
- ".github/workflows/dogfood.yaml"
910
# Uncomment these lines when testing with CI.
1011
# pull_request:
1112
# paths:
1213
# - "dogfood/**"
14+
# - ".github/workflows/dogfood.yaml"
1315
workflow_dispatch:
1416

1517
jobs:
1618
deploy_image:
17-
runs-on: ubuntu-latest
19+
runs-on: buildjet-4vcpu-ubuntu-2204
1820
steps:
1921
- name: Get branch name
2022
id: branch-name
@@ -57,14 +59,13 @@ jobs:
5759
- name: Get short commit SHA
5860
id: vars
5961
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
60-
- name: "Install latest Coder"
62+
- name: "Get latest Coder binary from the server"
6163
run: |
62-
curl -L https://coder.com/install.sh | sh
63-
# env:
64-
# VERSION: 0.x
64+
curl -fsSL "https://dev.coder.com/bin/coder-linux-amd64" -o "./coder"
65+
chmod +x "./coder"
6566
- name: "Push template"
6667
run: |
67-
coder templates push $CODER_TEMPLATE_NAME --directory $CODER_TEMPLATE_DIR --yes --name=$CODER_TEMPLATE_VERSION
68+
./coder templates push $CODER_TEMPLATE_NAME --directory $CODER_TEMPLATE_DIR --yes --name=$CODER_TEMPLATE_VERSION
6869
env:
6970
# Consumed by Coder CLI
7071
CODER_URL: https://dev.coder.com

.github/workflows/nightly-flake.yaml renamed to .github/workflows/nightly-gauntlet.yaml

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
name: nightly-flake
1+
# The nightly-gauntlet runs tests that are either too flaky or too slow to block
2+
# every PR.
3+
name: nightly-gauntlet
24
on:
35
schedule:
46
# Every day at midnight
57
- cron: "0 0 * * *"
68
workflow_dispatch:
7-
# For testing purposes
8-
# push:
9-
# paths:
10-
# - ".github/workflows/nightly-flake.yaml"
119
jobs:
12-
test-go-race:
10+
go-race:
1311
# While GitHub's toaster runners are likelier to flake, we want consistency
1412
# between this environment and the regular test environment for DataDog
1513
# statistics and to only show real workflow threats.
@@ -38,3 +36,20 @@ jobs:
3836
if: always()
3937
with:
4038
api-key: ${{ secrets.DATADOG_API_KEY }}
39+
40+
go-timing:
41+
# We run these tests with p=1 so we don't need a lot of compute.
42+
runs-on: "buildjet-2vcpu-ubuntu-2204"
43+
timeout-minutes: 10
44+
steps:
45+
- uses: actions/checkout@v3
46+
47+
- uses: ./.github/actions/setup-go
48+
- name: Run Tests
49+
run: |
50+
gotestsum --junitfile="gotests.xml" -- --tags="timing" -p=1 -run='_Timing/' ./...
51+
52+
- uses: ./.github/actions/upload-datadog
53+
if: always()
54+
with:
55+
api-key: ${{ secrets.DATADOG_API_KEY }}

.github/workflows/release.yaml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ on:
66
- "v*"
77
workflow_dispatch:
88
inputs:
9-
go_version:
10-
description: "Go version to use for building."
11-
required: false
12-
default: "1.20.4"
139
dry_run:
1410
description: Perform a dry-run release (devel). Note that ref must be an annotated tag when run without dry-run.
1511
type: boolean
@@ -35,7 +31,7 @@ env:
3531
# For some reason, setup-go won't actually pick up a new patch version if
3632
# it has an old one cached. We need to manually specify the versions so we
3733
# can get the latest release. Never use "~1.xx" here!
38-
CODER_GO_VERSION: "1.20.4"
34+
CODER_GO_VERSION: "1.20.5"
3935

4036
jobs:
4137
release:
@@ -98,10 +94,7 @@ jobs:
9894
username: ${{ github.actor }}
9995
password: ${{ secrets.GITHUB_TOKEN }}
10096

101-
- uses: buildjet/setup-go@v4
102-
with:
103-
go-version: ${{ env.CODER_GO_VERSION }}
104-
cache: true
97+
- uses: ./.github/actions/setup-go
10598

10699
- name: Cache Node
107100
id: cache-node

.github/workflows/security.yaml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ concurrency:
1919
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
2020

2121
env:
22-
CODER_GO_VERSION: "1.20.4"
22+
CODER_GO_VERSION: "1.20.5"
2323

2424
jobs:
2525
codeql:
@@ -32,10 +32,7 @@ jobs:
3232
with:
3333
languages: go, javascript
3434

35-
- name: Setup Go
36-
uses: buildjet/setup-go@v4
37-
with:
38-
go-version: ${{ env.CODER_GO_VERSION }}
35+
- uses: ./.github/actions/setup-go
3936

4037
# Workaround to prevent CodeQL from building the dashboard.
4138
- name: Remove Makefile
@@ -63,10 +60,7 @@ jobs:
6360
with:
6461
fetch-depth: 0
6562

66-
- uses: buildjet/setup-go@v4
67-
with:
68-
go-version: ${{ env.CODER_GO_VERSION }}
69-
cache: true
63+
- uses: ./.github/actions/setup-go
7064

7165
- name: Cache Node
7266
id: cache-node

.github/workflows/cron-weekly.yaml renamed to .github/workflows/weekly-docs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Weekly Cron
1+
name: weekly-docs
22
# runs every monday at 9 am
33
on:
44
schedule:

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,5 @@ site/stats/
5858
# Loadtesting
5959
./scaletest/terraform/.terraform
6060
./scaletest/terraform/.terraform.lock.hcl
61-
terraform.tfstate.*
62-
**/*.tfvars
61+
scaletest/terraform/secrets.tfvars
62+
.terraform.tfstate.*

.prettierignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ site/stats/
6161
# Loadtesting
6262
./scaletest/terraform/.terraform
6363
./scaletest/terraform/.terraform.lock.hcl
64-
terraform.tfstate.*
65-
**/*.tfvars
64+
scaletest/terraform/secrets.tfvars
65+
.terraform.tfstate.*
6666
# .prettierignore.include:
6767
# Helm templates contain variables that are invalid YAML and can't be formatted
6868
# by Prettier.

Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -525,13 +525,17 @@ coderd/apidoc/swagger.json: $(shell find ./scripts/apidocgen $(FIND_EXCLUSIONS)
525525
./scripts/apidocgen/generate.sh
526526
yarn run --cwd=site format:write:only ../docs/api ../docs/manifest.json ../coderd/apidoc/swagger.json
527527

528-
update-golden-files: cli/testdata/.gen-golden helm/tests/testdata/.gen-golden scripts/ci-report/testdata/.gen-golden
528+
update-golden-files: cli/testdata/.gen-golden helm/tests/testdata/.gen-golden scripts/ci-report/testdata/.gen-golden enterprise/cli/testdata/.gen-golden
529529
.PHONY: update-golden-files
530530

531531
cli/testdata/.gen-golden: $(wildcard cli/testdata/*.golden) $(wildcard cli/*.tpl) $(GO_SRC_FILES)
532532
go test ./cli -run="Test(CommandHelp|ServerYAML)" -update
533533
touch "$@"
534534

535+
enterprise/cli/testdata/.gen-golden: $(wildcard enterprise/cli/testdata/*.golden) $(wildcard cli/*.tpl) $(GO_SRC_FILES)
536+
go test ./enterprise/cli -run="TestEnterpriseCommandHelp" -update
537+
touch "$@"
538+
535539
helm/tests/testdata/.gen-golden: $(wildcard helm/tests/testdata/*.yaml) $(wildcard helm/tests/testdata/*.golden) $(GO_SRC_FILES)
536540
go test ./helm/tests -run=TestUpdateGoldenFiles -update
537541
touch "$@"
@@ -630,7 +634,7 @@ test-postgres-docker:
630634
--name test-postgres-docker \
631635
--restart no \
632636
--detach \
633-
postgres:13 \
637+
gcr.io/coder-dev-1/postgres:13 \
634638
-c shared_buffers=1GB \
635639
-c work_mem=1GB \
636640
-c effective_cache_size=1GB \

agent/agentssh/agentssh_internal_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ func Test_sessionStart_orphan(t *testing.T) {
3939
logger := slogtest.Make(t, nil)
4040
s, err := NewServer(ctx, logger, prometheus.NewRegistry(), afero.NewMemMapFs(), 0, "")
4141
require.NoError(t, err)
42+
defer s.Close()
4243

4344
// Here we're going to call the handler directly with a faked SSH session
4445
// that just uses io.Pipes instead of a network socket. There is a large

agent/agentssh/agentssh_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ func TestNewServer_ServeClient(t *testing.T) {
3636
logger := slogtest.Make(t, nil)
3737
s, err := agentssh.NewServer(ctx, logger, prometheus.NewRegistry(), afero.NewMemMapFs(), 0, "")
3838
require.NoError(t, err)
39+
defer s.Close()
3940

4041
// The assumption is that these are set before serving SSH connections.
4142
s.AgentToken = func() string { return "" }
@@ -77,6 +78,7 @@ func TestNewServer_CloseActiveConnections(t *testing.T) {
7778
logger := slogtest.Make(t, &slogtest.Options{IgnoreErrors: true})
7879
s, err := agentssh.NewServer(ctx, logger, prometheus.NewRegistry(), afero.NewMemMapFs(), 0, "")
7980
require.NoError(t, err)
81+
defer s.Close()
8082

8183
// The assumption is that these are set before serving SSH connections.
8284
s.AgentToken = func() string { return "" }

0 commit comments

Comments
 (0)