Skip to content

Commit f25768a

Browse files
authored
Merge branch 'main' into im-coder-lg-code-server-coder-diff
2 parents fbeb038 + 94b2774 commit f25768a

16 files changed

+591
-653
lines changed

.github/workflows/ci.yaml

+4-11
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
name: Run audit-ci
6161
needs: prebuild
6262
runs-on: ubuntu-latest
63-
timeout-minutes: 5
63+
timeout-minutes: 15
6464
steps:
6565
- name: Checkout repo
6666
uses: actions/checkout@v2
@@ -378,9 +378,6 @@ jobs:
378378
with:
379379
node-version: "14"
380380

381-
- name: Install playwright OS dependencies
382-
run: npx playwright install-deps
383-
384381
- name: Fetch dependencies from cache
385382
id: cache-yarn
386383
uses: actions/cache@v2
@@ -406,14 +403,10 @@ jobs:
406403
if: steps.cache-yarn.outputs.cache-hit != 'true'
407404
run: yarn --frozen-lockfile
408405

409-
# HACK: this shouldn't need to exist, but put it here anyway
410-
# in an attempt to solve Playwright cache failures.
411-
- name: Reinstall playwright
412-
if: steps.cache-yarn.outputs.cache-hit == 'true'
406+
- name: Install Playwright OS dependencies
413407
run: |
414-
cd test/
415-
rm -r node_modules/playwright
416-
yarn install --check-files
408+
./test/node_modules/.bin/playwright install-deps
409+
./test/node_modules/.bin/playwright install
417410
418411
- name: Run end-to-end tests
419412
run: yarn test:e2e

.github/workflows/docker.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
workflow_dispatch:
77

88
release:
9-
types: [published]
9+
types: [released]
1010

1111
jobs:
1212
docker-images:

.github/workflows/npm-brew.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
workflow_dispatch:
77

88
release:
9-
types: [published]
9+
types: [released]
1010

1111
jobs:
1212
# NOTE: this job requires curl, jq and yarn

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ vendor/modules
1212
node-*
1313
/plugins
1414
/lib/coder-cloud-agent
15-
/lib/linkup
1615
.home
1716
coverage
1817
**/.DS_Store

ci/build/build-code-server.sh

-9
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,6 @@ main() {
3030
chmod +x ./lib/coder-cloud-agent
3131
set -e
3232
fi
33-
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
4233
}
4334

4435
main "$@"

ci/build/build-release.sh

-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ EOF
6161
rsync node_modules/ "$RELEASE_PATH/node_modules"
6262
mkdir -p "$RELEASE_PATH/lib"
6363
rsync ./lib/coder-cloud-agent "$RELEASE_PATH/lib"
64-
rsync ./lib/linkup "$RELEASE_PATH/lib"
6564
fi
6665
}
6766

ci/build/npm-postinstall.sh

-6
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,6 @@ main() {
6666
echo "Failed to download cloud agent; --link will not work"
6767
fi
6868

69-
if curl -fsSL "https://storage.googleapis.com/coder-link-releases/latest/linkup-$OS-$ARCH" -o ./lib/linkup; then
70-
chmod +x ./lib/linkup
71-
else
72-
echo "Failed to download Link agent; the Link extension will not work"
73-
fi
74-
7569
if ! vscode_yarn; then
7670
echo "You may not have the required dependencies to build the native modules."
7771
echo "Please see https://github.com/cdr/code-server/blob/master/docs/npm.md"

ci/dev/postinstall.sh

+15-14
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,28 @@ main() {
66

77
echo "Installing code-server test dependencies..."
88

9+
local args=(install)
10+
if [[ ${CI-} ]]; then
11+
args+=(--frozen-lockfile)
12+
fi
13+
914
cd test
10-
yarn install
15+
yarn "${args[@]}"
1116
cd ..
1217

1318
cd vendor
1419
echo "Installing vendor dependencies..."
1520

16-
# * We install in 'modules' instead of 'node_modules' because VS Code's extensions
17-
# use a webpack config which cannot differentiate between its own node_modules
18-
# and itself being in a directory with the same name.
19-
#
20-
# * We ignore scripts because NPM/Yarn's default behavior is to assume that
21-
# devDependencies are not needed, and that even git repo based packages are
22-
# assumed to be compiled. Because the default behavior for VS Code's `postinstall`
23-
# assumes we're also compiled, this needs to be ignored.
21+
# We install in 'modules' instead of 'node_modules' because VS Code's
22+
# extensions use a webpack config which cannot differentiate between its own
23+
# node_modules and itself being in a directory with the same name.
24+
args+=(--modules-folder modules)
2425

25-
local args=(install --modules-folder modules --ignore-scripts)
26-
27-
if [[ ${CI-} ]]; then
28-
args+=("--frozen-lockfile")
29-
fi
26+
# We ignore scripts because NPM/Yarn's default behavior is to assume that
27+
# devDependencies are not needed, and that even git repo based packages are
28+
# assumed to be compiled. Because the default behavior for VS Code's
29+
# `postinstall` assumes we're also compiled, this needs to be ignored.
30+
args+=(--ignore-scripts)
3031

3132
yarn "${args[@]}"
3233

ci/helm-chart/values.yaml

-12
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,6 @@ podAnnotations: {}
2828
podSecurityContext: {}
2929
# fsGroup: 2000
3030

31-
securityContext: {}
32-
# capabilities:
33-
# drop:
34-
# - ALL
35-
# readOnlyRootFilesystem: true
36-
# runAsNonRoot: true
37-
# runAsUser: 1000
38-
3931
service:
4032
type: ClusterIP
4133
port: 8080
@@ -127,10 +119,6 @@ persistence:
127119
# existingClaim: ""
128120
# hostPath: /data
129121

130-
serviceAccount:
131-
create: true
132-
name:
133-
134122
## Enable an Specify container in extraContainers.
135123
## This is meant to allow adding code-server dependencies, like docker-dind.
136124
extraContainers: |

docs/CONTRIBUTING.md

+11-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# Contributing
44

55
- [Requirements](#requirements)
6+
- [Linux-specific requirements](#linux-specific-requirements)
67
- [Creating pull requests](#creating-pull-requests)
78
- [Commits and commit history](#commits-and-commit-history)
89
- [Development workflow](#development-workflow)
@@ -42,13 +43,21 @@ Here is what is needed:
4243
signature
4344
verification](https://docs.github.com/en/github/authenticating-to-github/managing-commit-signature-verification)
4445
or follow [this tutorial](https://joeprevite.com/verify-commits-on-github)
45-
- `build-essential` (Linux only - used by VS Code)
46-
- Get this by running `apt-get install -y build-essential`
4746
- `rsync` and `unzip`
4847
- Used for code-server releases
4948
- `bats`
5049
- Used to run script unit tests
5150

51+
### Linux-specific requirements
52+
53+
If you're developing code-server on Linux, make sure you have installed or install the following dependencies:
54+
55+
```shell
56+
sudo apt-get install build-essential g++ libx11-dev libxkbfile-dev libsecret-1-dev python-is-python3
57+
```
58+
59+
These are required by VS Code. See [their Wiki](https://github.com/microsoft/vscode/wiki/How-to-Contribute#prerequisites) for more information.
60+
5261
## Creating pull requests
5362

5463
Please create a [GitHub Issue](https://github.com/cdr/code-server/issues) that

package.json

+5-4
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"@types/ws": "^8.0.0",
5151
"@typescript-eslint/eslint-plugin": "^5.0.0",
5252
"@typescript-eslint/parser": "^5.0.0",
53-
"audit-ci": "^4.0.0",
53+
"audit-ci": "^5.0.0",
5454
"codecov": "^3.8.3",
5555
"doctoc": "^2.0.0",
5656
"eslint": "^7.7.0",
@@ -75,8 +75,9 @@
7575
"browserslist": "^4.16.5",
7676
"safe-buffer": "^5.1.1",
7777
"vfile-message": "^2.0.2",
78-
"argon2/@mapbox/node-pre-gyp/tar": "^6.1.9",
79-
"path-parse": "^1.0.7"
78+
"tar": "^6.1.9",
79+
"path-parse": "^1.0.7",
80+
"vm2": "^3.9.4"
8081
},
8182
"dependencies": {
8283
"@coder/logger": "1.1.16",
@@ -93,7 +94,7 @@
9394
"proxy-agent": "^5.0.0",
9495
"proxy-from-env": "^1.1.0",
9596
"qs": "6.10.1",
96-
"rotating-file-stream": "^2.1.1",
97+
"rotating-file-stream": "^3.0.0",
9798
"safe-buffer": "^5.1.1",
9899
"safe-compare": "^1.1.4",
99100
"semver": "^7.1.3",

src/node/link.ts

-16
This file was deleted.

src/node/main.ts

+1-17
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
import { field, logger } from "@coder/logger"
2-
import { ChildProcessWithoutNullStreams } from "child_process"
32
import http from "http"
43
import path from "path"
54
import { Disposable } from "../common/emitter"
6-
import { plural, logError } from "../common/util"
5+
import { plural } from "../common/util"
76
import { createApp, ensureAddress } from "./app"
87
import { AuthType, DefaultedArgs, Feature } from "./cli"
98
import { coderCloudBind } from "./coder_cloud"
109
import { commit, version, vsRootPath } from "./constants"
11-
import { startLink } from "./link"
1210
import { register } from "./routes"
1311
import { humanPath, isFile, loadAMDModule, open } from "./util"
1412

@@ -156,19 +154,6 @@ export const runCodeServer = async (
156154
logger.info(" - Connected to cloud agent")
157155
}
158156

159-
let linkAgent: undefined | ChildProcessWithoutNullStreams
160-
try {
161-
linkAgent = startLink(serverAddress)
162-
linkAgent.on("error", (error) => {
163-
logError(logger, "link daemon", error)
164-
})
165-
linkAgent.on("close", (code) => {
166-
logger.debug("link daemon closed", field("code", code))
167-
})
168-
} catch (error) {
169-
logError(logger, "link daemon", error)
170-
}
171-
172157
if (args.enable && args.enable.length > 0) {
173158
logger.info("Enabling the following experimental features:")
174159
args.enable.forEach((feature) => {
@@ -196,7 +181,6 @@ export const runCodeServer = async (
196181
return {
197182
server: app.server,
198183
dispose: async () => {
199-
linkAgent?.kill()
200184
disposeRoutes()
201185
await app.dispose()
202186
},

test/package.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"license": "MIT",
33
"#": "We must put jest in a sub-directory otherwise VS Code somehow picks up the types and generates conflicts with mocha.",
44
"devDependencies": {
5-
"@playwright/test": "^1.12.1",
5+
"@playwright/test": "^1.16.3",
66
"@types/jest": "^27.0.2",
77
"@types/jsdom": "^16.2.13",
88
"@types/node-fetch": "^2.5.8",
@@ -13,7 +13,7 @@
1313
"jest-fetch-mock": "^3.0.3",
1414
"jsdom": "^16.4.0",
1515
"node-fetch": "^2.6.1",
16-
"playwright": "^1.12.1",
16+
"playwright": "^1.16.3",
1717
"supertest": "^6.1.6",
1818
"ts-jest": "^27.0.7",
1919
"wtfnode": "^0.9.1"
@@ -22,6 +22,7 @@
2222
"ansi-regex": "^5.0.1",
2323
"argon2/@mapbox/node-pre-gyp/tar": "^6.1.9",
2424
"set-value": "^4.0.1",
25-
"tmpl": "^1.0.5"
25+
"tmpl": "^1.0.5",
26+
"path-parse": "^1.0.7"
2627
}
2728
}

0 commit comments

Comments
 (0)