Skip to content

Commit d573787

Browse files
committed
Report registry types that are configured for CodeQL in start-proxy telemetry
1 parent 1591680 commit d573787

File tree

2 files changed

+33
-6
lines changed

2 files changed

+33
-6
lines changed

lib/start-proxy-action.js

Lines changed: 11 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/start-proxy-action.ts

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {
1919
createStatusReportBase,
2020
getActionsStatus,
2121
sendStatusReport,
22+
StatusReportBase,
2223
} from "./status-report";
2324
import * as util from "./util";
2425

@@ -89,7 +90,17 @@ function generateCertificateAuthority(): CertificateAuthority {
8990
return { cert: pem, key };
9091
}
9192

92-
async function sendSuccessStatusReport(startedAt: Date, logger: Logger) {
93+
interface StartProxyStatus extends StatusReportBase {
94+
// A comma-separated list of registry types which are configured for CodeQL.
95+
// This only includes registry types we support, not all that are configured.
96+
registry_types: string;
97+
}
98+
99+
async function sendSuccessStatusReport(
100+
startedAt: Date,
101+
registry_types: string[],
102+
logger: Logger,
103+
) {
93104
const statusReportBase = await createStatusReportBase(
94105
ActionName.StartProxy,
95106
"success",
@@ -99,7 +110,11 @@ async function sendSuccessStatusReport(startedAt: Date, logger: Logger) {
99110
logger,
100111
);
101112
if (statusReportBase !== undefined) {
102-
await sendStatusReport(statusReportBase);
113+
const statusReport: StartProxyStatus = {
114+
...statusReportBase,
115+
registry_types: registry_types.join(","),
116+
};
117+
await sendStatusReport(statusReport);
103118
}
104119
}
105120

@@ -148,7 +163,11 @@ async function runWrapper() {
148163
await startProxy(proxyBin, proxyConfig, proxyLogFilePath, logger);
149164

150165
// Report success if we have reached this point.
151-
await sendSuccessStatusReport(startedAt, logger);
166+
await sendSuccessStatusReport(
167+
startedAt,
168+
proxyConfig.all_credentials.map((c) => c.type),
169+
logger,
170+
);
152171
} catch (unwrappedError) {
153172
const error = util.wrapError(unwrappedError);
154173
core.setFailed(`start-proxy action failed: ${error.message}`);

0 commit comments

Comments
 (0)