Skip to content

chore: upgrade Code to 1.74.1 #5909

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 31 commits into from
Dec 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
320f035
chore: upgrade Code to 1.74.1
jsjoeio Dec 19, 2022
ec4177c
chore: remove require in integration.diff
jsjoeio Dec 19, 2022
8afa5c2
chore: update marketplace.diff
jsjoeio Dec 19, 2022
be1a560
chore: update sha hash in webview.diff
jsjoeio Dec 19, 2022
6751c82
chore: update disable-builtin-ext-update.diff
jsjoeio Dec 19, 2022
6acfb0b
chore: refresh proxy-uri patch
jsjoeio Dec 19, 2022
bb2a29b
chore: refresh local-storage.diff
jsjoeio Dec 19, 2022
4c00ad4
chore: refresh sourcemaps.diff
jsjoeio Dec 19, 2022
661e1de
chore: refresh disable-downloads.diff
jsjoeio Dec 19, 2022
da4f4c3
chore: refresh display-language.diff
jsjoeio Dec 19, 2022
63fb534
chore: refresh getting-started.diff
jsjoeio Dec 19, 2022
093bbc0
docs: update testing notes for cli-window-open
jsjoeio Dec 19, 2022
b1b8205
docs: update telemetry testing instructions
jsjoeio Dec 19, 2022
0aecf9e
fix: add GITHUB_TOKEN to build code-server job
jsjoeio Dec 19, 2022
d00ab19
refactor: use own cache key build code-server job
jsjoeio Dec 19, 2022
4deb156
temp: disable vscode test
jsjoeio Dec 20, 2022
3999279
refactor: delete wrapper test
jsjoeio Dec 20, 2022
fc54c44
Revert "refactor: delete wrapper test"
jsjoeio Dec 20, 2022
b3f7a20
refactor: move vscode tests to e2e (#5911)
jsjoeio Dec 21, 2022
10ebf1b
refactor: rm unused imports
jsjoeio Dec 21, 2022
0fabb3a
refactor: rm unnecessary navigate call in test
jsjoeio Dec 21, 2022
cbf00ae
fixup: formatting
jsjoeio Dec 21, 2022
e8ef8bf
wip: update test
jsjoeio Dec 21, 2022
b6928fa
refactor: modify assertion for proxy
jsjoeio Dec 21, 2022
19b7ba8
fixup: use REVERSE_PROXY_BASE_PATH
jsjoeio Dec 21, 2022
fe33adc
refactor: add helper fn getMaybeProxiedPathname
jsjoeio Dec 21, 2022
02d0aec
fixup: formatting
jsjoeio Dec 21, 2022
9681243
fixup: rm unused import
jsjoeio Dec 21, 2022
a059129
chore: increase playwright timeout
jsjoeio Dec 21, 2022
3b02151
Revert "chore: increase playwright timeout"
jsjoeio Dec 21, 2022
c0d59c8
chore: rm timeout
jsjoeio Dec 21, 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
70 changes: 54 additions & 16 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,55 @@ jobs:
if: steps.changed-files.outputs.any_changed == 'true'
run: yarn lint:ts

test-unit:
name: Run unit tests
runs-on: ubuntu-20.04
timeout-minutes: 5
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 2

- name: Get changed files
id: changed-files
uses: tj-actions/[email protected]
with:
files: |
**/*.ts
files_ignore: |
lib/vscode/**

- name: Install Node.js v16
if: steps.changed-files.outputs.any_changed == 'true'
uses: actions/setup-node@v3
with:
node-version: "16"

- name: Fetch dependencies from cache
if: steps.changed-files.outputs.any_changed == 'true'
id: cache-node-modules
uses: actions/cache@v3
with:
path: "**/node_modules"
key: yarn-build-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
yarn-build-

- name: Install dependencies
if: steps.changed-files.outputs.any_changed == 'true' && steps.cache-node-modules.outputs.cache-hit != 'true'
run: SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile

- name: Run unit tests
if: steps.changed-files.outputs.any_changed == 'true'
run: yarn test:unit

- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
if: success()

build:
name: Build code-server
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -170,15 +219,17 @@ jobs:
uses: actions/cache@v3
with:
path: "**/node_modules"
key: yarn-build-${{ hashFiles('**/yarn.lock') }}
key: yarn-build-code-server-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
yarn-build-
yarn-build-code-server-

- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: yarn --frozen-lockfile

- name: Build code-server
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: yarn build

# Get Code's git hash. When this changes it means the content is
Expand All @@ -204,19 +255,6 @@ jobs:
if: steps.cache-vscode.outputs.cache-hit != 'true'
run: yarn build:vscode

# Our code imports code from VS Code's `out` directory meaning VS Code
# must be built before running these tests.
# TODO: Move to its own step?
- name: Run code-server unit tests
run: yarn test:unit
if: success()

- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
if: success()

# The release package does not contain any native modules
# and is neutral to architecture/os/libc version.
- name: Create release package
Expand Down Expand Up @@ -336,7 +374,7 @@ jobs:
./test/node_modules/.bin/playwright install

- name: Run end-to-end tests
run: CODE_SERVER_TEST_ENTRY=./release yarn test:e2e --global-timeout 840000
run: CODE_SERVER_TEST_ENTRY=./release yarn test:e2e

- name: Upload test artifacts
if: always()
Expand Down
16 changes: 0 additions & 16 deletions ci/dev/test-unit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,6 @@ main() {
make -s out/index.js
popd

# Our code imports from `out` in order to work during development but if you
# have only built for production you will have not have this directory. In
# that case symlink `out` to a production build directory.
if [[ ! -e lib/vscode/out ]]; then
pushd lib
local out=(vscode-reh-web-*)
if [[ -d "${out[0]}" ]]; then
ln -s "../${out[0]}/out" ./vscode/out
else
echo "Could not find lib/vscode/out or lib/vscode-reh-web-*"
echo "Code must be built before running unit tests"
exit 1
fi
popd
fi

# We must keep jest in a sub-directory. See ../../test/package.json for more
# information. We must also run it from the root otherwise coverage will not
# include our source files.
Expand Down
2 changes: 1 addition & 1 deletion lib/vscode
Submodule vscode updated 1777 files
2 changes: 1 addition & 1 deletion patches/cli-window-open.diff
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ To test:
2. Open code-server
3. Open terminal
4. Open another code-server window
5. Run code-server with a file or directory argument
5. Run node ./out/node/entry.js with a file or directory argument
Copy link
Member

@code-asher code-asher Dec 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI node . can be used as a shortcut since it will use the main entry in package.json which points to out/node/entry.js.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL!


The file or directory should only open from the instance attached to that
terminal.
Expand Down
11 changes: 0 additions & 11 deletions patches/disable-builtin-ext-update.diff
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,3 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extens
if (!this.local.preRelease && this.gallery.properties.isPreReleaseVersion) {
return false;
}
@@ -1237,6 +1241,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;
+ }
Comment on lines -25 to -28
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unsure if we still need this. See 6751c82

cc @code-asher

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you are right! One way to see is if on load Code downloads a bunch of builtin extensions into the extensions dir.

if (installed.isBuiltin && (!installed.local?.identifier.uuid || (!isWeb && this.productService.quality === 'stable'))) {
// Skip checking updates for a builtin extension if it does not has Marketplace identifier or the current product is VS Code Desktop stable.
continue;
2 changes: 1 addition & 1 deletion 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
@@ -271,6 +271,11 @@ export interface IWorkbenchConstructionO
@@ -264,6 +264,11 @@ export interface IWorkbenchConstructionO
*/
readonly userDataPath?: string

Expand Down
4 changes: 2 additions & 2 deletions patches/display-language.diff
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Index: code-server/lib/vscode/src/vs/base/common/platform.ts
export const LANGUAGE_DEFAULT = 'en';

let _isWindows = false;
@@ -83,17 +81,19 @@ if (typeof navigator === 'object' && !is
@@ -86,17 +84,19 @@ if (typeof navigator === 'object' && !is
_isMobile = _userAgent?.indexOf('Mobi') >= 0;
_isWeb = true;

Expand Down Expand Up @@ -125,7 +125,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
@@ -110,7 +110,7 @@ export abstract class AbstractNativeEnvi
@@ -107,7 +107,7 @@ export abstract class AbstractNativeEnvi
return URI.file(join(vscodePortable, 'argv.json'));
}

Expand Down
8 changes: 4 additions & 4 deletions patches/getting-started.diff
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/bro
===================================================================
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.ts
+++ code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.ts
@@ -62,7 +62,7 @@ import { GettingStartedIndexList } from
@@ -59,7 +59,7 @@ import { GettingStartedIndexList } from
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
import { KeyCode } from 'vs/base/common/keyCodes';
import { getTelemetryLevel } from 'vs/platform/telemetry/common/telemetryUtils';
Expand All @@ -19,7 +19,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/bro
import { OpenFolderViaWorkspaceAction } from 'vs/workbench/browser/actions/workspaceActions';
import { OpenRecentAction } from 'vs/workbench/browser/actions/windowActions';
import { Toggle } from 'vs/base/browser/ui/toggle/toggle';
@@ -758,6 +758,72 @@ export class GettingStartedPage extends
@@ -756,6 +756,72 @@ export class GettingStartedPage extends
$('p.subtitle.description', {}, localize({ key: 'gettingStarted.editingEvolved', comment: ['Shown as subtitle on the Welcome page.'] }, "Editing evolved"))
);

Expand Down Expand Up @@ -92,7 +92,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/bro

const leftColumn = $('.categories-column.categories-column-left', {},);
const rightColumn = $('.categories-column.categories-column-right', {},);
@@ -775,13 +841,23 @@ export class GettingStartedPage extends
@@ -773,13 +839,23 @@ export class GettingStartedPage extends
const layoutLists = () => {
if (gettingStartedList.itemCount) {
this.container.classList.remove('noWalkthroughs');
Expand Down Expand Up @@ -143,7 +143,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
@@ -276,6 +276,11 @@ export interface IWorkbenchConstructionO
@@ -269,6 +269,11 @@ export interface IWorkbenchConstructionO
*/
readonly isEnabledFileDownloads?: boolean

Expand Down
8 changes: 4 additions & 4 deletions patches/integration.diff
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Index: code-server/lib/vscode/src/vs/server/node/server.main.ts
-const LOCAL_HISTORY_HOME = join(APP_SETTINGS_HOME, 'History');
-const MACHINE_SETTINGS_HOME = join(USER_DATA_PATH, 'Machine');
-args['user-data-dir'] = USER_DATA_PATH;
-const APP_ROOT = dirname(FileAccess.asFileUri('', require).fsPath);
-const APP_ROOT = dirname(FileAccess.asFileUri('').fsPath);
-const BUILTIN_EXTENSIONS_FOLDER_PATH = join(APP_ROOT, 'extensions');
-args['builtin-extensions-dir'] = BUILTIN_EXTENSIONS_FOLDER_PATH;
-args['extensions-dir'] = args['extensions-dir'] || join(REMOTE_DATA_FOLDER, 'extensions');
Expand All @@ -58,7 +58,7 @@ Index: code-server/lib/vscode/src/vs/server/node/server.main.ts
+ const LOCAL_HISTORY_HOME = join(APP_SETTINGS_HOME, 'History');
+ const MACHINE_SETTINGS_HOME = join(USER_DATA_PATH, 'Machine');
+ args['user-data-dir'] = USER_DATA_PATH;
+ const APP_ROOT = dirname(FileAccess.asFileUri('', require).fsPath);
+ const APP_ROOT = dirname(FileAccess.asFileUri('').fsPath);
+ const BUILTIN_EXTENSIONS_FOLDER_PATH = args['builtin-extensions-dir'] || join(APP_ROOT, 'extensions');
+ args['builtin-extensions-dir'] = BUILTIN_EXTENSIONS_FOLDER_PATH;
+ args['extensions-dir'] = args['extensions-dir'] || join(REMOTE_DATA_FOLDER, 'extensions');
Expand Down Expand Up @@ -107,7 +107,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/parts/dialogs/dialogHandl
===================================================================
--- code-server.orig/lib/vscode/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
+++ code-server/lib/vscode/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
@@ -143,8 +143,11 @@ export class BrowserDialogHandler implem
@@ -145,8 +145,11 @@ export class BrowserDialogHandler implem

async about(): Promise<void> {
const detailString = (useAgo: boolean): string => {
Expand Down Expand Up @@ -184,7 +184,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/web.main.ts
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { IProgressService } from 'vs/platform/progress/common/progress';
import { DelayedLogChannel } from 'vs/workbench/services/output/common/delayedLogChannel';
@@ -117,6 +118,9 @@ export class BrowserMain extends Disposa
@@ -118,6 +119,9 @@ export class BrowserMain extends Disposa
// Startup
const instantiationService = workbench.startup();

Expand Down
2 changes: 1 addition & 1 deletion patches/local-storage.diff
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,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
@@ -266,6 +266,11 @@ export interface IWorkbenchConstructionO
@@ -259,6 +259,11 @@ export interface IWorkbenchConstructionO
*/
readonly configurationDefaults?: Record<string, any>;

Expand Down
2 changes: 1 addition & 1 deletion patches/marketplace.diff
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Index: code-server/lib/vscode/src/vs/platform/product/common/product.ts
===================================================================
--- code-server.orig/lib/vscode/src/vs/platform/product/common/product.ts
+++ code-server/lib/vscode/src/vs/platform/product/common/product.ts
@@ -53,6 +53,16 @@ else if (typeof require?.__$__nodeRequir
@@ -47,6 +47,16 @@ else if (globalThis._VSCODE_PRODUCT_JSON
version: pkg.version
});
}
Expand Down
2 changes: 1 addition & 1 deletion patches/proxy-uri.diff
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/web.main.ts
===================================================================
--- code-server.orig/lib/vscode/src/vs/workbench/browser/web.main.ts
+++ code-server/lib/vscode/src/vs/workbench/browser/web.main.ts
@@ -248,7 +248,7 @@ export class BrowserMain extends Disposa
@@ -247,7 +247,7 @@ export class BrowserMain extends Disposa

// Remote
const connectionToken = environmentService.options.connectionToken || getCookieValue(connectionTokenCookieName);
Expand Down
2 changes: 1 addition & 1 deletion patches/sourcemaps.diff
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Index: code-server/lib/vscode/build/gulpfile.reh.js

let version = packageJson.version;
const quality = product.quality;
@@ -388,7 +387,7 @@ function tweakProductForServerWeb(produc
@@ -389,7 +388,7 @@ function tweakProductForServerWeb(produc
const minifyTask = task.define(`minify-vscode-${type}`, task.series(
optimizeTask,
util.rimraf(`out-vscode-${type}-min`),
Expand Down
2 changes: 1 addition & 1 deletion patches/telemetry.diff
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Add support for telemetry endpoint

To test:
1. Create a RequestBin - https://requestbin.io/
1. Create a mock API using [RequestBin](https://requestbin.io/) or [Beeceptor](https://beeceptor.com/)
2. Run code-server with `CS_TELEMETRY_URL` set:
i.e. `CS_TELEMETRY_URL="https://requestbin.io/1ebub9z1" ./code-server-<version>-macos-amd64/bin/code-server`
NOTE: it has to be a production build.
Expand Down
10 changes: 5 additions & 5 deletions patches/webview.diff
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Index: code-server/lib/vscode/src/vs/workbench/services/environment/browser/envi
===================================================================
--- code-server.orig/lib/vscode/src/vs/workbench/services/environment/browser/environmentService.ts
+++ code-server/lib/vscode/src/vs/workbench/services/environment/browser/environmentService.ts
@@ -210,7 +210,7 @@ export class BrowserWorkbenchEnvironment
@@ -207,7 +207,7 @@ export class BrowserWorkbenchEnvironment

@memoize
get webviewExternalEndpoint(): string {
Expand Down Expand Up @@ -70,12 +70,12 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index
<meta charset="UTF-8">

<meta http-equiv="Content-Security-Policy"
- content="default-src 'none'; script-src 'sha256-lC8sxUeeYqUtmkCpPt/OX/HQdE0JbHG1Z3dzrilsRU0=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
+ content="default-src 'none'; script-src 'sha256-/9/YQU12wvTeVXCsIGB4shLwdWrMceCpKojfkloNjPU=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
- content="default-src 'none'; script-src 'sha256-6s2fEapj0jmA7ZDjzz23Uv4xLlM7KX3p9DYidJX7Zmk=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
+ content="default-src 'none'; script-src 'sha256-6/HBKMr5Cr24xXtQ+U/BxvVfCvBLYE55u8Jq3j/nzcI=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked webviews via Markdown Preview and Simple Browser. Unless the HTML files were cached, I didn't see any issues. I will double-check.


<!-- Disable pinch zooming -->
<meta name="viewport"
@@ -331,6 +331,12 @@
@@ -325,6 +325,12 @@

const hostname = location.hostname;

Expand All @@ -92,7 +92,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index
===================================================================
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index-no-csp.html
+++ code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index-no-csp.html
@@ -330,6 +330,12 @@
@@ -318,6 +318,12 @@

const hostname = location.hostname;

Expand Down
4 changes: 2 additions & 2 deletions test/e2e/models/CodeServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ export class CodeServer {
path.join(dir, "extensions"),
"--auth",
"none",
// The workspace to open.
...(this.args.includes("--ignore-last-opened") ? [] : [dir]),
...this.args,
// Using port zero will spawn on a random port.
"--bind-addr",
Expand All @@ -139,8 +141,6 @@ export class CodeServer {
path.join(dir, "config.yaml"),
"--user-data-dir",
dir,
// The last argument is the workspace to open.
dir,
]
this.logger.debug("spawning `node " + args.join(" ") + "`")
const proc = cp.spawn("node", args, {
Expand Down
Loading