Skip to content

Commit

Permalink
Hash result set name in sorted result set path
Browse files Browse the repository at this point in the history
  • Loading branch information
kaspersv committed Oct 12, 2023
1 parent ac4ccf4 commit 6d1b01d
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 2 deletions.
2 changes: 2 additions & 0 deletions extensions/ql-vscode/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## [UNRELEASED]

- 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)

## 1.9.2 - 12 October 2023

- 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)
Expand Down
11 changes: 11 additions & 0 deletions extensions/ql-vscode/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions extensions/ql-vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2081,6 +2081,7 @@
"dependencies": {
"@octokit/plugin-retry": "^6.0.1",
"@octokit/rest": "^20.0.2",
"@types/imurmurhash": "^0.1.2",
"@vscode/codicons": "^0.0.31",
"@vscode/debugadapter": "^1.59.0",
"@vscode/debugprotocol": "^1.59.0",
Expand Down
5 changes: 4 additions & 1 deletion extensions/ql-vscode/src/run-queries-shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { BaseLogger, showAndLogWarningMessage } from "./common/logging";
import { extLogger } from "./common/logging/vscode";
import { generateSummarySymbolsFile } from "./log-insights/summary-parser";
import { getErrorMessage } from "./common/helpers-pure";
import * as MurmurHash3 from "imurmurhash";

/**
* run-queries.ts
Expand Down Expand Up @@ -150,7 +151,9 @@ export class QueryEvaluationInfo extends QueryOutputDir {
};
}
getSortedResultSetPath(resultSetName: string) {
return join(this.querySaveDir, `sortedResults-${resultSetName}.bqrs`);
const hasher = new MurmurHash3.default();
hasher.hash(resultSetName);
return join(this.querySaveDir, `sortedResults-${hasher.result()}.bqrs`);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ describe("query-results", () => {
const expectedResultsPath = join(queryPath, "results.bqrs");
const expectedSortedResultsPath = join(
queryPath,
"sortedResults-a-result-set-name.bqrs",
"sortedResults-1110391921.bqrs",
);
expect(spy).toBeCalledWith(
expectedResultsPath,
Expand Down

0 comments on commit 6d1b01d

Please sign in to comment.