Merge branch 'main' into fix-missing-description-text

This commit is contained in:
Noah Gilson 2023-11-10 11:59:32 -08:00 коммит произвёл GitHub
Родитель 1f4352f9b6 93b17b88fc
Коммит 3864e23fb6
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
6 изменённых файлов: 124 добавлений и 43 удалений

Просмотреть файл

@ -8,23 +8,45 @@
"properties":
{
"installCommand": {
"type": "string",
"type": "array",
"typeDefinition" : {
"runUnderSudo":
{
"type": "boolean",
"description": "true if this command should be executed under sudo on linux"
},
"commandRoot":
{
"type": "string",
"description": "The first word in the command, e.g. if apt-get install foo, it would be the string apt."
},
"commandParts":
{
"type": "array",
"description": "The remaining parts of the command in an array, for apt-get install {0} it would be [install, {0}] as strings"
},
"description": "An array of these command objects needed to run in-order"
},
"description": "The command(s) needed to install dotnet for this distro. Use {0} for the package to install"
},
"uninstallCommand": {
"type": "string",
"type": "array",
"description": "The command(s) needed to uninstall dotnet. Use {0} for the package"
},
"updateCommand": {
"type": "string",
"type": "array",
"description": "The command(s) needed to update dotnet. Use {0} for the package"
},
"searchCommand": {
"type": "array",
"description": "The command(s) needed to see if a package is available. Use {0} for the package"
},
"isInstalledCommand": {
"type": "string",
"type": "array",
"description": "The command(s) needed that will return true if dotnet is installed on the machine"
},
"packageLookupCommand": {
"type": "string",
"type": "array",
"description": "The command(s) needed that will return true if a given package is installed on the machine"
},
"expectedDistroFeedInstallDirectory": {
@ -36,21 +58,68 @@
"description": "The path that dotnet would be installed if installed via the microsoft feed"
},
"installedSDKVersionsCommand": {
"type": "string",
"type": "array",
"description": "The command needed to get all installed dotnet sdk versions on the machine"
},
"installedRuntimeVersionsCommand": {
"type": "string",
"type": "array",
"description": "The command needed to get all installed dotnet runtime versions on the machine"
},
"currentInstallationVersionCommand": {
"type": "string",
"type": "array",
"description": "The command needed to get the version of the installed dotnet on the machine if available"
},
"currentInstallPathCommand": {
"type": "string",
"type": "array",
"description": "The command needed to get the path of the installed dotnet on the machine if available"
},
"packages": {
"type": "array",
"description": "Lists all of the packages that MAY be supported or found on the system per each version of .NET",
"items": [
{
"type": "object",
"properties": {
"version": {
"type": "string",
"description": "The version major.minor of dotnet"
},
"sdk": {
"type": "array",
"items": [
{
"type": "string",
"description": "a collection of all potential package names for this version of the dotnet sdk on this distro"
}
]
},
"runtime": {
"type": "array",
"items": [
{
"type": "string",
"description": "a collection of all potential package names for this version of the dotnet runtime on this distro"
}
]
},
"aspnetcore": {
"type": "array",
"items": [
{
"type": "string",
"description": "a collection of all potential package names for this version of aspnet on this distro"
}
]
}
},
"required": [
"version",
"sdk",
"runtime",
"aspnetcore"
]
}]
},
"versions":
{
"type": "array",
@ -64,38 +133,6 @@
"type": "string",
"description": "The distro version mapped to this object"
},
"dotnet": {
"type": "array",
"description": "An array of the supported versions of dotnet and their package names",
"items": [
{
"type": "object",
"description": "this object represents one version of dotnet thats supported, each version will have its own object",
"properties": {
"version": {
"type": "string",
"description": "the version of dotnet"
},
"sdk": {
"type": "string",
"description": "the string of the package name for the sdk of this version"
},
"runtime": {
"type": "string"
},
"aspnetcore": {
"type": "string"
}
},
"required": [
"version",
"sdk",
"runtime",
"aspnetcore"
]
}
]
},
"preInstallCommands":
{
"type": "array",
@ -109,7 +146,6 @@
},
"required": [
"version",
"dotnet",
"preInstallCommands"
]
}]

Просмотреть файл

@ -4,6 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import * as path from 'path';
import * as os from 'os';
import { runTests } from 'vscode-test';
@ -17,8 +18,23 @@ async function main() {
// Passed to --extensionTestsPath
const extensionTestsPath = path.resolve(__dirname, './index');
let platformValue = '';
switch(os.platform())
{
case 'win32':
platformValue = 'win32-x64-archive';
break;
case 'darwin':
platformValue = 'darwin';
break;
case 'linux':
platformValue = 'linux-x64';
break;
}
// Download VS Code, unzip it and run the integration test
await runTests({
...(platformValue !== '' && {platform: platformValue}),
extensionDevelopmentPath,
extensionTestsPath,
launchArgs: [

Просмотреть файл

@ -10,6 +10,7 @@ import * as os from 'os';
import * as path from 'path';
import { VersionResolver } from './VersionResolver';
import { DotnetFeatureBandDoesNotExistError,
DotnetFileIntegrityCheckEvent,
DotnetInvalidReleasesJSONError,
DotnetNoInstallerFileExistsError,
DotnetUnexpectedInstallerArchitectureError,
@ -249,6 +250,10 @@ Please report this issue so it can be remedied or investigated.`));
this.eventStream.post(releaseJsonErr);
throw releaseJsonErr.error;
}
else
{
this.eventStream.post(new DotnetFileIntegrityCheckEvent(`This installer file is hosted on an expected domain https://download.visualstudio.microsoft.com/.`));
}
let installerHash = installer[this.releasesHashKey];
if(!installerHash)

Просмотреть файл

@ -10,7 +10,7 @@ import { FileUtilities } from '../Utils/FileUtilities';
import { IGlobalInstaller } from './IGlobalInstaller';
import { IAcquisitionWorkerContext } from './IAcquisitionWorkerContext';
import { VersionResolver } from './VersionResolver';
import { DotnetConflictingGlobalWindowsInstallError, DotnetUnexpectedInstallerOSError, OSXOpenNotAvailableError, SuppressedAcquisitionError } from '../EventStream/EventStreamEvents';
import { DotnetConflictingGlobalWindowsInstallError, DotnetFileIntegrityCheckEvent, DotnetUnexpectedInstallerOSError, OSXOpenNotAvailableError, SuppressedAcquisitionError } from '../EventStream/EventStreamEvents';
import { ICommandExecutor } from '../Utils/ICommandExecutor';
import { CommandExecutor } from '../Utils/CommandExecutor';
import { IFileUtilities } from '../Utils/IFileUtilities';
@ -137,7 +137,9 @@ We cannot verify .NET is safe to download at this time. Please try again later.`
private async installerFileHasValidIntegrity(installerFile : string) : Promise<boolean>
{
const realFileHash = await this.file.getFileHash(installerFile);
this.acquisitionContext.eventStream.post(new DotnetFileIntegrityCheckEvent(`The hash of the installer file we downloaded is ${realFileHash}`));
const expectedFileHash = this.installerHash;
this.acquisitionContext.eventStream.post(new DotnetFileIntegrityCheckEvent(`The valid and expected hash of the installer file is ${expectedFileHash}`));
if(expectedFileHash === null)
{
@ -147,15 +149,18 @@ We cannot verify .NET is safe to download at this time. Please try again later.`
const pick = await this.utilityContext.ui.getModalWarningResponse(message, no, yes);
const userConsentsToContinue = pick === yes;
this.acquisitionContext.eventStream.post(new DotnetFileIntegrityCheckEvent(`The valid hash could not be found. The user chose to continue? ${userConsentsToContinue}`));
return userConsentsToContinue;
}
if(realFileHash !== expectedFileHash)
{
this.acquisitionContext.eventStream.post(new DotnetFileIntegrityCheckEvent(`The hashes DO NOT match.`));
return false;
}
else
{
this.acquisitionContext.eventStream.post(new DotnetFileIntegrityCheckEvent(`This file is valid.`));
return true;
}
}

Просмотреть файл

@ -401,6 +401,10 @@ export class DotnetCommandNotFoundEvent extends DotnetCustomMessageEvent {
public readonly eventName = 'DotnetCommandNotFoundEvent';
}
export class DotnetFileIntegrityCheckEvent extends DotnetCustomMessageEvent {
public readonly eventName = 'DotnetFileIntegrityCheckEvent';
}
export class CommandExecutionStdOut extends DotnetCustomMessageEvent {
public readonly eventName = 'CommandExecutionStdOut';
}

Просмотреть файл

@ -4,6 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import * as path from 'path';
import * as os from 'os';
import { runTests } from 'vscode-test';
@ -16,9 +17,23 @@ async function main() {
// The path to the extension test runner script
// Passed to --extensionTestsPath
const extensionTestsPath = path.resolve(__dirname, './index');
let platformValue = '';
switch(os.platform())
{
case 'win32':
platformValue = 'win32-x64-archive';
break;
case 'darwin':
platformValue = 'darwin';
break;
case 'linux':
platformValue = 'linux-x64';
break;
}
// Download VS Code, unzip it and run the integration test
await runTests({
...(platformValue !== '' && {platform: platformValue}),
extensionDevelopmentPath,
extensionTestsPath,
launchArgs: [