| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
| ); | ||
| const queries: Queries = {}; | ||
| for (const language of languages) { | ||
| if (queries[language] === undefined) { |
There was a problem hiding this comment.
Won't this always be true? The queries variable has just been defined to be {}.
Sorry, something went wrong.
|
So in this case, all the requisite codeql suites exist (i.e. ruby-code-scanning.qls, ruby-security-extended.qls, ruby-security-and-quality.qls) but they are empty? Otherwise I would have expected codeql to error trying to resolve the suite, but maybe it doesn't. Another thing to consider to make the error message better is there's a chunk of code at the end of loadConfig that does // The list of queries should not be empty for any language. If it is then
// it is a user configuration error.
for (const language of languages) {
if (
queries[language] === undefined ||
(queries[language].builtin.length === 0 &&
queries[language].custom.length === 0)
) {
throw new Error(
`Did not detect any queries to run for ${language}. ` +
"Please make sure that the default queries are enabled, or you are specifying queries to run."
);
}
}If you move that to initConfig so it runs when using the default config too then it'll give you a friendly error message quicker before it tries to build any code or run any queries. |
Sorry, something went wrong.
@robertbrignull Exactly. We don't have any queries yet that match the default query selectors. |
Sorry, something went wrong.
|
@robertbrignull Thanks for the quick review. I addressed your comments. |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM
Should be fine
Sorry, something went wrong.
| ) { | ||
| throw new Error( | ||
| `Did not detect any queries to run for ${language}. ` + | ||
| "Please make sure that the default queries are enabled, or you are specifying queries to run." |
There was a problem hiding this comment.
You could change this error message to be more accurate for the case of ruby, but also I assume this situation of having empty suites will be temporary so it doesn't matter too much.
Sorry, something went wrong.
There was a problem hiding this comment.
Yes, indeed. The important thing is that the Action no long crashes with an undefined property error.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
This PR improves the CodeQL action in case a query suite is used that contains no queries. This is a bit of a corner case and resulted in an error like no property 'builtin' for 'undefined' instead of the more friendly message Unable to analyse ruby as no queries were selected for this language
Merge / deployment checklist