Add compatibility checks for Copilot Chat extension in release build script#287807
Merged
joaomoreno merged 3 commits intomainfrom Jan 15, 2026
Merged
Add compatibility checks for Copilot Chat extension in release build script#287807joaomoreno merged 3 commits intomainfrom
joaomoreno merged 3 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds compatibility checks for the GitHub Copilot Chat extension in the VS Code release build script. The checks run before releasing insider builds to ensure the latest published version of the extension is compatible with the VS Code version being released.
Changes:
- Added version validation logic to check engine compatibility between VS Code and extensions
- Added API proposal parsing and validation to ensure proposal versions match
- Integrated compatibility check into the release pipeline for insider builds only
Comments suppressed due to low confidence (2)
build/azure-pipelines/common/releaseBuild.ts:87
- This version validation logic is a simplified reimplementation of the production validation code in
src/vs/platform/extensions/common/extensionValidator.ts. The production code uses a more sophisticated approach withparseVersion,normalizeVersion, andisValidVersionthat handles edge cases like pre-release versions (e.g.,1.95.0-20241201), 'x' wildcards, and date-based version constraints. This simplified version may produce different results than the production validation, creating inconsistencies. Consider reusing or closely matching the production validation logic to ensure consistency.
function isEngineCompatible(productVersion: string, engineVersion: string): { compatible: boolean; error?: string } {
if (engineVersion === '*') {
return { compatible: true };
}
const versionMatch = engineVersion.match(/^(\^|>=)?(\d+)\.(\d+)\.(\d+)/);
if (!versionMatch) {
return { compatible: false, error: `Could not parse engines.vscode value: ${engineVersion}` };
}
const [, prefix, major, minor, patch] = versionMatch;
const productMatch = productVersion.match(/^(\d+)\.(\d+)\.(\d+)/);
if (!productMatch) {
return { compatible: false, error: `Could not parse product version: ${productVersion}` };
}
const [, prodMajor, prodMinor, prodPatch] = productMatch;
const reqMajor = parseInt(major);
const reqMinor = parseInt(minor);
const reqPatch = parseInt(patch);
const pMajor = parseInt(prodMajor);
const pMinor = parseInt(prodMinor);
const pPatch = parseInt(prodPatch);
if (prefix === '>=') {
// Minimum version check
if (pMajor > reqMajor) { return { compatible: true }; }
if (pMajor < reqMajor) { return { compatible: false, error: `Extension requires VS Code >=${engineVersion}, but product version is ${productVersion}` }; }
if (pMinor > reqMinor) { return { compatible: true }; }
if (pMinor < reqMinor) { return { compatible: false, error: `Extension requires VS Code >=${engineVersion}, but product version is ${productVersion}` }; }
if (pPatch >= reqPatch) { return { compatible: true }; }
return { compatible: false, error: `Extension requires VS Code >=${engineVersion}, but product version is ${productVersion}` };
}
// Caret or exact version check
if (pMajor !== reqMajor) {
return { compatible: false, error: `Extension requires VS Code ${engineVersion}, but product version is ${productVersion} (major version mismatch)` };
}
if (prefix === '^') {
// Caret: same major, minor and patch must be >= required
if (pMinor > reqMinor) { return { compatible: true }; }
if (pMinor < reqMinor) { return { compatible: false, error: `Extension requires VS Code ${engineVersion}, but product version is ${productVersion}` }; }
if (pPatch >= reqPatch) { return { compatible: true }; }
return { compatible: false, error: `Extension requires VS Code ${engineVersion}, but product version is ${productVersion}` };
}
// Exact or default behavior
if (pMinor < reqMinor) { return { compatible: false, error: `Extension requires VS Code ${engineVersion}, but product version is ${productVersion}` }; }
if (pMinor > reqMinor) { return { compatible: true }; }
if (pPatch >= reqPatch) { return { compatible: true }; }
return { compatible: false, error: `Extension requires VS Code ${engineVersion}, but product version is ${productVersion}` };
}
build/azure-pipelines/common/releaseBuild.ts:170
- The regex pattern
/\t(\w+):\s*\{([^}]+)\}/gis fragile and depends on specific formatting of the generated TypeScript file. If the file's formatting changes (e.g., different indentation, spaces vs tabs, multi-line property definitions), the regex will fail to match, potentially resulting in zero API proposals being loaded. This would cause false positives in compatibility checks. Consider either importing the actual TypeScript module (if the build environment supports it) or using a more robust parsing approach that's less sensitive to formatting.
const proposalBlockRegex = /\t(\w+):\s*\{([^}]+)\}/g;
const versionRegex = /version:\s*(\d+)/;
let match;
while ((match = proposalBlockRegex.exec(apiProposalsContent)) !== null) {
const [, name, block] = match;
const versionMatch = versionRegex.exec(block);
allApiProposals[name] = {
proposal: '',
version: versionMatch ? parseInt(versionMatch[1]) : undefined
};
}
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @lszomoruMatched files:
|
dmitrivMS
approved these changes
Jan 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.