From 5f946ce1b2c8d5a479d5847ce16bce4c65323c6a Mon Sep 17 00:00:00 2001 From: Feiyang Liu Date: Wed, 10 Dec 2025 12:24:58 +0100 Subject: [PATCH 1/9] Map between the Code Editor and SageMaker Code Editor versions only in product.json metadata --- .github/workflows/release.yaml | 85 ++++++++++++++++++++-------------- 1 file changed, 51 insertions(+), 34 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 8c5cea0..75e5555 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,8 +1,15 @@ name: Create release on: - push: - tags: - - '*' + workflow_dispatch: + inputs: + code_editor_version: + description: 'Code Editor version' + required: true + type: string + sagemaker_version: + description: 'SageMaker Code Editor version' + required: true + type: string jobs: release: @@ -10,8 +17,8 @@ jobs: permissions: contents: write # Required for creating releases env: - COMMIT_SHA: ${{ github.sha }} - VERSION_NUM: ${{ github.event.inputs.version || github.ref_name }} + CODE_EDITOR_VERSION: ${{ github.event.inputs.code_editor_version }} + SAGEMAKER_VERSION: ${{ github.event.inputs.sagemaker_version }} SAGEMAKER_ARTIFACT_PREFIX: "code-editor-sagemaker-server" GH_TOKEN: ${{ github.token }} steps: @@ -20,22 +27,33 @@ jobs: with: fetch-depth: 0 - - name: Validate tag + - name: Validate versions and tag run: | - if ! echo "$VERSION_NUM" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+(-rc\.[0-9]+)?$'; then - echo "Tag $VERSION_NUM does not follow semantic version pattern (x.y.z or x.y.z-rc.N). Skipping release." - exit 78 # neutral exit code + if ! echo "$CODE_EDITOR_VERSION" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+(-rc\.[0-9]+)?$'; then + echo "Code Editor version $CODE_EDITOR_VERSION does not follow semantic version pattern (x.y.z) or x.y.z-rc.N. Skipping release." + exit 1 fi - echo "Tag $VERSION_NUM follows valid semantic version pattern" - - # Verify release tag is made on the correct major.minor version branch. - MAJOR_MINOR=$(echo "$VERSION_NUM" | cut -d'.' -f1,2) - BRANCH_CONTAINS_OUTPUT=$(git branch --remote --contains "$COMMIT_SHA" "origin/$MAJOR_MINOR") - if [ -z "$BRANCH_CONTAINS_OUTPUT" ]; then - echo "Tag $VERSION_NUM is not on the correct branch. Skipping release." - exit 78 + echo "Code Editor version $CODE_EDITOR_VERSION is valid" + echo "SageMaker Code Editor version $SAGEMAKER_VERSION will be mapped" + + # Verify tag exists and matches the version + if ! git rev-parse "$CODE_EDITOR_VERSION" >/dev/null 2>&1; then + echo "Error: Tag $CODE_EDITOR_VERSION does not exist. Create it first with: git tag $CODE_EDITOR_VERSION. Skipping release." + exit 1 + fi + + # Get commit SHA from tag and export it + TAG_COMMIT_SHA=$(git rev-parse "$CODE_EDITOR_VERSION") + echo "COMMIT_SHA=$TAG_COMMIT_SHA" >> $GITHUB_ENV + echo "Tag $CODE_EDITOR_VERSION points to commit $TAG_COMMIT_SHA" + + # Verify tag is on correct branch + MAJOR_MINOR=$(echo "$CODE_EDITOR_VERSION" | cut -d'.' -f1,2) + if ! git branch --remote --contains "$CODE_EDITOR_VERSION" | grep -q "origin/$MAJOR_MINOR"; then + echo "Error: Tag $CODE_EDITOR_VERSION is not on branch $MAJOR_MINOR. Skipping release." + exit 1 fi - echo "Tag is from a valid branch." + echo "Tag validation passed" - name: Download sagemaker artifacts by commit ID run: | @@ -58,21 +76,20 @@ jobs: fi done - - name: Update Code Editor version + - name: Update versions in artifacts run: | tar xzf "$COMMIT_SHA-$SAGEMAKER_ARTIFACT_PREFIX-src/$SAGEMAKER_ARTIFACT_PREFIX-src.tar.gz" cd code-editor-src - CURRENT_VERSION=$(jq -r '.codeEditorVersion' product.json) - jq ".codeEditorVersion = \"$VERSION_NUM\"" product.json > temp.json && mv temp.json product.json + CURRENT_CE_VERSION=$(jq -r '.codeEditorVersion' product.json) + jq ".codeEditorVersion = \"$CODE_EDITOR_VERSION\" | .sagemakerCodeEditorVersion = \"$SAGEMAKER_VERSION\"" product.json > temp.json && mv temp.json product.json cd .. - tar -czf "code-editor-sagemaker-src-$VERSION_NUM.tar.gz" code-editor-src/ + tar -czf "code-editor-sagemaker-src-$CODE_EDITOR_VERSION.tar.gz" code-editor-src/ rm -rf code-editor-src tar xzf "$COMMIT_SHA-$SAGEMAKER_ARTIFACT_PREFIX-build/$SAGEMAKER_ARTIFACT_PREFIX-build.tar.gz" cd vscode-reh-web-linux-x64 - # Update Code Editor Version in all files - jq ".codeEditorVersion = \"$VERSION_NUM\"" product.json > temp.json && mv temp.json product.json + jq ".codeEditorVersion = \"$CODE_EDITOR_VERSION\" | .sagemakerCodeEditorVersion = \"$SAGEMAKER_VERSION\"" product.json > temp.json && mv temp.json product.json FILES_TO_UPDATE=( "out/server-main.js" @@ -81,31 +98,31 @@ jobs: "out/vs/workbench/api/node/extensionHostProcess.js" ) for file in "${FILES_TO_UPDATE[@]}"; do - sed -i "s/codeEditorVersion:\s*\"$CURRENT_VERSION\"/codeEditorVersion:\"$VERSION_NUM\"/g" "$file" + sed -i "s/codeEditorVersion:\"$CURRENT_CE_VERSION\"/codeEditorVersion:\"$CODE_EDITOR_VERSION\",sagemakerCodeEditorVersion:\"$SAGEMAKER_VERSION\"/g" "$file" done cd .. - tar -czf "code-editor-sagemaker-server-$VERSION_NUM.tar.gz" vscode-reh-web-linux-x64/ + tar -czf "code-editor-sagemaker-server-$CODE_EDITOR_VERSION.tar.gz" vscode-reh-web-linux-x64/ rm -rf vscode-reh-web-linux-x64 - name: Create GitHub release run: | # Check if this is a release candidate PRERELEASE_FLAG="" - if echo "$VERSION_NUM" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+$'; then + if echo "$CODE_EDITOR_VERSION" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+$'; then PRERELEASE_FLAG="--prerelease" echo "Detected release candidate version, will mark as prerelease" fi # Check if release already exists. Needed when release created via new release in guthub ui - if gh release view "$VERSION_NUM" > /dev/null 2>&1; then - echo "Release for tag $VERSION_NUM already exists, uploading additional assets..." - gh release upload "$VERSION_NUM" ./*.tar.gz --clobber + if gh release view "$CODE_EDITOR_VERSION" > /dev/null 2>&1; then + echo "Release for tag $CODE_EDITOR_VERSION already exists, uploading additional assets..." + gh release upload "$CODE_EDITOR_VERSION" ./*.tar.gz --clobber else - echo "Creating new release for tag $VERSION_NUM..." - gh release create "$VERSION_NUM" ./*.tar.gz \ - --title "Release $VERSION_NUM" \ - --notes "Release $VERSION_NUM" \ + echo "Creating new release for tag $CODE_EDITOR_VERSION..." + gh release create "$CODE_EDITOR_VERSION" ./*.tar.gz \ + --title "Release $CODE_EDITOR_VERSION" \ + --notes "Release $CODE_EDITOR_VERSION\n\nSageMaker Code Editor Version: $SAGEMAKER_VERSION" \ $PRERELEASE_FLAG fi handle-failures: From 47d6328ca5e898753209ddc4158220efe00ced18 Mon Sep 17 00:00:00 2001 From: Feiyang Liu Date: Thu, 11 Dec 2025 09:37:39 +0100 Subject: [PATCH 2/9] automatically create tag when release workflow triggered --- .github/workflows/release.yaml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 75e5555..68564b0 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -27,7 +27,7 @@ jobs: with: fetch-depth: 0 - - name: Validate versions and tag + - name: Validate versions and create tag run: | if ! echo "$CODE_EDITOR_VERSION" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+(-rc\.[0-9]+)?$'; then echo "Code Editor version $CODE_EDITOR_VERSION does not follow semantic version pattern (x.y.z) or x.y.z-rc.N. Skipping release." @@ -36,10 +36,13 @@ jobs: echo "Code Editor version $CODE_EDITOR_VERSION is valid" echo "SageMaker Code Editor version $SAGEMAKER_VERSION will be mapped" - # Verify tag exists and matches the version - if ! git rev-parse "$CODE_EDITOR_VERSION" >/dev/null 2>&1; then - echo "Error: Tag $CODE_EDITOR_VERSION does not exist. Create it first with: git tag $CODE_EDITOR_VERSION. Skipping release." - exit 1 + # Check if tag already exists + if git rev-parse "$CODE_EDITOR_VERSION" >/dev/null 2>&1; then + echo "Tag $CODE_EDITOR_VERSION already exists" + else + echo "Creating tag $CODE_EDITOR_VERSION on current commit" + git tag "$CODE_EDITOR_VERSION" + git push origin "$CODE_EDITOR_VERSION" fi # Get commit SHA from tag and export it From cf44d7ea696a7649d184b1c7d35ef2912a401ffa Mon Sep 17 00:00:00 2001 From: Feiyang Liu Date: Thu, 11 Dec 2025 09:38:29 +0100 Subject: [PATCH 3/9] update release information --- RELEASE.md | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index 8952846..edfcb4a 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -15,18 +15,25 @@ We use major.minor branches (e.g., `1.0`, `1.1`, `2.1`) for releases. ### Release Process -1. **Determine version**: Choose tag name based on the commit's branch - - Tag format: `major.minor.patch` matching the branch the commit belongs to - - Example: Commit on `1.0` branch → tag `1.0.0`, `1.0.1`, etc. - -2. **Create tag**: Choose one of these methods: - - **Command line**: Push tag to trigger release workflow - ```bash - git tag 1.0.0 - git push origin 1.0.0 - ``` - - **GitHub Actions**: Manually run "Create release" workflow from Actions tab - - **GitHub UI**: Go to Releases → Create a new release - -3. **Release notes**: Include code-oss version information in the release description +1. **Determine versions**: + - **Code Editor version**: Choose tag name based on the commit's branch + - Tag format: `major.minor.patch` matching the branch the commit belongs to + - Example: Commit on `1.0` branch → tag `1.0.0`, `1.0.1`, etc. + - **SageMaker Code Editor version**: Determine the corresponding SageMaker version + - Example: Code Editor `1.0.1` → SageMaker Code Editor `1.8.0b7` + +2. **Create release**: + - Go to **Actions** → **Create release** → **Run workflow** + - Select the branch you want to release from (e.g., `1.0`) + - Enter: + - **Code Editor version**: `1.0.1` (semantic version x.y.z or x.y.z-rc.N.) + - **SageMaker Code Editor version**: `1.8.0b7` (any format) + - Click **Run workflow** + - The workflow will: + - Create tag on the current commit + - Fetch build artifacts for that commit + - Inject both versions into product.json + - Create GitHub release with both tarballs + +3. **Release notes**: Include code-oss version and Sagemaker Code Editor Version information in the release description From 71b2335573b0666c6b5aa60f9c2c65fed4fba7e1 Mon Sep 17 00:00:00 2001 From: Feiyang Liu Date: Thu, 11 Dec 2025 11:42:27 +0100 Subject: [PATCH 4/9] patches to show both versions in about dialog --- patches/sagemaker.series | 1 + .../display-both-versions-in-about.diff | 26 +++++++++++++++++++ third-party-src | 2 +- 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 patches/sagemaker/display-both-versions-in-about.diff diff --git a/patches/sagemaker.series b/patches/sagemaker.series index 6df0f36..1e21882 100644 --- a/patches/sagemaker.series +++ b/patches/sagemaker.series @@ -39,3 +39,4 @@ sagemaker/sagemaker-extension-smus-support.diff sagemaker/post-startup-notifications.diff sagemaker/sagemaker-extensions-sync.diff sagemaker/fix-port-forwarding.diff +sagemaker/display-both-versions-in-about.diff diff --git a/patches/sagemaker/display-both-versions-in-about.diff b/patches/sagemaker/display-both-versions-in-about.diff new file mode 100644 index 0000000..38247c4 --- /dev/null +++ b/patches/sagemaker/display-both-versions-in-about.diff @@ -0,0 +1,26 @@ +Index: code-editor-src/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts +=================================================================== +--- code-editor-src.orig/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts ++++ code-editor-src/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts +@@ -79,7 +79,8 @@ export class BrowserDialogHandler extend + async about(): Promise { + const detailString = (useAgo: boolean): string => { + return localize('aboutDetail', +- "Code Editor Version: {0}\nCode - OSS Version: {1}\nDate: {2}\nBrowser: {3}", ++ "SageMaker Code Editor Version: {0}\nCode Editor Version: {1}\nCode - OSS Version: {2}\nDate: {3}\nBrowser: {4}", ++ this.productService.sagemakerCodeEditorVersion || 'Unknown', + this.productService.codeEditorVersion || 'Unknown', + this.productService.version || 'Unknown', + this.productService.date ? `${this.productService.date}${useAgo ? ' (' + fromNow(new Date(this.productService.date), true) + ')' : ''}` : 'Unknown', +Index: code-editor-src/src/vs/base/common/product.ts +=================================================================== +--- code-editor-src.orig/src/vs/base/common/product.ts ++++ code-editor-src/src/vs/base/common/product.ts +@@ -62,6 +62,7 @@ export interface IProductConfiguration { + readonly quality?: string; + readonly commit?: string; + readonly codeEditorVersion?: string; ++ readonly sagemakerCodeEditorVersion?: string; + + readonly nameShort: string; + readonly nameLong: string; diff --git a/third-party-src b/third-party-src index 2901c5a..d542b6b 160000 --- a/third-party-src +++ b/third-party-src @@ -1 +1 @@ -Subproject commit 2901c5ac6db8a986a5666c3af51ff804d05af0d4 +Subproject commit d542b6b2efc9a47cd35d68521c71d0e81e5b964c From f08b3773d8bf99423ec46dcf433893e1e789c303 Mon Sep 17 00:00:00 2001 From: Feiyang Liu Date: Thu, 11 Dec 2025 11:59:11 +0100 Subject: [PATCH 5/9] improve release description formatting --- .github/workflows/release.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 68564b0..dca563b 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -125,7 +125,9 @@ jobs: echo "Creating new release for tag $CODE_EDITOR_VERSION..." gh release create "$CODE_EDITOR_VERSION" ./*.tar.gz \ --title "Release $CODE_EDITOR_VERSION" \ - --notes "Release $CODE_EDITOR_VERSION\n\nSageMaker Code Editor Version: $SAGEMAKER_VERSION" \ + --notes "Release $CODE_EDITOR_VERSION + + SageMaker Code Editor Version: $SAGEMAKER_VERSION" \ $PRERELEASE_FLAG fi handle-failures: From a5bcdbbdf0c935ba31995fb39f853409ba8a1674 Mon Sep 17 00:00:00 2001 From: Feiyang Liu Date: Thu, 11 Dec 2025 14:26:40 +0100 Subject: [PATCH 6/9] moving back to correct codeoss src version --- third-party-src | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third-party-src b/third-party-src index d542b6b..2901c5a 160000 --- a/third-party-src +++ b/third-party-src @@ -1 +1 @@ -Subproject commit d542b6b2efc9a47cd35d68521c71d0e81e5b964c +Subproject commit 2901c5ac6db8a986a5666c3af51ff804d05af0d4 From aa3d3e604bf3441630bb2b5fa940d13c146cd0c1 Mon Sep 17 00:00:00 2001 From: Feiyang Liu Date: Thu, 11 Dec 2025 14:45:39 +0100 Subject: [PATCH 7/9] adding sagemakercodeeditorversion placeholder in product json --- .../sagemaker/display-both-versions-in-about.diff | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/patches/sagemaker/display-both-versions-in-about.diff b/patches/sagemaker/display-both-versions-in-about.diff index 38247c4..df6164c 100644 --- a/patches/sagemaker/display-both-versions-in-about.diff +++ b/patches/sagemaker/display-both-versions-in-about.diff @@ -24,3 +24,15 @@ Index: code-editor-src/src/vs/base/common/product.ts readonly nameShort: string; readonly nameLong: string; +Index: code-editor-src/product.json +=================================================================== +--- code-editor-src.orig/product.json ++++ code-editor-src/product.json +@@ -12,6 +12,7 @@ + "nameShort": "SageMaker Code Editor", + "nameLong": "SageMaker Code Editor", + "codeEditorVersion": "1.0.0", ++ "sagemakerCodeEditorVersion":"1.0.0", + "applicationName": "code", + "dataFolderName": ".vscode-editor", + "win32MutexName": "vscodeoss", From 246d769c442eea404ef70ece9de7028a31dc88d2 Mon Sep 17 00:00:00 2001 From: VictorPaiu Date: Fri, 12 Dec 2025 13:51:00 +0100 Subject: [PATCH 8/9] Fixed bug --- .github/workflows/release.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index dca563b..a89d86f 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -92,6 +92,7 @@ jobs: tar xzf "$COMMIT_SHA-$SAGEMAKER_ARTIFACT_PREFIX-build/$SAGEMAKER_ARTIFACT_PREFIX-build.tar.gz" cd vscode-reh-web-linux-x64 + CURRENT_SM_VERSION=$(jq -r '.sagemakerCodeEditorVersion' product.json) jq ".codeEditorVersion = \"$CODE_EDITOR_VERSION\" | .sagemakerCodeEditorVersion = \"$SAGEMAKER_VERSION\"" product.json > temp.json && mv temp.json product.json FILES_TO_UPDATE=( @@ -101,7 +102,8 @@ jobs: "out/vs/workbench/api/node/extensionHostProcess.js" ) for file in "${FILES_TO_UPDATE[@]}"; do - sed -i "s/codeEditorVersion:\"$CURRENT_CE_VERSION\"/codeEditorVersion:\"$CODE_EDITOR_VERSION\",sagemakerCodeEditorVersion:\"$SAGEMAKER_VERSION\"/g" "$file" + sed -i "s/codeEditorVersion:\s*\"$CURRENT_CE_VERSION\"/codeEditorVersion:\"$CODE_EDITOR_VERSION\"/g" "$file" + sed -i "s/sagemakerCodeEditorVersion:\s*\"$CURRENT_SM_VERSION\"/sagemakerCodeEditorVersion:\"$SAGEMAKER_VERSION\"/g" "$file" done cd .. From d3457c89953e7454ab0b998bd37dd8b0d7fdefa5 Mon Sep 17 00:00:00 2001 From: VictorPaiu Date: Fri, 12 Dec 2025 14:49:05 +0100 Subject: [PATCH 9/9] Remove code editor version in about section --- patches/sagemaker/display-both-versions-in-about.diff | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/patches/sagemaker/display-both-versions-in-about.diff b/patches/sagemaker/display-both-versions-in-about.diff index df6164c..2fbcb8a 100644 --- a/patches/sagemaker/display-both-versions-in-about.diff +++ b/patches/sagemaker/display-both-versions-in-about.diff @@ -2,16 +2,17 @@ Index: code-editor-src/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts =================================================================== --- code-editor-src.orig/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts +++ code-editor-src/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts -@@ -79,7 +79,8 @@ export class BrowserDialogHandler extend +@@ -79,8 +79,8 @@ export class BrowserDialogHandler extend async about(): Promise { const detailString = (useAgo: boolean): string => { return localize('aboutDetail', - "Code Editor Version: {0}\nCode - OSS Version: {1}\nDate: {2}\nBrowser: {3}", -+ "SageMaker Code Editor Version: {0}\nCode Editor Version: {1}\nCode - OSS Version: {2}\nDate: {3}\nBrowser: {4}", +- this.productService.codeEditorVersion || 'Unknown', ++ "SageMaker Code Editor Version: {0}\nCode - OSS Version: {1}\nDate: {2}\nBrowser: {3}", + this.productService.sagemakerCodeEditorVersion || 'Unknown', - this.productService.codeEditorVersion || 'Unknown', this.productService.version || 'Unknown', this.productService.date ? `${this.productService.date}${useAgo ? ' (' + fromNow(new Date(this.productService.date), true) + ')' : ''}` : 'Unknown', + navigator.userAgent Index: code-editor-src/src/vs/base/common/product.ts =================================================================== --- code-editor-src.orig/src/vs/base/common/product.ts