Skip to content

Commit 6eb728f

Browse files
committed
Merge branch 'main' into mafredri/feat-coderd-add-template-variable-usage-to-insights
2 parents bf218e9 + 336e663 commit 6eb728f

File tree

323 files changed

+16846
-8021
lines changed

Some content is hidden

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

323 files changed

+16846
-8021
lines changed

.gitattributes

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Generated files
22
coderd/apidoc/docs.go linguist-generated=true
3+
docs/api/*.md linguist-generated=true
4+
docs/cli/*.md linguist-generated=true
35
coderd/apidoc/swagger.json linguist-generated=true
46
coderd/database/dump.sql linguist-generated=true
57
peerbroker/proto/*.go linguist-generated=true
@@ -9,3 +11,4 @@ provisionersdk/proto/*.go linguist-generated=true
911
*.tfstate.json linguist-generated=true
1012
*.tfstate.dot linguist-generated=true
1113
*.tfplan.dot linguist-generated=true
14+
site/src/api/typesGenerated.ts linguist-generated=true
+9-3
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
11
name: "Setup Node"
22
description: |
33
Sets up the node environment for tests, builds, etc.
4+
inputs:
5+
directory:
6+
description: |
7+
The directory to run the setup in.
8+
required: false
9+
default: "site"
410
runs:
511
using: "composite"
612
steps:
713
- name: Setup Node
814
uses: buildjet/setup-node@v3
915
with:
10-
node-version: 16.20.1
16+
node-version: 18.17.0
1117
# See https://github.com/actions/setup-node#caching-global-packages-data
1218
cache: "yarn"
13-
cache-dependency-path: "site/yarn.lock"
19+
cache-dependency-path: ${{ inputs.directory }}/yarn.lock
1420
- name: Install node_modules
1521
shell: bash
1622
run: ../scripts/yarn_install.sh
17-
working-directory: site
23+
working-directory: ${{ inputs.directory }}
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: Setup sqlc
2+
description: |
3+
Sets up the sqlc environment for tests, builds, etc.
4+
runs:
5+
using: "composite"
6+
steps:
7+
- name: Setup sqlc
8+
uses: sqlc-dev/setup-sqlc@v3
9+
with:
10+
sqlc-version: "1.19.1"

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ runs:
77
- name: Install Terraform
88
uses: hashicorp/setup-terraform@v2
99
with:
10-
terraform_version: 1.5.2
10+
terraform_version: ~1.5
1111
terraform_wrapper: false

.github/workflows/ci.yaml

+83-6
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ jobs:
3535
ts: ${{ steps.filter.outputs.ts }}
3636
k8s: ${{ steps.filter.outputs.k8s }}
3737
ci: ${{ steps.filter.outputs.ci }}
38+
offlinedocs-only: ${{ steps.filter.outputs.offlinedocs_count == steps.filter.outputs.all_count }}
39+
offlinedocs: ${{ steps.filter.outputs.offlinedocs }}
3840
steps:
3941
- name: Checkout
4042
uses: actions/checkout@v3
@@ -85,7 +87,6 @@ jobs:
8587
ts:
8688
- "site/**"
8789
- "Makefile"
88-
- "offlinedocs/**"
8990
k8s:
9091
- "helm/**"
9192
- "scripts/Dockerfile"
@@ -94,11 +95,16 @@ jobs:
9495
ci:
9596
- ".github/actions/**"
9697
- ".github/workflows/ci.yaml"
98+
offlinedocs:
99+
- "offlinedocs/**"
100+
97101
- id: debug
98102
run: |
99103
echo "${{ toJSON(steps.filter )}}"
100104
101105
lint:
106+
needs: changes
107+
if: needs.changes.outputs.offlinedocs-only == 'false' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main'
102108
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
103109
steps:
104110
- name: Checkout
@@ -164,9 +170,7 @@ jobs:
164170
uses: ./.github/actions/setup-go
165171

166172
- name: Setup sqlc
167-
uses: sqlc-dev/setup-sqlc@v3
168-
with:
169-
sqlc-version: "1.19.1"
173+
uses: ./.github/actions/setup-sqlc
170174

171175
- name: go install tools
172176
run: |
@@ -196,8 +200,10 @@ jobs:
196200
run: ./scripts/check_unstaged.sh
197201

198202
fmt:
203+
needs: changes
204+
if: needs.changes.outputs.offlinedocs-only == 'false' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main'
199205
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
200-
timeout-minutes: 5
206+
timeout-minutes: 7
201207
steps:
202208
- name: Checkout
203209
uses: actions/checkout@v3
@@ -569,10 +575,17 @@ jobs:
569575
with:
570576
buildScriptName: "storybook:build"
571577
exitOnceUploaded: true
578+
# This will prevent CI from failing when Chromatic detects visual changes
579+
exitZeroOnChanges: true
572580
# Chromatic states its fine to make this token public. See:
573581
# https://www.chromatic.com/docs/github-actions#forked-repositories
574582
projectToken: 695c25b6cb65
575583
workingDir: "./site"
584+
# Prevent excessive build runs on minor version changes
585+
skip: "@(renovate/**|dependabot/**)"
586+
# Run TurboSnap to trace file dependencies to related stories
587+
# and tell chromatic to only take snapshots of relevent stories
588+
onlyChanged: true
576589

577590
# This is a separate step for mainline only that auto accepts and changes
578591
# instead of holding CI up. Since we squash/merge, this is defensive to
@@ -588,13 +601,77 @@ jobs:
588601
STORYBOOK: true
589602
with:
590603
autoAcceptChanges: true
604+
# This will prevent CI from failing when Chromatic detects visual changes
605+
exitZeroOnChanges: true
591606
buildScriptName: "storybook:build"
592607
projectToken: 695c25b6cb65
593608
workingDir: "./site"
609+
# Run TurboSnap to trace file dependencies to related stories
610+
# and tell chromatic to only take snapshots of relevent stories
611+
onlyChanged: true
612+
613+
offlinedocs:
614+
name: offlinedocs
615+
needs: changes
616+
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
617+
if: needs.changes.outputs.offlinedocs == 'true' || needs.changes.outputs.ci == 'true'
618+
steps:
619+
- name: Checkout
620+
uses: actions/checkout@v3
621+
with:
622+
fetch-depth: 0
623+
624+
- name: Setup Node
625+
uses: ./.github/actions/setup-node
626+
with:
627+
directory: offlinedocs
628+
629+
- name: Setup Go
630+
uses: ./.github/actions/setup-go
631+
632+
- name: Install go tools
633+
run: |
634+
go install github.com/golang/mock/mockgen@v1.6.0
635+
636+
- name: Setup sqlc
637+
uses: sqlc-dev/setup-sqlc@v3
638+
with:
639+
sqlc-version: "1.19.1"
640+
641+
- name: Install dependencies
642+
run: |
643+
cd offlinedocs
644+
yarn
645+
# Install prettier globally
646+
prettier_version=$(jq -r '.devDependencies.prettier' < package.json)
647+
yarn global add "prettier@${prettier_version}"
648+
649+
- name: Format
650+
run: |
651+
cd offlinedocs
652+
yarn format:check
653+
654+
- name: Lint
655+
run: |
656+
cd offlinedocs
657+
yarn lint
658+
659+
- name: Build
660+
run: |
661+
version="$(./scripts/version.sh)"
662+
make -j build/coder_docs_"$version".tgz
594663
595664
required:
596665
runs-on: ubuntu-latest
597-
needs: [fmt, lint, gen, test-go, test-go-pg, test-go-race, test-js]
666+
needs:
667+
- fmt
668+
- lint
669+
- gen
670+
- test-go
671+
- test-go-pg
672+
- test-go-race
673+
- test-js
674+
- offlinedocs
598675
# Allow this job to run even if the needed jobs fail, are skipped or
599676
# cancelled.
600677
if: always()

.github/workflows/pr-cleanup.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Cleanup PR
1+
name: Cleanup PR deployment and image
22
on:
33
pull_request:
44
types: [closed]
@@ -37,7 +37,7 @@ jobs:
3737
run: |
3838
set -euxo pipefail
3939
mkdir -p ~/.kube
40-
echo "${{ secrets.DELIVERYBOT_KUBECONFIG }}" > ~/.kube/config
40+
echo "${{ secrets.PR_DEPLOYMENTS_KUBECONFIG }}" > ~/.kube/config
4141
export KUBECONFIG=~/.kube/config
4242
4343
- name: Delete helm release

0 commit comments

Comments
 (0)