Skip to content

Commit efe7f93

Browse files
committed
Merge remote-tracking branch 'origin/main' into authzquerier_layer
2 parents 7d0fad4 + 896158c commit efe7f93

File tree

247 files changed

+6676
-3348
lines changed

Some content is hidden

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

247 files changed

+6676
-3348
lines changed

.github/workflows/coder.yaml renamed to .github/workflows/ci.yaml

Lines changed: 61 additions & 132 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: coder
1+
name: ci
22

33
on:
44
push:
@@ -28,109 +28,44 @@ concurrency:
2828
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
2929

3030
jobs:
31-
typos:
32-
runs-on: ubuntu-latest
31+
lint:
32+
runs-on: ${{ github.repository_owner == 'coder' && 'ubuntu-latest-16-cores' || 'ubuntu-latest' }}
3333
steps:
3434
- name: Checkout
35-
uses: actions/checkout@v2
36-
- name: typos-action
37-
uses: crate-ci/typos@v1.13.3
35+
uses: actions/checkout@v3
36+
37+
# Install Go!
38+
- uses: actions/setup-go@v3
39+
with:
40+
go-version: "~1.19"
41+
42+
# Check for any typos!
43+
- name: Check for typos
44+
uses: crate-ci/typos@v1.13.9
3845
with:
3946
config: .github/workflows/typos.toml
40-
- name: Fix Helper
47+
- name: Fix the typos
4148
if: ${{ failure() }}
4249
run: |
4350
echo "::notice:: you can automatically fix typos from your CLI:
4451
cargo install typos-cli
4552
typos -c .github/workflows/typos.toml -w"
4653
47-
changes:
48-
runs-on: ubuntu-latest
49-
outputs:
50-
docs-only: ${{ steps.filter.outputs.docs_count == steps.filter.outputs.all_count }}
51-
sh: ${{ steps.filter.outputs.sh }}
52-
ts: ${{ steps.filter.outputs.ts }}
53-
k8s: ${{ steps.filter.outputs.k8s }}
54-
steps:
55-
- uses: actions/checkout@v3
56-
# For pull requests it's not necessary to checkout the code
57-
- uses: dorny/paths-filter@v2
58-
id: filter
59-
with:
60-
filters: |
61-
all:
62-
- '**'
63-
docs:
64-
- 'docs/**'
65-
# For testing:
66-
# - '.github/**'
67-
sh:
68-
- "**.sh"
69-
ts:
70-
- 'site/**'
71-
k8s:
72-
- 'helm/**'
73-
- Dockerfile
74-
- scripts/helm.sh
75-
- id: debug
76-
run: |
77-
echo "${{ toJSON(steps.filter )}}"
78-
79-
# Debug step
80-
debug-inputs:
81-
needs:
82-
- changes
83-
runs-on: ubuntu-latest
84-
steps:
85-
- id: log
86-
run: |
87-
echo "${{ toJSON(needs) }}"
88-
89-
style-lint-golangci:
90-
name: style/lint/golangci
91-
timeout-minutes: 5
92-
runs-on: ${{ github.repository_owner == 'coder' && 'ubuntu-latest-16-cores' || 'ubuntu-latest' }}
93-
steps:
94-
- uses: actions/checkout@v3
95-
- uses: actions/setup-go@v3
96-
with:
97-
go-version: "~1.19"
98-
- name: golangci-lint
54+
# Check for Go linting errors!
55+
- name: Lint Go
9956
uses: golangci/golangci-lint-action@v3.3.1
10057
with:
10158
version: v1.48.0
10259

103-
check-enterprise-imports:
104-
name: check/enterprise-imports
105-
timeout-minutes: 5
106-
runs-on: ubuntu-latest
107-
steps:
108-
- uses: actions/checkout@v3
109-
- name: Check imports of enterprise code
110-
run: ./scripts/check_enterprise_imports.sh
111-
112-
style-lint-shellcheck:
113-
name: style/lint/shellcheck
114-
timeout-minutes: 5
115-
runs-on: ubuntu-latest
116-
steps:
117-
- uses: actions/checkout@v3
118-
- name: Run ShellCheck
60+
- name: Lint shell scripts
11961
uses: ludeeus/action-shellcheck@1.1.0
12062
env:
12163
SHELLCHECK_OPTS: --external-sources
12264
with:
12365
ignore: node_modules
12466

125-
style-lint-typescript:
126-
name: "style/lint/typescript"
127-
timeout-minutes: 5
128-
runs-on: ubuntu-latest
129-
steps:
130-
- name: Checkout
131-
uses: actions/checkout@v3
132-
133-
- name: Cache Node
67+
# Lint our dashboard!
68+
- name: Cache node_modules
13469
id: cache-node
13570
uses: actions/cache@v3
13671
with:
@@ -140,36 +75,59 @@ jobs:
14075
key: js-${{ runner.os }}-test-${{ hashFiles('**/yarn.lock') }}
14176
restore-keys: |
14277
js-${{ runner.os }}-
143-
14478
- name: Install node_modules
14579
run: ./scripts/yarn_install.sh
146-
147-
- name: "yarn lint"
80+
- name: Lint TypeScript
14881
run: yarn lint
14982
working-directory: site
15083

151-
style-lint-k8s:
152-
name: "style/lint/k8s"
153-
timeout-minutes: 5
154-
needs: changes
155-
if: needs.changes.outputs.k8s == 'true'
156-
runs-on: ubuntu-latest
157-
steps:
158-
- name: Checkout
159-
uses: actions/checkout@v3
160-
84+
# Make sure the Helm chart is linted!
16185
- name: Install helm
16286
uses: azure/setup-helm@v3
16387
with:
16488
version: v3.9.2
165-
166-
- name: cd helm && make lint
89+
- name: Lint Helm chart
16790
run: |
16891
cd helm
16992
make lint
17093
94+
# Ensure AGPL and Enterprise are separated!
95+
- name: Check for AGPL code importing Enterprise...
96+
run: ./scripts/check_enterprise_imports.sh
97+
98+
changes:
99+
runs-on: ubuntu-latest
100+
outputs:
101+
docs-only: ${{ steps.filter.outputs.docs_count == steps.filter.outputs.all_count }}
102+
sh: ${{ steps.filter.outputs.sh }}
103+
ts: ${{ steps.filter.outputs.ts }}
104+
k8s: ${{ steps.filter.outputs.k8s }}
105+
steps:
106+
- uses: actions/checkout@v3
107+
# For pull requests it's not necessary to checkout the code
108+
- uses: dorny/paths-filter@v2
109+
id: filter
110+
with:
111+
filters: |
112+
all:
113+
- '**'
114+
docs:
115+
- 'docs/**'
116+
# For testing:
117+
# - '.github/**'
118+
sh:
119+
- "**.sh"
120+
ts:
121+
- 'site/**'
122+
k8s:
123+
- 'helm/**'
124+
- Dockerfile
125+
- scripts/helm.sh
126+
- id: debug
127+
run: |
128+
echo "${{ toJSON(steps.filter )}}"
129+
171130
gen:
172-
name: "style/gen"
173131
timeout-minutes: 8
174132
runs-on: ${{ github.repository_owner == 'coder' && 'ubuntu-latest-16-cores' || 'ubuntu-latest' }}
175133
needs: changes
@@ -243,8 +201,7 @@ jobs:
243201
- name: Check for unstaged files
244202
run: ./scripts/check_unstaged.sh
245203

246-
style-fmt:
247-
name: "style/fmt"
204+
fmt:
248205
runs-on: ubuntu-latest
249206
timeout-minutes: 5
250207
steps:
@@ -280,7 +237,6 @@ jobs:
280237
run: ./scripts/check_unstaged.sh
281238

282239
test-go:
283-
name: "test/go"
284240
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 }}
285241
timeout-minutes: 20
286242
strategy:
@@ -365,8 +321,7 @@ jobs:
365321
files: ./gotests.coverage
366322
flags: unittest-go-${{ matrix.os }}
367323

368-
test-go-postgres:
369-
name: "test/go/postgres"
324+
test-go-psql:
370325
runs-on: ${{ github.repository_owner == 'coder' && 'ubuntu-latest-16-cores' || 'ubuntu-latest' }}
371326
# This timeout must be greater than the timeout set by `go test` in
372327
# `make test-postgres` to ensure we receive a trace of running
@@ -532,7 +487,6 @@ jobs:
532487
retention-days: 7
533488

534489
test-js:
535-
name: "test/js"
536490
runs-on: ${{ github.repository_owner == 'coder' && 'ubuntu-latest-16-cores' || 'ubuntu-latest' }}
537491
timeout-minutes: 20
538492
steps:
@@ -572,16 +526,11 @@ jobs:
572526
flags: unittest-js
573527

574528
test-e2e:
575-
name: "test/e2e/${{ matrix.os }}"
576529
needs:
577530
- changes
578531
if: needs.changes.outputs.docs-only == 'false'
579-
runs-on: ${{ matrix.os }}
532+
runs-on: ${{ github.repository_owner == 'coder' && 'ubuntu-latest-16-cores' || 'ubuntu-latest' }}
580533
timeout-minutes: 20
581-
strategy:
582-
matrix:
583-
os:
584-
- ubuntu-latest
585534
steps:
586535
- uses: actions/checkout@v3
587536

@@ -693,23 +642,3 @@ jobs:
693642
buildScriptName: "storybook:build"
694643
projectToken: 695c25b6cb65
695644
workingDir: "./site"
696-
markdown-link-check:
697-
runs-on: ubuntu-latest
698-
steps:
699-
- uses: actions/checkout@master
700-
# For the main branch:
701-
- if: github.ref == 'refs/heads/main' && !github.event.pull_request.head.repo.fork
702-
uses: gaurav-nelson/github-action-markdown-link-check@v1
703-
with:
704-
use-quiet-mode: yes
705-
use-verbose-mode: yes
706-
config-file: .github/workflows/mlc_config.json
707-
# For pull requests:
708-
- if: github.ref != 'refs/heads/main' || github.event.pull_request.head.repo.fork
709-
uses: gaurav-nelson/github-action-markdown-link-check@v1
710-
with:
711-
use-quiet-mode: yes
712-
use-verbose-mode: yes
713-
check-modified-files-only: yes
714-
base-branch: main
715-
config-file: .github/workflows/mlc_config.json

.github/workflows/cla.yaml

Lines changed: 0 additions & 26 deletions
This file was deleted.

.github/workflows/pr.yaml renamed to .github/workflows/contrib.yaml

Lines changed: 41 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1-
name: Pull Request
1+
name: contrib
22

33
on:
4+
issue_comment:
5+
types: [created]
46
pull_request_target:
57
types:
8+
- opened
9+
- closed
10+
- synchronize
611
- labeled
712
- unlabeled
813
- opened
@@ -13,23 +18,52 @@ on:
1318
concurrency: pr-${{ github.ref }}
1419

1520
jobs:
16-
lint-title:
17-
name: Lint title
21+
# Dependabot is annoying, but this makes it a bit less so.
22+
auto-approve:
23+
runs-on: ubuntu-latest
24+
if: github.event_name == 'pull_request_target'
25+
permissions:
26+
pull-requests: write
27+
steps:
28+
- uses: hmarr/auto-approve-action@v3
29+
if: github.actor == 'dependabot[bot]'
30+
31+
cla:
32+
runs-on: ubuntu-latest
33+
steps:
34+
- name: cla
35+
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
36+
uses: contributor-assistant/github-action@v2.2.1
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
# the below token should have repo scope and must be manually added by you in the repository's secret
40+
PERSONAL_ACCESS_TOKEN: ${{ secrets.CDRCOMMUNITY_GITHUB_TOKEN }}
41+
with:
42+
remote-organization-name: "coder"
43+
remote-repository-name: "cla"
44+
path-to-signatures: "v2022-09-04/signatures.json"
45+
path-to-document: "https://github.com/coder/cla/blob/main/README.md"
46+
# branch should not be protected
47+
branch: "main"
48+
allowlist: dependabot*
49+
50+
title:
1851
runs-on: ubuntu-latest
52+
if: github.event_name == 'pull_request_target'
1953
steps:
20-
- uses: amannn/action-semantic-pull-request@v5
54+
- name: Validate PR title
55+
uses: amannn/action-semantic-pull-request@v5
2156
env:
2257
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2358
with:
2459
requireScope: false
2560

2661
release-labels:
27-
name: Release labels
2862
runs-on: ubuntu-latest
2963
# Depend on lint so that title is Conventional Commits-compatible.
30-
needs: [lint-title]
64+
needs: [title]
3165
# Skip tagging for draft PRs.
32-
if: ${{ success() && !github.event.pull_request.draft }}
66+
if: ${{ github.event_name == 'pull_request_target' && success() && !github.event.pull_request.draft }}
3367
steps:
3468
- uses: actions/github-script@v6
3569
with:

0 commit comments

Comments
 (0)