Skip to content

Commit 88f5c83

Browse files
committed
Merge branch 'main' into patch-1
2 parents 1aea0ae + 59efa4a commit 88f5c83

File tree

820 files changed

+43069
-18623
lines changed

Some content is hidden

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

820 files changed

+43069
-18623
lines changed

.github/workflows/ci.yaml

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ jobs:
3535
uses: actions/checkout@v3
3636

3737
# Install Go!
38-
- uses: actions/setup-go@v3
38+
- uses: actions/setup-go@v4
3939
with:
4040
go-version: "~1.20"
4141

4242
# Check for any typos!
4343
- name: Check for typos
44-
uses: crate-ci/typos@v1.13.14
44+
uses: crate-ci/typos@v1.14.3
4545
with:
4646
config: .github/workflows/typos.toml
4747
- name: Fix the typos
@@ -150,8 +150,9 @@ jobs:
150150
- name: Install node_modules
151151
run: ./scripts/yarn_install.sh
152152

153-
- uses: actions/setup-go@v3
153+
- uses: actions/setup-go@v4
154154
with:
155+
cache: false
155156
go-version: "~1.20"
156157

157158
- name: Echo Go Cache Paths
@@ -250,8 +251,9 @@ jobs:
250251
steps:
251252
- uses: actions/checkout@v3
252253

253-
- uses: actions/setup-go@v3
254+
- uses: actions/setup-go@v4
254255
with:
256+
cache: false
255257
go-version: "~1.20"
256258

257259
- name: Echo Go Cache Paths
@@ -273,7 +275,7 @@ jobs:
273275
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
274276

275277
- name: Install gotestsum
276-
uses: jaxxstorm/action-install-gh-release@v1.9.0
278+
uses: jaxxstorm/action-install-gh-release@v1.10.0
277279
env:
278280
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
279281
with:
@@ -299,7 +301,15 @@ jobs:
299301
echo "cover=false" >> $GITHUB_OUTPUT
300302
fi
301303
302-
gotestsum --junitfile="gotests.xml" --packages="./..." -- -parallel=8 -timeout=7m -short -failfast $COVERAGE_FLAGS
304+
export TS_DEBUG_DISCO=true
305+
gotestsum --junitfile="gotests.xml" --jsonfile="gotests.json" --packages="./..." -- -parallel=8 -timeout=7m -short -failfast $COVERAGE_FLAGS
306+
307+
- name: Print test stats
308+
if: success() || failure()
309+
run: |
310+
# Artifacts are not available after rerunning a job,
311+
# so we need to print the test stats to the log.
312+
go run ./scripts/ci-report/main.go gotests.json | tee gotests_stats.json
303313
304314
- uses: actions/upload-artifact@v3
305315
if: success() || failure()
@@ -330,8 +340,9 @@ jobs:
330340
steps:
331341
- uses: actions/checkout@v3
332342

333-
- uses: actions/setup-go@v3
343+
- uses: actions/setup-go@v4
334344
with:
345+
cache: false
335346
go-version: "~1.20"
336347

337348
- name: Echo Go Cache Paths
@@ -353,7 +364,7 @@ jobs:
353364
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
354365

355366
- name: Install gotestsum
356-
uses: jaxxstorm/action-install-gh-release@v1.9.0
367+
uses: jaxxstorm/action-install-gh-release@v1.10.0
357368
env:
358369
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
359370
with:
@@ -367,8 +378,16 @@ jobs:
367378

368379
- name: Test with PostgreSQL Database
369380
run: |
381+
export TS_DEBUG_DISCO=true
370382
make test-postgres
371383
384+
- name: Print test stats
385+
if: success() || failure()
386+
run: |
387+
# Artifacts are not available after rerunning a job,
388+
# so we need to print the test stats to the log.
389+
go run ./scripts/ci-report/main.go gotests.json | tee gotests_stats.json
390+
372391
- uses: actions/upload-artifact@v3
373392
if: success() || failure()
374393
with:
@@ -413,8 +432,9 @@ jobs:
413432
- name: Set up Google Cloud SDK
414433
uses: google-github-actions/setup-gcloud@v1
415434

416-
- uses: actions/setup-go@v3
435+
- uses: actions/setup-go@v4
417436
with:
437+
cache: false
418438
go-version: "~1.20"
419439

420440
- name: Echo Go Cache Paths
@@ -542,8 +562,9 @@ jobs:
542562
.eslintcache
543563
key: js-${{ runner.os }}-e2e-${{ hashFiles('**/yarn.lock') }}
544564

545-
- uses: actions/setup-go@v3
565+
- uses: actions/setup-go@v4
546566
with:
567+
cache: false
547568
go-version: "~1.20"
548569

549570
- uses: hashicorp/setup-terraform@v2
@@ -620,6 +641,9 @@ jobs:
620641
- name: Publish to Chromatic (non-mainline)
621642
if: github.ref != 'refs/heads/main' && github.repository_owner == 'coder'
622643
uses: chromaui/action@v1
644+
env:
645+
NODE_OPTIONS: "--max_old_space_size=4096"
646+
STORYBOOK: true
623647
with:
624648
buildScriptName: "storybook:build"
625649
exitOnceUploaded: true
@@ -637,6 +661,9 @@ jobs:
637661
- name: Publish to Chromatic (mainline)
638662
if: github.ref == 'refs/heads/main' && github.repository_owner == 'coder'
639663
uses: chromaui/action@v1
664+
env:
665+
NODE_OPTIONS: "--max_old_space_size=4096"
666+
STORYBOOK: true
640667
with:
641668
autoAcceptChanges: true
642669
buildScriptName: "storybook:build"

.github/workflows/cron-weekly.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Weekly Cron
2+
# runs every monday at 9 am
3+
on:
4+
schedule:
5+
- cron: "0 9 * * 1"
6+
workflow_dispatch: # allows to run manually for testing
7+
8+
jobs:
9+
check-docs:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@master
14+
15+
- name: Check Markdown links
16+
uses: gaurav-nelson/github-action-markdown-link-check@v1
17+
id: markdown-link-check
18+
# checks all markdown files from /docs including all subfolders
19+
with:
20+
use-quiet-mode: "yes"
21+
use-verbose-mode: "yes"
22+
config-file: ".github/workflows/mlc_config.json"
23+
folder-path: "docs/"
24+
file-path: "./README.md"
25+
26+
- name: Send Slack notification
27+
if: failure()
28+
run: |
29+
curl -X POST -H 'Content-type: application/json' -d '{"msg":"Broken links found in the documentation. Please check the logs at ${{ env.LOGS_URL }}"}' ${{ secrets.DOCS_LINK_SLACK_WEBHOOK }}
30+
echo "Sent Slack notification"
31+
env:
32+
LOGS_URL: https://github.com/coder/coder/actions/runs/${{ github.run_id }}

.github/workflows/mlc_config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@
1818
{
1919
"pattern": "tailscale.com"
2020
}
21-
]
21+
],
22+
"aliveStatusCodes": [200, 0]
2223
}

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ jobs:
9090
username: ${{ github.actor }}
9191
password: ${{ secrets.GITHUB_TOKEN }}
9292

93-
- uses: actions/setup-go@v3
93+
- uses: actions/setup-go@v4
9494
with:
9595
go-version: "~1.20"
9696

.github/workflows/security.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
languages: go, javascript
3131

3232
- name: Setup Go
33-
uses: actions/setup-go@v3
33+
uses: actions/setup-go@v4
3434
with:
3535
go-version: "~1.20"
3636

@@ -71,7 +71,7 @@ jobs:
7171
with:
7272
fetch-depth: 0
7373

74-
- uses: actions/setup-go@v3
74+
- uses: actions/setup-go@v4
7575
with:
7676
go-version: "~1.20"
7777

@@ -97,6 +97,9 @@ jobs:
9797
restore-keys: |
9898
js-${{ runner.os }}-
9999
100+
- name: Install sqlc
101+
run: |
102+
curl -sSL https://github.com/kyleconroy/sqlc/releases/download/v1.17.2/sqlc_1.17.2_linux_amd64.tar.gz | sudo tar -C /usr/bin -xz sqlc
100103
- name: Install yq
101104
run: go run github.com/mikefarah/yq/v4@v4.30.6
102105
- name: Install protoc-gen-go
@@ -137,7 +140,7 @@ jobs:
137140
echo "image=$(cat "$image_job")" >> $GITHUB_OUTPUT
138141
139142
- name: Run Trivy vulnerability scanner
140-
uses: aquasecurity/trivy-action@8bd2f9fbda2109502356ff8a6a89da55b1ead252
143+
uses: aquasecurity/trivy-action@1f0aa582c8c8f5f7639610d6d38baddfea4fdcee
141144
with:
142145
image-ref: ${{ steps.build.outputs.image }}
143146
format: sarif

.github/workflows/stale.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
issues: write
1212
pull-requests: write
1313
steps:
14-
- uses: actions/stale@v7.0.0
14+
- uses: actions/stale@v8.0.0
1515
with:
1616
stale-issue-label: "stale"
1717
stale-pr-label: "stale"

.github/workflows/typos.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,5 @@ extend-exclude = [
2424
# These files contain base64 strings that confuse the detector
2525
"**XService**.ts",
2626
"**identity.go",
27+
"scripts/ci-report/testdata/**",
2728
]

.gitignore

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
**/*.swp
77
gotests.coverage
88
gotests.xml
9-
gotestsum.json
9+
gotests_stats.json
10+
gotests.json
1011
node_modules/
1112
vendor/
1213
yarn-error.log
@@ -29,9 +30,8 @@ site/e2e/states/*.json
2930
site/playwright-report/*
3031
site/.swc
3132

32-
# Make target for updating golden files.
33-
cli/testdata/.gen-golden
34-
helm/tests/testdata/.gen-golden
33+
# Make target for updating golden files (any dir).
34+
.gen-golden
3535

3636
# Build
3737
/build/

.golangci.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ issues:
194194
linters:
195195
# We use assertions rather than explicitly checking errors in tests
196196
- errcheck
197+
- forcetypeassert
197198

198199
fix: true
199200
max-issues-per-linter: 0

.prettierignore

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
**/*.swp
1010
gotests.coverage
1111
gotests.xml
12-
gotestsum.json
12+
gotests_stats.json
13+
gotests.json
1314
node_modules/
1415
vendor/
1516
yarn-error.log
@@ -32,9 +33,8 @@ site/e2e/states/*.json
3233
site/playwright-report/*
3334
site/.swc
3435

35-
# Make target for updating golden files.
36-
cli/testdata/.gen-golden
37-
helm/tests/testdata/.gen-golden
36+
# Make target for updating golden files (any dir).
37+
.gen-golden
3838

3939
# Build
4040
/build/

Makefile

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,7 @@ gen: \
423423
provisionersdk/proto/provisioner.pb.go \
424424
provisionerd/proto/provisionerd.pb.go \
425425
site/src/api/typesGenerated.ts \
426+
coderd/rbac/object_gen.go \
426427
docs/admin/prometheus.md \
427428
docs/cli.md \
428429
docs/admin/audit-logs.md \
@@ -443,6 +444,7 @@ gen/mark-fresh:
443444
provisionersdk/proto/provisioner.pb.go \
444445
provisionerd/proto/provisionerd.pb.go \
445446
site/src/api/typesGenerated.ts \
447+
coderd/rbac/object_gen.go \
446448
docs/admin/prometheus.md \
447449
docs/cli.md \
448450
docs/admin/audit-logs.md \
@@ -495,6 +497,9 @@ site/src/api/typesGenerated.ts: scripts/apitypings/main.go $(shell find ./coders
495497
cd site
496498
yarn run format:types
497499

500+
coderd/rbac/object_gen.go: scripts/rbacgen/main.go coderd/rbac/object.go
501+
go run scripts/rbacgen/main.go ./coderd/rbac > coderd/rbac/object_gen.go
502+
498503
docs/admin/prometheus.md: scripts/metricsdocgen/main.go scripts/metricsdocgen/metrics
499504
go run scripts/metricsdocgen/main.go
500505
cd site
@@ -505,26 +510,30 @@ docs/cli.md: scripts/clidocgen/main.go $(GO_SRC_FILES) docs/manifest.json
505510
cd site
506511
yarn run format:write:only ../docs/cli.md ../docs/cli/*.md ../docs/manifest.json
507512

508-
docs/admin/audit-logs.md: scripts/auditdocgen/main.go enterprise/audit/table.go
513+
docs/admin/audit-logs.md: scripts/auditdocgen/main.go enterprise/audit/table.go coderd/rbac/object_gen.go
509514
go run scripts/auditdocgen/main.go
510515
cd site
511516
yarn run format:write:only ../docs/admin/audit-logs.md
512517

513-
coderd/apidoc/swagger.json: $(shell find ./scripts/apidocgen $(FIND_EXCLUSIONS) -type f) $(wildcard coderd/*.go) $(wildcard enterprise/coderd/*.go) $(wildcard codersdk/*.go) .swaggo docs/manifest.json
518+
coderd/apidoc/swagger.json: $(shell find ./scripts/apidocgen $(FIND_EXCLUSIONS) -type f) $(wildcard coderd/*.go) $(wildcard enterprise/coderd/*.go) $(wildcard codersdk/*.go) $(wildcard enterprise/wsproxy/wsproxysdk/*.go) coderd/database/querier.go .swaggo docs/manifest.json coderd/rbac/object_gen.go
514519
./scripts/apidocgen/generate.sh
515520
yarn run --cwd=site format:write:only ../docs/api ../docs/manifest.json ../coderd/apidoc/swagger.json
516521

517-
update-golden-files: cli/testdata/.gen-golden helm/tests/testdata/.gen-golden
522+
update-golden-files: cli/testdata/.gen-golden helm/tests/testdata/.gen-golden scripts/ci-report/testdata/.gen-golden
518523
.PHONY: update-golden-files
519524

520525
cli/testdata/.gen-golden: $(wildcard cli/testdata/*.golden) $(wildcard cli/*.tpl) $(GO_SRC_FILES)
521-
go test ./cli -run=TestCommandHelp -update
526+
go test ./cli -run="Test(CommandHelp|ServerYAML)" -update
522527
touch "$@"
523528

524529
helm/tests/testdata/.gen-golden: $(wildcard helm/tests/testdata/*.golden) $(GO_SRC_FILES)
525530
go test ./helm/tests -run=TestUpdateGoldenFiles -update
526531
touch "$@"
527532

533+
scripts/ci-report/testdata/.gen-golden: $(wildcard scripts/ci-report/testdata/*) $(wildcard scripts/ci-report/*.go)
534+
go test ./scripts/ci-report -run=TestOutputMatchesGoldenFile -update
535+
touch "$@"
536+
528537
# Generate a prettierrc for the site package that uses relative paths for
529538
# overrides. This allows us to share the same prettier config between the
530539
# site and the root of the repo.
@@ -596,6 +605,7 @@ test-postgres: test-clean test-postgres-docker
596605
# more consistent execution.
597606
DB=ci DB_FROM=$(shell go run scripts/migrate-ci/main.go) gotestsum \
598607
--junitfile="gotests.xml" \
608+
--jsonfile="gotests.json" \
599609
--packages="./..." -- \
600610
-covermode=atomic -coverprofile="gotests.coverage" -timeout=20m \
601611
-parallel=4 \

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ coder server --postgres-url <url> --access-url <url>
8484

8585
> <sup>1</sup> For production deployments, set up an external PostgreSQL instance for reliability.
8686
87-
Use `coder --help` to get a list of flags and environment variables. Use our [quickstart guide](https://coder.com/docs/v2/latest/quickstart) for a full walkthrough.
87+
Use `coder --help` to get a list of flags and environment variables. Use our [install guides](https://coder.com/docs/v2/latest/install) for a full walkthrough.
8888

8989
## Documentation
9090

0 commit comments

Comments
 (0)