Skip to content

Commit 7b4b491

Browse files
authored
Merge pull request #2099 from github/starcke/qlpack-gen-rename
Starcke/qlpack gen rename
2 parents 5e51bb5 + ffd27d4 commit 7b4b491

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

extensions/ql-vscode/src/legacy-query-server/run-queries.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ export async function compileAndRunQueryAgainstDatabase(
313313

314314
if (!packConfig.dbscheme) {
315315
throw new Error(
316-
"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.",
316+
"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.",
317317
);
318318
}
319319

extensions/ql-vscode/src/qlpack-generator.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ export class QlPackGenerator {
2525
this.qlpackVersion = "1.0.0";
2626
this.header = "# This is an automatically generated file.\n\n";
2727

28-
this.qlpackFileName = "qlpack.yml";
28+
this.qlpackFileName = "codeql-pack.yml";
2929
this.folderUri = Uri.file(join(this.storagePath, this.folderName));
3030
}
3131

3232
public async generate() {
3333
// create QL pack folder and add to workspace
3434
await this.createWorkspaceFolder();
3535

36-
// create qlpack.yml
36+
// create codeql-pack.yml
3737
await this.createQlPackYaml();
3838

3939
// create example.ql

extensions/ql-vscode/src/variant-analysis/run-remote-query.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ export interface GeneratedQueryPack {
5757

5858
/**
5959
* Two possibilities:
60-
* 1. There is no qlpack.yml in this directory. Assume this is a lone query and generate a synthetic qlpack for it.
61-
* 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.
60+
* 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.
61+
* 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.
6262
*
6363
* @returns the entire qlpack as a base64 string.
6464
*/
@@ -169,12 +169,12 @@ async function generateQueryPack(
169169
}
170170

171171
async function findPackRoot(queryFile: string): Promise<string> {
172-
// recursively find the directory containing qlpack.yml
172+
// recursively find the directory containing qlpack.yml or codeql-pack.yml
173173
let dir = dirname(queryFile);
174174
while (!(await getQlPackPath(dir))) {
175175
dir = dirname(dir);
176176
if (isFileSystemRoot(dir)) {
177-
// there is no qlpack.yml in this directory or any parent directory.
177+
// there is no qlpack.yml or codeql-pack.yml in this directory or any parent directory.
178178
// just use the query file's directory as the pack root.
179179
return dirname(queryFile);
180180
}
@@ -300,14 +300,14 @@ export async function prepareRemoteQueryRun(
300300
}
301301

302302
/**
303-
* Fixes the qlpack.yml file to be correct in the context of the MRVA request.
303+
* Fixes the qlpack.yml or codeql-pack.yml file to be correct in the context of the MRVA request.
304304
*
305305
* Performs the following fixes:
306306
*
307307
* - Updates the default suite of the query pack. This is used to ensure
308308
* only the specified query is run.
309309
* - Ensures the query pack name is set to the name expected by the server.
310-
* - Removes any `${workspace}` version references from the qlpack.yml file. Converts them
310+
* - Removes any `${workspace}` version references from the qlpack.yml or codeql-pack.yml file. Converts them
311311
* to `*` versions.
312312
*
313313
* @param queryPackDir The directory containing the query pack

extensions/ql-vscode/test/vscode-tests/global.helper.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ export async function cleanDatabases(databaseManager: DatabaseManager) {
3030
}
3131

3232
/**
33-
* Conditionally removes `${workspace}` references from a qlpack.yml file.
33+
* Conditionally removes `${workspace}` references from a qlpack.yml or codeql-pack.yml file.
3434
* CLI versions earlier than 2.11.3 do not support `${workspace}` references in the dependencies block.
35-
* If workspace references are removed, the qlpack.yml file is re-written to disk
35+
* If workspace references are removed, the qlpack.yml or codeql-pack.yml file is re-written to disk
3636
* without the `${workspace}` references and the original dependencies are returned.
3737
*
38-
* @param qlpackFileWithWorkspaceRefs The qlpack.yml file with workspace refs
38+
* @param qlpackFileWithWorkspaceRefs The qlpack.yml or codeql-pack.yml file with workspace refs
3939
* @param cli The cli to use to check version constraints
4040
* @returns The original dependencies with workspace refs, or undefined if the CLI version supports workspace refs and no changes were made
4141
*/
@@ -55,10 +55,10 @@ export async function fixWorkspaceReferences(
5555
}
5656

5757
/**
58-
* Restores the original dependencies with `${workspace}` refs to a qlpack.yml file.
58+
* Restores the original dependencies with `${workspace}` refs to a qlpack.yml or codeql-pack.yml file.
5959
* See `fixWorkspaceReferences` for more details.
6060
*
61-
* @param qlpackFileWithWorkspaceRefs The qlpack.yml file to restore workspace refs
61+
* @param qlpackFileWithWorkspaceRefs The qlpack.yml or codeql-pack.yml file to restore workspace refs
6262
* @param originalDeps the original dependencies with workspace refs or undefined if
6363
* no changes were made.
6464
*/

extensions/ql-vscode/test/vscode-tests/minimal-workspace/qlpack-generator.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ describe("QlPackGenerator", () => {
2424
packFolderName = `test-ql-pack-${language}`;
2525
packFolderPath = Uri.file(join(dir.name, packFolderName)).fsPath;
2626

27-
qlPackYamlFilePath = join(packFolderPath, "qlpack.yml");
27+
qlPackYamlFilePath = join(packFolderPath, "codeql-pack.yml");
2828
exampleQlFilePath = join(packFolderPath, "example.ql");
2929

3030
packAddSpy = jest.fn();

0 commit comments

Comments
 (0)