Skip to content

Commit 43cd118

Browse files
committed
merge: main into branch
2 parents d113cd7 + a8f5af1 commit 43cd118

File tree

687 files changed

+39778
-12079
lines changed

Some content is hidden

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

687 files changed

+39778
-12079
lines changed

.devcontainer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]
33

44
ENV EDITOR=vim
55

6-
RUN apt-get update && apt-get upgrade
6+
RUN apt-get update && apt-get upgrade --yes
77

88
RUN apt-get install --yes \
99
ca-certificates \

.github/ISSUE_TEMPLATE/external_bug_report.md

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

.github/workflows/coder.yaml

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- name: Checkout
3535
uses: actions/checkout@v2
3636
- name: typos-action
37-
uses: crate-ci/typos@v1.12.8
37+
uses: crate-ci/typos@v1.12.12
3838
with:
3939
config: .github/workflows/typos.toml
4040
- name: Fix Helper
@@ -89,14 +89,14 @@ jobs:
8989
style-lint-golangci:
9090
name: style/lint/golangci
9191
timeout-minutes: 5
92-
runs-on: ubuntu-latest
92+
runs-on: ${{ github.repository_owner == 'coder' && 'ubuntu-latest-16-cores' || 'ubuntu-latest' }}
9393
steps:
9494
- uses: actions/checkout@v3
9595
- uses: actions/setup-go@v3
9696
with:
9797
go-version: "~1.19"
9898
- name: golangci-lint
99-
uses: golangci/golangci-lint-action@v3.2.0
99+
uses: golangci/golangci-lint-action@v3.3.0
100100
with:
101101
version: v1.48.0
102102

@@ -171,7 +171,7 @@ jobs:
171171
gen:
172172
name: "style/gen"
173173
timeout-minutes: 8
174-
runs-on: ubuntu-latest
174+
runs-on: ${{ github.repository_owner == 'coder' && 'ubuntu-latest-16-cores' || 'ubuntu-latest' }}
175175
needs: changes
176176
if: needs.changes.outputs.docs-only == 'false'
177177
steps:
@@ -276,7 +276,7 @@ jobs:
276276
277277
test-go:
278278
name: "test/go"
279-
runs-on: ${{ matrix.os }}
279+
runs-on: ${{ matrix.os == 'ubuntu-latest' && github.repository_owner == 'coder' && 'ubuntu-latest-16-cores' || matrix.os == 'windows-2022' && github.repository_owner == 'coder' && 'windows-latest-8-cores'|| matrix.os }}
280280
timeout-minutes: 20
281281
strategy:
282282
matrix:
@@ -315,7 +315,7 @@ jobs:
315315
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
316316
with:
317317
repo: gotestyourself/gotestsum
318-
tag: v1.7.0
318+
tag: v1.8.2
319319

320320
- uses: hashicorp/setup-terraform@v2
321321
with:
@@ -336,11 +336,7 @@ jobs:
336336
echo ::set-output name=cover::false
337337
fi
338338
set -x
339-
test_timeout=5m
340-
if [[ "${{ matrix.os }}" == windows* ]]; then
341-
test_timeout=10m
342-
fi
343-
gotestsum --junitfile="gotests.xml" --packages="./..." -- -parallel=8 -timeout=$test_timeout -short -failfast $COVERAGE_FLAGS
339+
gotestsum --junitfile="gotests.xml" --packages="./..." -- -parallel=8 -timeout=3m -short -failfast $COVERAGE_FLAGS
344340
345341
- uses: codecov/codecov-action@v3
346342
# This action has a tendency to error out unexpectedly, it has
@@ -356,7 +352,7 @@ jobs:
356352

357353
test-go-postgres:
358354
name: "test/go/postgres"
359-
runs-on: ubuntu-latest
355+
runs-on: ${{ github.repository_owner == 'coder' && 'ubuntu-latest-16-cores' || 'ubuntu-latest' }}
360356
# This timeout must be greater than the timeout set by `go test` in
361357
# `make test-postgres` to ensure we receive a trace of running
362358
# goroutines. Setting this to the timeout +5m should work quite well
@@ -393,7 +389,7 @@ jobs:
393389
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
394390
with:
395391
repo: gotestyourself/gotestsum
396-
tag: v1.7.0
392+
tag: v1.8.2
397393

398394
- uses: hashicorp/setup-terraform@v2
399395
with:
@@ -417,7 +413,7 @@ jobs:
417413

418414
deploy:
419415
name: "deploy"
420-
runs-on: ubuntu-latest
416+
runs-on: ${{ github.repository_owner == 'coder' && 'ubuntu-latest-16-cores' || 'ubuntu-latest' }}
421417
timeout-minutes: 30
422418
needs: changes
423419
if: |
@@ -514,7 +510,7 @@ jobs:
514510

515511
test-js:
516512
name: "test/js"
517-
runs-on: ubuntu-latest
513+
runs-on: ${{ github.repository_owner == 'coder' && 'ubuntu-latest-16-cores' || 'ubuntu-latest' }}
518514
timeout-minutes: 20
519515
steps:
520516
- uses: actions/checkout@v3

.github/workflows/dogfood.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
steps:
1818
- name: Get branch name
1919
id: branch-name
20-
uses: tj-actions/branch-names@v6.1
20+
uses: tj-actions/branch-names@v6.2
2121

2222
- name: "Branch name to Docker tag name"
2323
id: docker-tag-name

.github/workflows/mlc_config.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99
{
1010
"pattern": "developer.github.com"
1111
},
12+
{
13+
"pattern": "docs.github.com"
14+
},
15+
{
16+
"pattern": "support.google.com"
17+
},
1218
{
1319
"pattern": "tailscale.com"
1420
}

.github/workflows/packages.yaml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Submit Packages
2+
on:
3+
workflow_run:
4+
workflows: [release]
5+
types:
6+
- completed
7+
env:
8+
CODER_VERSION: "${{ github.event.release.tag_name }}"
9+
10+
jobs:
11+
winget:
12+
runs-on: windows-latest
13+
steps:
14+
- name: Install wingetcreate
15+
run: |
16+
Invoke-WebRequest https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe
17+
18+
# the package version is the same as the release tag without the leading
19+
# "v", and with a trailing ".0" (e.g. "v1.2.3" -> "1.2.3.0")
20+
- name: Calculate package version
21+
id: version
22+
run: |
23+
$version = $env:CODER_VERSION -replace "^v", ""
24+
$version += ".0"
25+
echo "::set-output name=version::$version"
26+
27+
- name: Submit updated manifest to winget-pkgs
28+
run: |
29+
$release_assets = gh release view --repo coder/coder "$env:CODER_VERSION" --json assets | `
30+
ConvertFrom-Json
31+
32+
$installer_url = $release_assets.assets | `
33+
Where-Object name -Match ".*_windows_amd64_installer.exe$" | `
34+
Select -ExpandProperty url
35+
36+
echo "Installer URL: $installer_url"
37+
38+
# version should be extracted from the installer
39+
wingetcreate update Coder.Coder `
40+
--submit `
41+
--version "${{ steps.version.outputs.version }}" `
42+
--urls "$installer_url" `
43+
--token "${{ secrets.CDRCI_GITHUB_TOKEN }}"
44+
45+
- name: Comment on PR
46+
run: |
47+
# find the PR that wingetcreate just made
48+
$pr_list = gh pr list --repo microsoft/winget-pkgs --search "author:cdrci Coder.Coder version ${{ steps.version.outputs.version }}" --limit 1 --json number | `
49+
ConvertFrom-Json`
50+
$pr_number = $pr_list[0].number
51+
52+
gh pr comment --repo microsoft/winget-pkgs "$pr_number" --body "🤖 cc: @deansheather"

.github/workflows/release.yaml

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,15 @@ permissions:
2020
contents: write
2121
# Necessary to push docker images to ghcr.io.
2222
packages: write
23+
# Necessary for GCP authentication (https://github.com/google-github-actions/setup-gcloud#usage)
24+
id-token: write
2325

2426
env:
2527
CODER_RELEASE: ${{ github.event.inputs.snapshot && 'false' || 'true' }}
2628

2729
jobs:
2830
release:
29-
runs-on: ubuntu-latest
31+
runs-on: ${{ github.repository_owner == 'coder' && 'ubuntu-latest-16-cores' || 'ubuntu-latest' }}
3032
env:
3133
# Necessary for Docker manifest
3234
DOCKER_CLI_EXPERIMENTAL: "enabled"
@@ -65,13 +67,14 @@ jobs:
6567
restore-keys: |
6668
js-${{ runner.os }}-
6769
70+
- name: Install nsis and zstd
71+
run: sudo apt-get install -y nsis zstd
72+
6873
- name: Install nfpm
6974
run: |
7075
set -euo pipefail
7176
wget -O /tmp/nfpm.deb https://github.com/goreleaser/nfpm/releases/download/v2.18.1/nfpm_amd64.deb
7277
sudo dpkg -i /tmp/nfpm.deb
73-
- name: Install zstd
74-
run: sudo apt-get install -y zstd
7578
7679
- name: Install rcodesign
7780
run: |
@@ -107,6 +110,7 @@ jobs:
107110
make -j \
108111
build/coder_"$version"_linux_{amd64,armv7,arm64}.{tar.gz,apk,deb,rpm} \
109112
build/coder_"$version"_{darwin,windows}_{amd64,arm64}.zip \
113+
build/coder_"$version"_windows_amd64_installer.exe \
110114
build/coder_helm_"$version".tgz
111115
env:
112116
CODER_SIGN_DARWIN: "1"
@@ -155,6 +159,7 @@ jobs:
155159
run: |
156160
./scripts/publish_release.sh \
157161
${{ (github.event.inputs.dry_run || github.event.inputs.snapshot) && '--dry-run' }} \
162+
./build/*_installer.exe \
158163
./build/*.zip \
159164
./build/*.tar.gz \
160165
./build/*.tgz \
@@ -164,6 +169,26 @@ jobs:
164169
env:
165170
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
166171

172+
- name: Authenticate to Google Cloud
173+
uses: google-github-actions/auth@v0
174+
with:
175+
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_ID_PROVIDER }}
176+
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}
177+
178+
- name: Setup GCloud SDK
179+
uses: 'google-github-actions/setup-gcloud@v0'
180+
181+
- name: Publish Helm Chart
182+
run: |
183+
set -euo pipefail
184+
version="$(./scripts/version.sh)"
185+
mkdir -p build/helm
186+
cp "build/coder_helm_${version}.tgz" build/helm
187+
gsutil cp gs://helm.coder.com/v2/index.yaml build/helm/index.yaml
188+
helm repo index build/helm --url https://helm.coder.com/v2 --merge build/helm/index.yaml
189+
gsutil -h "Cache-Control:no-cache,max-age=0" cp build/helm/coder_helm_${version}.tgz gs://helm.coder.com/v2
190+
gsutil -h "Cache-Control:no-cache,max-age=0" cp build/helm/index.yaml gs://helm.coder.com/v2
191+
167192
- name: Upload artifacts to actions (if dry-run or snapshot)
168193
if: ${{ github.event.inputs.dry_run || github.event.inputs.snapshot }}
169194
uses: actions/upload-artifact@v2

.github/workflows/stale.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ jobs:
1515
# https://github.com/actions/stale/pull/775
1616
- uses: actions/stale@v6.0.0
1717
with:
18-
stale-issue-label: stale
19-
stale-pr-label: stale
18+
stale-issue-label: 'stale'
19+
stale-pr-label: 'stale'
20+
exempt-issue-labels: 'never stale'
21+
exempt-pr-labels: 'never stale'
2022
# Pull Requests become stale more quickly due to merge conflicts.
2123
# Also, we promote minimizing WIP.
2224
days-before-pr-stale: 7

.github/workflows/typos.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ MacOS = "macOS"
77
[default.extend-words]
88
# do as sudo replacement
99
doas = "doas"
10+
darcula = "darcula"
11+
Hashi = "Hashi"
12+
trialer = "trialer"
1013

1114
[files]
1215
extend-exclude = [

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ gotests.coverage
1818
.gitpod.yml
1919
.DS_Store
2020

21+
# Make target for updating golden files.
22+
cli/testdata/.gen-golden
23+
2124
# Front-end ignore
2225
.next/
2326
site/.eslintcache
@@ -46,3 +49,6 @@ site/out/
4649
**/*.swp
4750
.coderv2/*
4851
**/__debug_bin
52+
53+
# direnv
54+
.envrc

.golangci.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ linters-settings:
123123

124124
misspell:
125125
locale: US
126+
ignore-words:
127+
- trialer
126128

127129
nestif:
128130
min-complexity: 4 # Min complexity of if statements (def 5, goal 4)

0 commit comments

Comments
 (0)