Handle codeql-pack.yml files everywhere#2054
Conversation
This will add support for the `codeql-pack.yml` filename in all places where we currently support `qlpack.yml`. It centralizes the list of the supported filenames in a single place and a method that can figure out the correct filename to use.
elenatanasoiu
left a comment
There was a problem hiding this comment.
Looks good! Thanks for doing this. I left some small suggestions but they're not blocking.
| } | ||
| } | ||
|
|
||
| return undefined; |
There was a problem hiding this comment.
Could we have a test for this new function?
There was a problem hiding this comment.
👍 , I've added a test for this function. I've also moved the function to the pure directory because this doesn't actually need VSCode and that makes it clearer that this can be a unit test.
| ) { | ||
| if (!qlPackFile) { | ||
| return true; | ||
| } |
There was a problem hiding this comment.
I see we don't have a test file for quick-query functions so this is a stretch. If the setup isn't terribly complicated, do you think it's worth adding one to test what this is doing?
I do see we have a queries.test.ts file which I guess covers some of the quick-query functionality.
There was a problem hiding this comment.
I could add a test for this function, but I don't really know what input values it would actually receive. I'm not quite sure when the function should be returning true or false or what it's purpose is, so I'm hesitant to add tests based purely on its implementation, rather than on its intended behaviour.
There was a problem hiding this comment.
Quick query is a feature where the IDE generates a bare-bones qlpack in a temporary directory that is tailored to the current language. It is meant to be semi-ephemeral.
When you call the quick query command, the extension checks if the query query pack exists already and if it is for the correct language of the current database.
This will add support for the
codeql-pack.ymlfilename in all places where we currently supportqlpack.yml. It centralizes the list of the supported filenames in a single place and a method that can figure out the correct filename to use.Checklist
ready-for-doc-reviewlabel there.