Install dependencies for tutorial query in codespace#2090
Install dependencies for tutorial query in codespace#2090elenatanasoiu merged 3 commits intomainfrom
Conversation
92943cd to
2503b87
Compare
ddf2abf to
5269e0b
Compare
2503b87 to
6a2bb63
Compare
aeisenberg
left a comment
There was a problem hiding this comment.
What you have now is probably fine, just I think it's a little simpler to avoid re-parsing the URI.
6a2bb63 to
7a94d00
Compare
b24013c to
e176861
Compare
|
This looks reasonable, but it makes me wonder why we need the separate command. Could the tour call the existing |
|
@adityasharad Thanks. You're right, we don't need to do this in the extension since the tutorial folder is only present in the codespace. I've opened a new PR to run the install command: github/codespaces-codeql#10 |
|
the other PR to work with running the packInstall command in the code tour: github/codespaces-codeql#10 So I'm reopening this PR. We know this works so we can merge this and spend time separately thinking about how to run parameterised commands in the tour extension. |
When a user goes through the Code Tour, we select a dummy `csv` database for them to get them up and running. Once they complete the code tour and would like to continue writing queries, they will need to add their own database. After they do that, we check the language of their new database and generate a skeleton QL pack for them so that they don't need to create these files by hand. See [1] for details. This skeleton pack folder will be called `codeql-custom-queries-<language>` and it comes with its own example query: `example.ql`. When we try to run this example query, the query gets confused about which `dbscheme` to pick, as it sees a `qlpack.yml` file in the new skeleton pack folder, as well as one in the existing `tutorial-lib` folder. So we'll need to get rid of the `tutorial-lib` folder in order to make room for new queries to be run once the tour is complete. This commit introduces a `handleTourDependencies` step which will trigger a `codeql pack install` command in order to install real library dependencies for `tutorial-queries`, since we no longer have the dummy library in `tutorial-lib`.
I was initially trying to understand why this method was failing due to an unrelated error [1] so I ended up over-engineering the path parsing. We can use the path from the first workspace folder, like we do in other places in the extension. [1]: #2104
Co-authored-by: Andrew Eisenberg <aeisenberg@github.com>
e176861 to
1f4790b
Compare
adityasharad
left a comment
There was a problem hiding this comment.
Approving as a temporary strategy, until we figure out how to pass directory URIs to commands via CodeTour.
Required by this PR: github/codespaces-codeql#6
When a user goes through the Code Tour, we select a dummy
csvdatabasefor them to get them up and running.
Once they complete the code tour and would like to continue writing
queries, they will need to add their own database.
After they do that, we check the language of their new database and
generate a skeleton QL pack for them so that they don't need to create
these files by hand. See 1 for details.
This skeleton pack folder will be called
codeql-custom-queries-<language>and it comes with its own examplequery:
example.ql.When we try to run this example query, the query gets confused about
which
dbschemeto pick, as it sees aqlpack.ymlfile in the newskeleton pack folder, as well as one in the existing
tutorial-libfolder.
So we'll need to get rid of the
tutorial-libfolder in order to make roomfor new queries to be run once the tour is complete.
This PR introduces a
handleTourDependenciesstep which will trigger acodeql pack installcommand in order to install real library dependenciesfor
tutorial-queries, since we no longer have the dummy library intutorial-lib.