Commit Graph

2105 Commits

Author SHA1 Message Date
Koen Vlaswinkel
902c489979 Use nullish coalescing operator for loading results 2022-10-07 10:28:13 +02:00
Koen Vlaswinkel
a20d9102e6 Add variant analysis results manager
This adds a new variant analysis results manager which is responsible
for downloading and loading variant analysis results to/from the
filesystem. It is essentially the `AnalysesResultsManager` modified to
suit the variant analysis results.
2022-10-06 15:13:52 +02:00
Koen Vlaswinkel
131d252a8b Merge pull request #1567 from github/koesie10/set-repo-results-message
Implement message for setting download status
2022-10-06 10:43:46 +02:00
Koen Vlaswinkel
90023137ca Merge pull request #1562 from github/koesie10/set-variant-analysis-message
Implement `setVariantAnalysis` message
2022-10-05 16:20:32 +02:00
Koen Vlaswinkel
303a7d1662 Show loading icon when downloading repo results 2022-10-05 12:58:28 +02:00
Koen Vlaswinkel
7c935b37b0 Receive setRepoStates message in webview 2022-10-05 12:58:28 +02:00
Koen Vlaswinkel
339fc9a755 Post setRepoStates message when downloading 2022-10-05 12:58:28 +02:00
Koen Vlaswinkel
4138ca1085 Receive setRepoResults message in React component 2022-10-05 12:58:28 +02:00
Koen Vlaswinkel
6941584214 Add variant analysis view to disposables of manager 2022-10-05 12:53:05 +02:00
Koen Vlaswinkel
525d7f5f3d Receive setVariantAnalysis message in React component
This will store the variant analysis in the React state and replace it
when the `setVariantAnalysis` message is received.
2022-10-05 12:53:05 +02:00
Koen Vlaswinkel
84621b7ecc Fix variant analysis monitor failing
All fields in the variant analysis skipped repositories are optional,
but this was not properly defined in the API types. This will correct
the types and the functions processing the data such that they handle
non-existing fields.
2022-10-05 12:53:05 +02:00
Koen Vlaswinkel
2baa53a149 Post message to view when variant analysis is updated 2022-10-05 12:53:05 +02:00
Koen Vlaswinkel
15579012f1 Emit event when variant analysis is updated 2022-10-05 12:53:05 +02:00
Koen Vlaswinkel
28b00b249b Update variant analysis from API response
This will ensure that when we return a new variant analysis summary from
the API, the variant analysis object will be updated.
2022-10-05 12:53:05 +02:00
Koen Vlaswinkel
401da636a0 Keep track of opened variant analysis views
To be able to send messages to the open view for a variant analysis, we
need to have a reference to the view. This is done by keeping track of
all open views in a dictionary indexed by their variant analysis ID.

We currently only allow one view per variant analysis, but do allow
multiple variant analysis views to be open at a time. In the future, we
may want to allow multiple views per variant analysis (such that e.g.
"Split right" works), but this is not supported yet.

The reason for the indirection through the interfaces is to prevent
circular dependencies between the variant analysis view and the manager.
2022-10-05 12:53:02 +02:00
Elena Tanasoiu
ab9cf465cc Merge pull request #1559 from github/elenatanasoiu/download-variant-analysis-results
Download variant analysis results
2022-10-05 11:43:05 +01:00
Elena Tanasoiu
bb7246b612 Pass in variant analysis summary to autodownload command
This was missed in 4f84376faa
2022-10-04 18:09:02 +01:00
Elena Tanasoiu
b82cd8b6f4 Use real cancellation token match VSCode behaviour 2022-10-04 18:08:50 +01:00
Elena Tanasoiu
f56f017a84 Generate ids using faker for test factories 2022-10-04 17:07:15 +01:00
Elena Tanasoiu
7dc5eebcc1 Generate a real NotFoundRepoGroup
This won't have an `id` field. We initially generated this the same
way we did for all other skipped repos, but this one is special because
it's only providing the fullName field, while the others also provide
`id` and `private`.
2022-10-04 16:36:00 +01:00
Elena Tanasoiu
644a83d6d8 Only use safe navigator for optional fields 2022-10-04 16:35:59 +01:00
Elena Tanasoiu
4f84376faa Make monitor trigger autodownload of result when a new repo is scanned
This introduces a new `autoDownloadVariantAnalysisResult` command which
will be called by the VariantAnalysisMonitor every time it detects a new
repo has been scanned.

In turn, this will use the `autoDownloadVariantAnalysisResult` method
which we defined in an earlier commit on the VariantAnalysisManager.
2022-10-04 16:35:59 +01:00
Elena Tanasoiu
5e76c08f84 Only import what we need from vscode in VariantAnalysisMonitor
In the next commit, we'll also import `commands`.
2022-10-04 16:35:59 +01:00
Elena Tanasoiu
765c956481 Introduce download method on VariantAnalysisManager
This method will be called from the VariantAnalysisMonitor once
a new repo has been scanned.

It will then perform an API request to get the repo task for it,
which will contain an `artifact_url`.

Finally it will use the API method we introduced in the previous commit
to download the result for the repo and then save it on disk.
2022-10-04 16:35:59 +01:00
Elena Tanasoiu
deac8c8c02 Add API method for download scanned repo result
This will download the result for a particular repo by making a call
to the download URL via octokit.
2022-10-04 16:35:59 +01:00
Elena Tanasoiu
a47031b0d5 Call monitor from new VariantAnalysisManager class 2022-10-04 16:35:59 +01:00
Elena Tanasoiu
3bf27b3472 Set up factories for VSCode VariantAnalysis
In a previous PR [1] we introduced factories for generating variant analyses
(and their associated objects) that were returned from the API.

Let's also introduce factories for generating their VSCode equivalent.

We can immediately use them for generating a VariantAnalysis object for the
monitor tests.

[1]: https://github.com/github/vscode-codeql/pull/1545
2022-10-04 16:35:58 +01:00
Shati Patel
9422c6d65c Fix running Jest unit tests from the debugger on Windows (#1563) 2022-10-04 13:28:49 +01:00
Koen Vlaswinkel
b81e3c7b94 Merge pull request #1560 from github/koesie10/reduce-duplication-repo-rows
Combine repository row components into a single component
2022-10-04 12:19:50 +02:00
Andrew Eisenberg
011eee1d16 Merge pull request #1565 from github/aeisenberg/db-folder-check
Use better heuristics when checking db folders
2022-10-03 14:50:57 -07:00
Andrew Eisenberg
924d24b106 Update extensions/ql-vscode/src/vscode-tests/no-workspace/helpers.test.ts
Co-authored-by: Angela P Wen <angelapwen@github.com>
2022-10-03 14:36:34 -07:00
Andrew Eisenberg
54ba5ced09 Use better heuristics when chekcking db folders 2022-10-03 14:07:55 -07:00
Koen Vlaswinkel
78a90ffa92 Merge pull request #1553 from github/koesie10/show-variant-analysis-view
Open variant analysis view after submission
2022-10-03 11:21:26 +02:00
Koen Vlaswinkel
b95ee896df Combine repository row components into a single component
This is a follow-up to clean up the skipped and analyzed repository
component duplication. The rows in both tabs are very similar, so this
will combine them to use a single component.
2022-10-03 11:07:14 +02:00
Koen Vlaswinkel
d33b07b2d1 Merge branch 'main' into koesie10/show-variant-analysis-view 2022-10-03 10:06:58 +02:00
James Fletcher
3d7f303c65 Merge pull request #1558 from github/lgtm-update
Remove mentions of lgtm.com from README
2022-09-30 20:23:21 +01:00
Andrew Eisenberg
540d6758d1 Merge pull request #1557 from github/aeisenberg/view-column
Ensure results view is opened in column beside
2022-09-30 09:22:21 -07:00
Koen Vlaswinkel
b5b34743f1 Open variant analysis view after submission
This will open the variant analysis view after the variant analysis has
been submitted. It will also show a notification that the analysis has
been submitted, which includes the query name.
2022-09-30 17:01:12 +02:00
Robert
0a6db47b5f Merge pull request #1549 from github/robertbrignull/skipped-repos
Implement skipped repositories tabs
2022-09-30 13:10:12 +01:00
James Fletcher
f679a2efec remove lgtm.com from reaadme 2022-09-30 11:47:43 +00:00
Robert
72253a1bb8 Merge branch 'main' into robertbrignull/skipped-repos 2022-09-30 11:22:38 +01:00
Elena Tanasoiu
2065c7d75c Merge pull request #1545 from github/elenatanasoiu/monitor-variant-analysis
Implement monitoring for variant analysis live results
2022-09-30 10:00:03 +01:00
Elena Tanasoiu
ff4ea3e4c8 Exit early if variant analysis completes 2022-09-30 09:41:23 +01:00
Andrew Eisenberg
9bd932294a Ensure results view is opened in column beside
The results view will always open next to the current editor.
2022-09-29 13:04:28 -07:00
Andrew Eisenberg
afdc8164c8 Merge pull request #1554 from github/aeisenberg/bump-to-2.11.0-cli
Update tests to v2.11.0
2022-09-29 09:18:40 -07:00
dependabot[bot]
ea022f4cde Bump @octokit/rest from 18.6.0 to 19.0.4 in /extensions/ql-vscode (#1551)
Bumps [@octokit/rest](https://github.com/octokit/rest.js) from 18.6.0 to 19.0.4.
- [Release notes](https://github.com/octokit/rest.js/releases)
- [Commits](https://github.com/octokit/rest.js/compare/v18.6.0...v19.0.4)

---
updated-dependencies:
- dependency-name: "@octokit/rest"
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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-09-29 09:12:38 -07:00
Andrew Eisenberg
48ced51035 Update tests to v2.11.0 2022-09-29 07:50:43 -07:00
Koen Vlaswinkel
177688dc56 Merge pull request #1544 from github/koesie10/scanned-repos-tab
Add analyzed repositories component
2022-09-29 16:05:20 +02:00
Koen Vlaswinkel
c5cbf92b3a Merge pull request #1546 from github/koesie10/refactor-raw-results-table
Refactor `RawResultsTable` component
2022-09-29 16:03:29 +02:00
Robert
529ceb133e Fix text when 1 repo is shown 2022-09-29 13:02:22 +01:00