Commit Graph

3043 Commits

Author SHA1 Message Date
Charis Kyriakou
216faee279 Db module init tidy up (#1858) 2022-12-12 11:59:57 +00:00
Koen Vlaswinkel
891ce74a80 Merge pull request #1847 from github/koesie10/typecheck-everything
Run type checking on all directories in CI
2022-12-12 11:36:09 +01:00
Koen Vlaswinkel
e2e4879548 Merge remote-tracking branch 'origin/main' into koesie10/typecheck-everything 2022-12-12 10:14:50 +01:00
Koen Vlaswinkel
cac7c3ae4e Simplify gulpfile.ts/tsconfig.json
The `tsconfig.json` inside `gulpfile.ts` needs to match the root
`tsconfig.json`, so by making it extend the root `tsconfig.json` and
changing just the options which decide which files are included, we can
remove a lot of duplication.
2022-12-12 10:13:58 +01:00
Charis Kyriakou
7dedfca369 Properly track collapsed/expanded events (#1856) 2022-12-12 09:00:19 +00:00
Charis Kyriakou
1a0d88135d Add executeCommand to app container (#1857) 2022-12-09 17:12:25 +00:00
Nora
ed76b46fa5 Merge pull request #1853 from github/nora/test-factories-dbitem
Create and use more factories for DbItem creation
2022-12-09 14:27:29 +01:00
Nora
1dc69a125b Merge pull request #1848 from github/nora/db-module-initialization
Initialize DbManager when newQueryRun is enabled
2022-12-09 14:21:50 +01:00
Nora
35f582b731 Implement merge comments 2022-12-09 12:53:40 +00:00
Koen Vlaswinkel
794e874206 Merge pull request #1854 from github/koesie10/upgrade-vsce
Replace vsce by @vscode/vsce
2022-12-09 12:34:18 +01:00
Nora
e7bab9207d Remove unused checks 2022-12-09 09:59:59 +00:00
Koen Vlaswinkel
3bd61ae1a6 Merge remote-tracking branch 'origin/main' into koesie10/upgrade-vsce 2022-12-09 10:36:02 +01:00
Angela P Wen
698b6ad0e4 Bump CLI version to 2.11.5 for integration tests (#1855) 2022-12-09 09:33:29 +00:00
Koen Vlaswinkel
abbebd3d42 Merge pull request #1845 from github/koesie10/variant-analysis-remove-item-tests
Add tests for removing remote queries and variant analyses
2022-12-09 10:30:23 +01:00
Nora
33ef89a28c Use new factories 2022-12-09 10:16:49 +01:00
Nora
a9b2aec353 Create missing factories and test adjustment 2022-12-09 10:16:49 +01:00
Koen Vlaswinkel
1cb0b0b6cb Replace vsce by @vscode/vsce
The `vsce` package has been replaced by `@vscode/vsce`, as announced
in the VSCode 1.74.0 release notes. There should be no functional
changes between 2.7.0 and 2.15.0 for our use case.

See: https://code.visualstudio.com/updates/v1_74#_renaming-of-vsce-to-vscodevsce
2022-12-09 09:48:27 +01:00
Koen Vlaswinkel
3346bd48cb Merge remote-tracking branch 'origin/main' into koesie10/variant-analysis-remove-item-tests 2022-12-09 09:47:46 +01:00
Andrew Eisenberg
5138831cd3 Merge pull request #1852 from github/koesie10/fix-vscode-1.74.0
Fix failing tests on VSCode 1.74.0
2022-12-08 10:20:29 -08:00
Koen Vlaswinkel
484c7db8c5 Use Proxy for _VSCODE_NODE_MODULES
Instead of deleting the complete `_VSCODE_NODE_MODULES` object, we now
use a `Proxy` to intercept the `_isMockFunction` property. This is safer
and will not delete a global variable that VSCode expects to exist.
2022-12-08 18:47:03 +01:00
Koen Vlaswinkel
691121d7c7 Restructure handleRemoveHistoryItem tests
This will restructure the `handleRemoveHistoryItem` tests to be more
structured and easier to read.
2022-12-08 14:01:33 +01:00
Koen Vlaswinkel
1ea3cfddb0 Fix failing tests on VSCode 1.74.0
This fixes the tests on VSCode 1.74.0. The issue is as follows:

1. Jest wil try reset all mocks after each test, as it should.
2. When Jest does this, it will loop over all global variables and check
if they are mocks.
3. One of the global variables it checks is _VSCODE_NODE_MODULES, which
is a proxy object.
4. When Jest checks whether it is a proxy by getting _isMockFunction on
it, the `get` function on the proxy object will be called.
5. This will in turn call require, which will try to load
the non-existing `_isMockFunction` module. This throws the error we are
seeing.

By removing the `_VSCODE_NODE_MODULES` property from the global object
in the Jest environment, Jest will not try to reset it, and the tests
should work again.

See: 41bf230089/packages/jest-runtime/src/index.ts (L1173-L1186)
See: ed442a9e99/src/bootstrap-amd.js (L15)
2022-12-08 11:52:45 +01:00
Koen Vlaswinkel
993b8c94d6 Merge pull request #1832 from github/koesie10/restructure-varianta-analysis-manager-tests
Restructure variant analysis manager tests
2022-12-08 10:04:19 +01:00
Koen Vlaswinkel
79f427c05d Merge pull request #1850 from github/koesie10/upgrade-actions-upload-artifact
Upgrade actions/upload-artifact to v3
2022-12-07 18:55:02 +01:00
Koen Vlaswinkel
d66e7c6198 Merge pull request #1837 from github/koesie10/fix-no-error-empty-repositories
Fix missing error message on repository selection
2022-12-07 17:57:54 +01:00
Koen Vlaswinkel
8205b19125 Upgrade actions/upload-artifact to v3
This upgrades the action to remove a deprecation warning about Node 12.
2022-12-07 17:44:44 +01:00
Koen Vlaswinkel
597c9c48ff Merge pull request #1849 from github/koesie10/date-environment-variables
Add environment variables for date test
2022-12-07 17:36:29 +01:00
Koen Vlaswinkel
7fd45efed8 Merge remote-tracking branch 'origin/main' into koesie10/fix-no-error-empty-repositories 2022-12-07 17:29:44 +01:00
Koen Vlaswinkel
2e7557ba09 Run type checking on all directories in CI
This commit adds a new step to the CI workflow that runs type checking
on all directories containing `tsconfig.json` files, using `find` and
`xargs`. Unfortunately, this does not work on Windows, so on Windows
it's not possible to run all of these type checks locally.
2022-12-07 16:50:19 +01:00
Koen Vlaswinkel
0f5117ecec Merge pull request #1828 from github/koesie10/results-loading
Add spinner when loading results
2022-12-07 16:46:20 +01:00
Koen Vlaswinkel
0ae7bb821d Extract mocking of repo states into method 2022-12-07 16:44:34 +01:00
Koen Vlaswinkel
ba419dd561 Remove duplicate describe 2022-12-07 16:40:15 +01:00
Koen Vlaswinkel
3dd0ef50e0 Merge pull request #1846 from github/koesie10/monitor-multiple-responses-test
Add integration test for variant analysis monitor
2022-12-07 16:38:47 +01:00
Nora
1c1117f7a3 Suggestion: initialize DbManager when newQueryRun is enabled 2022-12-07 16:35:51 +01:00
Koen Vlaswinkel
4e66b62534 Add environment variables for date test
This adds the environment variables necessary for running the date test
in all of these cases:
- When running the npm script outside of VSCode (using `cross-env`)
- When using the Jest Runner "Run" option (`terminal.integrated.env.*`)
- When using the Jest Runner "Debug" option
2022-12-07 16:35:48 +01:00
Nora
572ba290b4 Merge pull request #1838 from github/charis-nora/run-mrva-against-selected-db
Use currently selected remote DB when Variant Analysis is run
2022-12-07 15:05:35 +01:00
Koen Vlaswinkel
63c2932cd9 Add integration test for variant analysis monitor
This integration test will check that the monitor will actually make
multiple requests to the API and that it will trigger a download
extension command for each repo that has finished scanning.
2022-12-07 14:49:32 +01:00
Charis Kyriakou
d97eb2e76b Track expanded state of db items (#1844) 2022-12-07 12:39:18 +00:00
Nora
323862a828 Merge comments 2022-12-07 12:57:10 +01:00
Koen Vlaswinkel
502d4236ad Add tests for removing remote queries and variant analyses
Unfortunately, one of the tests we have for local queries doesn't seem
to be working for variant analyses. I'm not sure why it isn't
working, but I think it's better to get the rest of the integration
tests in and then figure out what's going on with that one.
2022-12-07 12:30:56 +01:00
dependabot[bot]
28652a2088 Bump decode-uri-component from 0.2.0 to 0.2.2 in /extensions/ql-vscode (#1842)
Bumps [decode-uri-component](https://github.com/SamVerschueren/decode-uri-component) from 0.2.0 to 0.2.2.
- [Release notes](https://github.com/SamVerschueren/decode-uri-component/releases)
- [Commits](https://github.com/SamVerschueren/decode-uri-component/compare/v0.2.0...v0.2.2)

---
updated-dependencies:
- dependency-name: decode-uri-component
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-06 17:39:18 +01:00
dependabot[bot]
04b4d15099 Bump @xmldom/xmldom from 0.8.3 to 0.8.6 in /extensions/ql-vscode (#1843)
Bumps [@xmldom/xmldom](https://github.com/xmldom/xmldom) from 0.8.3 to 0.8.6.
- [Release notes](https://github.com/xmldom/xmldom/releases)
- [Changelog](https://github.com/xmldom/xmldom/blob/master/CHANGELOG.md)
- [Commits](https://github.com/xmldom/xmldom/compare/0.8.3...0.8.6)

---
updated-dependencies:
- dependency-name: "@xmldom/xmldom"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-06 17:20:19 +01:00
Shati Patel
7ef75f5971 New DB panel: Add UI command to select database item (#1840) 2022-12-06 16:00:08 +00:00
Koen Vlaswinkel
4bfefb8ebb Merge pull request #1841 from github/koesie10/fix-monitor-await
Fix incorrect await for monitor
2022-12-06 16:30:15 +01:00
Charis Kyriakou
a5fcfe7f40 Add functionality to set the selected db item (#1839) 2022-12-06 15:20:07 +00:00
Nora
7a3d5c1925 Add unit tests 2022-12-06 15:28:14 +01:00
Nora
18c3ce237e Reorder existing tests in new describe blog 2022-12-06 15:25:33 +01:00
Koen Vlaswinkel
6f52469d64 Fix incorrect await for monitor
When rehydrating remote queries, we were awaiting the monitoring
command. Since this command may take minutes to hours to complete, it
seems like this would block the extension from loading. This is the same
issue as in https://github.com/github/vscode-codeql/pull/1698, but for
remote queries instead of variant analyses.
2022-12-06 14:36:00 +01:00
Nora
728f80189b Refactor selection method to allow all types of DbItem lists 2022-12-06 09:41:36 +01:00
Nora
dbba6972e1 Run MRVA against remote DB 2022-12-06 09:41:36 +01:00