Skip to content

Commit 2f3f83b

Browse files
authored
Merge branch 'cdr:main' into im-coder-lg-code-server-coder-diff
2 parents 217beba + 976891a commit 2f3f83b

File tree

5,338 files changed

+5227
-1453239
lines changed

Some content is hidden

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

5,338 files changed

+5227
-1453239
lines changed

.editorconfig

+5
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,9 @@ root = true
33
[*]
44
indent_style = space
55
trim_trailing_whitespace = true
6+
7+
# The indent size used in the `package.json` file cannot be changed
8+
# https://github.com/npm/npm/pull/3180#issuecomment-16336516
9+
[{*.yml,*.yaml,package.json}]
10+
indent_style = space
611
indent_size = 2

.github/CODEOWNERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
* @cdr/code-server-reviewers
22

3-
ci/helm-chart @Matthew-Beckett @alexgorbatchev
3+
ci/helm-chart/ @Matthew-Beckett @alexgorbatchev

.github/codecov.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ coverage:
66
precision: 2
77
round: down
88
range: "40...70"
9-
patch: off
9+
status:
10+
patch: off
1011

1112
parsers:
1213
gcov:

.github/codeql-config.yml

-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
11
name: "code-server CodeQL config"
2-
3-
paths-ignore:
4-
- lib/vscode

.github/lock.yml

-37
This file was deleted.

.github/ranger.yml

-4
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ labels:
1515
"squash when passing": merge
1616
"rebase when passing": merge
1717
"merge when passing": merge
18-
stale:
19-
action: close
20-
delay: 7 days
21-
comment: "⚠️ This issue has been marked stale and will automatically be closed in $DELAY."
2218
"new contributor":
2319
action: comment
2420
delay: 5s

.github/workflows/ci.yaml

+55-40
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ jobs:
1919
name: Pre-build checks
2020
runs-on: ubuntu-latest
2121
timeout-minutes: 15
22-
env:
23-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
2422
steps:
2523
- name: Checkout repo
2624
uses: actions/checkout@v2
@@ -33,17 +31,21 @@ jobs:
3331
- name: Install helm
3432
uses: azure/[email protected]
3533

36-
- name: Fetch dependencies from cache
37-
id: cache-yarn
38-
uses: actions/cache@v2
39-
with:
40-
path: "**/node_modules"
41-
key: yarn-build-${{ hashFiles('**/yarn.lock') }}
42-
restore-keys: |
43-
yarn-build-
34+
# NOTE@jsjoeio
35+
# disabling this until we can audit the build process
36+
# and the usefulness of this step
37+
# See: https://github.com/cdr/code-server/issues/4287
38+
# - name: Fetch dependencies from cache
39+
# id: cache-yarn
40+
# uses: actions/cache@v2
41+
# with:
42+
# path: "**/node_modules"
43+
# key: yarn-build-${{ hashFiles('**/yarn.lock') }}
44+
# restore-keys: |
45+
# yarn-build-
4446

4547
- name: Install dependencies
46-
if: steps.cache-yarn.outputs.cache-hit != 'true'
48+
# if: steps.cache-yarn.outputs.cache-hit != 'true'
4749
run: yarn --frozen-lockfile
4850

4951
- name: Run yarn fmt
@@ -54,14 +56,6 @@ jobs:
5456
run: yarn lint
5557
if: success()
5658

57-
- name: Run code-server unit tests
58-
run: yarn test:unit
59-
if: success()
60-
61-
- name: Upload coverage report to Codecov
62-
run: yarn coverage
63-
if: success()
64-
6559
audit-ci:
6660
name: Run audit-ci
6761
needs: prebuild
@@ -98,6 +92,8 @@ jobs:
9892
needs: prebuild
9993
runs-on: ubuntu-latest
10094
timeout-minutes: 30
95+
env:
96+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
10197
steps:
10298
- uses: actions/checkout@v2
10399
with:
@@ -108,48 +104,63 @@ jobs:
108104
with:
109105
node-version: "14"
110106

111-
- name: Fetch dependencies from cache
112-
id: cache-yarn
113-
uses: actions/cache@v2
114-
with:
115-
path: "**/node_modules"
116-
key: yarn-build-${{ hashFiles('**/yarn.lock') }}
117-
restore-keys: |
118-
yarn-build-
107+
# TODO@Teffen investigate why this omits code-oss-dev/node_modules
108+
# - name: Fetch dependencies from cache
109+
# id: cache-yarn
110+
# uses: actions/cache@v2
111+
# with:
112+
# path: |
113+
# "**/node_modules"
114+
# "**/vendor/modules"
115+
# "**/vendor/modules/code-oss-dev/node_modules"
116+
# key: yarn-build-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/vendor/yarn.lock') }}
117+
# restore-keys: |
118+
# yarn-build-
119119

120120
- name: Install dependencies
121-
if: steps.cache-yarn.outputs.cache-hit != 'true'
121+
# if: steps.cache-yarn.outputs.cache-hit != 'true'
122122
run: yarn --frozen-lockfile
123123

124124
- name: Build code-server
125125
run: yarn build
126126

127-
# Parse the hash of the latest commit inside lib/vscode
127+
# Parse the hash of the latest commit inside vendor/modules/code-oss-dev
128128
# use this to avoid rebuilding it if nothing changed
129129
# How it works: the `git log` command fetches the hash of the last commit
130-
# that changed a file inside `lib/vscode`. If a commit changes any file in there,
130+
# that changed a file inside `vendor/modules/code-oss-dev`. If a commit changes any file in there,
131131
# the hash returned will change, and we rebuild vscode. If the hash did not change,
132132
# (for example, a change to `src/` or `docs/`), we reuse the same build as last time.
133133
# This saves a lot of time in CI, as compiling VSCode can take anywhere from 5-10 minutes.
134-
- name: Get latest lib/vscode rev
134+
- name: Get latest vendor/modules/code-oss-dev rev
135135
id: vscode-rev
136-
run: echo "::set-output name=rev::$(git log -1 --format='%H' ./lib/vscode)"
136+
run: echo "::set-output name=rev::$(jq -r '.devDependencies["code-oss-dev"]' vendor/package.json | sed -r 's|.*#(.*)$|\1|')"
137137

138138
- name: Attempt to fetch vscode build from cache
139139
id: cache-vscode
140140
uses: actions/cache@v2
141141
with:
142142
path: |
143-
lib/vscode/.build
144-
lib/vscode/out-build
145-
lib/vscode/out-vscode
146-
lib/vscode/out-vscode-min
147-
key: vscode-build-${{ steps.vscode-rev.outputs.rev }}
143+
vendor/modules/code-oss-dev/.build
144+
vendor/modules/code-oss-dev/out-build
145+
vendor/modules/code-oss-dev/out-vscode-server
146+
vendor/modules/code-oss-dev/out-vscode-server-min
147+
key: vscode-server-build-${{ steps.vscode-rev.outputs.rev }}
148148

149149
- name: Build vscode
150150
if: steps.cache-vscode.outputs.cache-hit != 'true'
151151
run: yarn build:vscode
152152

153+
# Our code imports code from VS Code's `out` directory meaning VS Code
154+
# must be built before running these tests.
155+
# TODO: Move to its own step?
156+
- name: Run code-server unit tests
157+
run: yarn test:unit
158+
if: success()
159+
160+
- name: Upload coverage report to Codecov
161+
run: yarn coverage
162+
if: success()
163+
153164
# The release package does not contain any native modules
154165
# and is neutral to architecture/os/libc version.
155166
- name: Create release package
@@ -240,10 +251,14 @@ jobs:
240251
# so we just build with "native"/x86_64 node, then download arm64/armv7l node
241252
# and then put it in our release. We can't smoke test the cross build this way,
242253
# but this means we don't need to maintain a self-hosted runner!
254+
255+
# NOTE@jsjoeio:
256+
# We used to use 16.04 until GitHub deprecated it on September 20, 2021
257+
# See here: https://github.com/actions/virtual-environments/pull/3862/files
243258
package-linux-cross:
244259
name: Linux cross-compile builds
245260
needs: build
246-
runs-on: ubuntu-16.04
261+
runs-on: ubuntu-18.04
247262
timeout-minutes: 15
248263
strategy:
249264
matrix:
@@ -275,7 +290,7 @@ jobs:
275290
echo "$HOME/.local/bin" >> $GITHUB_PATH
276291
277292
- name: Install cross-compiler
278-
run: sudo apt install $PACKAGE
293+
run: sudo apt update && sudo apt install $PACKAGE
279294
env:
280295
PACKAGE: ${{ format('g++-{0}', matrix.prefix) }}
281296

@@ -420,7 +435,7 @@ jobs:
420435
uses: actions/checkout@v2
421436
- name: Run Trivy vulnerability scanner in repo mode
422437
#Commit SHA for v0.0.17
423-
uses: aquasecurity/trivy-action@8eccb5539730451af599c84f444c6d6cf0fc2bb0
438+
uses: aquasecurity/trivy-action@1ccef265f594a7555a720f623a461a3d69b45bf7
424439
with:
425440
scan-type: "fs"
426441
scan-ref: "."

.github/workflows/docs-preview.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
- name: Install Node.js
3838
uses: actions/setup-node@v2
3939
with:
40-
node-version: 12.x
40+
node-version: 14
4141

4242
- name: Cache Node Modules
4343
uses: actions/cache@v2

.github/workflows/installer.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ on:
55
branches:
66
- main
77
paths:
8-
- "installer.sh"
8+
- "install.sh"
99
pull_request:
1010
branches:
1111
- main
12+
paths:
13+
- "install.sh"
1214

1315
jobs:
1416
ubuntu:

.github/workflows/scripts.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,14 @@ on:
55
branches:
66
- main
77
paths:
8-
- "installer.sh"
8+
- "**.sh"
9+
- "**.bats"
910
pull_request:
1011
branches:
1112
- main
13+
paths:
14+
- "**.sh"
15+
- "**.bats"
1216

1317
jobs:
1418
test:

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ release-packages/
88
release-gcp/
99
release-images/
1010
node_modules
11-
/lib/vscode/node_modules.asar
11+
vendor/modules
1212
node-*
1313
/plugins
1414
/lib/coder-cloud-agent
15+
/lib/linkup
1516
.home
1617
coverage
1718
**/.DS_Store

.prettierrc.yaml

+13
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,16 @@ printWidth: 120
22
semi: false
33
trailingComma: all
44
arrowParens: always
5+
singleQuote: false
6+
useTabs: false
7+
8+
overrides:
9+
# Attempt to keep VScode's existing code style intact.
10+
- files: "vendor/modules/code-oss-dev/**/*.ts"
11+
options:
12+
# No limit defined upstream.
13+
printWidth: 10000
14+
semi: true
15+
singleQuote: true
16+
useTabs: true
17+
arrowParens: avoid

.tours/contributing.tour

+2-2
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,9 @@
143143
"description": "Static images and the manifest live here in `src/browser/media` (see the explorer)."
144144
},
145145
{
146-
"directory": "lib/vscode",
146+
"directory": "vendor/modules/code-oss-dev",
147147
"line": 1,
148148
"description": "code-server makes use of VS Code's frontend web/remote support. Most of the modifications implement the remote server since that portion of the code is closed source and not released with VS Code.\n\nWe also have a few bug fixes and have added some features (like client-side extensions). See [https://github.com/cdr/code-server/blob/master/docs/CONTRIBUTING.md#modifications-to-vs-code](https://github.com/cdr/code-server/blob/master/docs/CONTRIBUTING.md#modifications-to-vs-code) for a list.\n\nWe make an effort to keep the modifications as few as possible."
149149
}
150150
]
151-
}
151+
}

ci/build/arch-override.json

-8
This file was deleted.

ci/build/build-code-server.sh

+15-8
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,30 @@ main() {
1515
chmod +x out/node/entry.js
1616
fi
1717

18+
# for arch; we do not use OS from lib.sh and get our own.
19+
# lib.sh normalizes macos to darwin - but cloud-agent's binaries do not
20+
source ./ci/lib.sh
21+
OS="$(uname | tr '[:upper:]' '[:lower:]')"
22+
23+
mkdir -p ./lib
24+
1825
if ! [ -f ./lib/coder-cloud-agent ]; then
1926
echo "Downloading the cloud agent..."
2027

21-
# for arch; we do not use OS from lib.sh and get our own.
22-
# lib.sh normalizes macos to darwin - but cloud-agent's binaries do not
23-
source ./ci/lib.sh
24-
OS="$(uname | tr '[:upper:]' '[:lower:]')"
25-
2628
set +e
2729
curl -fsSL "https://github.com/cdr/cloud-agent/releases/latest/download/cloud-agent-$OS-$ARCH" -o ./lib/coder-cloud-agent
2830
chmod +x ./lib/coder-cloud-agent
2931
set -e
3032
fi
3133

32-
yarn browserify out/browser/register.js -o out/browser/register.browserified.js
33-
yarn browserify out/browser/pages/login.js -o out/browser/pages/login.browserified.js
34-
yarn browserify out/browser/pages/vscode.js -o out/browser/pages/vscode.browserified.js
34+
if ! [ -f ./lib/linkup ]; then
35+
echo "Downloading Link agent..."
36+
37+
set +e
38+
curl -fsSL "https://storage.googleapis.com/coder-link-releases/latest/linkup-$OS-$ARCH" -o ./lib/linkup
39+
chmod +x ./lib/linkup
40+
set -e
41+
fi
3542
}
3643

3744
main "$@"

0 commit comments

Comments
 (0)