Commit Graph

2378 Commits

Author SHA1 Message Date
github-actions[bot]
75b4934d97 Bump version to v1.7.4 (#1676)
Co-authored-by: angelapwen <angelapwen@users.noreply.github.com>
2022-10-29 00:31:47 +00:00
Angela P Wen
77c28e0453 v1.7.3 (#1675)
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.3
2022-10-28 23:11:00 +00:00
Koen Vlaswinkel
bc10a7a38a Merge pull request #1663 from github/koesie10/gh-api-client-msw-test
Add msw tests for gh-api-client
2022-10-28 17:20:34 +02:00
Koen Vlaswinkel
562986546d Use scenario JSON files in tests
This will check that the data returned matches the data in the JSON
files, rather than checking against constants/magic values.
2022-10-28 16:36:03 +02:00
Koen Vlaswinkel
c4d9ef26a8 Use correct tsconfig.json in pure tests
This will change the pure tests Mocha setup to actually use the
`tsconfig.json` located in the `test` directory. Before, it was using
the root-level `tsconfig.json`. To ensure we are still using mostly the
same settings, this will extend the `test/tsconfig.json` from the
root-level `tsconfig.json`.
2022-10-28 16:34:36 +02:00
Koen Vlaswinkel
a9e49f2d72 Split mock GitHub API server into VSCode and non-VSCode
This splits the mock GitHub API server class into two parts: one for the
interactive, VSCode parts and one for the non-VSCode parts. This allows
us to use the non-VSCode part in tests.
2022-10-28 14:59:18 +02:00
Charis Kyriakou
b15626853b Add script to help with scenario recording (#1671) 2022-10-28 09:22:11 +00:00
Charis Kyriakou
f04c34629e Set in memory variant analysis on submission (#1673) 2022-10-28 10:07:14 +01:00
Charis Kyriakou
a217b53bf3 Add some more mock scenarios (#1667) 2022-10-28 09:44:14 +01:00
Elena Tanasoiu
4826a7e91f Merge pull request #1658 from github/elena/add-tests-for-removal
Add test for `removeVariantAnalysis`
2022-10-28 09:11:17 +01:00
Koen Vlaswinkel
d12cdbe679 Merge pull request #1664 from github/koesie10/upgrade-vscode-test
Upgrade from vscode-test to @vscode/test-electron
2022-10-28 09:41:46 +02:00
Koen Vlaswinkel
1ec3d044cf Merge pull request #1668 from github/koesie10/dangling-foreach-promises
Fix dangling promises in `forEach` calls
2022-10-27 15:17:28 +02:00
Charis Kyriakou
dbb549d5fb Add mock GitHub API server docs (#1661) 2022-10-27 12:08:08 +00:00
Koen Vlaswinkel
4c469e7386 Fix dangling promises in forEach calls
This will ensure that we are awaiting all calls by using `Promise.all`.
2022-10-27 14:06:48 +02:00
Shati Patel
2ccdb9e577 Correctly rehydrate variant analyses (#1666) 2022-10-27 12:30:36 +01:00
Koen Vlaswinkel
123219aace Upgrade from vscode-test to @vscode/test-electron 2022-10-27 10:51:30 +02:00
Koen Vlaswinkel
ecdc485e79 Add msw tests for gh-api-client
This adds some really simple tests for the `gh-api-client` file to
ensure that we can use msw mocks in pure tests.
2022-10-27 10:29:23 +02:00
Charis Kyriakou
3812e3dcb0 Add some mock scenarios (#1660) 2022-10-27 09:23:26 +01:00
Elena Tanasoiu
eb09a0db8a Use getter method 2022-10-26 16:55:53 +01:00
Charis Kyriakou
158bebd03f Remove incorrect and unnecessary field from data model (#1659) 2022-10-26 15:46:42 +00:00
Elena Tanasoiu
1a3fecd3e8 Add test for removeVariantAnalysis 2022-10-26 15:15:12 +01:00
Elena Tanasoiu
1348de5a5f Surround tests with describe blocks
To better indicate which method they're testing.
2022-10-26 15:06:46 +01:00
Elena Tanasoiu
8521138bce Merge pull request #1657 from github/elena/decouple-manager-from-results
Decouple VariantAnalysisManager from VariantAnalysisResultsManager
2022-10-26 15:04:10 +01:00
Elena Tanasoiu
8569fa7399 Don't track results manager as a disposable object 2022-10-26 14:36:51 +01:00
Elena Tanasoiu
ee37fbff63 Merge pull request #1656 from github/nora-charis-elena/handle-item-removal-take-two
Implement `handleRemoveHistoryItem` for variant analysis history items - take two
2022-10-26 14:16:10 +01:00
Elena Tanasoiu
d49bffe98e Decouple VariantAnalysisManager from VariantAnalysisResultsManager
At the moment we create the results manager as a private property on the `VariantAnalysisManager`.

If we instead created it at the extension level and passed it to the `VariantAnalysisManager`, we would have more freedom to write unit tests for the `VariantAnalysisManager` without needing to reach into a private results manager property.
2022-10-26 13:47:52 +01:00
Nora
832211d789 Adjust comment 2022-10-26 14:33:47 +02:00
Nora
f9553d7033 Rename method 2022-10-26 14:29:50 +02:00
Elena Tanasoiu
f18f1b0ca7 Implement handleRemoveHistoryItem for variant analysis history items
We had previously added a no-op placeholder for when we attempt
to remove a variant analysis from our query history.

This adds the implementation:
- removes the item from the query history
- cleans up any existing result files attached to the variant analysis

NB: The remote queries would store all their results in a single folder.
For variant analysis, we store results per repo. The folder names are build
using a cache key and are stored in `cachedResults`. The cache key is
built from the variant analysis id and the repo name.

In order to delete the results, we've had to pass in the full variant analysis
object to the manager and call `cacheResults.delete()` for each of its scanned
repos.

Co-authored-by: Charis Kyriakou <charisk@github.com>
Co-authored-by: Nora Scheuch <norascheuch@github.com>
2022-10-26 12:21:46 +01:00
Shati Patel
50ec71893c Implement openQueryResults for variant analysis items (#1654) 2022-10-26 10:20:23 +01:00
Andrew Eisenberg
56af69e58d Merge pull request #1638 from github/aeisenberg/persist-dbs
Fix bug where dbs are lost on restart
2022-10-25 10:28:58 -07:00
Andrew Eisenberg
d209e52a0b Merge branch 'main' into aeisenberg/persist-dbs 2022-10-25 08:54:31 -07:00
Andrew Eisenberg
09b30fe5a3 Merge pull request #1568 from asgerf/asgerf/navigate-alerts
Add commands for navigation of alerts
2022-10-25 08:51:38 -07:00
Andrew Eisenberg
c6d54de748 Update extensions/ql-vscode/CHANGELOG.md
Co-authored-by: Edoardo Pirovano <6748066+edoardopirovano@users.noreply.github.com>
2022-10-25 08:42:27 -07:00
Andrew Eisenberg
a3fafc8e59 Merge pull request #1611 from github/aeisenberg/fix-flakes
Test cleanups
2022-10-25 08:26:26 -07:00
Charis Kyriakou
6a636baa21 Remove historyItemId for variant analyses (#1651) 2022-10-25 12:57:48 +00:00
Charis Kyriakou
9e92d0c4a7 Allow multiple query history items for a single variant analysis (#1653) 2022-10-25 13:47:53 +01:00
Shati Patel
78a0a4e580 Bump CLI version to 2.11.2 for integration tests 2022-10-25 11:30:04 +01:00
Koen Vlaswinkel
f0f01720f1 Merge pull request #1648 from github/koesie10/store-scenario-bodies-as-files
Store binary scenario bodies as files
2022-10-25 11:18:38 +02:00
Elena Tanasoiu
c8b0461f7f Merge pull request #1620 from github/mob/consume-update-event
QueryHistory: Consume event when variant analysis status is updated
2022-10-25 09:20:31 +01:00
Koen Vlaswinkel
00de0820fb Add proper handling of binary responses
msw doesn't seem to support binary responses because it decodes them to
a UTF-8 string. To work around that, we will do a separate fetch of the
file and save that.
2022-10-25 10:07:43 +02:00
Koen Vlaswinkel
5a76df8489 Load response bodies from files 2022-10-25 10:07:16 +02:00
Koen Vlaswinkel
9764a93900 Store ZIP bodies as files 2022-10-25 10:06:50 +02:00
Charis Kyriakou
130d8efe35 Tidy up msw handlers used for scenario replay (#1649) 2022-10-25 08:44:29 +01:00
Angela P Wen
63a5021e5e Use sarif parser for reopened results (#1457) 2022-10-24 12:31:35 -07:00
Edoardo Pirovano
e891169ca3 MRVA: Use QLX to precompile queries
Co-authored-by: Henning Makholm <hmakholm@github.com>
2022-10-24 17:33:25 +01:00
Charis Kyriakou
98284d9b2c Add loading of mock scenarios (#1641) 2022-10-24 16:27:37 +01:00
Asger F
b480f8f375 Fix incorrect merge resolution in changelog 2022-10-24 13:20:42 +02:00
Asger F
ead1fb4cd9 Merge branch 'main' into asgerf/navigate-alerts 2022-10-24 13:19:05 +02:00
Asger F
0acf9f7b66 Fix bad suggestion merge in package.json 2022-10-24 13:18:33 +02:00