Skip to content

Commit b91f573

Browse files
authored
Merge branch 'main' into matifali/kubestream-docs
2 parents 03e5774 + 75265ec commit b91f573

File tree

12 files changed

+1160
-803
lines changed

12 files changed

+1160
-803
lines changed
Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
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:
@@ -10,8 +16,8 @@ runs:
1016
node-version: 16.20.1
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 }}
Lines changed: 10 additions & 0 deletions
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/workflows/ci.yaml

Lines changed: 70 additions & 5 deletions
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,6 +200,8 @@ 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' }}
200206
timeout-minutes: 5
201207
steps:
@@ -592,9 +598,68 @@ jobs:
592598
projectToken: 695c25b6cb65
593599
workingDir: "./site"
594600

601+
offlinedocs:
602+
name: offlinedocs
603+
needs: changes
604+
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
605+
if: needs.changes.outputs.offlinedocs == 'true' || needs.changes.outputs.ci == 'true'
606+
steps:
607+
- name: Checkout
608+
uses: actions/checkout@v3
609+
with:
610+
fetch-depth: 0
611+
612+
- name: Setup Node
613+
uses: ./.github/actions/setup-node
614+
with:
615+
directory: offlinedocs
616+
617+
- name: Setup Go
618+
uses: ./.github/actions/setup-go
619+
620+
- name: Install go tools
621+
run: |
622+
go install github.com/golang/mock/mockgen@v1.6.0
623+
624+
- name: Setup sqlc
625+
uses: sqlc-dev/setup-sqlc@v3
626+
with:
627+
sqlc-version: "1.19.1"
628+
629+
- name: Install dependencies
630+
run: |
631+
cd offlinedocs
632+
yarn
633+
# Install prettier globally
634+
prettier_version=$(jq -r '.devDependencies.prettier' < package.json)
635+
yarn global add "prettier@${prettier_version}"
636+
637+
- name: Format
638+
run: |
639+
cd offlinedocs
640+
yarn format:check
641+
642+
- name: Lint
643+
run: |
644+
cd offlinedocs
645+
yarn lint
646+
647+
- name: Build
648+
run: |
649+
version="$(./scripts/version.sh)"
650+
make -j build/coder_docs_"$version".tgz
651+
595652
required:
596653
runs-on: ubuntu-latest
597-
needs: [fmt, lint, gen, test-go, test-go-pg, test-go-race, test-js]
654+
needs:
655+
- fmt
656+
- lint
657+
- gen
658+
- test-go
659+
- test-go-pg
660+
- test-go-race
661+
- test-js
662+
- offlinedocs
598663
# Allow this job to run even if the needed jobs fail, are skipped or
599664
# cancelled.
600665
if: always()

.github/workflows/pr-deploy.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,7 @@ jobs:
9898
uses: ./.github/actions/setup-go
9999

100100
- name: Setup sqlc
101-
uses: sqlc-dev/setup-sqlc@v3
102-
with:
103-
sqlc-version: "1.19.1"
101+
uses: ./.github/actions/setup-sqlc
104102

105103
- name: GHCR Login
106104
uses: docker/login-action@v2

.github/workflows/security.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,7 @@ jobs:
8181
js-${{ runner.os }}-
8282
8383
- name: Setup sqlc
84-
uses: sqlc-dev/setup-sqlc@v3
85-
with:
86-
sqlc-version: "1.19.1"
84+
uses: ./.github/actions/setup-sqlc
8785

8886
- name: Install yq
8987
run: go run github.com/mikefarah/yq/v4@v4.30.6

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,9 +410,14 @@ else
410410
endif
411411
.PHONY: fmt/shfmt
412412

413-
lint: lint/shellcheck lint/go lint/ts lint/helm
413+
lint: lint/shellcheck lint/go lint/ts lint/helm lint/site-icons
414414
.PHONY: lint
415415

416+
lint/site-icons:
417+
./scripts/check_site_icons.sh
418+
419+
.PHONY: lint/site-icons
420+
416421
lint/ts:
417422
cd site
418423
yarn && yarn lint

coderd/unhanger/detector.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,6 @@ func (d *Detector) Start() {
140140
if stats.Error != nil && !xerrors.As(stats.Error, &acquireLockError{}) {
141141
d.log.Warn(d.ctx, "error running workspace build hang detector once", slog.Error(stats.Error))
142142
}
143-
if len(stats.TerminatedJobIDs) != 0 {
144-
d.log.Warn(d.ctx, "detected (and terminated) hung provisioner jobs", slog.F("job_ids", stats.TerminatedJobIDs))
145-
}
146143
if d.stats != nil {
147144
select {
148145
case <-d.ctx.Done():
@@ -251,7 +248,10 @@ func unhangJob(ctx context.Context, log slog.Logger, db database.Store, pub pubs
251248
}
252249
}
253250

254-
log.Info(ctx, "detected hung (>5m) provisioner job, forcefully terminating")
251+
log.Warn(
252+
ctx, "detected hung provisioner job, forcefully terminating",
253+
"threshold", HungJobDuration,
254+
)
255255

256256
// First, get the latest logs from the build so we can make sure
257257
// our messages are in the latest stage.

docs/admin/automation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ curl https://coder.example.com/api/v2/workspaces?q=owner:me \
3030

3131
## Documentation
3232

33-
We publish an [API reference](../api/index.md) in our documentation. You can also enable a [Swagger endpoint](../cli/server#--swagger-enable) on your Coder deployment.
33+
We publish an [API reference](../api/index.md) in our documentation. You can also enable a [Swagger endpoint](../cli/server.md#--swagger-enable) on your Coder deployment.
3434

3535
## Use cases
3636

offlinedocs/package.json

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@
77
"build": "next build",
88
"start": "next start",
99
"export": "yarn copy-images && next build && next export",
10-
"copy-images": "sh ./scripts/copyImages.sh"
10+
"copy-images": "sh ./scripts/copyImages.sh",
11+
"lint": "yarn run lint:types",
12+
"lint:fix": "FIX=true yarn lint",
13+
"lint:types": "tsc --noEmit",
14+
"format:check": "prettier --cache --check './**/*.{css,html,js,json,jsx,md,ts,tsx,yaml,yml}'",
15+
"format:write": "prettier --cache --write './**/*.{css,html,js,json,jsx,md,ts,tsx,yaml,yml}'"
1116
},
1217
"dependencies": {
1318
"@chakra-ui/react": "2.8.0",
@@ -16,22 +21,25 @@
1621
"archiver": "5.3.1",
1722
"framer-motion": "6",
1823
"front-matter": "4.0.2",
19-
"fs-extra": "10.1.0",
24+
"fs-extra": "11.1.1",
2025
"lodash": "4.17.21",
21-
"next": "12.1.6",
26+
"next": "13.4.12",
2227
"react": "18.2.0",
2328
"react-dom": "18.2.0",
24-
"react-icons": "4.4.0",
29+
"react-icons": "4.10.1",
2530
"react-markdown": "8.0.3",
2631
"rehype-raw": "6.1.1",
2732
"remark-gfm": "3.0.1"
2833
},
2934
"devDependencies": {
35+
"@react-native-community/eslint-config": "^3.2.0",
36+
"@react-native-community/eslint-plugin": "^1.3.0",
3037
"@types/node": "18.0.0",
31-
"@types/react": "18.0.14",
32-
"@types/react-dom": "18.0.5",
38+
"@types/react": "18.2.15",
39+
"@types/react-dom": "18.2.7",
3340
"eslint": "8.45.0",
3441
"eslint-config-next": "13.4.10",
42+
"prettier": "3.0.0",
3543
"typescript": "4.7.3"
3644
}
3745
}

0 commit comments

Comments
 (0)