Add build mode to status report
This commit is contained in:
parent
28b564f8c6
commit
e4a536270d
6 changed files with 19 additions and 5 deletions
|
|
@ -2,6 +2,7 @@ import test from "ava";
|
|||
import * as sinon from "sinon";
|
||||
|
||||
import * as actionsUtil from "./actions-util";
|
||||
import { BuildMode } from "./config-utils";
|
||||
import { EnvVar } from "./environment";
|
||||
import { Language } from "./languages";
|
||||
import { createStatusReportBase } from "./status-report";
|
||||
|
|
@ -39,7 +40,10 @@ test("createStatusReportBase", async (t) => {
|
|||
"init",
|
||||
"failure",
|
||||
new Date("May 19, 2023 05:19:00"),
|
||||
createTestConfig({ languages: [Language.java, Language.swift] }),
|
||||
createTestConfig({
|
||||
buildMode: BuildMode.None,
|
||||
languages: [Language.java, Language.swift],
|
||||
}),
|
||||
{ numAvailableBytes: 100, numTotalBytes: 500 },
|
||||
"failure cause",
|
||||
"exception stack trace",
|
||||
|
|
@ -53,6 +57,7 @@ test("createStatusReportBase", async (t) => {
|
|||
new Date("May 19, 2023 05:19:00").toISOString(),
|
||||
);
|
||||
t.is(statusReport.analysis_key, "analysis-key");
|
||||
t.is(statusReport.build_mode, BuildMode.None);
|
||||
t.is(statusReport.cause, "failure cause");
|
||||
t.is(statusReport.commit_oid, process.env["GITHUB_SHA"]!);
|
||||
t.is(statusReport.exception, "exception stack trace");
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import {
|
|||
ActionName,
|
||||
} from "./actions-util";
|
||||
import { getAnalysisKey, getApiClient } from "./api-client";
|
||||
import { Config } from "./config-utils";
|
||||
import { BuildMode, Config } from "./config-utils";
|
||||
import { EnvVar } from "./environment";
|
||||
import {
|
||||
ConfigurationError,
|
||||
|
|
@ -54,6 +54,8 @@ export interface StatusReportBase {
|
|||
action_version: string;
|
||||
/** Analysis key, normally composed from the workflow path and job name. */
|
||||
analysis_key: string;
|
||||
/** Build mode, if specified. */
|
||||
build_mode?: BuildMode;
|
||||
/** Cause of the failure (or undefined if status is not failure). */
|
||||
cause?: string;
|
||||
/** CodeQL CLI version (x.y.z from the CLI). */
|
||||
|
|
@ -230,6 +232,7 @@ export async function createStatusReportBase(
|
|||
action_started_at: actionStartedAt.toISOString(),
|
||||
action_version: getActionVersion(),
|
||||
analysis_key,
|
||||
build_mode: config?.buildMode,
|
||||
commit_oid: commitOid,
|
||||
first_party_analysis: isFirstPartyAnalysis(actionName),
|
||||
job_name: jobName,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue