Skip to content

Commit

Permalink
Add sarifRunPropertyFlag to databaseInterpretResults()
Browse files Browse the repository at this point in the history
  • Loading branch information
Chuan-kai Lin committed Oct 23, 2024
1 parent db53998 commit b311eee
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/analyze.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,8 @@ export async function runQueries(
): Promise<QueriesStatusReport> {
const statusReport: QueriesStatusReport = {};

const sarifRunPropertyFlag = undefined;

const codeql = await getCodeQL(config.codeQLCmd);
const queryFlags = [memoryFlag, threadsFlag];

Expand Down Expand Up @@ -336,6 +338,7 @@ export async function runQueries(
addSnippetsFlag,
threadsFlag,
enableDebugLogging ? "-vv" : "-v",
sarifRunPropertyFlag,
automationDetailsId,
config,
features,
Expand Down
1 change: 1 addition & 0 deletions src/codeql.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -839,6 +839,7 @@ for (const {
"",
"",
"-v",
undefined,
"",
Object.assign({}, stubConfig, { gitHubVersion: githubVersion }),
createFeatures([]),
Expand Down
5 changes: 5 additions & 0 deletions src/codeql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ export interface CodeQL {
addSnippetsFlag: string,
threadsFlag: string,
verbosityFlag: string | undefined,
sarifRunPropertyFlag: string | undefined,
automationDetailsId: string | undefined,
config: Config,
features: FeatureEnablement,
Expand Down Expand Up @@ -834,6 +835,7 @@ export async function getCodeQLForCmd(
addSnippetsFlag: string,
threadsFlag: string,
verbosityFlag: string,
sarifRunPropertyFlag: string | undefined,
automationDetailsId: string | undefined,
config: Config,
features: FeatureEnablement,
Expand Down Expand Up @@ -861,6 +863,9 @@ export async function getCodeQLForCmd(
...(await getJobRunUuidSarifOptions(this)),
...getExtraOptionsFromEnv(["database", "interpret-results"]),
];
if (sarifRunPropertyFlag !== undefined) {
codeqlArgs.push(sarifRunPropertyFlag);
}
if (automationDetailsId !== undefined) {
codeqlArgs.push("--sarif-category", automationDetailsId);
}
Expand Down

0 comments on commit b311eee

Please sign in to comment.