Commit Graph

3487 Commits

Author SHA1 Message Date
Elena Tanasoiu
5fd902257e Merge pull request #2111 from github/elena/update-tutorial-database-path
Update path to codespace tutorial database
2023-02-28 14:51:14 +00:00
Koen Vlaswinkel
fd57133a41 Merge pull request #2103 from github/koesie10/mock-more-objects
Remove more instances of `as unknown as`
2023-02-28 13:44:41 +01:00
Nora
f39bbd325c Merge pull request #2119 from github/nora/cleanup-split-runquery
Remove new commands from command palette
2023-02-28 13:28:16 +01:00
Nora
9a53b637e8 Remove new commands from comman palette 2023-02-28 11:42:08 +00:00
Nora
eb25f31b9f Merge pull request #2117 from github/nora/split-run-query
Split usage of runQuery and runQueryOnMultipleDatabases
2023-02-28 12:26:39 +01:00
Nora
7188d8df41 reorder command 2023-02-28 11:01:44 +00:00
Robert
badbee1bfb Merge pull request #2101 from github/robertbrignull/unique-command-use-query
Add unique-command-use.ql
2023-02-28 09:15:18 +00:00
Elena Tanasoiu
2f92ea396a Merge pull request #2090 from github/elena/install-csv-depenedencies
Install dependencies for tutorial query in codespace
2023-02-27 20:24:04 +00:00
Elena Tanasoiu
1f4790bbb7 Use join as it's meant to be used
Co-authored-by: Andrew Eisenberg <aeisenberg@github.com>
2023-02-27 20:09:05 +00:00
Elena Tanasoiu
28abc1e3a6 Don't reparse Uri path
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]: https://github.com/github/vscode-codeql/pull/2104
2023-02-27 20:09:05 +00:00
Elena Tanasoiu
9b7c3bc2bf Install dependencies for tutorial query in codespace
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`.
2023-02-27 20:09:04 +00:00
Robert
4d73e1a068 Remove getLocationOrdinal 2023-02-27 17:46:49 +00:00
Robert
6f5ac5df4f Introduce getAUse 2023-02-27 17:45:24 +00:00
Robert
4c880dfb19 Fix typos 2023-02-27 17:42:43 +00:00
Robert
56e8d8aac7 Merge pull request #2114 from github/robertbrignull/enable_telemetry
Enable new telemetry by default
2023-02-27 16:46:41 +00:00
Robert
ced9f60949 Add documentation 2023-02-27 16:06:38 +00:00
Charis Kyriakou
4fa530d69d Check controller repo before we set it (#2116) 2023-02-27 16:01:39 +00:00
Robert
c0a65c994a Convert to alert only first usage, instead of all other usages 2023-02-27 15:54:38 +00:00
Nora
921d9d22e4 split usage of runQuery and runQueryOnMultipleDatabases 2023-02-27 15:53:00 +00:00
Robert
ead1869a7e Use PackageJson class 2023-02-27 15:30:45 +00:00
Robert
b1ddf89fe3 Update CHANGELOG.md 2023-02-27 15:23:36 +00:00
Robert
c37096bf2c Update changelog 2023-02-27 13:12:28 +00:00
Robert
4127be2905 Enable new telemetry by default 2023-02-27 13:07:10 +00:00
Charis Kyriakou
ce29768796 Minor changes to the test plan (#2113) 2023-02-27 12:59:06 +00:00
Charis Kyriakou
571d9d1424 Merge pull request #2109 from github/version/bump-to-v1.7.11
Bump version to v1.7.11
2023-02-27 11:54:51 +00:00
Koen Vlaswinkel
65e652b5e4 Fix mockResolvedValue not working with mocked objects 2023-02-27 11:59:11 +01:00
Koen Vlaswinkel
fd2b91d4d4 Remove casting to QueryHistoryConfig 2023-02-27 11:59:11 +01:00
Koen Vlaswinkel
dd4df012e9 Remove as unknown as ExtensionContext 2023-02-27 11:59:11 +01:00
Koen Vlaswinkel
af167c6d6e Remove as unknown as DatabaseManager
Unfortunately `Object.defineProperty` doesn't work on proxies, so I've
added an options object to `mockedObject` which allows passing in
methods that will return a value for a specific property.
2023-02-27 11:59:11 +01:00
Koen Vlaswinkel
551ed95fc8 Remove as unknown as QueryHistoryManager 2023-02-27 11:59:11 +01:00
Koen Vlaswinkel
9b1ca5136e Remove as unknown as WorkspaceFolder 2023-02-27 11:59:10 +01:00
Koen Vlaswinkel
fa5bad6946 Remove as unknown as TextEditor/TextDocument 2023-02-27 11:59:10 +01:00
Koen Vlaswinkel
4c14db951b Merge pull request #2102 from github/koesie10/mock-objects
Add new `mockedObject` function
2023-02-24 15:43:19 +01:00
Koen Vlaswinkel
bed4e8a060 Rename methods parameter to props 2023-02-24 15:28:01 +01:00
Elena Tanasoiu
2c6dc24525 Update path to codespace tutorial database
In https://github.com/github/codespaces-codeql/pull/12 we moved
the source for our tutorial database into `.tours` in order to
avoid confusing the user when we load the database into the
workspace, since they'd see two databases.

Since this is just the source, we'd like to hide it.
2023-02-23 17:08:20 +00:00
Charis Kyriakou
8d5a00dcc7 Remove obsolete config setting (#2110) 2023-02-23 16:47:30 +00:00
github-actions[bot]
3ea3cd8e9b Bump version to v1.7.11 2023-02-23 08:58:41 +00:00
Charis Kyriakou
a32b0736db Merge pull request #2108 from github/v1.7.10
Some checks failed
Release / Release (push) Has been cancelled
Release / Publish to VS Code Marketplace (push) Has been cancelled
Release / Publish to Open VSX Registry (push) Has been cancelled
v1.7.10
v1.7.10
2023-02-23 08:54:39 +00:00
Charis Kyriakou
50b0926390 v1.7.10 2023-02-23 08:38:10 +00:00
Elena Tanasoiu
4be573c805 Merge pull request #2106 from github/elena/change-query
Update skeleton query
2023-02-22 12:14:23 +00:00
Elena Tanasoiu
8bf8adfc74 Fix default query for skeleton pack
We mark this query as `@kind problem`.

We'll need to change the query a bit to make it fit this type of ...
erm... kind.

This means the results view will be formatted to display the file name
next to each of the results.

We're also getting rid of any mentions of an empty block query since
that's no longer what it checks.
2023-02-22 11:57:01 +00:00
Robert
14f58df2fc Merge pull request #2107 from github/revert-2076-robertbrignull/unhandled_rejection
Revert "Add unhandled rejection listener"
2023-02-22 10:53:00 +00:00
Robert
c712b069b1 Revert "Add unhandled rejection listener" 2023-02-22 10:06:37 +00:00
Anders Starcke Henriksen
7b4b491a9d Merge pull request #2099 from github/starcke/qlpack-gen-rename
Starcke/qlpack gen rename
2023-02-21 16:34:47 +01:00
Koen Vlaswinkel
2a43ffb49a Add new mockedObject function
This will remove some instances where we're using `as unknown as T` and
replace them by a call to `mockedObject<T>()`. The `mockedObject`
function is a bit more explicit about what it does and has types which
ensure that the methods that are set on the object actually exist.

Unfortunately, we can't fully get rid of `as unknown as T` in the
`mockedObject` function. However, this construct is more localized and
does not need to be used in as many places. If we do enable an ESLint
rule to prevent the use of `as unknown as T`, I would feel comfortable
with disabling the rule for the `mockedObject` function.
2023-02-21 13:01:28 +01:00
Koen Vlaswinkel
5e51bb57f5 Merge pull request #2098 from github/koesie10/refactor-cli-arguments
Use options objects instead of multiple optional arguments in CLI methods
2023-02-21 12:55:35 +01:00
Robert
70ae7284f3 Add unique-command-use.ql 2023-02-21 11:09:15 +00:00
Charis Kyriakou
396fdb8c5b Update README files for database dirs (#2100) 2023-02-21 09:39:02 +00:00
Charis Kyriakou
51570c3ba3 Remove obsolete config settings (#2097) 2023-02-21 09:09:54 +00:00
Charis Kyriakou
403e893f93 Remove isVariantAnalysisReposPanelEnabled feature flag and old flows (#2096) 2023-02-21 08:52:50 +00:00