Skip to content

Commit 09ce3db

Browse files
committed
Sort interfaces and enums
1 parent c6d2843 commit 09ce3db

3 files changed

Lines changed: 66 additions & 52 deletions

File tree

lib/status-report.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/status-report.ts

Lines changed: 60 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,45 @@ import {
2323
} from "./util";
2424

2525
export type ActionName =
26-
| "init"
2726
| "autobuild"
2827
| "finish"
29-
| "upload-sarif"
28+
| "init"
3029
| "init-post"
31-
| "resolve-environment";
30+
| "resolve-environment"
31+
| "upload-sarif";
32+
3233
export type ActionStatus =
33-
| "starting"
3434
| "aborted"
35-
| "success"
3635
| "failure"
36+
| "starting"
37+
| "success"
3738
| "user-error";
3839

3940
export interface StatusReportBase {
41+
/** Name of the action being executed. */
42+
action_name: ActionName;
43+
/** Version of the action being executed, as a commit oid. */
44+
action_oid: string;
45+
/** Version of the action being executed, as a ref. */
46+
action_ref?: string;
47+
/** Time this action started. */
48+
action_started_at: string;
49+
/** Action version (x.y.z from package.json). */
50+
action_version: string;
51+
/** Analysis key, normally composed from the workflow path and job name. */
52+
analysis_key: string;
53+
/** Cause of the failure (or undefined if status is not failure). */
54+
cause?: string;
55+
/** CodeQL CLI version (x.y.z from the CLI). */
56+
codeql_version?: string;
57+
/** Commit oid that the workflow was triggered on. */
58+
commit_oid: string;
59+
/** Time this action completed, or undefined if not yet completed. */
60+
completed_at?: string;
61+
/** Stack trace of the failure (or undefined if status is not failure). */
62+
exception?: string;
63+
/** Job name from the workflow. */
64+
job_name: string;
4065
/**
4166
* UUID representing the job run that this status report belongs to. We
4267
* generate our own UUID here because Actions currently does not expose a
@@ -49,34 +74,32 @@ export interface StatusReportBase {
4974
* telemetry tables.
5075
*/
5176
job_run_uuid: string;
52-
/** ID of the workflow run containing the action run. */
53-
workflow_run_id: number;
54-
/** Attempt number of the run containing the action run. */
55-
workflow_run_attempt: number;
56-
/** Workflow name. Converted to analysis_name further down the pipeline.. */
57-
workflow_name: string;
58-
/** Job name from the workflow. */
59-
job_name: string;
60-
/** Analysis key, normally composed from the workflow path and job name. */
61-
analysis_key: string;
6277
/** Value of the matrix for this instantiation of the job. */
6378
matrix_vars?: string;
64-
/** Commit oid that the workflow was triggered on. */
65-
commit_oid: string;
79+
/**
80+
* Information about the enablement of the ML-powered JS query pack.
81+
*
82+
* @see {@link util.getMlPoweredJsQueriesStatus}
83+
*/
84+
ml_powered_javascript_queries?: string;
6685
/** Ref that the workflow was triggered on. */
6786
ref: string;
68-
/** Name of the action being executed. */
69-
action_name: ActionName;
70-
/** Version of the action being executed, as a ref. */
71-
action_ref?: string;
72-
/** Version of the action being executed, as a commit oid. */
73-
action_oid: string;
87+
/** Action runner hardware architecture (context runner.arch). */
88+
runner_arch?: string;
89+
/** Available disk space on the runner, in bytes. */
90+
runner_available_disk_space_bytes: number;
91+
/**
92+
* Version of the runner image, for workflows running on GitHub-hosted runners. Absent otherwise.
93+
*/
94+
runner_image_version?: string;
95+
/** Action runner operating system (context runner.os). */
96+
runner_os: string;
97+
/** Action runner operating system release (x.y.z from os.release()). */
98+
runner_os_release?: string;
99+
/** Total disk space on the runner, in bytes. */
100+
runner_total_disk_space_bytes: number;
74101
/** Time the first action started. Normally the init action. */
75102
started_at: string;
76-
/** Time this action started. */
77-
action_started_at: string;
78-
/** Time this action completed, or undefined if not yet completed. */
79-
completed_at?: string;
80103
/** State this action is currently in. */
81104
status: ActionStatus;
82105
/**
@@ -85,26 +108,12 @@ export interface StatusReportBase {
85108
* `["", "qa-rc", "qa-rc-1", "qa-rc-2", "qa-experiment-1", "qa-experiment-2", "qa-experiment-3"]`.
86109
*/
87110
testing_environment: string;
88-
/**
89-
* Information about the enablement of the ML-powered JS query pack.
90-
*
91-
* @see {@link util.getMlPoweredJsQueriesStatus}
92-
*/
93-
ml_powered_javascript_queries?: string;
94-
/** Cause of the failure (or undefined if status is not failure). */
95-
cause?: string;
96-
/** Stack trace of the failure (or undefined if status is not failure). */
97-
exception?: string;
98-
/** Action runner operating system (context runner.os). */
99-
runner_os: string;
100-
/** Action runner hardware architecture (context runner.arch). */
101-
runner_arch?: string;
102-
/** Action runner operating system release (x.y.z from os.release()). */
103-
runner_os_release?: string;
104-
/** Action version (x.y.z from package.json). */
105-
action_version: string;
106-
/** CodeQL CLI version (x.y.z from the CLI). */
107-
codeql_version?: string;
111+
/** Workflow name. Converted to analysis_name further down the pipeline.. */
112+
workflow_name: string;
113+
/** Attempt number of the run containing the action run. */
114+
workflow_run_attempt: number;
115+
/** ID of the workflow run containing the action run. */
116+
workflow_run_id: number;
108117
}
109118

110119
export interface DatabaseCreationTimings {
@@ -125,12 +134,10 @@ export function getActionsStatus(
125134

126135
// Any status report may include an array of EventReports associated with it.
127136
export interface EventReport {
128-
/** An enumerable description of the event. */
129-
event: string;
130-
/** Time this event started. */
131-
started_at: string;
132137
/** Time this event ended. */
133138
completed_at: string;
139+
/** An enumerable description of the event. */
140+
event: string;
134141
/** eg: `success`, `failure`, `timeout`, etc. */
135142
exit_status?: string;
136143
/** If the event is language-specific. */
@@ -140,6 +147,8 @@ export interface EventReport {
140147
* Use Object.assign() to append additional fields to the object.
141148
*/
142149
properties?: object;
150+
/** Time this event started. */
151+
started_at: string;
143152
}
144153

145154
/**

src/util.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import type { Config, Pack } from "./config-utils";
1414
import { EnvVar } from "./environment";
1515
import { Language } from "./languages";
1616
import { Logger } from "./logging";
17+
import { getDiskInfo } from "node-disk-info";
1718

1819
/**
1920
* Specifies bundle versions that are known to be broken
@@ -844,3 +845,7 @@ export function prettyPrintPack(pack: Pack) {
844845
pack.path ? `:${pack.path}` : ""
845846
}`;
846847
}
848+
849+
export async function checkDiskUsage() {
850+
const diskUsage = awgetDiskInfo
851+
}

0 commit comments

Comments
 (0)