Skip to content

Commit 6610e06

Browse files
author
Yixin Hao
committed
Merge tag 'v0.19.2' into immoral-v0.17.0
Release v0.19.2
2 parents 98cec92 + 7eb2c2f commit 6610e06

File tree

713 files changed

+35430
-17868
lines changed

Some content is hidden

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

713 files changed

+35430
-17868
lines changed

.github/pull_request_template.md

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

.github/workflows/ci.yaml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141

4242
# Check for any typos!
4343
- name: Check for typos
44-
uses: crate-ci/typos@v1.13.9
44+
uses: crate-ci/typos@v1.13.14
4545
with:
4646
config: .github/workflows/typos.toml
4747
- name: Fix the typos
@@ -186,8 +186,9 @@ jobs:
186186

187187
- name: Install Protoc
188188
run: |
189-
# protoc must be in lockstep with our dogfood Dockerfile
190-
# or the version in the comments will differ.
189+
# protoc must be in lockstep with our dogfood Dockerfile or the
190+
# version in the comments will differ. This is also defined in
191+
# security.yaml
191192
set -x
192193
cd dogfood
193194
DOCKER_BUILDKIT=1 docker build . --target proto -t protoc
@@ -506,7 +507,7 @@ jobs:
506507
507508
- uses: actions/setup-node@v3
508509
with:
509-
node-version: "14"
510+
node-version: "16.16.0"
510511

511512
- name: Install node_modules
512513
run: ./scripts/yarn_install.sh
@@ -555,7 +556,7 @@ jobs:
555556

556557
- uses: actions/setup-node@v3
557558
with:
558-
node-version: "14"
559+
node-version: "16.16.0"
559560

560561
- name: Echo Go Cache Paths
561562
id: go-cache-paths
@@ -609,6 +610,10 @@ jobs:
609610
# only get 1 commit on shallow checkout.
610611
fetch-depth: 0
611612

613+
- uses: actions/setup-node@v3
614+
with:
615+
node-version: "16.16.0"
616+
612617
- name: Install dependencies
613618
run: cd site && yarn
614619

.github/workflows/contrib.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ concurrency: pr-${{ github.ref }}
1919

2020
jobs:
2121
# Dependabot is annoying, but this makes it a bit less so.
22-
auto-approve:
22+
auto-approve-dependabot:
2323
runs-on: ubuntu-latest
2424
if: github.event_name == 'pull_request_target'
2525
permissions:
@@ -33,7 +33,7 @@ jobs:
3333
steps:
3434
- name: cla
3535
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
36-
uses: contributor-assistant/github-action@v2.2.1
36+
uses: contributor-assistant/github-action@v2.3.0
3737
env:
3838
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3939
# the below token should have repo scope and must be manually added by you in the repository's secret

.github/workflows/docker-base.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,38 @@ jobs:
5353
project: wl5hnrrkns
5454
context: base-build-context
5555
file: scripts/Dockerfile.base
56+
platforms: linux/amd64,linux/arm64,linux/arm/v7
5657
pull: true
5758
no-cache: true
5859
push: true
5960
tags: |
6061
ghcr.io/coder/coder-base:latest
62+
63+
- name: Verify that images are pushed properly
64+
run: |
65+
# retry 10 times with a 5 second delay as the images may not be
66+
# available immediately
67+
for i in {1..10}; do
68+
rc=0
69+
raw_manifests=$(docker buildx imagetools inspect --raw ghcr.io/coder/coder-base:latest) || rc=$?
70+
if [[ "$rc" -eq 0 ]]; then
71+
break
72+
fi
73+
if [[ "$i" -eq 10 ]]; then
74+
echo "Failed to pull manifests after 10 retries"
75+
exit 1
76+
fi
77+
echo "Failed to pull manifests, retrying in 5 seconds"
78+
sleep 5
79+
done
80+
81+
manifests=$(
82+
echo "$raw_manifests" | \
83+
jq -r '.manifests[].platform | .os + "/" + .architecture + (if .variant then "/" + .variant else "" end)'
84+
)
85+
86+
# Verify all 3 platforms are present.
87+
set -euxo pipefail
88+
echo "$manifests" | grep -q linux/amd64
89+
echo "$manifests" | grep -q linux/arm64
90+
echo "$manifests" | grep -q linux/arm/v7

.github/workflows/pr-auto-assign.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Filtering pull requests is much easier when we can reliably guarantee
2+
# that the "Assignee" field is populated.
3+
name: PR Auto Assign
4+
5+
on:
6+
pull_request_target:
7+
types: [opened]
8+
9+
permissions:
10+
pull-requests: write
11+
12+
jobs:
13+
assign-author:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: toshimaru/auto-author-assign@v1.6.2

.github/workflows/release.yaml

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,42 @@ jobs:
188188
project: wl5hnrrkns
189189
context: base-build-context
190190
file: scripts/Dockerfile.base
191+
platforms: linux/amd64,linux/arm64,linux/arm/v7
191192
pull: true
192193
no-cache: true
193194
push: true
194195
tags: |
195196
${{ steps.image-base-tag.outputs.tag }}
196197
198+
- name: Verify that images are pushed properly
199+
run: |
200+
# retry 10 times with a 5 second delay as the images may not be
201+
# available immediately
202+
for i in {1..10}; do
203+
rc=0
204+
raw_manifests=$(docker buildx imagetools inspect --raw "${{ steps.image-base-tag.outputs.tag }}") || rc=$?
205+
if [[ "$rc" -eq 0 ]]; then
206+
break
207+
fi
208+
if [[ "$i" -eq 10 ]]; then
209+
echo "Failed to pull manifests after 10 retries"
210+
exit 1
211+
fi
212+
echo "Failed to pull manifests, retrying in 5 seconds"
213+
sleep 5
214+
done
215+
216+
manifests=$(
217+
echo "$raw_manifests" | \
218+
jq -r '.manifests[].platform | .os + "/" + .architecture + (if .variant then "/" + .variant else "" end)'
219+
)
220+
221+
# Verify all 3 platforms are present.
222+
set -euxo pipefail
223+
echo "$manifests" | grep -q linux/amd64
224+
echo "$manifests" | grep -q linux/arm64
225+
echo "$manifests" | grep -q linux/arm/v7
226+
197227
- name: Build Linux Docker images
198228
run: |
199229
set -euxo pipefail
@@ -275,7 +305,7 @@ jobs:
275305
276306
- name: Upload artifacts to actions (if dry-run)
277307
if: ${{ inputs.dry_run }}
278-
uses: actions/upload-artifact@v2
308+
uses: actions/upload-artifact@v3
279309
with:
280310
name: release-artifacts
281311
path: |

.github/workflows/security.yaml

Lines changed: 42 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,11 @@ permissions:
66
security-events: write
77

88
on:
9-
push:
10-
branches: ["main"]
11-
12-
pull_request:
13-
branches: ["main"]
14-
159
workflow_dispatch:
1610

1711
schedule:
18-
# Run every week at 10:24 on Thursday.
19-
- cron: "24 10 * * 4"
12+
# Run every 6 hours Monday-Friday!
13+
- cron: "0 0,6,12,18 * * 1-5"
2014

2115
# Cancel in-progress runs for pull requests when developers push
2216
# additional changes
@@ -59,6 +53,17 @@ jobs:
5953
- name: Perform CodeQL Analysis
6054
uses: github/codeql-action/analyze@v2
6155

56+
- name: Send Slack notification on failure
57+
if: ${{ failure() }}
58+
run: |
59+
msg="❌ CodeQL Failed\n\nhttps://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
60+
curl \
61+
-qfsSL \
62+
-X POST \
63+
-H "Content-Type: application/json" \
64+
--data "{\"content\": \"$msg\"}" \
65+
"${{ secrets.SLACK_SECURITY_FAILURE_WEBHOOK_URL }}"
66+
6267
trivy:
6368
runs-on: ${{ github.repository_owner == 'coder' && 'ubuntu-latest-8-cores' || 'ubuntu-latest' }}
6469
steps:
@@ -94,6 +99,22 @@ jobs:
9499
95100
- name: Install yq
96101
run: go run github.com/mikefarah/yq/v4@v4.30.6
102+
- name: Install protoc-gen-go
103+
run: go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.26
104+
- name: Install protoc-gen-go-drpc
105+
run: go install storj.io/drpc/cmd/protoc-gen-go-drpc@v0.0.26
106+
- name: Install Protoc
107+
run: |
108+
# protoc must be in lockstep with our dogfood Dockerfile or the
109+
# version in the comments will differ. This is also defined in
110+
# ci.yaml.
111+
set -x
112+
cd dogfood
113+
DOCKER_BUILDKIT=1 docker build . --target proto -t protoc
114+
protoc_path=/usr/local/bin/protoc
115+
docker run --rm --entrypoint cat protoc /tmp/bin/protoc > $protoc_path
116+
chmod +x $protoc_path
117+
protoc --version
97118
98119
- name: Build Coder linux amd64 Docker image
99120
id: build
@@ -116,7 +137,7 @@ jobs:
116137
echo "image=$(cat "$image_job")" >> $GITHUB_OUTPUT
117138
118139
- name: Run Trivy vulnerability scanner
119-
uses: aquasecurity/trivy-action@9ab158e8597f3b310480b9a69402b419bc03dbd5
140+
uses: aquasecurity/trivy-action@8bd2f9fbda2109502356ff8a6a89da55b1ead252
120141
with:
121142
image-ref: ${{ steps.build.outputs.image }}
122143
format: sarif
@@ -130,8 +151,19 @@ jobs:
130151
category: "Trivy"
131152

132153
- name: Upload Trivy scan results as an artifact
133-
uses: actions/upload-artifact@v2
154+
uses: actions/upload-artifact@v3
134155
with:
135156
name: trivy
136157
path: trivy-results.sarif
137158
retention-days: 7
159+
160+
- name: Send Slack notification on failure
161+
if: ${{ failure() }}
162+
run: |
163+
msg="❌ CodeQL Failed\n\nhttps://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
164+
curl \
165+
-qfsSL \
166+
-X POST \
167+
-H "Content-Type: application/json" \
168+
--data "{\"content\": \"$msg\"}" \
169+
"${{ secrets.SLACK_SECURITY_FAILURE_WEBHOOK_URL }}"

.golangci.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,6 @@ linters:
215215
- asciicheck
216216
- bidichk
217217
- bodyclose
218-
- deadcode
219218
- dogsled
220219
- errcheck
221220
- errname
@@ -259,4 +258,3 @@ linters:
259258
- typecheck
260259
- unconvert
261260
- unused
262-
- varcheck

.vscode/settings.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"agentsdk",
55
"apps",
66
"ASKPASS",
7+
"authcheck",
78
"autostop",
89
"awsidentity",
910
"bodyclose",
@@ -113,6 +114,7 @@
113114
"stretchr",
114115
"STTY",
115116
"stuntest",
117+
"tanstack",
116118
"tailbroker",
117119
"tailcfg",
118120
"tailexchange",

Makefile

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -368,9 +368,15 @@ install: build/coder_$(VERSION)_$(GOOS)_$(GOARCH)$(GOOS_BIN_EXT)
368368
cp "$<" "$$output_file"
369369
.PHONY: install
370370

371-
fmt: fmt/prettier fmt/terraform fmt/shfmt
371+
fmt: fmt/prettier fmt/terraform fmt/shfmt fmt/go
372372
.PHONY: fmt
373373

374+
fmt/go:
375+
# VS Code users should check out
376+
# https://github.com/mvdan/gofumpt#visual-studio-code
377+
go run mvdan.cc/gofumpt@v0.4.0 -w -l .
378+
.PHONY: fmt/go
379+
374380
fmt/prettier:
375381
echo "--- prettier"
376382
cd site
@@ -418,7 +424,7 @@ gen: \
418424
provisionerd/proto/provisionerd.pb.go \
419425
site/src/api/typesGenerated.ts \
420426
docs/admin/prometheus.md \
421-
docs/cli/coder.md \
427+
docs/cli.md \
422428
docs/admin/audit-logs.md \
423429
coderd/apidoc/swagger.json \
424430
.prettierignore.include \
@@ -438,7 +444,7 @@ gen/mark-fresh:
438444
provisionerd/proto/provisionerd.pb.go \
439445
site/src/api/typesGenerated.ts \
440446
docs/admin/prometheus.md \
441-
docs/cli/coder.md \
447+
docs/cli.md \
442448
docs/admin/audit-logs.md \
443449
coderd/apidoc/swagger.json \
444450
.prettierignore.include \
@@ -494,10 +500,12 @@ docs/admin/prometheus.md: scripts/metricsdocgen/main.go scripts/metricsdocgen/me
494500
cd site
495501
yarn run format:write:only ../docs/admin/prometheus.md
496502

497-
docs/cli/coder.md: scripts/clidocgen/main.go $(GO_SRC_FILES) docs/manifest.json
498-
BASE_PATH="." go run scripts/clidocgen/main.go
503+
docs/cli.md: scripts/clidocgen/main.go $(GO_SRC_FILES) docs/manifest.json
504+
# TODO(@ammario): re-enable server.md once we finish clibase migration.
505+
ls ./docs/cli/*.md | grep -vP "\/coder_server" | xargs rm
506+
BASE_PATH="." go run ./scripts/clidocgen
499507
cd site
500-
yarn run format:write:only ../docs/cli/*.md ../docs/manifest.json
508+
yarn run format:write:only ../docs/cli.md ../docs/cli/*.md ../docs/manifest.json
501509

502510
docs/admin/audit-logs.md: scripts/auditdocgen/main.go enterprise/audit/table.go
503511
go run scripts/auditdocgen/main.go

0 commit comments

Comments
 (0)