Skip to content

Commit ee5b738

Browse files
committed
Hash result set name in sorted result set path
1 parent 00a5717 commit ee5b738

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

extensions/ql-vscode/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## [UNRELEASED]
44

5+
- Sorted result set filenames now include a hash of the result set name instead of the full name. [#2955](https://github.com/github/vscode-codeql/pull/2955)
6+
57
## 1.9.2 - 12 October 2023
68

79
- Fix a bug where the query to Find Definitions in database source files would not be cancelled appropriately. [#2885](https://github.com/github/vscode-codeql/pull/2885)

extensions/ql-vscode/src/run-queries-shared.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import { BaseLogger, showAndLogWarningMessage } from "./common/logging";
2424
import { extLogger } from "./common/logging/vscode";
2525
import { generateSummarySymbolsFile } from "./log-insights/summary-parser";
2626
import { getErrorMessage } from "./common/helpers-pure";
27+
import { createHash } from "crypto";
2728

2829
/**
2930
* run-queries.ts
@@ -150,7 +151,12 @@ export class QueryEvaluationInfo extends QueryOutputDir {
150151
};
151152
}
152153
getSortedResultSetPath(resultSetName: string) {
153-
return join(this.querySaveDir, `sortedResults-${resultSetName}.bqrs`);
154+
const hasher = createHash("sha256");
155+
hasher.update(resultSetName);
156+
return join(
157+
this.querySaveDir,
158+
`sortedResults-${hasher.digest("hex")}.bqrs`,
159+
);
154160
}
155161

156162
/**

extensions/ql-vscode/test/vscode-tests/no-workspace/query-results.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ describe("query-results", () => {
160160
const expectedResultsPath = join(queryPath, "results.bqrs");
161161
const expectedSortedResultsPath = join(
162162
queryPath,
163-
"sortedResults-a-result-set-name.bqrs",
163+
"sortedResults-cc8589f226adc134f87f2438e10075e0667571c72342068e2281e0b3b65e1092.bqrs",
164164
);
165165
expect(spy).toBeCalledWith(
166166
expectedResultsPath,

0 commit comments

Comments
 (0)