Add registries to the init status complete report

Registries might require authentication, before we add it to the
report we remove any credentials.
This commit is contained in:
Remco Vermeulen 2024-07-26 16:35:29 -07:00
parent 25d25968e6
commit 9f7e0af9f6
2 changed files with 10 additions and 0 deletions

View file

@ -881,6 +881,13 @@ function parseRegistries(
}
}
export function parseRegistriesWithoutCredentials(registriesInput?: string) : RegistryConfigNoCredentials[] | undefined {
return parseRegistries(registriesInput)?.map((r) => {
const {token:_, ...registryWithoutCredentials} = r;
return registryWithoutCredentials;
})
}
function isLocal(configPath: string): boolean {
// If the path starts with ./, look locally
if (configPath.indexOf("./") === 0) {

View file

@ -93,6 +93,8 @@ interface InitWithConfigStatusReport extends InitStatusReport {
trap_cache_download_size_bytes: number;
/** Time taken to download TRAP caches, in milliseconds. */
trap_cache_download_duration_ms: number;
/** Stringified JSON array of registry configuration objects, from the 'registries' config field or workflow input. **/
registries: string;
/** Stringified JSON object representing a query-filters, from the 'query-filters' config field. **/
query_filters: string;
}
@ -210,6 +212,7 @@ async function sendCompletedStatusReport(
),
trap_cache_download_duration_ms: Math.round(config.trapCacheDownloadTime),
query_filters: JSON.stringify(config.originalUserInput["query-filters"]),
registries: JSON.stringify(configUtils.parseRegistriesWithoutCredentials(getOptionalInput("registries"))),
};
await sendStatusReport({
...initWithConfigStatusReport,