From 06e5fff7b6628c217efd7bcc06acd50c974bfbf5 Mon Sep 17 00:00:00 2001 From: Aijia Cen Date: Wed, 11 Sep 2024 17:29:34 -0700 Subject: [PATCH 1/2] Update Patched VS Code version to 1.93.0 with patches applied --- patches/local-storage.diff | 6 +-- patches/sagemaker-idle-extension.patch | 22 +++++------ patches/sagemaker-integration.diff | 51 +++++++------------------- patches/series | 2 +- vscode | 2 +- 5 files changed, 29 insertions(+), 54 deletions(-) diff --git a/patches/local-storage.diff b/patches/local-storage.diff index 90c24abe..6191381b 100644 --- a/patches/local-storage.diff +++ b/patches/local-storage.diff @@ -20,10 +20,10 @@ Index: sagemaker-code-editor/vscode/src/vs/server/node/webClientServer.ts =================================================================== --- sagemaker-code-editor.orig/vscode/src/vs/server/node/webClientServer.ts +++ sagemaker-code-editor/vscode/src/vs/server/node/webClientServer.ts -@@ -332,6 +332,7 @@ export class WebClientServer { +@@ -330,6 +330,7 @@ export class WebClientServer { const workbenchWebConfiguration = { remoteAuthority, - webviewEndpoint: vscodeBase + this._staticRoute + '/out/vs/workbench/contrib/webview/browser/pre', + serverBasePath: this._basePath, + userDataPath: this._environmentService.userDataPath, _wrapWebWorkerExtHostInIframe, developmentOptions: { enableSmokeTestDriver: this._environmentService.args['enable-smoke-test-driver'] ? true : undefined, logLevel: this._logService.getLevel() }, @@ -32,7 +32,7 @@ Index: sagemaker-code-editor/vscode/src/vs/workbench/browser/web.api.ts =================================================================== --- sagemaker-code-editor.orig/vscode/src/vs/workbench/browser/web.api.ts +++ sagemaker-code-editor/vscode/src/vs/workbench/browser/web.api.ts -@@ -276,6 +276,11 @@ export interface IWorkbenchConstructionO +@@ -298,6 +298,11 @@ export interface IWorkbenchConstructionO */ readonly configurationDefaults?: Record; diff --git a/patches/sagemaker-idle-extension.patch b/patches/sagemaker-idle-extension.patch index f42b600d..9597edfc 100644 --- a/patches/sagemaker-idle-extension.patch +++ b/patches/sagemaker-idle-extension.patch @@ -269,10 +269,10 @@ Index: sagemaker-code-editor/vscode/build/gulpfile.extensions.js =================================================================== --- sagemaker-code-editor.orig/vscode/build/gulpfile.extensions.js +++ sagemaker-code-editor/vscode/build/gulpfile.extensions.js -@@ -61,6 +61,7 @@ const compilations = [ +@@ -59,6 +59,7 @@ const compilations = [ + 'extensions/references-view/tsconfig.json', 'extensions/search-result/tsconfig.json', 'extensions/simple-browser/tsconfig.json', - 'extensions/sagemaker-extension/tsconfig.json', + 'extensions/sagemaker-idle-extension/tsconfig.json', 'extensions/tunnel-forwarding/tsconfig.json', 'extensions/typescript-language-features/test-workspace/tsconfig.json', @@ -281,10 +281,10 @@ Index: sagemaker-code-editor/vscode/build/npm/dirs.js =================================================================== --- sagemaker-code-editor.orig/vscode/build/npm/dirs.js +++ sagemaker-code-editor/vscode/build/npm/dirs.js -@@ -40,6 +40,7 @@ const dirs = [ +@@ -38,6 +38,7 @@ const dirs = [ + 'extensions/npm', 'extensions/php-language-features', 'extensions/references-view', - 'extensions/sagemaker-extension', + 'extensions/sagemaker-idle-extension', 'extensions/search-result', 'extensions/simple-browser', @@ -296,12 +296,12 @@ Index: sagemaker-code-editor/vscode/src/vs/server/node/webClientServer.ts @@ -4,6 +4,7 @@ *--------------------------------------------------------------------------------------------*/ - import { createReadStream } from 'fs'; + import { createReadStream, promises } from 'fs'; +import {readFile } from 'fs/promises'; - import { Promises } from 'vs/base/node/pfs'; import * as path from 'path'; import * as http from 'http'; -@@ -100,6 +101,7 @@ export class WebClientServer { + import * as url from 'url'; +@@ -101,6 +102,7 @@ export class WebClientServer { private readonly _staticRoute: string; private readonly _callbackRoute: string; private readonly _webExtensionRoute: string; @@ -309,7 +309,7 @@ Index: sagemaker-code-editor/vscode/src/vs/server/node/webClientServer.ts constructor( private readonly _connectionToken: ServerConnectionToken, -@@ -115,6 +117,7 @@ export class WebClientServer { +@@ -117,6 +119,7 @@ export class WebClientServer { this._staticRoute = `${serverRootPath}/static`; this._callbackRoute = `${serverRootPath}/callback`; this._webExtensionRoute = `${serverRootPath}/web-extension-resource`; @@ -317,7 +317,7 @@ Index: sagemaker-code-editor/vscode/src/vs/server/node/webClientServer.ts } /** -@@ -132,6 +135,9 @@ export class WebClientServer { +@@ -134,6 +137,9 @@ export class WebClientServer { if (pathname === this._basePath) { return this._handleRoot(req, res, parsedUrl); } @@ -327,7 +327,7 @@ Index: sagemaker-code-editor/vscode/src/vs/server/node/webClientServer.ts if (pathname === this._callbackRoute) { // callback support return this._handleCallback(res); -@@ -451,6 +457,27 @@ export class WebClientServer { +@@ -468,4 +474,25 @@ export class WebClientServer { }); return void res.end(data); } @@ -353,5 +353,3 @@ Index: sagemaker-code-editor/vscode/src/vs/server/node/webClientServer.ts + } + } } - - /** diff --git a/patches/sagemaker-integration.diff b/patches/sagemaker-integration.diff index 9af2d5de..53357c96 100644 --- a/patches/sagemaker-integration.diff +++ b/patches/sagemaker-integration.diff @@ -69,7 +69,7 @@ Index: sagemaker-code-editor/vscode/src/vs/workbench/browser/web.main.ts =================================================================== --- sagemaker-code-editor.orig/vscode/src/vs/workbench/browser/web.main.ts +++ sagemaker-code-editor/vscode/src/vs/workbench/browser/web.main.ts -@@ -95,6 +95,7 @@ import { TunnelSource } from 'vs/workbench/services/re +@@ -96,6 +96,7 @@ import { ISecretStorageService } from 'v import { TunnelSource } from 'vs/workbench/services/remote/common/tunnelModel'; import { mainWindow } from 'vs/base/browser/window'; import { INotificationService, Severity } from 'vs/platform/notification/common/notification'; @@ -77,16 +77,16 @@ Index: sagemaker-code-editor/vscode/src/vs/workbench/browser/web.main.ts export class BrowserMain extends Disposable { -@@ -129,6 +130,9 @@ export class BrowserMain extends Disposable { - +@@ -131,6 +132,9 @@ export class BrowserMain extends Disposa // Startup const instantiationService = workbench.startup(); -+ + + // Create instance of SagemakerServerClient + this._register(instantiationService.createInstance(SagemakerServerClient)); - ++ // Window this._register(instantiationService.createInstance(BrowserWindow)); + Index: sagemaker-code-editor/vscode/product.json =================================================================== --- sagemaker-code-editor.orig/vscode/product.json @@ -100,14 +100,14 @@ Index: sagemaker-code-editor/vscode/product.json "applicationName": "code-oss", "dataFolderName": ".vscode-oss", "win32MutexName": "vscodeoss", -@@ -34,52 +34,16 @@ +@@ -32,53 +32,17 @@ "urlProtocol": "code-oss", "webviewContentExternalBaseUrlTemplate": "https://{{uuid}}.vscode-cdn.net/insider/ef65ac1ba57f57f2a3961bfe94aa20481caca4c6/out/vs/workbench/contrib/webview/browser/pre/", "builtInExtensions": [ - { - "name": "ms-vscode.js-debug-companion", -- "version": "1.1.2", -- "sha256": "e034b8b41beb4e97e02c70f7175bd88abe66048374c2bd629f54bb33354bc2aa", +- "version": "1.1.3", +- "sha256": "7380a890787452f14b2db7835dfa94de538caf358ebc263f9d46dd68ac52de93", - "repo": "https://github.com/microsoft/vscode-js-debug-companion", - "metadata": { - "id": "99cb0b7f-7354-4278-b8da-6cc79972169d", @@ -122,8 +122,8 @@ Index: sagemaker-code-editor/vscode/product.json - }, - { - "name": "ms-vscode.js-debug", -- "version": "1.90.0", -- "sha256": "1317dd7d1ac50641c1534a3e957ecbc94349f4fbd897acb916da11eea3208a66", +- "version": "1.93.0", +- "sha256": "9339cb8e6b77f554df54d79e71f533279cb76b0f9b04c207f633bfd507442b6a", - "repo": "https://github.com/microsoft/vscode-js-debug", - "metadata": { - "id": "25629058-ddac-4e17-abba-74678e126c5d", @@ -152,6 +152,7 @@ Index: sagemaker-code-editor/vscode/product.json - "publisherDisplayName": "Microsoft" - } - } +- ] + ], + "extensionsGallery": { + "serviceUrl": "https://open-vsx.org/vscode/gallery", @@ -164,37 +165,13 @@ Index: sagemaker-code-editor/vscode/product.json + }, + "linkProtectionTrustedDomains": [ + "https://open-vsx.org" - ] -Index: sagemaker-code-editor/vscode/src/vs/platform/product/common/product.ts -=================================================================== ---- sagemaker-code-editor.orig/vscode/src/vs/platform/product/common/product.ts -+++ sagemaker-code-editor/vscode/src/vs/platform/product/common/product.ts -@@ -59,15 +59,17 @@ else { - if (Object.keys(product).length === 0) { - Object.assign(product, { - version: '1.90.0-dev', -- nameShort: 'Code - OSS Dev', -- nameLong: 'Code - OSS Dev', -+ nameShort: 'CodeEditor', -+ nameLong: 'Code Editor', - applicationName: 'code-oss', - dataFolderName: '.vscode-oss', -+ commit: "hellocommit", -+ date: "hellodate", - urlProtocol: 'code-oss', - reportIssueUrl: 'https://github.com/microsoft/vscode/issues/new', - licenseName: 'MIT', - licenseUrl: 'https://github.com/microsoft/vscode/blob/main/LICENSE.txt', -- serverLicenseUrl: 'https://github.com/microsoft/vscode/blob/main/LICENSE.txt' -+ serverLicenseUrl: 'https://github.com/microsoft/vscode/blob/main/LICENSE.txt', - }); - } ++ ] } Index: sagemaker-code-editor/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.ts =================================================================== --- sagemaker-code-editor.orig/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.ts +++ sagemaker-code-editor/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.ts -@@ -779,8 +779,8 @@ export class GettingStartedPage extends EditorPane { +@@ -800,8 +800,8 @@ export class GettingStartedPage extends })); const header = $('.header', {}, @@ -379,7 +356,7 @@ Index: sagemaker-code-editor/vscode/src/vs/workbench/contrib/welcomeGettingStart =================================================================== --- sagemaker-code-editor.orig/vscode/src/vs/workbench/contrib/welcomeGettingStarted/common/gettingStartedContent.ts +++ sagemaker-code-editor/vscode/src/vs/workbench/contrib/welcomeGettingStarted/common/gettingStartedContent.ts -@@ -257,8 +257,8 @@ export const walkthroughs: GettingStartedWalkthroughCo +@@ -310,8 +310,8 @@ export const walkthroughs: GettingStarte { id: 'SetupWeb', diff --git a/patches/series b/patches/series index 9091c133..1547c75c 100644 --- a/patches/series +++ b/patches/series @@ -7,4 +7,4 @@ local-storage.diff sagemaker-integration.diff license.diff sagemaker-idle-extension.patch -terminal-crash-mitigation.patch \ No newline at end of file +terminal-crash-mitigation.patch diff --git a/vscode b/vscode index 611f9bfc..4849ca9b 160000 --- a/vscode +++ b/vscode @@ -1 +1 @@ -Subproject commit 611f9bfce64f25108829dd295f54a6894e87339d +Subproject commit 4849ca9bdf9666755eb463db297b69e5385090e3 From 0b1c0cff86006998ef56dbd4ea48c48fd341fc94 Mon Sep 17 00:00:00 2001 From: Aijia Cen Date: Thu, 12 Sep 2024 17:48:26 -0700 Subject: [PATCH 2/2] adding patch and tested with sh ./scripts/install.sh command --- README.md | 3 +- patches/base-path.diff | 26 -- patches/disable-online-services.diff | 35 --- patches/disable-telemetry.diff | 51 --- patches/local-storage.diff | 12 - patches/sagemaker-extension.diff | 444 --------------------------- patches/webview.diff | 20 +- 7 files changed, 3 insertions(+), 588 deletions(-) diff --git a/README.md b/README.md index c9d2a463..d4744320 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,8 @@ sh ./scripts/test.sh --website='http://localhost:9090' -uicl This will run the OSS unit and integration tests, and the Cypress integration tests for a local Code Editor instance at `localhost:9090`. ## Publishing Releases -To publish a new release using the GitHub Action, push a tag that starts with `v`, e.g. `v1.5.0`. This will trigger an Action to create a tarball and publish it in a release with the tag `v1.5.0`. Currently the Action will require manual approval from @aws-pangestu, @aws-navinns, or @aws-asolidu. +To publish a new release using the GitHub Action, open a new branch the open a PR, the PR should be reviewed and manually approval from @aws-pangestu, @aws-navinns, or @aws-asolidu. +Once PR is approved, push a tag that starts with `v`, e.g. `v1.5.0`. This will trigger an Action to create a tarball and publish it in a release with the tag `v1.5.0`. Currently the Action will require. manually approval from @aws-pangestu, @aws-navinns, or @aws-asolidu. ### Future We hope to extend this Action to also automatically update the CodeEditor feedstock repository. diff --git a/patches/base-path.diff b/patches/base-path.diff index e729f907..29148ee0 100644 --- a/patches/base-path.diff +++ b/patches/base-path.diff @@ -38,19 +38,6 @@ Index: sagemaker-code-editor/vscode/src/vs/code/browser/workbench/workbench-dev. Object.keys(self.webPackagePaths).map(function (key, index) { self.webPackagePaths[key] = `${baseUrl}/remote/web/node_modules/${key}/${self.webPackagePaths[key]}`; }); -Index: sagemaker-code-editor/vscode/src/vs/code/browser/workbench/workbench.html -=================================================================== ---- sagemaker-code-editor.orig/vscode/src/vs/code/browser/workbench/workbench.html -+++ sagemaker-code-editor/vscode/src/vs/code/browser/workbench/workbench.html -@@ -36,7 +36,7 @@ - - -