Skip to content

Commit

Permalink
Nest alertCounts object in event_report.properties (#1770)
Browse files Browse the repository at this point in the history
  • Loading branch information
Angela P Wen authored and GitHub committed Jul 11, 2023
1 parent d6c8719 commit 863a05b
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 4 deletions.
4 changes: 3 additions & 1 deletion lib/analyze.js

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

2 changes: 1 addition & 1 deletion lib/analyze.js.map

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions lib/analyze.test.js

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

2 changes: 1 addition & 1 deletion lib/analyze.test.js.map

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions src/analyze.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ test("status report fields and search path setting", async (t) => {
if (builtinStatusReport.event_reports) {
for (const eventReport of builtinStatusReport.event_reports) {
t.deepEqual(eventReport.event, "codeql database interpret-results");
t.true("properties" in eventReport);
t.true("alertCounts" in eventReport.properties!);
}
}

Expand Down Expand Up @@ -214,6 +216,8 @@ test("status report fields and search path setting", async (t) => {
if (customStatusReport.event_reports) {
for (const eventReport of customStatusReport.event_reports) {
t.deepEqual(eventReport.event, "codeql database interpret-results");
t.true("properties" in eventReport);
t.true("alertCounts" in eventReport.properties!);
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/analyze.ts
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,9 @@ export async function runQueries(
completed_at: endTimeInterpretResults.toISOString(),
exit_status: "success",
language,
properties: perQueryAlertCounts,
properties: {
alertCounts: perQueryAlertCounts,
},
};

if (statusReport["event_reports"] === undefined) {
Expand Down

0 comments on commit 863a05b

Please sign in to comment.