Add steady_state_default_setup as field to base status report (#2305)

This will help us distinguish steady-state runs in default setup mode from advanced setup runs and default setup validation/onboarding runs.
This commit is contained in:
Angela P Wen 2024-05-23 00:47:59 +02:00 committed by GitHub
parent b1bd8da5e7
commit acdf23828a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 11 additions and 2 deletions

2
lib/status-report.js generated
View file

@ -133,6 +133,7 @@ async function createStatusReportBase(actionName, status, actionStartedAt, confi
if (testingEnvironment !== "") {
core.exportVariable(environment_1.EnvVar.TESTING_ENVIRONMENT, testingEnvironment);
}
const isSteadyStateDefaultSetupRun = process.env["CODE_SCANNING_IS_STEADY_STATE_DEFAULT_SETUP"] === "true";
const statusReport = {
action_name: actionName,
action_oid: "unknown", // TODO decide if it's possible to fill this in
@ -149,6 +150,7 @@ async function createStatusReportBase(actionName, status, actionStartedAt, confi
runner_os: runnerOs,
started_at: workflowStartedAt,
status,
steady_state_default_setup: isSteadyStateDefaultSetupRun,
testing_environment: testingEnvironment,
workflow_name: workflowName,
workflow_run_attempt: workflowRunAttempt,

File diff suppressed because one or more lines are too long

View file

@ -79,6 +79,7 @@ function setupEnvironmentAndStub(tmpDir) {
t.is(statusReport.runner_os, process.env["RUNNER_OS"]);
t.is(statusReport.started_at, process.env[environment_1.EnvVar.WORKFLOW_STARTED_AT]);
t.is(statusReport.status, "failure");
t.is(statusReport.steady_state_default_setup, false);
t.is(statusReport.workflow_name, process.env["GITHUB_WORKFLOW"] || "");
t.is(statusReport.workflow_run_attempt, 2);
t.is(statusReport.workflow_run_id, 100);

File diff suppressed because one or more lines are too long

View file

@ -75,6 +75,7 @@ test("createStatusReportBase", async (t) => {
t.is(statusReport.runner_os, process.env["RUNNER_OS"]!);
t.is(statusReport.started_at, process.env[EnvVar.WORKFLOW_STARTED_AT]!);
t.is(statusReport.status, "failure");
t.is(statusReport.steady_state_default_setup, false);
t.is(statusReport.workflow_name, process.env["GITHUB_WORKFLOW"] || "");
t.is(statusReport.workflow_run_attempt, 2);
t.is(statusReport.workflow_run_id, 100);

View file

@ -143,6 +143,8 @@ export interface StatusReportBase {
started_at: string;
/** State this action is currently in. */
status: ActionStatus;
/** Whether this run is part of a steady-state, and not new, default setup run. */
steady_state_default_setup: boolean;
/**
* Testing environment: Set if non-production environment.
* The server accepts one of the following values:
@ -270,6 +272,8 @@ export async function createStatusReportBase(
if (testingEnvironment !== "") {
core.exportVariable(EnvVar.TESTING_ENVIRONMENT, testingEnvironment);
}
const isSteadyStateDefaultSetupRun =
process.env["CODE_SCANNING_IS_STEADY_STATE_DEFAULT_SETUP"] === "true";
const statusReport: StatusReportBase = {
action_name: actionName,
@ -287,6 +291,7 @@ export async function createStatusReportBase(
runner_os: runnerOs,
started_at: workflowStartedAt,
status,
steady_state_default_setup: isSteadyStateDefaultSetupRun,
testing_environment: testingEnvironment,
workflow_name: workflowName,
workflow_run_attempt: workflowRunAttempt,