From 5f946ce1b2c8d5a479d5847ce16bce4c65323c6a Mon Sep 17 00:00:00 2001 From: Feiyang Liu Date: Wed, 10 Dec 2025 12:24:58 +0100 Subject: [PATCH 1/4] 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/4] 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/4] 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 2f6a2dd32964936941460a3db6ffa85fb06f4eb6 Mon Sep 17 00:00:00 2001 From: Feiyang Liu Date: Thu, 11 Dec 2025 10:45:48 +0100 Subject: [PATCH 4/4] patches to show both versions in about dialog --- patches/sagemaker.series | 1 + .../display-both-versions-in-about.diff | 27 +++++++++++++++++++ patches/series | 1 + 3 files changed, 29 insertions(+) create mode 100644 patches/sagemaker/display-both-versions-in-about.diff create mode 100644 patches/series 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..212ccde --- /dev/null +++ b/patches/sagemaker/display-both-versions-in-about.diff @@ -0,0 +1,27 @@ +Index: code-editorv2/code-editor-src/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts +=================================================================== +--- code-editorv2.orig/code-editor-src/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts ++++ code-editorv2/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-editorv2/code-editor-src/src/vs/base/common/product.ts +=================================================================== +--- code-editorv2.orig/code-editor-src/src/vs/base/common/product.ts ++++ code-editorv2/code-editor-src/src/vs/base/common/product.ts +@@ -62,6 +62,8 @@ export interface IProductConfiguration { + readonly quality?: string; + readonly commit?: string; + readonly codeEditorVersion?: string; ++ readonly sagemakerCodeEditorVersion?: string; ++ + + readonly nameShort: string; + readonly nameLong: string; diff --git a/patches/series b/patches/series new file mode 100644 index 0000000..267b006 --- /dev/null +++ b/patches/series @@ -0,0 +1 @@ +sagemaker/display-both-versions-in-about.diff