Improve FindPath API for Finding SDK w/out Feature Band (#2042)
* Fix acquisition error on non fully qualified version The new, unreleased code for getting a feature band of a sdk version try catches when it tries to get the band. It will not throw if there is no band in the string which can be expected in certain cases, but it still posts an error to the event stream. Posting an error to the event stream causes the error to bubble up to the user even if it is caught. We need to take some additional action here so the user doesn't see an error popup for something that's not an error. This is blocking our release with all of the findPath features. Resolves https://github.com/dotnet/vscode-dotnet-runtime/issues/2015 Version updates are to update the shas of the internal packages which got updated. * Update imports * remove extra else
This commit is contained in:
Родитель
1916ef1d8f
Коммит
814208c72c
|
@ -9,7 +9,6 @@
|
|||
"dependencies": {
|
||||
"@typescript-eslint/eslint-plugin-tslint": "^7.0.2",
|
||||
"@vscode/vsce": "^2.26.1",
|
||||
"eslint": "^8.0.0",
|
||||
"eslint-import-resolver-typescript": "^3.6.3",
|
||||
"eslint-plugin-import": "^2.30.0",
|
||||
"eslint-plugin-jsdoc": "^50.2.2",
|
||||
|
@ -21,6 +20,7 @@
|
|||
"@types/source-map-support": "^0.5.6",
|
||||
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
||||
"@typescript-eslint/parser": "^8.0.0",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"eslint-import-resolver-node": "^0.3.9",
|
||||
"eslint-plugin-prettier": "^5.2.1",
|
||||
|
@ -356,21 +356,20 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@eslint/js": {
|
||||
"version": "8.57.1",
|
||||
"resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@eslint/js/-/js-8.57.1.tgz",
|
||||
"integrity": "sha1-3mM9s+wu9qPIni8ZA4Bj6KEi4sI=",
|
||||
"license": "MIT",
|
||||
"version": "8.57.0",
|
||||
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz",
|
||||
"integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==",
|
||||
"engines": {
|
||||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@humanwhocodes/config-array": {
|
||||
"version": "0.13.0",
|
||||
"resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@humanwhocodes/config-array/-/config-array-0.13.0.tgz",
|
||||
"integrity": "sha1-+5B2JN8yVtBLmqLfUNeql+xkh0g=",
|
||||
"license": "Apache-2.0",
|
||||
"version": "0.11.14",
|
||||
"resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz",
|
||||
"integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==",
|
||||
"deprecated": "Use @eslint/config-array instead",
|
||||
"dependencies": {
|
||||
"@humanwhocodes/object-schema": "^2.0.3",
|
||||
"@humanwhocodes/object-schema": "^2.0.2",
|
||||
"debug": "^4.3.1",
|
||||
"minimatch": "^3.0.5"
|
||||
},
|
||||
|
@ -380,9 +379,8 @@
|
|||
},
|
||||
"node_modules/@humanwhocodes/config-array/node_modules/brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
"resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
"integrity": "sha1-PH/L9SnYcibz0vUrlm/1Jx60Qd0=",
|
||||
"license": "MIT",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||
"dependencies": {
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
|
@ -390,9 +388,8 @@
|
|||
},
|
||||
"node_modules/@humanwhocodes/config-array/node_modules/minimatch": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/minimatch/-/minimatch-3.1.2.tgz",
|
||||
"integrity": "sha1-Gc0ZS/0+Qo8EmnCBfAONiatL41s=",
|
||||
"license": "ISC",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
|
||||
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
|
||||
"dependencies": {
|
||||
"brace-expansion": "^1.1.7"
|
||||
},
|
||||
|
@ -415,9 +412,9 @@
|
|||
},
|
||||
"node_modules/@humanwhocodes/object-schema": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz",
|
||||
"integrity": "sha1-Siho111taWPkI7z5C3/RvjQ0CdM=",
|
||||
"license": "BSD-3-Clause"
|
||||
"resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz",
|
||||
"integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==",
|
||||
"deprecated": "Use @eslint/object-schema instead"
|
||||
},
|
||||
"node_modules/@nodelib/fs.scandir": {
|
||||
"version": "2.1.5",
|
||||
|
@ -510,17 +507,16 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/eslint-plugin": {
|
||||
"version": "8.8.1",
|
||||
"resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.8.1.tgz",
|
||||
"integrity": "sha1-k2S3VtTXi8vfb9PpNF5pJMaK03E=",
|
||||
"version": "8.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.0.0.tgz",
|
||||
"integrity": "sha512-STIZdwEQRXAHvNUS6ILDf5z3u95Gc8jzywunxSNqX00OooIemaaNIA0vEgynJlycL5AjabYLLrIyHd4iazyvtg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@eslint-community/regexpp": "^4.10.0",
|
||||
"@typescript-eslint/scope-manager": "8.8.1",
|
||||
"@typescript-eslint/type-utils": "8.8.1",
|
||||
"@typescript-eslint/utils": "8.8.1",
|
||||
"@typescript-eslint/visitor-keys": "8.8.1",
|
||||
"@typescript-eslint/scope-manager": "8.0.0",
|
||||
"@typescript-eslint/type-utils": "8.0.0",
|
||||
"@typescript-eslint/utils": "8.0.0",
|
||||
"@typescript-eslint/visitor-keys": "8.0.0",
|
||||
"graphemer": "^1.4.0",
|
||||
"ignore": "^5.3.1",
|
||||
"natural-compare": "^1.4.0",
|
||||
|
@ -680,16 +676,15 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/parser": {
|
||||
"version": "8.8.1",
|
||||
"resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@typescript-eslint/parser/-/parser-8.8.1.tgz",
|
||||
"integrity": "sha1-WVK6KoO9UgJLhy8/3I7S02Ngc7g=",
|
||||
"version": "8.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.0.0.tgz",
|
||||
"integrity": "sha512-pS1hdZ+vnrpDIxuFXYQpLTILglTjSYJ9MbetZctrUawogUsPdz31DIIRZ9+rab0LhYNTsk88w4fIzVheiTbWOQ==",
|
||||
"dev": true,
|
||||
"license": "BSD-2-Clause",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/scope-manager": "8.8.1",
|
||||
"@typescript-eslint/types": "8.8.1",
|
||||
"@typescript-eslint/typescript-estree": "8.8.1",
|
||||
"@typescript-eslint/visitor-keys": "8.8.1",
|
||||
"@typescript-eslint/scope-manager": "8.0.0",
|
||||
"@typescript-eslint/types": "8.0.0",
|
||||
"@typescript-eslint/typescript-estree": "8.0.0",
|
||||
"@typescript-eslint/visitor-keys": "8.0.0",
|
||||
"debug": "^4.3.4"
|
||||
},
|
||||
"engines": {
|
||||
|
@ -709,14 +704,13 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/scope-manager": {
|
||||
"version": "8.8.1",
|
||||
"resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@typescript-eslint/scope-manager/-/scope-manager-8.8.1.tgz",
|
||||
"integrity": "sha1-tL6hwHharr/jxKsFntrqHEl35/8=",
|
||||
"version": "8.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.0.0.tgz",
|
||||
"integrity": "sha512-V0aa9Csx/ZWWv2IPgTfY7T4agYwJyILESu/PVqFtTFz9RIS823mAze+NbnBI8xiwdX3iqeQbcTYlvB04G9wyQw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "8.8.1",
|
||||
"@typescript-eslint/visitor-keys": "8.8.1"
|
||||
"@typescript-eslint/types": "8.0.0",
|
||||
"@typescript-eslint/visitor-keys": "8.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
|
@ -727,14 +721,13 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/type-utils": {
|
||||
"version": "8.8.1",
|
||||
"resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@typescript-eslint/type-utils/-/type-utils-8.8.1.tgz",
|
||||
"integrity": "sha1-MfWexG6ToCtAn7TUBqNopZ+tMG4=",
|
||||
"version": "8.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.0.0.tgz",
|
||||
"integrity": "sha512-mJAFP2mZLTBwAn5WI4PMakpywfWFH5nQZezUQdSKV23Pqo6o9iShQg1hP2+0hJJXP2LnZkWPphdIq4juYYwCeg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/typescript-estree": "8.8.1",
|
||||
"@typescript-eslint/utils": "8.8.1",
|
||||
"@typescript-eslint/typescript-estree": "8.0.0",
|
||||
"@typescript-eslint/utils": "8.0.0",
|
||||
"debug": "^4.3.4",
|
||||
"ts-api-utils": "^1.3.0"
|
||||
},
|
||||
|
@ -752,11 +745,10 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/types": {
|
||||
"version": "8.8.1",
|
||||
"resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@typescript-eslint/types/-/types-8.8.1.tgz",
|
||||
"integrity": "sha1-6+heD6So4yokpWra3wYBA77xO9E=",
|
||||
"version": "8.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.0.0.tgz",
|
||||
"integrity": "sha512-wgdSGs9BTMWQ7ooeHtu5quddKKs5Z5dS+fHLbrQI+ID0XWJLODGMHRfhwImiHoeO2S5Wir2yXuadJN6/l4JRxw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
},
|
||||
|
@ -766,16 +758,15 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/typescript-estree": {
|
||||
"version": "8.8.1",
|
||||
"resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@typescript-eslint/typescript-estree/-/typescript-estree-8.8.1.tgz",
|
||||
"integrity": "sha1-NGSfTijTLuSRUhk7x97cDnjl0ew=",
|
||||
"version": "8.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.0.0.tgz",
|
||||
"integrity": "sha512-5b97WpKMX+Y43YKi4zVcCVLtK5F98dFls3Oxui8LbnmRsseKenbbDinmvxrWegKDMmlkIq/XHuyy0UGLtpCDKg==",
|
||||
"dev": true,
|
||||
"license": "BSD-2-Clause",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "8.8.1",
|
||||
"@typescript-eslint/visitor-keys": "8.8.1",
|
||||
"@typescript-eslint/types": "8.0.0",
|
||||
"@typescript-eslint/visitor-keys": "8.0.0",
|
||||
"debug": "^4.3.4",
|
||||
"fast-glob": "^3.3.2",
|
||||
"globby": "^11.1.0",
|
||||
"is-glob": "^4.0.3",
|
||||
"minimatch": "^9.0.4",
|
||||
"semver": "^7.6.0",
|
||||
|
@ -795,16 +786,15 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/utils": {
|
||||
"version": "8.8.1",
|
||||
"resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@typescript-eslint/utils/-/utils-8.8.1.tgz",
|
||||
"integrity": "sha1-nilID7+iZMJpRiU9qnIYH58FPJ0=",
|
||||
"version": "8.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.0.0.tgz",
|
||||
"integrity": "sha512-k/oS/A/3QeGLRvOWCg6/9rATJL5rec7/5s1YmdS0ZU6LHveJyGFwBvLhSRBv6i9xaj7etmosp+l+ViN1I9Aj/Q==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@eslint-community/eslint-utils": "^4.4.0",
|
||||
"@typescript-eslint/scope-manager": "8.8.1",
|
||||
"@typescript-eslint/types": "8.8.1",
|
||||
"@typescript-eslint/typescript-estree": "8.8.1"
|
||||
"@typescript-eslint/scope-manager": "8.0.0",
|
||||
"@typescript-eslint/types": "8.0.0",
|
||||
"@typescript-eslint/typescript-estree": "8.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
|
@ -818,13 +808,12 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/visitor-keys": {
|
||||
"version": "8.8.1",
|
||||
"resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/@typescript-eslint/visitor-keys/-/visitor-keys-8.8.1.tgz",
|
||||
"integrity": "sha1-D7EoDzgRSfw0Xf3in3VC/05Yf8U=",
|
||||
"version": "8.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.0.0.tgz",
|
||||
"integrity": "sha512-oN0K4nkHuOyF3PVMyETbpP5zp6wfyOvm7tWhTMfoqxSSsPmJIh6JNASuZDlODE8eE+0EB9uar+6+vxr9DBTYOA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "8.8.1",
|
||||
"@typescript-eslint/types": "8.0.0",
|
||||
"eslint-visitor-keys": "^3.4.3"
|
||||
},
|
||||
"engines": {
|
||||
|
@ -2042,16 +2031,16 @@
|
|||
}
|
||||
},
|
||||
"node_modules/eslint": {
|
||||
"version": "8.57.1",
|
||||
"resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/eslint/-/eslint-8.57.1.tgz",
|
||||
"integrity": "sha1-ffEJZUq6fju+XI6uUzxeRh08bKk=",
|
||||
"license": "MIT",
|
||||
"version": "8.57.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz",
|
||||
"integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==",
|
||||
"deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.",
|
||||
"dependencies": {
|
||||
"@eslint-community/eslint-utils": "^4.2.0",
|
||||
"@eslint-community/regexpp": "^4.6.1",
|
||||
"@eslint/eslintrc": "^2.1.4",
|
||||
"@eslint/js": "8.57.1",
|
||||
"@humanwhocodes/config-array": "^0.13.0",
|
||||
"@eslint/js": "8.57.0",
|
||||
"@humanwhocodes/config-array": "^0.11.14",
|
||||
"@humanwhocodes/module-importer": "^1.0.1",
|
||||
"@nodelib/fs.walk": "^1.2.8",
|
||||
"@ungap/structured-clone": "^1.2.0",
|
||||
|
@ -3891,10 +3880,9 @@
|
|||
},
|
||||
"node_modules/minimatch": {
|
||||
"version": "9.0.5",
|
||||
"resolved": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public-npm/npm/registry/minimatch/-/minimatch-9.0.5.tgz",
|
||||
"integrity": "sha1-10+d1rV9g9jpjPuCEzsDl4vJKeU=",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz",
|
||||
"integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"brace-expansion": "^2.0.1"
|
||||
},
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
"dependencies": {
|
||||
"@typescript-eslint/eslint-plugin-tslint": "^7.0.2",
|
||||
"@vscode/vsce": "^2.26.1",
|
||||
"eslint": "^8.0.0",
|
||||
"eslint-import-resolver-typescript": "^3.6.3",
|
||||
"eslint-plugin-import": "^2.30.0",
|
||||
"eslint-plugin-jsdoc": "^50.2.2",
|
||||
|
@ -28,6 +27,7 @@
|
|||
"@types/source-map-support": "^0.5.6",
|
||||
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
||||
"@typescript-eslint/parser": "^8.0.0",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"eslint-import-resolver-node": "^0.3.9",
|
||||
"eslint-plugin-prettier": "^5.2.1",
|
||||
|
|
3458
sample/yarn.lock
3458
sample/yarn.lock
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -63,6 +63,7 @@
|
|||
"eol": "^0.9.1",
|
||||
"get-proxy-settings": "^0.1.13",
|
||||
"https-proxy-agent": "^7.0.4",
|
||||
"lodash": "^4.17.21",
|
||||
"mocha": "^9.1.3",
|
||||
"open": "^8.4.0",
|
||||
"proper-lockfile": "^4.1.2",
|
||||
|
@ -74,6 +75,7 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@types/chai": "4.2.22",
|
||||
"@types/lodash": "^4.17.13",
|
||||
"@types/proper-lockfile": "^4.1.2",
|
||||
"glob": "^7.2.0"
|
||||
},
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -5,7 +5,14 @@
|
|||
|
||||
import { IAcquisitionWorkerContext } from './IAcquisitionWorkerContext';
|
||||
import { IEventStream } from '../EventStream/EventStream';
|
||||
import { DotnetFeatureBandDoesNotExistError, DotnetInvalidRuntimePatchVersion, DotnetVersionParseEvent, DotnetVersionResolutionError, EventCancellationError } from '../EventStream/EventStreamEvents';
|
||||
import {
|
||||
DotnetFeatureBandDoesNotExistError,
|
||||
DotnetInvalidRuntimePatchVersion,
|
||||
DotnetVersionParseEvent,
|
||||
DotnetVersionResolutionError,
|
||||
EventCancellationError,
|
||||
FeatureBandDoesNotExist
|
||||
} from '../EventStream/EventStreamEvents';
|
||||
import { getInstallFromContext } from '../Utils/InstallIdUtilities';
|
||||
|
||||
const invalidFeatureBandErrorString = `A feature band couldn't be determined for the requested version: `;
|
||||
|
@ -57,16 +64,24 @@ export function getMajorMinor(fullySpecifiedVersion : string, eventStream : IEve
|
|||
*
|
||||
* @param fullySpecifiedVersion the version of the sdk, either fully specified or not, but containing a band definition.
|
||||
* @returns a single string representing the band number, e.g. 3 in 7.0.301.
|
||||
* @remarks can return '' if no band exists in the fully specified version, and if considerErrorIfNoBand is false.
|
||||
*/
|
||||
export function getFeatureBandFromVersion(fullySpecifiedVersion : string, eventStream : IEventStream, context : IAcquisitionWorkerContext) : string
|
||||
export function getFeatureBandFromVersion(fullySpecifiedVersion : string, eventStream : IEventStream, context : IAcquisitionWorkerContext, considerErrorIfNoBand = true) : string
|
||||
{
|
||||
const band : string | undefined = fullySpecifiedVersion.split('.')?.at(2)?.charAt(0);
|
||||
if(band === undefined)
|
||||
{
|
||||
const event = new DotnetFeatureBandDoesNotExistError(new EventCancellationError('DotnetFeatureBandDoesNotExistError', `${invalidFeatureBandErrorString}${fullySpecifiedVersion}.`),
|
||||
getInstallFromContext(context));
|
||||
eventStream.post(event);
|
||||
throw event.error;
|
||||
if(considerErrorIfNoBand)
|
||||
{
|
||||
const event = new DotnetFeatureBandDoesNotExistError(new EventCancellationError('DotnetFeatureBandDoesNotExistError', `${invalidFeatureBandErrorString}${fullySpecifiedVersion}.`),
|
||||
getInstallFromContext(context));
|
||||
eventStream.post(event);
|
||||
throw event.error;
|
||||
}
|
||||
|
||||
const nonErrEvent = new FeatureBandDoesNotExist(`${invalidFeatureBandErrorString}${fullySpecifiedVersion}.`);
|
||||
eventStream.post(nonErrEvent);
|
||||
return '';
|
||||
}
|
||||
return band;
|
||||
}
|
||||
|
@ -75,27 +90,36 @@ export function getFeatureBandFromVersion(fullySpecifiedVersion : string, eventS
|
|||
*
|
||||
* @param fullySpecifiedVersion the version of the sdk, either fully specified or not, but containing a band definition.
|
||||
* @returns a single string representing the band patch version, e.g. 12 in 7.0.312.
|
||||
* @remarks can return '' if no band exists in the fully specified version, and if considerErrorIfNoBand is false.
|
||||
*/
|
||||
export function getFeatureBandPatchVersion(fullySpecifiedVersion : string, eventStream : IEventStream, context : IAcquisitionWorkerContext) : string
|
||||
export function getFeatureBandPatchVersion(fullySpecifiedVersion : string, eventStream : IEventStream, context : IAcquisitionWorkerContext, considerErrorIfNoBand = true) : string
|
||||
{
|
||||
return Number(getSDKPatchVersionString(fullySpecifiedVersion, eventStream, context)).toString();
|
||||
return Number(getSDKPatchVersionString(fullySpecifiedVersion, eventStream, context, considerErrorIfNoBand)).toString();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @remarks the logic for getFeatureBandPatchVersion, except that it returns '01' or '00' instead of the patch number.
|
||||
* Can return '' if no band exists in the fully specified version, and if considerErrorIfNoBand is false.
|
||||
* Not meant for public use.
|
||||
*/
|
||||
export function getSDKPatchVersionString(fullySpecifiedVersion : string, eventStream : IEventStream, context : IAcquisitionWorkerContext) : string
|
||||
export function getSDKPatchVersionString(fullySpecifiedVersion : string, eventStream : IEventStream, context : IAcquisitionWorkerContext, considerErrorIfNoBand = true) : string
|
||||
{
|
||||
const patch : string | undefined = fullySpecifiedVersion.split('.')?.at(2)?.substring(1)?.split('-')?.at(0);
|
||||
if(patch === undefined || !isNumber(patch))
|
||||
{
|
||||
const event = new DotnetFeatureBandDoesNotExistError(new EventCancellationError('DotnetFeatureBandDoesNotExistError',
|
||||
`${invalidFeatureBandErrorString}${fullySpecifiedVersion}.`),
|
||||
getInstallFromContext(context));
|
||||
eventStream.post(event);
|
||||
throw event.error;
|
||||
if(considerErrorIfNoBand)
|
||||
{
|
||||
const event = new DotnetFeatureBandDoesNotExistError(new EventCancellationError('DotnetFeatureBandDoesNotExistError',
|
||||
`${invalidFeatureBandErrorString}${fullySpecifiedVersion}.`),
|
||||
getInstallFromContext(context));
|
||||
eventStream.post(event);
|
||||
throw event.error;
|
||||
}
|
||||
|
||||
const nonErrEvent = new FeatureBandDoesNotExist(`${invalidFeatureBandErrorString}${fullySpecifiedVersion}.`);
|
||||
eventStream.post(nonErrEvent);
|
||||
return '';
|
||||
}
|
||||
return patch
|
||||
}
|
||||
|
@ -110,11 +134,11 @@ export function getSDKCompleteBandAndPatchVersionString(fullySpecifiedVersion :
|
|||
{
|
||||
try
|
||||
{
|
||||
const band = getFeatureBandFromVersion(fullySpecifiedVersion, eventStream, context);
|
||||
const patch = getSDKPatchVersionString(fullySpecifiedVersion, eventStream, context);
|
||||
const band = getFeatureBandFromVersion(fullySpecifiedVersion, eventStream, context, false);
|
||||
const patch = getSDKPatchVersionString(fullySpecifiedVersion, eventStream, context, false);
|
||||
return `${band}${patch}`;
|
||||
}
|
||||
catch
|
||||
catch ( error : any )
|
||||
{
|
||||
// Catch failure for when version does not include a band, etc
|
||||
}
|
||||
|
|
|
@ -779,6 +779,10 @@ export class TriedToExitMasterSudoProcess extends DotnetCustomMessageEvent {
|
|||
public readonly eventName = 'TriedToExitMasterSudoProcess';
|
||||
}
|
||||
|
||||
export class FeatureBandDoesNotExist extends DotnetCustomMessageEvent {
|
||||
public readonly eventName = 'FeatureBandDoesNotExist';
|
||||
}
|
||||
|
||||
export class DotnetUninstallStarted extends DotnetCustomMessageEvent {
|
||||
public readonly eventName = 'DotnetUninstallStarted';
|
||||
public type = EventType.DotnetUninstallMessage;
|
||||
|
|
|
@ -64,6 +64,7 @@ suite('Version Utilities Unit Tests', () => {
|
|||
assert.equal(resolver.getSDKCompleteBandAndPatchVersionString(uniqueMajorMinorVersion, mockEventStream, mockCtx), '300');
|
||||
assert.equal(resolver.getSDKCompleteBandAndPatchVersionString(twoDigitMajorVersion, mockEventStream, mockCtx), '102');
|
||||
assert.equal(resolver.getSDKCompleteBandAndPatchVersionString(twoDigitPatchVersion, mockEventStream, mockCtx), '221');
|
||||
assert.equal(resolver.getSDKPatchVersionString('8.0', mockEventStream, mockCtx, false), '', 'It does not error if no feature band in version if no error bool set');
|
||||
});
|
||||
|
||||
test('Get Patch from Runtime Version', async () => {
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
5093
yarn.lock
5093
yarn.lock
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Загрузка…
Ссылка в новой задаче