Skip to content

Commit 6f94ec4

Browse files
authored
Merge branch 'coder:main' into main
2 parents f42b149 + 85945af commit 6f94ec4

File tree

884 files changed

+56717
-13955
lines changed

Some content is hidden

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

884 files changed

+56717
-13955
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: 32 additions & 16 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.13.3
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.1
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="./..." --debug -- -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: |
@@ -432,7 +428,7 @@ jobs:
432428
fetch-depth: 0
433429

434430
- name: Authenticate to Google Cloud
435-
uses: google-github-actions/auth@v0
431+
uses: google-github-actions/auth@v1
436432
with:
437433
workload_identity_provider: projects/573722524737/locations/global/workloadIdentityPools/github/providers/github
438434
service_account: coder-ci@coder-dogfood.iam.gserviceaccount.com
@@ -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
@@ -674,3 +670,23 @@ jobs:
674670
buildScriptName: "storybook:build"
675671
projectToken: 695c25b6cb65
676672
workingDir: "./site"
673+
markdown-link-check:
674+
runs-on: ubuntu-latest
675+
steps:
676+
- uses: actions/checkout@master
677+
# For the main branch:
678+
- if: github.ref == 'refs/heads/main' && !github.event.pull_request.head.repo.fork
679+
uses: gaurav-nelson/github-action-markdown-link-check@v1
680+
with:
681+
use-quiet-mode: yes
682+
use-verbose-mode: yes
683+
config-file: .github/workflows/mlc_config.json
684+
# For pull requests:
685+
- if: github.ref != 'refs/heads/main' || github.event.pull_request.head.repo.fork
686+
uses: gaurav-nelson/github-action-markdown-link-check@v1
687+
with:
688+
use-quiet-mode: yes
689+
use-verbose-mode: yes
690+
check-modified-files-only: yes
691+
base-branch: main
692+
config-file: .github/workflows/mlc_config.json

.github/workflows/dependabot.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ jobs:
99
permissions:
1010
pull-requests: write
1111
steps:
12-
- uses: hmarr/auto-approve-action@v2
12+
- uses: hmarr/auto-approve-action@v3
1313
if: github.actor == 'dependabot[bot]'

.github/workflows/dogfood.yaml

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ on:
1212
workflow_dispatch:
1313

1414
jobs:
15-
deploy:
15+
deploy_image:
1616
runs-on: ubuntu-latest
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.3
2121

2222
- name: "Branch name to Docker tag name"
2323
id: docker-tag-name
@@ -47,3 +47,27 @@ jobs:
4747
tags: "codercom/oss-dogfood:${{ steps.docker-tag-name.outputs.tag }},codercom/oss-dogfood:latest"
4848
cache-from: type=registry,ref=codercom/oss-dogfood:latest
4949
cache-to: type=inline
50+
deploy_template:
51+
runs-on: ubuntu-latest
52+
steps:
53+
- name: Checkout
54+
uses: actions/checkout@v3
55+
- name: Get short commit SHA
56+
id: vars
57+
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
58+
- name: "Install latest Coder"
59+
run: |
60+
curl -L https://coder.com/install.sh | sh
61+
# env:
62+
# VERSION: 0.x
63+
- name: "Push template"
64+
run: |
65+
coder templates push $CODER_TEMPLATE_NAME --directory $CODER_TEMPLATE_DIR --yes --name=$CODER_TEMPLATE_VERSION
66+
env:
67+
# Consumed by Coder CLI
68+
CODER_URL: https://dev.coder.com
69+
CODER_SESSION_TOKEN: ${{ secrets.CODER_SESSION_TOKEN }}
70+
# Template source & details
71+
CODER_TEMPLATE_NAME: ${{ secrets.CODER_TEMPLATE_NAME }}
72+
CODER_TEMPLATE_VERSION: ${{ steps.vars.outputs.sha_short }}
73+
CODER_TEMPLATE_DIR: ./dogfood

.github/workflows/mlc_config.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"ignorePatterns": [
3+
{
4+
"pattern": ":\/\/localhost"
5+
},
6+
{
7+
"pattern": ":\/\/.*.?example\\.com"
8+
},
9+
{
10+
"pattern": "developer.github.com"
11+
},
12+
{
13+
"pattern": "docs.github.com"
14+
},
15+
{
16+
"pattern": "support.google.com"
17+
},
18+
{
19+
"pattern": "tailscale.com"
20+
}
21+
]
22+
}

.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@v1
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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ 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'
2020
# Pull Requests become stale more quickly due to merge conflicts.
2121
# Also, we promote minimizing WIP.
2222
days-before-pr-stale: 7

.github/workflows/typos.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ IST = "IST"
55
MacOS = "macOS"
66

77
[default.extend-words]
8+
# do as sudo replacement
9+
doas = "doas"
10+
darcula = "darcula"
11+
Hashi = "Hashi"
12+
trialer = "trialer"
13+
encrypter = "encrypter"
814

915
[files]
1016
extend-exclude = [

0 commit comments

Comments
 (0)