Skip to content

chore: upgrade Code to 1.66 #5135

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 50 commits into from
May 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
10e9ae9
chore: upgrade Code to 1.66
Apr 26, 2022
a8eb7eb
docs: update docs for Code upgrades
Apr 26, 2022
4b87916
fixup!: docs
Apr 26, 2022
9c8fbf5
chore: update vscode submodule
Apr 26, 2022
173932b
chore: update integration patch
Apr 26, 2022
a34e57c
chore: update node-version patch
Apr 26, 2022
557247a
chore: update github-auth patch
Apr 26, 2022
86ca662
refactor: remove postinstall patch
Apr 26, 2022
eeb5735
chore: refresh local-storage patch
Apr 27, 2022
ed37849
chore: refresh service-worker patch
Apr 27, 2022
40ba2b9
chore: bulk refresh patches
Apr 27, 2022
8a6608a
fixup!: docs formatting
Apr 27, 2022
7cea69d
Merge branch 'main' into jsjoeio/vscode-1.66
jsjoeio Apr 27, 2022
afc702e
refactor: remove unused last-opened patch
Apr 27, 2022
a0c0ea2
fixup!: formatting docs
Apr 27, 2022
4c79c9a
fixup!: formatting docs
Apr 27, 2022
8d6b613
refactor: remove rsync postinstall
Apr 27, 2022
a5225d3
Revert "refactor: remove rsync postinstall"
Apr 27, 2022
202630d
refactor: update postinstall.js to .mjs
Apr 27, 2022
5e98158
feat(patches): add parent-origin bypass
jsjoeio Apr 27, 2022
013934d
docs(patches): add notes for testing store-socket
jsjoeio Apr 28, 2022
b6a3f9a
docs(patches): update testing info for node-version
jsjoeio Apr 28, 2022
31a354a
refactor(patches): delete github-auth.diff patch
jsjoeio Apr 28, 2022
35a1819
docs(patches): add notes for testing connection-type
jsjoeio Apr 28, 2022
bdeb521
fixup!: delete github-auth patch
jsjoeio Apr 28, 2022
c6e67f7
fixup!: update connection type testing
jsjoeio Apr 29, 2022
d7a0447
docs(patches): add notes to insecure-notification.diff
jsjoeio Apr 29, 2022
cf855ae
docs(patches): add nots for update-check.diff
jsjoeio Apr 29, 2022
5ef2c27
fixup!: remove comma in integration patch
jsjoeio Apr 29, 2022
f779d85
fix(e2e): disable workspace trust
jsjoeio Apr 29, 2022
7579dbb
refactor: add --no-default-rc for yarn install
jsjoeio Apr 29, 2022
114485b
feat(patches): remove yarnrc in presinstall
jsjoeio Apr 29, 2022
91de1fe
fixup!: silly mistake
jsjoeio Apr 29, 2022
63dfa8d
docs: add note about KEEP_MODULES=1
jsjoeio Apr 30, 2022
786f087
docs(patches): add testing notes for node-version
jsjoeio Apr 30, 2022
70ef582
refactor(patches): remove node-version
May 2, 2022
5b0f69a
fixup!: add cd ../.. to code upgrade instructions
May 3, 2022
687009d
fixup!: add note to yarn --production flag
May 3, 2022
0b34b5b
fixup!: make parent-origin easier to upstream
May 3, 2022
5d8628d
Revert "refactor(patches): delete github-auth.diff patch"
jsjoeio May 3, 2022
1945220
Revert "fixup!: delete github-auth patch"
jsjoeio May 3, 2022
022c480
Merge webview origin patch into webview patch
code-asher May 4, 2022
a78f8b5
Remove unused post-install patch
code-asher May 4, 2022
1ce5da3
Prevent builtin extensions from updating
code-asher May 4, 2022
85e8183
Refresh sourcemaps patch
code-asher May 4, 2022
9cbcfa9
Update Node to v16
code-asher May 4, 2022
694c44b
Replace fs.rmdir with fs.rm
code-asher May 4, 2022
e346fe2
Update github-auth patch
code-asher May 4, 2022
1ac2dcf
Prevent fs.rm from erroring about non-existent files
code-asher May 4, 2022
7d99254
Install Python 3 in CentOS CI container
code-asher May 4, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ jobs:
fetch-depth: 0
submodules: true

- name: Install Node.js v14
- name: Install Node.js v16
uses: actions/setup-node@v3
with:
node-version: "14"
node-version: "16"

- name: Install helm
uses: azure/[email protected]
Expand Down Expand Up @@ -74,10 +74,10 @@ jobs:
fetch-depth: 0
submodules: true

- name: Install Node.js v14
- name: Install Node.js v16
uses: actions/setup-node@v3
with:
node-version: "14"
node-version: "16"

- name: Fetch dependencies from cache
id: cache-yarn
Expand Down Expand Up @@ -116,10 +116,10 @@ jobs:
- name: Patch Code
run: quilt push -a

- name: Install Node.js v14
- name: Install Node.js v16
uses: actions/setup-node@v3
with:
node-version: "14"
node-version: "16"

- name: Fetch dependencies from cache
id: cache-yarn
Expand Down Expand Up @@ -253,15 +253,15 @@ jobs:
with:
fetch-depth: 0

- name: Install Node.js v14
- name: Install Node.js v16
uses: actions/setup-node@v3
with:
node-version: "14"
node-version: "16"

- name: Install development tools
run: |
yum install -y epel-release centos-release-scl
yum install -y devtoolset-9-{make,gcc,gcc-c++} jq rsync
yum install -y devtoolset-9-{make,gcc,gcc-c++} jq rsync python3
- name: Install nfpm and envsubst
run: |
Expand Down Expand Up @@ -337,18 +337,18 @@ jobs:
CXX: ${{ format('{0}-g++', matrix.prefix) }}
LINK: ${{ format('{0}-g++', matrix.prefix) }}
NPM_CONFIG_ARCH: ${{ matrix.arch }}
NODE_VERSION: v14.17.4
NODE_VERSION: v16.13.0

steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install Node.js v14
- name: Install Node.js v16
uses: actions/setup-node@v3
with:
node-version: "14"
node-version: "16"

- name: Install nfpm
run: |
Expand Down Expand Up @@ -397,10 +397,10 @@ jobs:
with:
fetch-depth: 0

- name: Install Node.js v14
- name: Install Node.js v16
uses: actions/setup-node@v3
with:
node-version: "14"
node-version: "16"

- name: Install nfpm
run: |
Expand Down Expand Up @@ -446,10 +446,10 @@ jobs:
fetch-depth: 0
submodules: true

- name: Install Node.js v14
- name: Install Node.js v16
uses: actions/setup-node@v3
with:
node-version: "14"
node-version: "16"

- name: Fetch dependencies from cache
id: cache-yarn
Expand Down
2 changes: 1 addition & 1 deletion ci/build/build-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ EOF
# Include global extension dependencies as well.
rsync "$VSCODE_SRC_PATH/extensions/package.json" "$VSCODE_OUT_PATH/extensions/package.json"
rsync "$VSCODE_SRC_PATH/extensions/yarn.lock" "$VSCODE_OUT_PATH/extensions/yarn.lock"
rsync "$VSCODE_SRC_PATH/extensions/postinstall.js" "$VSCODE_OUT_PATH/extensions/postinstall.js"
rsync "$VSCODE_SRC_PATH/extensions/postinstall.mjs" "$VSCODE_OUT_PATH/extensions/postinstall.mjs"

pushd "$VSCODE_OUT_PATH"
symlink_asar
Expand Down
6 changes: 3 additions & 3 deletions ci/build/npm-postinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ main() {
echo "USE AT YOUR OWN RISK!"
fi

if [ "$major_node_version" -ne "${FORCE_NODE_VERSION:-14}" ]; then
echo "ERROR: code-server currently requires node v14."
if [ "$major_node_version" -ne "${FORCE_NODE_VERSION:-16}" ]; then
echo "ERROR: code-server currently requires node v16."
if [ -n "$FORCE_NODE_VERSION" ]; then
echo "However, you have overrided the version check to use v$FORCE_NODE_VERSION."
fi
Expand Down Expand Up @@ -92,7 +92,7 @@ symlink_asar() {
vscode_yarn() {
echo 'Installing Code dependencies...'
cd lib/vscode
yarn --production --frozen-lockfile
yarn --production --frozen-lockfile --no-default-rc

symlink_asar

Expand Down
3 changes: 3 additions & 0 deletions ci/dev/postinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ install-deps() {
if [[ ${CI-} ]]; then
args+=(--frozen-lockfile)
fi
if [[ "$1" == "lib/vscode" ]]; then
args+=(--no-default-rc)
fi
# If there is no package.json then yarn will look upward and end up installing
# from the root resulting in an infinite loop (this can happen if you have not
# checked out the submodule yet for example).
Expand Down
6 changes: 5 additions & 1 deletion docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ re-apply the patches.
### Version updates to Code

1. Update the `lib/vscode` submodule to the desired upstream version branch.
1. `cd lib/vscode && git checkout release/1.66 && cd ../..`
2. `git add lib && git commit -m "chore: update Code"`
2. Apply the patches (`quilt push -a`) or restore your stashed changes. At this
stage you may need to resolve conflicts. For example use `quilt push -f`,
manually apply the rejected portions, then `quilt refresh`.
Expand Down Expand Up @@ -130,11 +132,13 @@ yarn build:vscode
yarn release
```

_NOTE: this does not keep `node_modules`. If you want them to be kept, use `KEEP_MODULES=1 yarn release` (if you're testing in Coder, you'll want to do this)_

Run your build:

```shell
cd release
yarn --production
yarn --production # Skip if you used KEEP_MODULES=1
# Runs the built JavaScript with Node.
node .
```
Expand Down
6 changes: 3 additions & 3 deletions docs/android.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
```

6. Exit the terminal using `exit` and then reopen the terminal
7. Install and use Node.js 14:
7. Install and use Node.js 16:

```shell
nvm install 14
nvm use 14
nvm install 16
nvm use 16
```

8. Install code-server globally on device with: `npm i -g code-server`
Expand Down
6 changes: 3 additions & 3 deletions docs/npm.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ includes installing instructions based on your operating system.

## Node.js version

We use the same major version of Node.js shipped with VSCode's Electron,
which is currently `14.x`. VS Code also [lists Node.js
We use the same major version of Node.js shipped with Code's remote, which is
currently `16.x`. VS Code also [lists Node.js
requirements](https://github.com/microsoft/vscode/wiki/How-to-Contribute#prerequisites).

Using other versions of Node.js [may lead to unexpected
Expand Down Expand Up @@ -72,7 +72,7 @@ Proceed to [installing](#installing)
## FreeBSD

```sh
pkg install -y git python npm-node14 yarn-node14 pkgconf
pkg install -y git python npm-node16 yarn-node16 pkgconf
pkg install -y libinotify
```

Expand Down
2 changes: 1 addition & 1 deletion lib/vscode
Submodule vscode updated 1246 files
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
"browser-ide"
],
"engines": {
"node": ">= 14"
"node": "16"
},
"jest": {
"transform": {
Expand Down
14 changes: 7 additions & 7 deletions patches/base-path.diff
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
===================================================================
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
@@ -252,7 +252,10 @@ export class WebClientServer {
@@ -253,7 +253,10 @@ export class WebClientServer {
return res.end();
}

Expand All @@ -171,7 +171,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts

function escapeAttribute(value: string): string {
return value.replace(/"/g, '"');
@@ -272,6 +275,8 @@ export class WebClientServer {
@@ -275,6 +278,8 @@ export class WebClientServer {
accessToken: this._environmentService.args['github-auth'],
scopes: [['user:email'], ['repo']]
} : undefined;
Expand All @@ -180,15 +180,15 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
const data = (await util.promisify(fs.readFile)(filePath)).toString()
.replace('{{WORKBENCH_WEB_CONFIGURATION}}', escapeAttribute(JSON.stringify({
remoteAuthority,
@@ -279,6 +284,7 @@ export class WebClientServer {
developmentOptions: { enableSmokeTestDriver: this._environmentService.driverHandle === 'web' ? true : undefined },
settingsSyncOptions: !this._environmentService.isBuilt && this._environmentService.args['enable-sync'] ? { enabled: true } : undefined,
@@ -285,6 +290,7 @@ export class WebClientServer {
folderUri: resolveWorkspaceURI(this._environmentService.args['default-folder']),
workspaceUri: resolveWorkspaceURI(this._environmentService.args['default-workspace']),
productConfiguration: <Partial<IProductConfiguration>>{
+ rootEndpoint: base,
codeServerVersion: this._productService.codeServerVersion,
embedderIdentifier: 'server-distro',
extensionsGallery: this._webExtensionResourceUrlTemplate ? {
@@ -291,7 +297,9 @@ export class WebClientServer {
@@ -297,7 +303,9 @@ export class WebClientServer {
} : undefined
}
})))
Expand All @@ -199,7 +199,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts

const cspDirectives = [
'default-src \'self\';',
@@ -370,3 +378,70 @@ export class WebClientServer {
@@ -376,3 +384,70 @@ export class WebClientServer {
return res.end(data);
}
}
Expand Down
8 changes: 7 additions & 1 deletion patches/connection-type.diff
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,18 @@ This allows the backend to distinguish them. In our case we use them to count a
single "open" of Code so we need to be able to distinguish between web sockets
from two instances and two web sockets used in a single instance.

To test this,
1. Run code-server
2. Open Network tab in Browser DevTools and filter for websocket requests
3. You should see the `type=<connection-type>` in the request url


Index: code-server/lib/vscode/src/vs/platform/remote/common/remoteAgentConnection.ts
===================================================================
--- code-server.orig/lib/vscode/src/vs/platform/remote/common/remoteAgentConnection.ts
+++ code-server/lib/vscode/src/vs/platform/remote/common/remoteAgentConnection.ts
@@ -231,7 +231,7 @@ async function connectToRemoteExtensionH

let socket: ISocket;
try {
- socket = await createSocket(options.logService, options.socketFactory, options.host, options.port, `reconnectionToken=${options.reconnectionToken}&reconnection=${options.reconnectionProtocol ? 'true' : 'false'}`, `renderer-${connectionTypeToString(connectionType)}-${options.reconnectionToken}`, timeoutCancellationToken);
Expand Down
30 changes: 30 additions & 0 deletions patches/disable-builtin-ext-update.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Prevent builtin extensions from being updated

Updating builtin extensions from the marketplace prevents us from patching them
(for example out GitHub authentication patches).

Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts
===================================================================
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts
+++ code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts
@@ -206,6 +206,9 @@ export class Extension implements IExten
if (!this.gallery || !this.local) {
return false;
}
+ if (this.type !== ExtensionType.User) {
+ return false;
+ }
if (!this.local.preRelease && this.gallery.properties.isPreReleaseVersion) {
return false;
}
@@ -1057,6 +1060,10 @@ export class ExtensionsWorkbenchService
// Skip if check updates only for builtin extensions and current extension is not builtin.
continue;
}
+ if (installed.type !== ExtensionType.User) {
+ // Never update builtin extensions.
+ continue;
+ }
if (installed.isBuiltin && !installed.local?.identifier.uuid) {
// Skip if the builtin extension does not have Marketplace id
continue;
14 changes: 7 additions & 7 deletions patches/disable-downloads.diff
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/web.api.ts
===================================================================
--- code-server.orig/lib/vscode/src/vs/workbench/browser/web.api.ts
+++ code-server/lib/vscode/src/vs/workbench/browser/web.api.ts
@@ -210,6 +210,11 @@ export interface IWorkbenchConstructionO
@@ -215,6 +215,11 @@ export interface IWorkbenchConstructionO
*/
readonly userDataPath?: string

Expand Down Expand Up @@ -66,7 +66,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts

/* ----- server setup ----- */

@@ -92,6 +93,7 @@ export interface ServerParsedArgs {
@@ -96,6 +97,7 @@ export interface ServerParsedArgs {
'disable-update-check'?: boolean;
'auth'?: string
'locale'?: string
Expand All @@ -78,14 +78,14 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
===================================================================
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
@@ -290,6 +290,7 @@ export class WebClientServer {
@@ -293,6 +293,7 @@ export class WebClientServer {
logLevel: this._logService.getLevel(),
},
userDataPath: this._environmentService.userDataPath,
+ isEnabledFileDownloads: !this._environmentService.args['disable-file-downloads'],
settingsSyncOptions: !this._environmentService.isBuilt && this._environmentService.args['enable-sync'] ? { enabled: true } : undefined,
productConfiguration: <Partial<IProductConfiguration>>{
rootEndpoint: base,
enableWorkspaceTrust: !this._environmentService.args['disable-workspace-trust'],
folderUri: resolveWorkspaceURI(this._environmentService.args['default-folder']),
Index: code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts
===================================================================
--- code-server.orig/lib/vscode/src/vs/workbench/browser/contextkeys.ts
Expand Down Expand Up @@ -135,7 +135,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/files/browser/fileActions
===================================================================
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/files/browser/fileActions.contribution.ts
+++ code-server/lib/vscode/src/vs/workbench/contrib/files/browser/fileActions.contribution.ts
@@ -21,7 +21,7 @@ import { CLOSE_SAVED_EDITORS_COMMAND_ID,
@@ -22,7 +22,7 @@ import { CLOSE_SAVED_EDITORS_COMMAND_ID,
import { AutoSaveAfterShortDelayContext } from 'vs/workbench/services/filesConfiguration/common/filesConfigurationService';
import { WorkbenchListDoubleSelection } from 'vs/platform/list/browser/listService';
import { Schemas } from 'vs/base/common/network';
Expand All @@ -144,7 +144,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/files/browser/fileActions
import { IsWebContext } from 'vs/platform/contextkey/common/contextkeys';
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
import { ThemeIcon } from 'vs/platform/theme/common/themeService';
@@ -475,13 +475,16 @@ MenuRegistry.appendMenuItem(MenuId.Explo
@@ -476,13 +476,16 @@ MenuRegistry.appendMenuItem(MenuId.Explo
id: DOWNLOAD_COMMAND_ID,
title: DOWNLOAD_LABEL
},
Expand Down
Loading