mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-11 10:38:31 -05:00
Enforce vscode and ads version check when installing extensions (#4267)
* engine check when install extension * gallery install/update and vsix install * FIX COMMENTS * Fix the detail not loading issue when version is invalid * add more comments and adress PR comments * add install telemetry for install from vsix scenario * correct the name of the version property for telemetry
This commit is contained in:
@@ -209,7 +209,7 @@ export interface IReducedExtensionDescription {
|
||||
engines: {
|
||||
vscode: string;
|
||||
// {{SQL CARBON EDIT}}
|
||||
sqlops?: string;
|
||||
azdata?: string;
|
||||
};
|
||||
main?: string;
|
||||
}
|
||||
@@ -222,12 +222,13 @@ export function isValidExtensionVersion(version: string, extensionDesc: IReduced
|
||||
}
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
return (extensionDesc.engines.sqlops && extensionDesc.engines.sqlops === '*') || isVersionValid(version, extensionDesc.engines.sqlops, notices);
|
||||
return (extensionDesc.engines.azdata && extensionDesc.engines.azdata === '*') || isVersionValid(version, extensionDesc.engines.azdata, notices);
|
||||
}
|
||||
|
||||
export function isEngineValid(engine: string): boolean {
|
||||
// {{SQL CARBON EDIT}}
|
||||
export function isEngineValid(engine: string, version: string = pkg.version): boolean {
|
||||
// TODO@joao: discuss with alex '*' doesn't seem to be a valid engine version
|
||||
return engine === '*' || isVersionValid(pkg.version, engine);
|
||||
return engine === '*' || isVersionValid(version, engine);
|
||||
}
|
||||
|
||||
export function isVersionValid(currentVersion: string, requestedVersion: string, notices: string[] = []): boolean {
|
||||
|
||||
Reference in New Issue
Block a user