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 39 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
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
2 changes: 1 addition & 1 deletion ci/build/npm-postinstall.sh
Original file line number Diff line number Diff line change
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
2 changes: 1 addition & 1 deletion lib/vscode
Submodule vscode updated 1246 files
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
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
14 changes: 7 additions & 7 deletions patches/display-language.diff
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverServices.ts
===================================================================
--- code-server.orig/lib/vscode/src/vs/server/node/serverServices.ts
+++ code-server/lib/vscode/src/vs/server/node/serverServices.ts
@@ -188,6 +188,9 @@ export async function setupServerService
@@ -192,6 +192,9 @@ export async function setupServerService
const channel = new ExtensionManagementChannel(extensionManagementService, (ctx: RemoteAgentConnectionContext) => getUriTransformer(ctx.remoteAuthority));
socketServer.registerChannel('extensions', channel);

Expand Down Expand Up @@ -94,7 +94,7 @@ Index: code-server/lib/vscode/src/vs/platform/environment/common/environmentServ
===================================================================
--- code-server.orig/lib/vscode/src/vs/platform/environment/common/environmentService.ts
+++ code-server/lib/vscode/src/vs/platform/environment/common/environmentService.ts
@@ -105,7 +105,7 @@ export abstract class AbstractNativeEnvi
@@ -108,7 +108,7 @@ export abstract class AbstractNativeEnvi
return URI.file(join(vscodePortable, 'argv.json'));
}

Expand Down Expand Up @@ -168,15 +168,15 @@ 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
@@ -26,6 +26,7 @@ import { URI } from 'vs/base/common/uri'
@@ -27,6 +27,7 @@ import { URI } from 'vs/base/common/uri'
import { streamToBuffer } from 'vs/base/common/buffer';
import { IProductConfiguration } from 'vs/base/common/product';
import { isString } from 'vs/base/common/types';
+import { getLocaleFromConfig, getNLSConfiguration } from 'vs/server/node/remoteLanguagePacks';

const textMimeType = {
'.html': 'text/html',
@@ -277,6 +278,8 @@ export class WebClientServer {
@@ -280,6 +281,8 @@ export class WebClientServer {
} : undefined;
const base = relativeRoot(getOriginalUrl(req))
const vscodeBase = relativePath(getOriginalUrl(req))
Expand All @@ -185,7 +185,7 @@ 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,
@@ -303,7 +306,8 @@ export class WebClientServer {
@@ -309,7 +312,8 @@ export class WebClientServer {
})))
.replace('{{WORKBENCH_AUTH_SESSION}}', () => authSessionInfo ? escapeAttribute(JSON.stringify(authSessionInfo)) : '')
.replace(/{{BASE}}/g, base)
Expand All @@ -207,7 +207,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts

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

@@ -90,6 +91,7 @@ export interface ServerParsedArgs {
@@ -94,6 +95,7 @@ export interface ServerParsedArgs {
/* ----- code-server ----- */
'disable-update-check'?: boolean;
'auth'?: string
Expand Down Expand Up @@ -252,7 +252,7 @@ Index: code-server/lib/vscode/src/vs/workbench/workbench.web.main.ts
===================================================================
--- code-server.orig/lib/vscode/src/vs/workbench/workbench.web.main.ts
+++ code-server/lib/vscode/src/vs/workbench/workbench.web.main.ts
@@ -111,6 +111,10 @@ registerSingleton(IDiagnosticsService, N
@@ -112,6 +112,10 @@ registerSingleton(IDiagnosticsService, N

//#region --- workbench contributions

Expand Down
118 changes: 0 additions & 118 deletions patches/github-auth.diff

This file was deleted.

9 changes: 7 additions & 2 deletions patches/insecure-notification.diff
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ may think code-server is broken. Ideally there would be a notification at the
point where these things are used instead of this though.

To test access over something like an HTTP domain or an IP address (not
localhost).
localhost). For example:

1. run code-server
2. use ngrok to expose code-server
3. access via HTTP
4. look for notification in bottom right

Index: code-server/lib/vscode/src/vs/workbench/browser/client.ts
===================================================================
Expand All @@ -15,7 +20,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/client.ts
import { Disposable } from 'vs/base/common/lifecycle';
+import { localize } from 'vs/nls';
+import { INotificationService, Severity } from 'vs/platform/notification/common/notification';

export class CodeServerClient extends Disposable {
constructor (
+ @INotificationService private notificationService: INotificationService,
Expand Down
Loading