Skip to content

Commit

Permalink
Tidy up telemetry call
Browse files Browse the repository at this point in the history
  • Loading branch information
Henry Mercer committed Jul 2, 2024
1 parent 7e6aa4d commit 8dba596
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 36 deletions.
11 changes: 3 additions & 8 deletions lib/analyze-action.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-action.js.map

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

40 changes: 13 additions & 27 deletions src/analyze-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -356,33 +356,19 @@ async function run() {
core.setFailed(error.message);
}

if (error instanceof CodeQLAnalysisError) {
const stats = { ...error.queriesStatusReport };
await sendStatusReport(
startedAt,
config,
stats,
error.error, // use the underlying error in case it is a configuration error
trapCacheUploadTime,
dbCreationTimings,
didUploadTrapCaches,
trapCacheCleanupTelemetry,
logger,
);
} else {
await sendStatusReport(
startedAt,
config,
undefined,
error,
trapCacheUploadTime,
dbCreationTimings,
didUploadTrapCaches,
trapCacheCleanupTelemetry,
logger,
);
}

await sendStatusReport(
startedAt,
config,
error instanceof CodeQLAnalysisError
? error.queriesStatusReport
: undefined,
error instanceof CodeQLAnalysisError ? error.error : error,
trapCacheUploadTime,
dbCreationTimings,
didUploadTrapCaches,
trapCacheCleanupTelemetry,
logger,
);
return;
}

Expand Down

0 comments on commit 8dba596

Please sign in to comment.