Add function for starting status report

This commit is contained in:
Michael B. Gale
2025-10-17 11:16:00 +01:00
parent ee753b4724
commit adf39dd33f
2 changed files with 40 additions and 22 deletions

View File

@@ -96,6 +96,31 @@ interface InitToolsDownloadFields {
tools_feature_flags_valid?: boolean;
}
/**
* Sends a status report indicating that the `init` Action is starting.
*
* @param startedAt
* @param config
* @param logger
*/
async function sendStartingStatusReport(
startedAt: Date,
config: configUtils.Config | undefined,
logger: Logger,
) {
const statusReportBase = await createStatusReportBase(
ActionName.Init,
"starting",
startedAt,
config,
await checkDiskUsage(logger),
logger,
);
if (statusReportBase !== undefined) {
await sendStatusReport(statusReportBase);
}
}
async function sendCompletedStatusReport(
startedAt: Date,
config: configUtils.Config | undefined,
@@ -227,17 +252,7 @@ async function run() {
);
try {
const statusReportBase = await createStatusReportBase(
ActionName.Init,
"starting",
startedAt,
config,
await checkDiskUsage(logger),
logger,
);
if (statusReportBase !== undefined) {
await sendStatusReport(statusReportBase);
}
await sendStartingStatusReport(startedAt, config, logger);
const codeQLDefaultVersionInfo = await features.getDefaultCliVersion(
gitHubVersion.type,
);