Skip to content

Commit 9316f61

Browse files
author
Akash Satheesan
authored
Merge branch 'main' into jsjoeio/fix-password-hash
2 parents cc6e284 + 58622cc commit 9316f61

15 files changed

+192
-220
lines changed

.github/workflows/ci.yaml

+28-44
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ jobs:
2424
- name: Checkout repo
2525
uses: actions/checkout@v2
2626

27-
- name: Install Node.js v12
27+
- name: Install Node.js v14
2828
uses: actions/setup-node@v2
2929
with:
30-
node-version: "12"
30+
node-version: "14"
3131

3232
- name: Install helm
3333
uses: azure/[email protected]
@@ -67,10 +67,10 @@ jobs:
6767
- name: Checkout repo
6868
uses: actions/checkout@v2
6969

70-
- name: Install Node.js v12
70+
- name: Install Node.js v14
7171
uses: actions/setup-node@v2
7272
with:
73-
node-version: "12"
73+
node-version: "14"
7474

7575
- name: Fetch dependencies from cache
7676
id: cache-yarn
@@ -96,10 +96,10 @@ jobs:
9696
with:
9797
fetch-depth: 0
9898

99-
- name: Install Node.js v12
99+
- name: Install Node.js v14
100100
uses: actions/setup-node@v2
101101
with:
102-
node-version: "12"
102+
node-version: "14"
103103

104104
- name: Fetch dependencies from cache
105105
id: cache-yarn
@@ -169,10 +169,10 @@ jobs:
169169
steps:
170170
- uses: actions/checkout@v2
171171

172-
- name: Install Node.js v12
172+
- name: Install Node.js v14
173173
uses: actions/setup-node@v2
174174
with:
175-
node-version: "12"
175+
node-version: "14"
176176

177177
- name: Install development tools
178178
run: |
@@ -244,10 +244,10 @@ jobs:
244244
steps:
245245
- uses: actions/checkout@v2
246246

247-
- name: Install Node.js v12
247+
- name: Install Node.js v14
248248
uses: actions/setup-node@v2
249249
with:
250-
node-version: "12"
250+
node-version: "14"
251251

252252
- name: Install nfpm
253253
run: |
@@ -270,8 +270,8 @@ jobs:
270270

271271
- name: Replace node with arm64 equivalent
272272
run: |
273-
wget https://nodejs.org/dist/v12.18.4/node-v12.18.4-linux-arm64.tar.gz
274-
tar -xzf node-v12.18.4-linux-arm64.tar.gz node-v12.18.4-linux-arm64/bin/node --strip-components=2
273+
wget https://nodejs.org/dist/v14.17.0/node-v14.17.0-linux-arm64.tar.xz
274+
tar -xf node-v14.17.0-linux-arm64.tar.xz node-v14.17.0-linux-arm64/bin/node --strip-components=2
275275
mv ./node ./release-standalone/lib/node
276276
277277
- name: Build packages with nfpm
@@ -290,10 +290,10 @@ jobs:
290290
steps:
291291
- uses: actions/checkout@v2
292292

293-
- name: Install Node.js v12
293+
- name: Install Node.js v14
294294
uses: actions/setup-node@v2
295295
with:
296-
node-version: "12"
296+
node-version: "14"
297297

298298
- name: Install nfpm
299299
run: |
@@ -333,10 +333,10 @@ jobs:
333333
steps:
334334
- uses: actions/checkout@v2
335335

336-
- name: Install Node.js v12
336+
- name: Install Node.js v14
337337
uses: actions/setup-node@v2
338338
with:
339-
node-version: "12"
339+
node-version: "14"
340340

341341
- name: Install playwright
342342
uses: microsoft/playwright-github-action@v1
@@ -386,9 +386,10 @@ jobs:
386386
- name: Remove release packages and test artifacts
387387
run: rm -rf ./release-packages ./test/test-results
388388

389-
docker-amd64:
389+
# Builds both amd64 and arm64 images
390+
docker-images:
390391
runs-on: ubuntu-latest
391-
needs: package-linux-amd64
392+
needs: [package-linux-amd64, package-linux-arm64]
392393
steps:
393394
- uses: actions/checkout@v2
394395

@@ -398,42 +399,24 @@ jobs:
398399
name: release-packages
399400
path: ./release-packages
400401

401-
- name: Run ./ci/steps/build-docker-image.sh
402-
run: ./ci/steps/build-docker-image.sh
402+
- name: Set up QEMU
403+
uses: docker/setup-qemu-action@v1
403404

404-
- name: Upload release image
405-
uses: actions/upload-artifact@v2
406-
with:
407-
name: release-images
408-
path: ./release-images
409-
410-
# TODO: this is the last place where we use our self-hosted arm64 runner.
411-
# In the future, consider switching to docker buildx + qemu,
412-
# thus removing the requirement for us to maintain the runner.
413-
docker-arm64:
414-
runs-on: ubuntu-arm64-latest
415-
needs: package-linux-arm64
416-
steps:
417-
- uses: actions/checkout@v2
418-
419-
- name: Download release package
420-
uses: actions/download-artifact@v2
421-
with:
422-
name: release-packages
423-
path: ./release-packages
405+
- name: Set up Docker Buildx
406+
uses: docker/setup-buildx-action@v1
424407

425408
- name: Run ./ci/steps/build-docker-image.sh
426409
run: ./ci/steps/build-docker-image.sh
427410

428-
- name: Upload release image
411+
- name: Upload release images
429412
uses: actions/upload-artifact@v2
430413
with:
431414
name: release-images
432415
path: ./release-images
433416

434417
trivy-scan-image:
435418
runs-on: ubuntu-20.04
436-
needs: docker-amd64
419+
needs: docker-images
437420
# NOTE@jsjoeio: disabling due to a memory issue upstream
438421
# See: https://github.com/github/codeql-action/issues/528
439422
if: 1 == 2
@@ -449,7 +432,7 @@ jobs:
449432

450433
- name: Run Trivy vulnerability scanner in image mode
451434
# Commit SHA for v0.0.17
452-
uses: aquasecurity/trivy-action@dba83feec810c70bacbc4bead308ae1e466c572b
435+
uses: aquasecurity/trivy-action@ac8de07fd168680dd0331bef43681c0e150e9ad1
453436
with:
454437
input: "./release-images/code-server-amd64-*.tar"
455438
scan-type: "image"
@@ -466,6 +449,7 @@ jobs:
466449
uses: github/codeql-action/upload-sarif@v1
467450
with:
468451
sarif_file: "trivy-image-results.sarif"
452+
469453
# We have to use two trivy jobs
470454
# because GitHub only allows
471455
# codeql/upload-sarif action per job
@@ -476,7 +460,7 @@ jobs:
476460
uses: actions/checkout@v2
477461
- name: Run Trivy vulnerability scanner in repo mode
478462
#Commit SHA for v0.0.17
479-
uses: aquasecurity/trivy-action@dba83feec810c70bacbc4bead308ae1e466c572b
463+
uses: aquasecurity/trivy-action@ac8de07fd168680dd0331bef43681c0e150e9ad1
480464
with:
481465
scan-type: "fs"
482466
scan-ref: "."

.tours/start-development.tour

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
{
66
"file": "package.json",
77
"line": 31,
8-
"description": "## Commands\n\nTo start developing, make sure you have Node 12+ and the [required dependencies](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#prerequisites) installed. Then, run the following commands:\n\n1. Install dependencies:\n>> yarn\n\n3. Start development mode (and watch for changes):\n>> yarn watch"
8+
"description": "## Commands\n\nTo start developing, make sure you have Node 14+ and the [required dependencies](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#prerequisites) installed. Then, run the following commands:\n\n1. Install dependencies:\n>> yarn\n\n3. Start development mode (and watch for changes):\n>> yarn watch"
99
},
1010
{
1111
"file": "src/node/app.ts",

CHANGELOG.md

+6-29
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,3 @@
1-
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
2-
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
3-
# Changelog
4-
5-
- [Changelog](#changelog)
6-
- [Next Version](#next-version)
7-
- [New Features](#new-features)
8-
- [Bug Fixes](#bug-fixes)
9-
- [Documentation](#documentation)
10-
- [Development](#development)
11-
- [3.10.2](#3102)
12-
- [New Features](#new-features-1)
13-
- [Bug Fixes](#bug-fixes-1)
14-
- [Development](#development-1)
15-
- [Documentation](#documentation-1)
16-
- [3.10.1](#3101)
17-
- [Bug Fixes](#bug-fixes-2)
18-
- [Documentation](#documentation-2)
19-
- [Development](#development-2)
20-
- [3.10.0](#3100)
21-
- [New Features](#new-features-2)
22-
- [Bug Fixes](#bug-fixes-3)
23-
- [Documentation](#documentation-3)
24-
- [Development](#development-3)
25-
- [Previous versions](#previous-versions)
26-
27-
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
28-
291
# Changelog
302

313
<!--
@@ -75,10 +47,15 @@ VS Code v0.00.0
7547

7648
### Documentation
7749

78-
- docs: fix confusing sentence in pull requests section #3460 @shiv-tyag
50+
- docs: add Pomerium #3424 @desimone
51+
- docs: fix confusing sentence in pull requests section #3460 @shiv-tyagi
52+
- docs: remove toc from changelog @oxy @jsjoeio
53+
- docs(MAINTAINING): add information about CHANGELOG #3467 @jsjoeio
7954

8055
### Development
8156

57+
- chore: cross-compile docker images with buildx #3166 @oxy
58+
- chore: update node to v14 #3458 @oxy
8259
- fix: use sufficient computational effort for password hash #3422 @jsjoeio
8360

8461
## 3.10.2

ci/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ You can disable minification by setting `MINIFY=`.
100100

101101
This directory contains the release docker container image.
102102

103-
- [./release-image/build.sh](./release-image/build.sh)
104-
- Builds the release container with the tag `codercom/code-server-$ARCH:$VERSION`.
103+
- [./ci/steps/build-docker-image.sh](./ci/steps/build-docker-image.sh)
104+
- Builds the release containers with tags `codercom/code-server-$ARCH:$VERSION` for amd64 and arm64 with `docker buildx`.
105105
- Assumes debian releases are ready in `./release-packages`.
106106

107107
## images

ci/build/npm-postinstall.sh

+20-3
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,21 @@ main() {
2323
# Grabs the major version of node from $npm_config_user_agent which looks like
2424
# yarn/1.21.1 npm/? node/v14.2.0 darwin x64
2525
major_node_version=$(echo "$npm_config_user_agent" | sed -n 's/.*node\/v\([^.]*\).*/\1/p')
26-
if [ "$major_node_version" -lt 12 ]; then
27-
echo "code-server currently requires at least node v12"
26+
27+
if [ -n "${FORCE_NODE_VERSION:-}" ]; then
28+
echo "WARNING: Overriding required Node.js version to v$FORCE_NODE_VERSION"
29+
echo "This could lead to broken functionality, and is unsupported."
30+
echo "USE AT YOUR OWN RISK!"
31+
fi
32+
33+
if [ "$major_node_version" -ne "${FORCE_NODE_VERSION:-14}" ]; then
34+
echo "ERROR: code-server currently requires node v14."
35+
if [ -n "$FORCE_NODE_VERSION" ]; then
36+
echo "However, you have overrided the version check to use v$FORCE_NODE_VERSION."
37+
fi
2838
echo "We have detected that you are on node v$major_node_version"
29-
echo "See https://github.com/cdr/code-server/issues/1633"
39+
echo "You can override this version check by setting \$FORCE_NODE_VERSION,"
40+
echo "but configurations that do not use the same node version are unsupported."
3041
exit 1
3142
fi
3243

@@ -54,6 +65,12 @@ main() {
5465
echo "Please see https://github.com/cdr/code-server/blob/master/docs/npm.md"
5566
exit 1
5667
fi
68+
69+
if [ -n "${FORCE_NODE_VERSION:-}" ]; then
70+
echo "WARNING: The required Node.js version was overriden to v$FORCE_NODE_VERSION"
71+
echo "This could lead to broken functionality, and is unsupported."
72+
echo "USE AT YOUR OWN RISK!"
73+
fi
5774
}
5875

5976
# This is a copy of symlink_asar in ../lib.sh. Look there for details.

ci/dev/fmt.sh

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ main() {
3131
doctoc --title '# Contributor Covenant Code of Conduct' docs/CODE_OF_CONDUCT.md >/dev/null
3232
doctoc --title '# iPad' docs/ipad.md >/dev/null
3333
doctoc --title '# Termux' docs/termux.md >/dev/null
34-
doctoc --title '# Changelog' CHANGELOG.md >/dev/null
3534

3635
if [[ ${CI-} && $(git ls-files --other --modified --exclude-standard) ]]; then
3736
echo "Files need generation or are formatted incorrectly:"

ci/release-image/build.sh

-11
This file was deleted.

ci/release-image/docker-bake.hcl

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Use this file from the top of the repo, with `-f ci/release-image/docker-bake.hcl`
2+
3+
# Uses env var VERSION if set;
4+
# normally, this is set by ci/lib.sh
5+
variable "VERSION" {
6+
default = "latest"
7+
}
8+
9+
group "default" {
10+
targets = ["code-server-amd64", "code-server-arm64"]
11+
}
12+
13+
target "code-server-amd64" {
14+
dockerfile = "ci/release-image/Dockerfile"
15+
tags = ["docker.io/codercom/code-server-amd64:${VERSION}"]
16+
platforms = ["linux/amd64"]
17+
output = ["type=tar,dest=./release-images/code-server-amd64-${VERSION}.tar"]
18+
}
19+
20+
target "code-server-arm64" {
21+
dockerfile = "ci/release-image/Dockerfile"
22+
tags = ["docker.io/codercom/code-server-arm64:${VERSION}"]
23+
platforms = ["linux/arm64"]
24+
output = ["type=tar,dest=./release-images/code-server-arm64-${VERSION}.tar"]
25+
}

ci/steps/build-docker-image.sh

+1-3
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@ main() {
55
cd "$(dirname "$0")/../.."
66
source ./ci/lib.sh
77

8-
./ci/release-image/build.sh
9-
108
mkdir -p release-images
11-
docker save "codercom/code-server-$ARCH:$VERSION" >"release-images/code-server-$ARCH-$VERSION.tar"
9+
docker buildx bake -f ci/release-image/docker-bake.hcl
1210
}
1311

1412
main "$@"

docs/CONTRIBUTING.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ The prerequisites for contributing to code-server are almost the same as those f
3535
[VS Code](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#prerequisites).
3636
There are several differences, however. Here is what is needed:
3737

38-
- `node` v12.x or greater
38+
- `node` v14.x or greater
3939
- `git` v2.x or greater
4040
- [`yarn`](https://classic.yarnpkg.com/en/)
4141
- used to install JS packages and run scripts
@@ -74,6 +74,7 @@ To update VS Code, follow these steps:
7474
4. There will be merge conflicts. First commit them.
7575
1. We do this because if we don't, it will be impossible to review your PR.
7676
5. Once they're all fixed, test code-server locally and make sure it all works.
77+
6. Check the version of Node.js that the version of Electron shipped with VSCode uses, and update the version of Node.js if necessary.
7778

7879
#### Notes about Changes
7980

docs/MAINTAINING.md

+9
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
- [Versioning](#versioning)
1111
- [Pull Requests](#pull-requests)
1212
- [Merge Strategies](#merge-strategies)
13+
- [Changelog](#changelog)
1314
- [Release](#release)
1415
- [Release Manager Rotation](#release-manager-rotation)
1516

@@ -79,6 +80,14 @@ If a PR does fix an issue, don't add it to the version milestone. Otherwise, the
7980
For most things, we recommend "Squash and Merge". If you're updating `lib/vscode`, we suggest using the "Rebase and Merge" strategy. There may be times where "Create a merge commit" makes sense as well. Use your best judgement. If you're unsure, you can always discuss in the PR with the team.
8081
The code-server project follows traditional [semantic versioning](ttps://semver.org/), with the objective of minimizing major changes that break backward compatibility. We increment the patch level for all releases, except when the upstream Visual Studio Code project increments its minor version or we change the plugin API in a backward-compatible manner. In those cases, we increment the minor version rather than the patch level.
8182

83+
### Changelog
84+
85+
To save time when creating a new release for code-server, we keep a running changelog at `CHANGELOG.md`.
86+
87+
If either author or reviewer of a PR believe the change should be mentioned in the `CHANGELOG`, then it should be added.
88+
89+
If there is not a "Next Version" when you modify `CHANGELOG`, please add it using the template you see near the top of `CHANGELOG`. You can use the suggested format: `<pr title> <pr #> <author> Example: `fix: Check the logged user instead of $USER #3330 @videlanicolas`
90+
8291
## Release
8392

8493
### Release Manager Rotation

0 commit comments

Comments
 (0)