From 1541d753b8c5b350518bb78f64c277818b0d34b7 Mon Sep 17 00:00:00 2001 From: Peng Lyu Date: Mon, 15 Sep 2025 22:28:45 -0700 Subject: [PATCH 1/7] Improve copilot coding agent setup --- .github/workflows/copilot-setup-steps.yml | 111 ++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 .github/workflows/copilot-setup-steps.yml diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml new file mode 100644 index 0000000000000..3aba833954efc --- /dev/null +++ b/.github/workflows/copilot-setup-steps.yml @@ -0,0 +1,111 @@ +name: Copilot Setup Steps + +# This workflow customizes the ephemeral GitHub Copilot coding agent environment. +# It preinstalls dependencies and warms caches to speed up iterative agent tasks. +# NOTE: The single job MUST be named `copilot-setup-steps`. +# Supported customizations: runs-on, permissions, steps, container, services, snapshot, timeout-minutes. + +on: + workflow_dispatch: + push: + paths: + - .github/workflows/copilot-setup-steps.yml + pull_request: + paths: + - .github/workflows/copilot-setup-steps.yml + +jobs: + copilot-setup-steps: + runs-on: ubuntu-latest + timeout-minutes: 30 + permissions: + contents: read + + env: + ELECTRON_SKIP_BINARY_DOWNLOAD: 1 + PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 + + steps: + - name: Checkout repository + uses: actions/checkout@v5 + + - name: Setup Node.js (from .nvmrc + npm cache) + uses: actions/setup-node@v5 + with: + node-version-file: .nvmrc + cache: npm + + - name: Compute node_modules cache key + run: | + set -e + mkdir -p .build + node build/azure-pipelines/common/computeNodeModulesCacheKey.js copilot $(node -p process.arch) > .build/packagelockhash + + - name: Restore node_modules cache + id: cache-node-modules + uses: actions/cache/restore@v4 + with: + path: .build/node_modules_cache + key: node_modules-copilot-${{ hashFiles('.build/packagelockhash') }} + + - name: Extract node_modules cache + if: steps.cache-node-modules.outputs.cache-hit == 'true' + run: tar -xzf .build/node_modules_cache/cache.tgz + + - name: Install build essentials (cache miss only) + if: steps.cache-node-modules.outputs.cache-hit != 'true' + run: | + set -e + sudo apt-get update -y + sudo apt-get install -y --no-install-recommends \ + build-essential pkg-config libx11-dev libx11-xcb-dev libxkbfile-dev libkrb5-dev libnotify-bin + + - name: Install dependencies (retry up to 5x) + if: steps.cache-node-modules.outputs.cache-hit != 'true' + run: | + set -e + for i in {1..5}; do + if npm ci; then + break + fi + if [ $i -eq 5 ]; then + echo "npm ci failed too many times" >&2 + exit 1 + fi + echo "Retrying npm ci ($i)..." + sleep 5 + done + + - name: Create node_modules archive (cache miss only) + if: steps.cache-node-modules.outputs.cache-hit != 'true' + run: | + set -e + node build/azure-pipelines/common/listNodeModules.js .build/node_modules_list.txt + mkdir -p .build/node_modules_cache + tar -czf .build/node_modules_cache/cache.tgz --files-from .build/node_modules_list.txt + + - name: Transpile sources (non-blocking) + continue-on-error: true + run: npm run gulp transpile-client-esbuild transpile-extensions + + - name: Compute built-in extensions cache key + run: node build/azure-pipelines/common/computeBuiltInDepsCacheKey.js > .build/builtindepshash + + - name: Restore built-in extensions cache + id: cache-builtin-extensions + uses: actions/cache/restore@v4 + with: + enableCrossOsArchive: true + path: .build/builtInExtensions + key: builtin-extensions-${{ hashFiles('.build/builtindepshash') }} + + - name: Download built-in extensions (if cache miss) + if: steps.cache-builtin-extensions.outputs.cache-hit != 'true' + run: node build/lib/builtInExtensions.js + + - name: Environment summary + run: | + echo "Node: $(node -v)" || true + echo "NPM: $(npm -v)" || true + du -sh node_modules 2>/dev/null || true + df -h || true From f39ac34be8e85cb65001207a1bcffab84f9aa83e Mon Sep 17 00:00:00 2001 From: Peng Lyu Date: Mon, 15 Sep 2025 22:30:14 -0700 Subject: [PATCH 2/7] Update .github/workflows/copilot-setup-steps.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/copilot-setup-steps.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index 3aba833954efc..4ce1c34eece4f 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -32,8 +32,8 @@ jobs: - name: Setup Node.js (from .nvmrc + npm cache) uses: actions/setup-node@v5 with: - node-version-file: .nvmrc - cache: npm + node-version-file: .nvmrc + cache: npm - name: Compute node_modules cache key run: | From c34285217c2bf3be532a5fc9ea2e0cf8b75e274f Mon Sep 17 00:00:00 2001 From: Peng Lyu Date: Tue, 16 Sep 2025 10:07:31 -0700 Subject: [PATCH 3/7] experiment ubuntu-4-core --- .github/workflows/copilot-setup-steps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index 4ce1c34eece4f..f5f277c180b61 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -16,7 +16,7 @@ on: jobs: copilot-setup-steps: - runs-on: ubuntu-latest + runs-on: ubuntu-4-core timeout-minutes: 30 permissions: contents: read From 9aba23589d1f95a667a3e43d50d42e17645949ba Mon Sep 17 00:00:00 2001 From: Peng Lyu Date: Wed, 17 Sep 2025 09:31:07 -0700 Subject: [PATCH 4/7] maybe macos --- .github/workflows/copilot-setup-steps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index f5f277c180b61..c21f5a3373a96 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -16,7 +16,7 @@ on: jobs: copilot-setup-steps: - runs-on: ubuntu-4-core + runs-on: macos-14-xlarge timeout-minutes: 30 permissions: contents: read From 67ed568d37a53f82016b5645a5f9cef6857d2a55 Mon Sep 17 00:00:00 2001 From: Peng Lyu Date: Wed, 17 Sep 2025 21:19:54 -0700 Subject: [PATCH 5/7] ubuntu-latest-4-cores --- .github/workflows/copilot-setup-steps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index db3814aa46fb3..89a71dbe7ebe2 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -14,7 +14,7 @@ on: jobs: # The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot. copilot-setup-steps: - runs-on: macos-14-xlarge + runs-on: ubuntu-latest-4-cores # Set the permissions to the lowest permissions possible needed for your steps. # Copilot will be given its own token for its operations. From 1710d1283ac290b6856452eaf77afa5d58850fd4 Mon Sep 17 00:00:00 2001 From: Ladislau Szomoru <3372902+lszomoru@users.noreply.github.com> Date: Fri, 19 Sep 2025 06:51:40 -0700 Subject: [PATCH 6/7] Engineering - fix publish build regression (#267483) --- build/azure-pipelines/product-build.yml | 2 ++ build/azure-pipelines/product-publish.yml | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/build/azure-pipelines/product-build.yml b/build/azure-pipelines/product-build.yml index 912bd66f90c63..93a2a335a855e 100644 --- a/build/azure-pipelines/product-build.yml +++ b/build/azure-pipelines/product-build.yml @@ -674,6 +674,8 @@ extends: displayName: Publish Build steps: - template: build/azure-pipelines/product-publish.yml@self + parameters: + VSCODE_QUALITY: ${{ variables.VSCODE_QUALITY }} - ${{ if and(parameters.VSCODE_RELEASE, eq(variables['VSCODE_PRIVATE_BUILD'], false)) }}: - stage: ApproveRelease diff --git a/build/azure-pipelines/product-publish.yml b/build/azure-pipelines/product-publish.yml index c905b5015e4d7..124f6d354b0d1 100644 --- a/build/azure-pipelines/product-publish.yml +++ b/build/azure-pipelines/product-publish.yml @@ -1,3 +1,7 @@ +parameters: + - name: VSCODE_QUALITY + type: string + steps: - template: ./common/checkout.yml@self From eeca8c6a90ae55a0b461bb2190875b3ee6c11c1b Mon Sep 17 00:00:00 2001 From: Peng Lyu Date: Fri, 19 Sep 2025 08:19:11 -0700 Subject: [PATCH 7/7] use large runners --- .github/workflows/copilot-setup-steps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index 89a71dbe7ebe2..b520069a389be 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -14,7 +14,7 @@ on: jobs: # The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot. copilot-setup-steps: - runs-on: ubuntu-latest-4-cores + runs-on: vscode-large-runners # Set the permissions to the lowest permissions possible needed for your steps. # Copilot will be given its own token for its operations.