Fix invalid property name on message

This commit is contained in:
Andrew Eisenberg
2021-01-29 11:13:12 -08:00
parent 07eb334e6c
commit f154206b47
4 changed files with 11 additions and 8 deletions

View File

@@ -3,6 +3,7 @@
## [UNRELEASED] ## [UNRELEASED]
- Fix bug where databases are not reregistered when the query server restarts. [#734](https://github.com/github/vscode-codeql/pull/734) - Fix bug where databases are not reregistered when the query server restarts. [#734](https://github.com/github/vscode-codeql/pull/734)
- Fix bug where upgrade requests were erroneously being marked as failed. [#734](https://github.com/github/vscode-codeql/pull/734)
## 1.3.10 - 20 January 2021 ## 1.3.10 - 20 January 2021

View File

@@ -479,7 +479,7 @@ export interface CompileUpgradeSequenceResult {
/** /**
* The compiled upgrades as a single file. * The compiled upgrades as a single file.
*/ */
compiledUpgrades?: string; compiledUpgrade?: string;
/** /**
* Any errors that occurred when checking the scripts. * Any errors that occurred when checking the scripts.
*/ */

View File

@@ -354,14 +354,14 @@ async function compileNonDestructiveUpgrade(
reportNoUpgradePath(query); reportNoUpgradePath(query);
} }
const result = await compileDatabaseUpgradeSequence(qs, query.dbItem, scripts, upgradeTemp, progress, token); const result = await compileDatabaseUpgradeSequence(qs, query.dbItem, scripts, upgradeTemp, progress, token);
if (result.compiledUpgrades === undefined) { if (result.compiledUpgrade === undefined) {
const error = result.error || '[no error message available]'; const error = result.error || '[no error message available]';
throw new Error(error); throw new Error(error);
} }
// We can upgrade to the actual target // We can upgrade to the actual target
query.program.dbschemePath = query.queryDbscheme; query.program.dbschemePath = query.queryDbscheme;
// We are new enough that we will always support single file upgrades. // We are new enough that we will always support single file upgrades.
return result.compiledUpgrades; return result.compiledUpgrade;
} }

View File

@@ -20,9 +20,9 @@ const MAX_UPGRADE_MESSAGE_LINES = 10;
/** /**
* Check that we support non-destructive upgrades. * Check that we support non-destructive upgrades.
* *
* This requires 3 features. The ability to compile an upgrade sequence; The ability to * This requires 3 features. The ability to compile an upgrade sequence; The ability to
* run a non-destructive upgrades as a query; the ability to specify a target when * run a non-destructive upgrades as a query; the ability to specify a target when
* resolving upgrades. We check for a version of codeql that has all three features. * resolving upgrades. We check for a version of codeql that has all three features.
*/ */
export async function hasNondestructiveUpgradeCapabilities(qs: qsClient.QueryServerClient): Promise<boolean> { export async function hasNondestructiveUpgradeCapabilities(qs: qsClient.QueryServerClient): Promise<boolean> {
@@ -34,12 +34,14 @@ export async function hasNondestructiveUpgradeCapabilities(qs: qsClient.QuerySer
* Compile a database upgrade sequence. * Compile a database upgrade sequence.
* Callers must check that this is valid with the current queryserver first. * Callers must check that this is valid with the current queryserver first.
*/ */
export async function compileDatabaseUpgradeSequence(qs: qsClient.QueryServerClient, export async function compileDatabaseUpgradeSequence(
qs: qsClient.QueryServerClient,
db: DatabaseItem, db: DatabaseItem,
resolvedSequence: string[], resolvedSequence: string[],
currentUpgradeTmp: tmp.DirectoryResult, currentUpgradeTmp: tmp.DirectoryResult,
progress: ProgressCallback, progress: ProgressCallback,
token: vscode.CancellationToken): Promise<messages.CompileUpgradeSequenceResult> { token: vscode.CancellationToken
): Promise<messages.CompileUpgradeSequenceResult> {
if (db.contents === undefined || db.contents.dbSchemeUri === undefined) { if (db.contents === undefined || db.contents.dbSchemeUri === undefined) {
throw new Error('Database is invalid, and cannot be upgraded.'); throw new Error('Database is invalid, and cannot be upgraded.');
} }