-
Notifications
You must be signed in to change notification settings - Fork 357
Extend init complete status report #2394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extend init complete status report #2394
Conversation
To support both the single language and multi language case we turn the single language case into a multi language case using the configured language. The entire packs record is then stored as a stringified JSON object.
Registries might require authentication, before we add it to the report we remove any credentials.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. This PR is missing the updated map files and minified JS files.
The rebuild action is failing because this is in a fork. @rvermeulen, if you remove and then add the |
Can you run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies...something I didn't catch the first time I reviewed.
ed2e214
to
ba3ac6f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few questions from my end 😄
return parseRegistries(registriesInput)?.map((r) => { | ||
const { url, packages } = r; | ||
return { url, packages }; | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand the logic here 🤔 do you mind explaining it here or in a code comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we use destructuring assignment to unpack the properties of a registry we need to create a new RegistryConfigNoCredentials
object.
Initially I had:
const { token: _, ...registryWithoutCredentials } = r;
but this triggered an ESLint unused variable error for _
.
In hindsight, selecting the properties we actually care about instead of removing current sensitive properties is a better solution in case we add more sensitive properties in the future or rename the current sensitive property.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see! That makes sense 👍 I was missing the context that we were selecting for url
and packages
(it looked to me like we were just returning everything in registriesInput
)
/** Stringified JSON object of packs, from the 'packs' config field or workflow input. */ | ||
packs: string; | ||
/** Comma-separated list of languages for which we are using TRAP caching. */ | ||
trap_cache_languages: string; | ||
/** Size of TRAP caches that we downloaded, in bytes. */ | ||
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💭 Is it possible that any of these field values are undefined or empty before we pass them to JSON.stringify
? If so, what's the output & is that we want?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, they might be undefined, but the value of those properties cannot be.
That being said, let me explicitly use their initialization values according to their type, that is an empty array for registries
and query_filters
.
Both are arrays, so we will use an empty array if they are undefined.
b34eb51
to
e6c9383
Compare
Signed-off-by: Remco Vermeulen <rvermeulen@github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for answering my questions ❣️
…nit-complete-status-report
To gain insights into how users are using CodeQL in combination with packs, query filters, and registries we extend the init complete status report. This report now includes the packs, query-filters, and registries that are used in the CodeQL setup.
Merge / deployment checklist