Skip to content

Commit d220266

Browse files
committed
Merge branch 'main' into dean/proxy-derp-map
2 parents 403eac5 + c3b8898 commit d220266

File tree

276 files changed

+19236
-4076
lines changed

Some content is hidden

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

276 files changed

+19236
-4076
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ runs:
1313
cache-dependency-path: "site/yarn.lock"
1414
- name: Install node_modules
1515
shell: bash
16-
run: ./scripts/yarn_install.sh
16+
run: ../scripts/yarn_install.sh
17+
working-directory: site

.github/dependabot.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,28 @@ updates:
123123
- "@swc/jest"
124124
- "@types/jest"
125125

126+
- package-ecosystem: "npm"
127+
directory: "/offlinedocs/"
128+
schedule:
129+
interval: "monthly"
130+
time: "06:00"
131+
timezone: "America/Chicago"
132+
reviewers:
133+
- "coder/ts"
134+
commit-message:
135+
prefix: "chore"
136+
labels: []
137+
ignore:
138+
# Ignore patch updates for all dependencies
139+
- dependency-name: "*"
140+
update-types:
141+
- version-update:semver-patch
142+
# Ignore major updates to Node.js types, because they need to
143+
# correspond to the Node.js engine version
144+
- dependency-name: "@types/node"
145+
update-types:
146+
- version-update:semver-major
147+
126148
# Update dogfood.
127149
- package-ecosystem: "docker"
128150
directory: "/dogfood/"

.github/workflows/ci.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ jobs:
8585
ts:
8686
- "site/**"
8787
- "Makefile"
88+
- "offlinedocs/**"
8889
k8s:
8990
- "helm/**"
9091
- "scripts/Dockerfile"
@@ -126,7 +127,7 @@ jobs:
126127
127128
# Check for any typos
128129
- name: Check for typos
129-
uses: crate-ci/typos@v1.16.0
130+
uses: crate-ci/typos@v1.16.1
130131
with:
131132
config: .github/workflows/typos.toml
132133

@@ -240,6 +241,7 @@ jobs:
240241
if: needs.changes.outputs.go == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main'
241242
timeout-minutes: 20
242243
strategy:
244+
fail-fast: false
243245
matrix:
244246
os:
245247
- ubuntu-latest
@@ -543,7 +545,7 @@ jobs:
543545
# REMARK: this is only used to build storybook and deploy it to Chromatic.
544546
runs-on: ubuntu-latest
545547
needs: changes
546-
if: needs.changes.outputs.ts == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main'
548+
if: needs.changes.outputs.ts == 'true' || needs.changes.outputs.ci == 'true'
547549
steps:
548550
- name: Checkout
549551
uses: actions/checkout@v3

.github/workflows/dogfood.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,22 +51,30 @@ jobs:
5151
tags: "codercom/oss-dogfood:${{ steps.docker-tag-name.outputs.tag }},codercom/oss-dogfood:latest"
5252
cache-from: type=registry,ref=codercom/oss-dogfood:latest
5353
cache-to: type=inline
54+
5455
deploy_template:
5556
needs: deploy_image
5657
runs-on: ubuntu-latest
5758
steps:
5859
- name: Checkout
5960
uses: actions/checkout@v3
61+
6062
- name: Get short commit SHA
6163
id: vars
6264
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
65+
66+
- name: Get latest commit title
67+
id: message
68+
run: echo "pr_title=$(git log --format=%s -n 1 ${{ github.sha }})" >> $GITHUB_OUTPUT
69+
6370
- name: "Get latest Coder binary from the server"
6471
run: |
6572
curl -fsSL "https://dev.coder.com/bin/coder-linux-amd64" -o "./coder"
6673
chmod +x "./coder"
74+
6775
- name: "Push template"
6876
run: |
69-
./coder templates push $CODER_TEMPLATE_NAME --directory $CODER_TEMPLATE_DIR --yes --name=$CODER_TEMPLATE_VERSION
77+
./coder templates push $CODER_TEMPLATE_NAME --directory $CODER_TEMPLATE_DIR --yes --name=$CODER_TEMPLATE_VERSION --message="$CODER_TEMPLATE_MESSAGE"
7078
env:
7179
# Consumed by Coder CLI
7280
CODER_URL: https://dev.coder.com
@@ -75,3 +83,4 @@ jobs:
7583
CODER_TEMPLATE_NAME: ${{ secrets.CODER_TEMPLATE_NAME }}
7684
CODER_TEMPLATE_VERSION: ${{ steps.vars.outputs.sha_short }}
7785
CODER_TEMPLATE_DIR: ./dogfood
86+
CODER_TEMPLATE_MESSAGE: ${{ steps.message.outputs.pr_title }}

.github/workflows/pr-deploy.yaml

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
name: Deploy PR
33
on:
44
issue_comment:
5+
types: [created, edited]
56
workflow_dispatch:
67
inputs:
78
pr_number:
@@ -17,12 +18,12 @@ permissions:
1718
pull-requests: write
1819

1920
concurrency:
20-
group: ${{ github.workflow }}-${{ github.ref }}
21-
cancel-in-progress: true
21+
group: ${{ github.workflow }}-${{ github.event.issue.number || github.run_id }}
22+
cancel-in-progress: false
2223

2324
jobs:
2425
pr_commented:
25-
if: github.event_name == 'issue_comment' && contains(github.event.comment.body, '/deploy-pr') && github.event.comment.author_association == 'MEMBER' || github.event_name == 'workflow_dispatch'
26+
if: (github.event_name == 'issue_comment' && contains(github.event.comment.body, '/deploy-pr') && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'COLLABORATOR' || github.event.comment.author_association == 'OWNER')) || github.event_name == 'workflow_dispatch'
2627
outputs:
2728
PR_NUMBER: ${{ steps.pr_number.outputs.PR_NUMBER }}
2829
PR_TITLE: ${{ steps.pr_number.outputs.PR_TITLE }}
@@ -58,23 +59,6 @@ jobs:
5859
CODER_BASE_IMAGE_TAG: ghcr.io/coder/coder-preview-base:pr${{ steps.pr_number.outputs.PR_NUMBER }}
5960
CODER_IMAGE_TAG: ghcr.io/coder/coder-preview:pr${{ steps.pr_number.outputs.PR_NUMBER }}
6061

61-
- name: Find Deploy Comment
62-
if: github.event_name == 'issue_comment'
63-
uses: peter-evans/find-comment@v2
64-
id: fco
65-
with:
66-
issue-number: ${{ steps.pr_number.outputs.PR_NUMBER }}
67-
comment-author: "github-actions[bot]"
68-
body-includes: /deploy-pr
69-
70-
- name: React with Rocket
71-
if: github.event_name == 'issue_comment'
72-
id: comment_ido
73-
uses: peter-evans/create-or-update-comment@v3
74-
with:
75-
comment-id: ${{ steps.fco.outputs.comment-id }}
76-
reactions: rocket
77-
7862
- name: Find Comment
7963
uses: peter-evans/find-comment@v2
8064
id: fc
@@ -154,32 +138,33 @@ jobs:
154138
- name: Checkout
155139
uses: actions/checkout@v3
156140

157-
- name: "Set up kubeconfig"
141+
- name: Set up kubeconfig
158142
run: |
159143
set -euxo pipefail
160144
mkdir -p ~/.kube
161145
echo "${{ secrets.DELIVERYBOT_KUBECONFIG }}" > ~/.kube/config
162146
export KUBECONFIG=~/.kube/config
163147
164-
- name: "Create PR namespace"
148+
- name: Create PR namespace
165149
run: |
166150
set -euxo pipefail
167151
# try to delete the namespace, but don't fail if it doesn't exist
168152
kubectl delete namespace "pr${{ env.PR_NUMBER }}" || true
169153
kubectl create namespace "pr${{ env.PR_NUMBER }}"
170154
171-
- name: "Install Helm chart"
155+
- name: Install Helm chart
172156
run: |
173157
helm upgrade --install pr${{ env.PR_NUMBER }} ./helm \
174158
--namespace "pr${{ env.PR_NUMBER }}" \
175159
--set coder.image.repo=${{ env.REPO }} \
176160
--set coder.image.tag=pr${{ env.PR_NUMBER }} \
177161
--set coder.service.type=ClusterIP \
162+
--set coder.serviceAccount.enableDeployments=true \
178163
--set coder.env[0].name=CODER_ACCESS_URL \
179164
--set coder.env[0].value="" \
180165
--force
181166
182-
- name: "Get deployment URL"
167+
- name: Get deployment URL
183168
id: deployment_url
184169
run: |
185170
set -euo pipefail
@@ -189,6 +174,13 @@ jobs:
189174
echo "::add-mask::$CODER_ACCESS_URL"
190175
echo "CODER_ACCESS_URL=$CODER_ACCESS_URL" >> $GITHUB_OUTPUT
191176
177+
- name: Install coder-logstream-kube
178+
run: |
179+
helm repo add coder-logstream-kube https://helm.coder.com/logstream-kube
180+
helm install coder-logstream-kube coder-logstream-kube/coder-logstream-kube \
181+
--namespace "pr${{ env.PR_NUMBER }}" \
182+
--set url="${{ steps.deployment_url.outputs.CODER_ACCESS_URL }}"
183+
192184
- name: Send Slack notification
193185
run: |
194186
curl -s -o /dev/null -X POST -H 'Content-type: application/json' \

.github/workflows/release.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
set -euo pipefail
7777
ref=HEAD
7878
old_version="$(git describe --abbrev=0 "$ref^1")"
79-
version="$(./scripts/version.sh)"
79+
version="v$(./scripts/version.sh)"
8080
8181
# Generate notes.
8282
release_notes_file="$(mktemp -t release_notes.XXXXXX)"
@@ -259,6 +259,11 @@ jobs:
259259
env:
260260
CODER_BASE_IMAGE_TAG: ${{ steps.image-base-tag.outputs.tag }}
261261

262+
- name: Generate offline docs
263+
run: |
264+
version="$(./scripts/version.sh)"
265+
make -j build/coder_docs_"$version".tgz
266+
262267
- name: ls build
263268
run: ls -lh build
264269

.prettierrc.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
printWidth: 80
55
semi: false
66
trailingComma: all
7+
useTabs: false
8+
tabWidth: 2
79
overrides:
810
- files:
911
- README.md

Makefile

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,10 +356,18 @@ build/coder_helm_$(VERSION).tgz:
356356
--output "$@"
357357

358358
site/out/index.html: site/package.json $(shell find ./site $(FIND_EXCLUSIONS) -type f \( -name '*.ts' -o -name '*.tsx' \))
359-
./scripts/yarn_install.sh
360359
cd site
360+
../scripts/yarn_install.sh
361361
yarn build
362362

363+
offlinedocs/out/index.html: $(shell find ./offlinedocs $(FIND_EXCLUSIONS) -type f) $(shell find ./docs $(FIND_EXCLUSIONS) -type f | sed 's: :\\ :g')
364+
cd offlinedocs
365+
../scripts/yarn_install.sh
366+
yarn export
367+
368+
build/coder_docs_$(VERSION).tgz: offlinedocs/out/index.html
369+
tar -czf "$@" -C offlinedocs/out .
370+
363371
install: build/coder_$(VERSION)_$(GOOS)_$(GOARCH)$(GOOS_BIN_EXT)
364372
install_dir="$$(go env GOPATH)/bin"
365373
output_file="$${install_dir}/coder$(GOOS_BIN_EXT)"
@@ -402,9 +410,14 @@ else
402410
endif
403411
.PHONY: fmt/shfmt
404412

405-
lint: lint/shellcheck lint/go lint/ts lint/helm
413+
lint: lint/shellcheck lint/go lint/ts lint/helm lint/site-icons
406414
.PHONY: lint
407415

416+
lint/site-icons:
417+
./scripts/check_site_icons.sh
418+
419+
.PHONY: lint/site-icons
420+
408421
lint/ts:
409422
cd site
410423
yarn && yarn lint

0 commit comments

Comments
 (0)