Update text to reflect multiple pack names.
This commit is contained in:
@@ -313,7 +313,7 @@ export async function compileAndRunQueryAgainstDatabase(
|
||||
|
||||
if (!packConfig.dbscheme) {
|
||||
throw new Error(
|
||||
"Could not find a database scheme for this query. Please check that you have a valid qlpack.yml file for this query, which refers to a database scheme either in the `dbscheme` field or through one of its dependencies.",
|
||||
"Could not find a database scheme for this query. Please check that you have a valid qlpack.yml or codeql-pack.yml file for this query, which refers to a database scheme either in the `dbscheme` field or through one of its dependencies.",
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -57,8 +57,8 @@ export interface GeneratedQueryPack {
|
||||
|
||||
/**
|
||||
* Two possibilities:
|
||||
* 1. There is no qlpack.yml in this directory. Assume this is a lone query and generate a synthetic qlpack for it.
|
||||
* 2. There is a qlpack.yml in this directory. Assume this is a query pack and use the yml to pack the query before uploading it.
|
||||
* 1. There is no qlpack.yml (or codeql-pack.yml) in this directory. Assume this is a lone query and generate a synthetic qlpack for it.
|
||||
* 2. There is a qlpack.yml (or codeql-pack.yml) in this directory. Assume this is a query pack and use the yml to pack the query before uploading it.
|
||||
*
|
||||
* @returns the entire qlpack as a base64 string.
|
||||
*/
|
||||
@@ -169,12 +169,12 @@ async function generateQueryPack(
|
||||
}
|
||||
|
||||
async function findPackRoot(queryFile: string): Promise<string> {
|
||||
// recursively find the directory containing qlpack.yml
|
||||
// recursively find the directory containing qlpack.yml or codeql-pack.yml
|
||||
let dir = dirname(queryFile);
|
||||
while (!(await getQlPackPath(dir))) {
|
||||
dir = dirname(dir);
|
||||
if (isFileSystemRoot(dir)) {
|
||||
// there is no qlpack.yml in this directory or any parent directory.
|
||||
// there is no qlpack.yml or codeql-pack.yml in this directory or any parent directory.
|
||||
// just use the query file's directory as the pack root.
|
||||
return dirname(queryFile);
|
||||
}
|
||||
@@ -300,14 +300,14 @@ export async function prepareRemoteQueryRun(
|
||||
}
|
||||
|
||||
/**
|
||||
* Fixes the qlpack.yml file to be correct in the context of the MRVA request.
|
||||
* Fixes the qlpack.yml or codeql-pack.yml file to be correct in the context of the MRVA request.
|
||||
*
|
||||
* Performs the following fixes:
|
||||
*
|
||||
* - Updates the default suite of the query pack. This is used to ensure
|
||||
* only the specified query is run.
|
||||
* - Ensures the query pack name is set to the name expected by the server.
|
||||
* - Removes any `${workspace}` version references from the qlpack.yml file. Converts them
|
||||
* - Removes any `${workspace}` version references from the qlpack.yml or codeql-pack.yml file. Converts them
|
||||
* to `*` versions.
|
||||
*
|
||||
* @param queryPackDir The directory containing the query pack
|
||||
|
||||
@@ -30,12 +30,12 @@ export async function cleanDatabases(databaseManager: DatabaseManager) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Conditionally removes `${workspace}` references from a qlpack.yml file.
|
||||
* Conditionally removes `${workspace}` references from a qlpack.yml or codeql-pack.yml file.
|
||||
* CLI versions earlier than 2.11.3 do not support `${workspace}` references in the dependencies block.
|
||||
* If workspace references are removed, the qlpack.yml file is re-written to disk
|
||||
* If workspace references are removed, the qlpack.yml or codeql-pack.yml file is re-written to disk
|
||||
* without the `${workspace}` references and the original dependencies are returned.
|
||||
*
|
||||
* @param qlpackFileWithWorkspaceRefs The qlpack.yml file with workspace refs
|
||||
* @param qlpackFileWithWorkspaceRefs The qlpack.yml or codeql-pack.yml file with workspace refs
|
||||
* @param cli The cli to use to check version constraints
|
||||
* @returns The original dependencies with workspace refs, or undefined if the CLI version supports workspace refs and no changes were made
|
||||
*/
|
||||
@@ -55,10 +55,10 @@ export async function fixWorkspaceReferences(
|
||||
}
|
||||
|
||||
/**
|
||||
* Restores the original dependencies with `${workspace}` refs to a qlpack.yml file.
|
||||
* Restores the original dependencies with `${workspace}` refs to a qlpack.yml or codeql-pack.yml file.
|
||||
* See `fixWorkspaceReferences` for more details.
|
||||
*
|
||||
* @param qlpackFileWithWorkspaceRefs The qlpack.yml file to restore workspace refs
|
||||
* @param qlpackFileWithWorkspaceRefs The qlpack.yml or codeql-pack.yml file to restore workspace refs
|
||||
* @param originalDeps the original dependencies with workspace refs or undefined if
|
||||
* no changes were made.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user