Report registry types that are configured for CodeQL in start-proxy telemetry

This commit is contained in:
Michael B. Gale
2025-10-01 16:00:05 +01:00
parent 15916800df
commit d573787cca
2 changed files with 33 additions and 6 deletions
+11 -3
View File
@@ -95752,7 +95752,7 @@ function generateCertificateAuthority() {
const key = import_node_forge.pki.privateKeyToPem(keys.privateKey);
return { cert: pem, key };
}
async function sendSuccessStatusReport(startedAt, logger) {
async function sendSuccessStatusReport(startedAt, registry_types, logger) {
const statusReportBase = await createStatusReportBase(
"start-proxy" /* StartProxy */,
"success",
@@ -95762,7 +95762,11 @@ async function sendSuccessStatusReport(startedAt, logger) {
logger
);
if (statusReportBase !== void 0) {
await sendStatusReport(statusReportBase);
const statusReport = {
...statusReportBase,
registry_types: registry_types.join(",")
};
await sendStatusReport(statusReport);
}
}
async function runWrapper() {
@@ -95794,7 +95798,11 @@ async function runWrapper() {
};
const proxyBin = await getProxyBinaryPath(logger);
await startProxy(proxyBin, proxyConfig, proxyLogFilePath, logger);
await sendSuccessStatusReport(startedAt, logger);
await sendSuccessStatusReport(
startedAt,
proxyConfig.all_credentials.map((c) => c.type),
logger
);
} catch (unwrappedError) {
const error2 = wrapError(unwrappedError);
core11.setFailed(`start-proxy action failed: ${error2.message}`);
+22 -3
View File
@@ -19,6 +19,7 @@ import {
createStatusReportBase,
getActionsStatus,
sendStatusReport,
StatusReportBase,
} from "./status-report";
import * as util from "./util";
@@ -89,7 +90,17 @@ function generateCertificateAuthority(): CertificateAuthority {
return { cert: pem, key };
}
async function sendSuccessStatusReport(startedAt: Date, logger: Logger) {
interface StartProxyStatus extends StatusReportBase {
// A comma-separated list of registry types which are configured for CodeQL.
// This only includes registry types we support, not all that are configured.
registry_types: string;
}
async function sendSuccessStatusReport(
startedAt: Date,
registry_types: string[],
logger: Logger,
) {
const statusReportBase = await createStatusReportBase(
ActionName.StartProxy,
"success",
@@ -99,7 +110,11 @@ async function sendSuccessStatusReport(startedAt: Date, logger: Logger) {
logger,
);
if (statusReportBase !== undefined) {
await sendStatusReport(statusReportBase);
const statusReport: StartProxyStatus = {
...statusReportBase,
registry_types: registry_types.join(","),
};
await sendStatusReport(statusReport);
}
}
@@ -148,7 +163,11 @@ async function runWrapper() {
await startProxy(proxyBin, proxyConfig, proxyLogFilePath, logger);
// Report success if we have reached this point.
await sendSuccessStatusReport(startedAt, logger);
await sendSuccessStatusReport(
startedAt,
proxyConfig.all_credentials.map((c) => c.type),
logger,
);
} catch (unwrappedError) {
const error = util.wrapError(unwrappedError);
core.setFailed(`start-proxy action failed: ${error.message}`);