mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-18 23:59:43 +01:00
* chore: ralph loop checkpoint - 2026-02-17 12:48 * fix shell script * Inline compile stage into platform jobs Remove the standalone Compile stage from the ADO pipeline. Each platform job (Windows, Linux, macOS, Alpine, Web) now compiles TypeScript itself instead of downloading a shared Compilation artifact. - Add VSCODE_RUN_CHECKS parameter to Linux jobs for hygiene/lint/CG - Add VSCODE_RUN_COMPILE_EXTRAS parameter to macOS jobs for telemetry extraction and sourcemap upload - Remove VSCODE_COMPILE_ONLY parameter entirely - Delete product-compile.yml (no longer referenced) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Always run telemetry extraction on macOS builds The macOS Universal app merge requires both x64 and arm64 builds to have identical file sets. Telemetry extraction was only running on arm64 (via VSCODE_RUN_COMPILE_EXTRAS), causing the universal merge to fail due to missing telemetry-core.json and telemetry-extensions.json in the x64 build. Move telemetry extraction outside the VSCODE_RUN_COMPILE_EXTRAS gate so it runs on all macOS builds. Sourcemap upload remains gated. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Run telemetry extraction on all client builds All client builds (Linux, Windows, macOS) need telemetry-core.json and telemetry-extensions.json. Previously only macOS arm64 ran extract-telemetry. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Only run telemetry extraction on Linux x64 (client build) Linux arm64 and armhf are server-only builds, no need for telemetry files. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Remove .ralph scaffolding files Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix telemetry extraction on Windows with native PowerShell The bash extract-telemetry.sh script fails on Windows because the Unix bin shim gets interpreted as Node.js code. Use a native PowerShell implementation that calls the extractor JS entry point directly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Handle missing telemetry files gracefully on Windows The telemetry extractor may skip emitting declarations-resolved.json when no events are found. Handle this case with a warning instead of failing the build. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Use deterministic build date from git commit timestamp When each platform compiles independently, the build date embedded in cli.js (via INSERT_PRODUCT_CONFIGURATION) differs between machines because each uses new Date().toISOString(). This causes the macOS Universal app merge to fail since cli.js SHA differs between x64/arm64. Fix: use the git commit date (git log -1 --format=%cI HEAD) instead of the current wall-clock time. This ensures all independent builds on different machines produce identical timestamps. Updated in: - build/lib/date.ts: writeISODate() uses git commit date - build/next/index.ts: bundle(), transpile, and readISODate fallback all use git commit date Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Remove redundant extensions-ci task from CI pipelines core-ci (esbuild path) already includes cleanExtensionsBuildTask, compileNonNativeExtensionsBuildTask, and compileExtensionMediaBuildTask. Running extensions-ci in parallel caused a race condition where core-ci's rimraf of .build/extensions clashed with extensions-ci writing to the same directory. Also removes dead code: - extensions-ci and extensions-ci-pr task definitions (fully subsumed) - core-ci-old task (useEsbuildTranspile is always true) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * remove VSCODE_RUN_COMPILE_EXTRAS * address PR feedback regarding code duplication of `getGitCommitDate()` function by exporting a single helper function from `build/lib/date.ts` and importing it in `build/next/index.ts` to ensure consistent behavior and improve code maintainability. * update readISODate function to return git commit date instead of current date * add telemetry sorting script and integrate into build process for consistent output * refactor telemetry extraction process: replace shell script with TypeScript implementation * update skill * update telemetry-extractor dependency to version 1.19.0 * fix build * fix more duplicate telemetry definition issues * cleanup * refactor: consolidate validation checks into quality checks and remove obsolete tasks * bust the cache * undo cache bust * fix expression * fix * fix: update Azure storage account name in quality checks * fix: initialize stages set with 'Quality' * fix: add VSCODE_BUILD_TYPE parameter with options for Product and CI builds * fix: update Azure Pipeline CLI to use parameters instead of variables for queueing builds * fix: update VSCODE_BUILD_TYPE parameter values for clarity * fix: update default value for VSCODE_BUILD_TYPE parameter to 'Product' * leaner * even leaner * only npm ci in build * 💄 * run entire npm ci * fix * fix * fix it * Inline CompileCLI into platform stages - Remove centralized CompileCLI stage - Move CLI jobs into Windows, Linux, macOS stages as independent jobs - CLI jobs now compile, publish unsigned mid-job, sign, and publish signed - Platform compile jobs use deemon + waitForArtifacts for async CLI download - Delete separate CLI sign jobs (now merged into CLI compile jobs) - Remove CompileCLI from publish.ts stage tracking * fix: macOS CLI signing - use proper directory structure for ESRP * fix: add BUILDS_API_URL to Windows and Linux job templates * fix: label Linux CLI jobs clearly --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: João Moreno <22350+joaomoreno@users.noreply.github.com>
322 lines
11 KiB
Markdown
322 lines
11 KiB
Markdown
---
|
|
name: azure-pipelines
|
|
description: Use when validating Azure DevOps pipeline changes for the VS Code build. Covers queueing builds, checking build status, viewing logs, and iterating on pipeline YAML changes without waiting for full CI runs.
|
|
---
|
|
|
|
# Validating Azure Pipeline Changes
|
|
|
|
When modifying Azure DevOps pipeline files (YAML files in `build/azure-pipelines/`), you can validate changes locally using the Azure CLI before committing. This avoids the slow feedback loop of pushing changes, waiting for CI, and checking results.
|
|
|
|
## Prerequisites
|
|
|
|
1. **Check if Azure CLI is installed**:
|
|
```bash
|
|
az --version
|
|
```
|
|
|
|
If not installed, install it:
|
|
```bash
|
|
# macOS
|
|
brew install azure-cli
|
|
|
|
# Windows (PowerShell as Administrator)
|
|
winget install Microsoft.AzureCLI
|
|
|
|
# Linux (Debian/Ubuntu)
|
|
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
|
|
```
|
|
|
|
2. **Check if the DevOps extension is installed**:
|
|
```bash
|
|
az extension show --name azure-devops
|
|
```
|
|
|
|
If not installed, add it:
|
|
```bash
|
|
az extension add --name azure-devops
|
|
```
|
|
|
|
3. **Authenticate**:
|
|
```bash
|
|
az login
|
|
az devops configure --defaults organization=https://dev.azure.com/monacotools project=Monaco
|
|
```
|
|
|
|
## VS Code Main Build
|
|
|
|
The main VS Code build pipeline:
|
|
- **Organization**: `monacotools`
|
|
- **Project**: `Monaco`
|
|
- **Definition ID**: `111`
|
|
- **URL**: https://dev.azure.com/monacotools/Monaco/_build?definitionId=111
|
|
|
|
## VS Code Insider Scheduled Builds
|
|
|
|
Two Insider builds run automatically on a scheduled basis:
|
|
- **Morning build**: ~7:00 AM CET
|
|
- **Evening build**: ~7:00 PM CET
|
|
|
|
These scheduled builds use the same pipeline definition (`111`) but run on the `main` branch to produce Insider releases.
|
|
|
|
---
|
|
|
|
## Queueing a Build
|
|
|
|
Use the [queue command](./azure-pipeline.ts) to queue a validation build:
|
|
|
|
```bash
|
|
# Queue a build on the current branch
|
|
node .github/skills/azure-pipelines/azure-pipeline.ts queue
|
|
|
|
# Queue with a specific source branch
|
|
node .github/skills/azure-pipelines/azure-pipeline.ts queue --branch my-feature-branch
|
|
|
|
# Queue with custom parameters
|
|
node .github/skills/azure-pipelines/azure-pipeline.ts queue --parameter "VSCODE_BUILD_WEB=false" --parameter "VSCODE_PUBLISH=false"
|
|
|
|
# Parameter value with spaces
|
|
node .github/skills/azure-pipelines/azure-pipeline.ts queue --parameter "VSCODE_BUILD_TYPE=Product Build"
|
|
```
|
|
|
|
> **Important**: Before queueing a new build, cancel any previous builds on the same branch that you no longer need. This frees up build agents and reduces resource waste:
|
|
> ```bash
|
|
> # Find the build ID from status, then cancel it
|
|
> node .github/skills/azure-pipelines/azure-pipeline.ts status
|
|
> node .github/skills/azure-pipelines/azure-pipeline.ts cancel --build-id <id>
|
|
> node .github/skills/azure-pipelines/azure-pipeline.ts queue
|
|
> ```
|
|
|
|
### Script Options
|
|
|
|
| Option | Description |
|
|
|--------|-------------|
|
|
| `--branch <name>` | Source branch to build (default: current git branch) |
|
|
| `--definition <id>` | Pipeline definition ID (default: 111) |
|
|
| `--parameter <entry>` | Pipeline parameter in `KEY=value` format (repeatable) |
|
|
| `--parameters <list>` | Space-separated parameters in `KEY=value KEY2=value2` format |
|
|
| `--dry-run` | Print the command without executing |
|
|
|
|
### Product Build Queue Parameters (`build/azure-pipelines/product-build.yml`)
|
|
|
|
| Name | Type | Default | Allowed Values | Description |
|
|
|------|------|---------|----------------|-------------|
|
|
| `VSCODE_QUALITY` | string | `insider` | `exploration`, `insider`, `stable` | Build quality channel |
|
|
| `VSCODE_BUILD_TYPE` | string | `Product Build` | `Product`, `CI` | Build mode for Product vs CI |
|
|
| `NPM_REGISTRY` | string | `https://pkgs.dev.azure.com/monacotools/Monaco/_packaging/vscode/npm/registry/` | any URL | Custom npm registry |
|
|
| `CARGO_REGISTRY` | string | `sparse+https://pkgs.dev.azure.com/monacotools/Monaco/_packaging/vscode/Cargo/index/` | any URL | Custom Cargo registry |
|
|
| `VSCODE_BUILD_WIN32` | boolean | `true` | `true`, `false` | Build Windows x64 |
|
|
| `VSCODE_BUILD_WIN32_ARM64` | boolean | `true` | `true`, `false` | Build Windows arm64 |
|
|
| `VSCODE_BUILD_LINUX` | boolean | `true` | `true`, `false` | Build Linux x64 |
|
|
| `VSCODE_BUILD_LINUX_SNAP` | boolean | `true` | `true`, `false` | Build Linux x64 Snap |
|
|
| `VSCODE_BUILD_LINUX_ARM64` | boolean | `true` | `true`, `false` | Build Linux arm64 |
|
|
| `VSCODE_BUILD_LINUX_ARMHF` | boolean | `true` | `true`, `false` | Build Linux armhf |
|
|
| `VSCODE_BUILD_ALPINE` | boolean | `true` | `true`, `false` | Build Alpine x64 |
|
|
| `VSCODE_BUILD_ALPINE_ARM64` | boolean | `true` | `true`, `false` | Build Alpine arm64 |
|
|
| `VSCODE_BUILD_MACOS` | boolean | `true` | `true`, `false` | Build macOS x64 |
|
|
| `VSCODE_BUILD_MACOS_ARM64` | boolean | `true` | `true`, `false` | Build macOS arm64 |
|
|
| `VSCODE_BUILD_MACOS_UNIVERSAL` | boolean | `true` | `true`, `false` | Build macOS universal (requires both macOS arches) |
|
|
| `VSCODE_BUILD_WEB` | boolean | `true` | `true`, `false` | Build Web artifacts |
|
|
| `VSCODE_PUBLISH` | boolean | `true` | `true`, `false` | Publish to builds.code.visualstudio.com |
|
|
| `VSCODE_RELEASE` | boolean | `false` | `true`, `false` | Trigger release flow if successful |
|
|
| `VSCODE_STEP_ON_IT` | boolean | `false` | `true`, `false` | Skip tests |
|
|
|
|
Example: run a quick CI-oriented validation with minimal publish/release side effects:
|
|
|
|
```bash
|
|
node .github/skills/azure-pipelines/azure-pipeline.ts queue \
|
|
--parameter "VSCODE_BUILD_TYPE=CI Build" \
|
|
--parameter "VSCODE_PUBLISH=false" \
|
|
--parameter "VSCODE_RELEASE=false"
|
|
```
|
|
|
|
---
|
|
|
|
## Checking Build Status
|
|
|
|
Use the [status command](./azure-pipeline.ts) to monitor a running build:
|
|
|
|
```bash
|
|
# Get status of the most recent builds
|
|
node .github/skills/azure-pipelines/azure-pipeline.ts status
|
|
|
|
# Get overview of a specific build by ID
|
|
node .github/skills/azure-pipelines/azure-pipeline.ts status --build-id 123456
|
|
|
|
# Watch build status (refreshes every 30 seconds)
|
|
node .github/skills/azure-pipelines/azure-pipeline.ts status --watch
|
|
|
|
# Watch with custom interval (60 seconds)
|
|
node .github/skills/azure-pipelines/azure-pipeline.ts status --watch 60
|
|
```
|
|
|
|
### Script Options
|
|
|
|
| Option | Description |
|
|
|--------|-------------|
|
|
| `--build-id <id>` | Specific build ID (default: most recent on current branch) |
|
|
| `--branch <name>` | Filter builds by branch name (shows last 20 builds for branch) |
|
|
| `--reason <reason>` | Filter builds by reason: `manual`, `individualCI`, `batchedCI`, `schedule`, `pullRequest` |
|
|
| `--definition <id>` | Pipeline definition ID (default: 111) |
|
|
| `--watch [seconds]` | Continuously poll status until build completes (default: 30s) |
|
|
| `--download-log <id>` | Download a specific log to /tmp |
|
|
| `--download-artifact <name>` | Download artifact to /tmp |
|
|
| `--json` | Output raw JSON for programmatic consumption |
|
|
|
|
---
|
|
|
|
## Cancelling a Build
|
|
|
|
Use the [cancel command](./azure-pipeline.ts) to stop a running build:
|
|
|
|
```bash
|
|
# Cancel a build by ID (use status command to find IDs)
|
|
node .github/skills/azure-pipelines/azure-pipeline.ts cancel --build-id 123456
|
|
|
|
# Dry run (show what would be cancelled)
|
|
node .github/skills/azure-pipelines/azure-pipeline.ts cancel --build-id 123456 --dry-run
|
|
```
|
|
|
|
### Script Options
|
|
|
|
| Option | Description |
|
|
|--------|-------------|
|
|
| `--build-id <id>` | Build ID to cancel (required) |
|
|
| `--definition <id>` | Pipeline definition ID (default: 111) |
|
|
| `--dry-run` | Print what would be cancelled without executing |
|
|
|
|
---
|
|
|
|
## Testing Pipeline Changes
|
|
|
|
When the user asks to **test changes in an Azure Pipelines build**, follow this workflow:
|
|
|
|
1. **Queue a new build** on the current branch
|
|
2. **Poll for completion** by periodically checking the build status until it finishes
|
|
|
|
### Polling for Build Completion
|
|
|
|
Use a shell loop with `sleep` to poll the build status. The `sleep` command works on all major operating systems:
|
|
|
|
```bash
|
|
# Queue the build and note the build ID from output (e.g., 123456)
|
|
node .github/skills/azure-pipelines/azure-pipeline.ts queue
|
|
|
|
# Poll every 60 seconds until complete (works on macOS, Linux, and Windows with Git Bash/WSL)
|
|
# Replace <BUILD_ID> with the actual build ID from the queue command
|
|
while true; do
|
|
node .github/skills/azure-pipelines/azure-pipeline.ts status --build-id <BUILD_ID> --json 2>/dev/null | grep -q '"status": "completed"' && break
|
|
sleep 60
|
|
done
|
|
|
|
# Check final result
|
|
node .github/skills/azure-pipelines/azure-pipeline.ts status --build-id <BUILD_ID>
|
|
```
|
|
|
|
Alternatively, use the built-in `--watch` flag which handles polling automatically:
|
|
|
|
```bash
|
|
node .github/skills/azure-pipelines/azure-pipeline.ts queue
|
|
# Use the build ID returned by the queue command
|
|
node .github/skills/azure-pipelines/azure-pipeline.ts status --build-id <BUILD_ID> --watch
|
|
```
|
|
|
|
> **Note**: The `--watch` flag polls every 30 seconds by default. Use `--watch 60` for a 60-second interval to reduce API calls.
|
|
|
|
---
|
|
|
|
## Common Workflows
|
|
|
|
### 1. Quick Pipeline Validation
|
|
|
|
```bash
|
|
# Make your YAML changes, then:
|
|
git add -A && git commit -m "test: pipeline changes"
|
|
git push origin HEAD
|
|
|
|
# Check for any previous builds on this branch and cancel if needed
|
|
node .github/skills/azure-pipelines/azure-pipeline.ts status
|
|
node .github/skills/azure-pipelines/azure-pipeline.ts cancel --build-id <id> # if there's an active build
|
|
|
|
# Queue and watch the new build
|
|
node .github/skills/azure-pipelines/azure-pipeline.ts queue
|
|
node .github/skills/azure-pipelines/azure-pipeline.ts status --watch
|
|
```
|
|
|
|
### 2. Investigate a Build
|
|
|
|
```bash
|
|
# Get overview of a build (shows stages, artifacts, and log IDs)
|
|
node .github/skills/azure-pipelines/azure-pipeline.ts status --build-id 123456
|
|
|
|
# Download a specific log for deeper inspection
|
|
node .github/skills/azure-pipelines/azure-pipeline.ts status --build-id 123456 --download-log 5
|
|
|
|
# Download an artifact
|
|
node .github/skills/azure-pipelines/azure-pipeline.ts status --build-id 123456 --download-artifact unsigned_vscode_cli_win32_x64_cli
|
|
```
|
|
|
|
### 3. Test with Modified Parameters
|
|
|
|
```bash
|
|
# Customize build matrix for quicker validation
|
|
node .github/skills/azure-pipelines/azure-pipeline.ts queue \
|
|
--parameter "VSCODE_BUILD_TYPE=CI Build" \
|
|
--parameter "VSCODE_BUILD_WEB=false" \
|
|
--parameter "VSCODE_BUILD_ALPINE=false" \
|
|
--parameter "VSCODE_BUILD_ALPINE_ARM64=false" \
|
|
--parameter "VSCODE_PUBLISH=false"
|
|
```
|
|
|
|
### 4. Cancel a Running Build
|
|
|
|
```bash
|
|
# First, find the build ID
|
|
node .github/skills/azure-pipelines/azure-pipeline.ts status
|
|
|
|
# Cancel a specific build by ID
|
|
node .github/skills/azure-pipelines/azure-pipeline.ts cancel --build-id 123456
|
|
|
|
# Dry run to see what would be cancelled
|
|
node .github/skills/azure-pipelines/azure-pipeline.ts cancel --build-id 123456 --dry-run
|
|
```
|
|
|
|
### 5. Iterate on Pipeline Changes
|
|
|
|
When iterating on pipeline YAML changes, always cancel obsolete builds before queueing new ones:
|
|
|
|
```bash
|
|
# Push new changes
|
|
git add -A && git commit --amend --no-edit
|
|
git push --force-with-lease origin HEAD
|
|
|
|
# Find the outdated build ID and cancel it
|
|
node .github/skills/azure-pipelines/azure-pipeline.ts status
|
|
node .github/skills/azure-pipelines/azure-pipeline.ts cancel --build-id <id>
|
|
|
|
# Queue a fresh build and monitor
|
|
node .github/skills/azure-pipelines/azure-pipeline.ts queue
|
|
node .github/skills/azure-pipelines/azure-pipeline.ts status --watch
|
|
```
|
|
|
|
---
|
|
|
|
## Troubleshooting
|
|
|
|
### Authentication Issues
|
|
```bash
|
|
# Re-authenticate
|
|
az logout
|
|
az login
|
|
|
|
# Check current account
|
|
az account show
|
|
```
|
|
|
|
### Extension Not Found
|
|
```bash
|
|
az extension add --name azure-devops --upgrade
|
|
```
|
|
|
|
### Rate Limiting
|
|
If you hit rate limits, add delays between API calls or use `--watch` with a longer interval.
|