Commit Graph

3013 Commits

Author SHA1 Message Date
Shati Patel
8b354357c1 Show selected item in new DB panel (#1824) 2022-12-02 12:44:51 +00:00
Koen Vlaswinkel
109ee0498e Merge pull request #1816 from github/koesie10/export-cancelled-results
Add exporting of in-progress/cancelled results
2022-12-02 13:03:37 +01:00
Koen Vlaswinkel
944a9115e9 Add basic Swift support
The extension doesn't actually use anything regarding the language of
variant analyses, so this just updates some types.

The actual Swift support is done in the CLI, which is also used for
determining which languages are actually supported. So, the environment
variable is already used by the CLI for showing supported languages.
2022-12-02 11:23:26 +01:00
Koen Vlaswinkel
9c51974cb0 Merge pull request #1821 from github/koesie10/monitor-error-handling
Handle errors when retrieving variant analyses in the monitor
2022-12-02 11:12:29 +01:00
Charis Kyriakou
6d1b5ab1e1 Update the format of selected state and propagate it to the treeview (#1817) 2022-12-01 16:27:21 +00:00
Koen Vlaswinkel
5bee07c712 Merge pull request #1819 from github/koesie10/fix-export-title
Fix Gist title in result export
2022-12-01 14:19:00 +01:00
Koen Vlaswinkel
32f3d32989 Add tests for opening query text/file 2022-12-01 14:03:07 +01:00
Koen Vlaswinkel
dd5da2bbc0 Make query text and file commands consistent
We were using two different implementations for opening the query file
and query text between the query history and the results view. This
moves the better implementation in the view to a command and uses these
commands for opening the query text/file in the query history and view.
This results in consistent error messages and behaviour between the two
different views.
2022-12-01 13:39:35 +01:00
Koen Vlaswinkel
3d81e1b31e Handle errors when retrieving variant analyses in the monitor
This will add error handling to the retrieval of variant analyses in the
monitor by catching the error. It will show a warning to the user and
log it. Then, it will simply sleep for 5 seconds and try again.

I'm not sure if we want to show all of these errors to the user since
this can result in many warnings popping up if many variant analyses are
being monitored, but this is probably that the user should be made aware
of.
2022-12-01 13:22:57 +01:00
Koen Vlaswinkel
bf84dbea69 Merge pull request #1818 from github/koesie10/fix-duplicate-webviews-error
Close serialized webview when another view already exists
2022-12-01 12:55:47 +01:00
Koen Vlaswinkel
7414a77b8a Add progress notification to exporting results
This will add a progress notification to exporting results to give users
feedback about what's happening.

Unfortunately, we need to change some things in how we handle the
actions on completion notifications since we want the progress
notification to disappear when that notification shows. This results in
us having to remove the `await` on the
`showInformationMessageWithAction` calls.
2022-12-01 12:53:10 +01:00
Nora
fb154ab423 Merge pull request #1814 from github/nora/adjust-errormessage-api-response
Adjust for new GitHub Api response
2022-12-01 12:24:28 +01:00
Koen Vlaswinkel
6a431b0719 Fix Gist title in result export
The Gist title in the result export didn't take into account the actual
number of exported repositories, it only used the scanned, unfiltered,
repositories in the variant analysis. This switches it to use the actual
exported repositories for determining the result and repository counts.

This is somewhat more complicated than we'd expect it to be since the
results are being read in async, so we need to switch the order of
operations and store some additional information for being able to
compute this information. However, this also makes the code somewhat
easier to understand since the summary file is now being created in only
1 location, rather than being split between a method and a for-loop.
2022-12-01 12:14:35 +01:00
Koen Vlaswinkel
f6bb233a15 Close serialized webview when another view already exists
When deserializing a webview, it could happen that a view was already
manually opened by the user before the webview was deserialized. This
would result in duplicate webview tabs, which is not supported by the
manager.

This will close the webview that is being deserialized and focus on the
existing view. This should ensure that we never have duplicate loaded
webview tabs. There could still be duplicate webview tabs if there are
non-deserialized tabs, but once it is opened it should be closed
automatically.
2022-12-01 11:43:37 +01:00
Elena Tanasoiu
386e9bb865 Merge pull request #1791 from github/elena/eslint-github
Install `eslint-plugin-github` and apply autofixes where possible
2022-12-01 10:30:04 +00:00
Koen Vlaswinkel
0f7cf2d935 Take into account filters for action buttons
This will disable the export and copy buttons when no results would be
exported by executing the command. In contrast to the "normal" filtering
in the view, this will also take into account the checkboxes since those
are also used in the extension host.
2022-12-01 11:21:28 +01:00
Koen Vlaswinkel
72f253e39f Add exporting of in-progress/cancelled results
This will allow exporting results for a variant analysis which is
cancelled or in-progress. Repositories for which the results are not yet
available or which have not yet been downloaded will not be exported.

The header of the summary file is incorrect, but this will be fixed in
a follow-up PR.
2022-12-01 11:21:26 +01:00
Elena Tanasoiu
168ce8fd28 Add new lint fix 2022-12-01 09:40:33 +00:00
Elena Tanasoiu
0a633a29fe Remove duplicate identifier
This was also caught while running gulp-typescript.
2022-12-01 09:10:47 +00:00
Elena Tanasoiu
d8bbd3de9f Fix faulty import
During the build process, we now get errors pointing out that we import two different
items and call them `QueryServerClient`. One is actually the legacy one and has been
superseded by the new one so far.

Let's fix this and appease the linter.

Full errors:

```

[gulp-typescript]
/home/runner/work/vscode-codeql/vscode-codeql/extensions/ql-vscode/src/extension.ts(88,9):
error TS2300: Duplicate identifier 'QueryServerClient'.

[gulp-typescript]
/home/runner/work/vscode-codeql/vscode-codeql/extensions/ql-vscode/src/extension.ts(89,9):
error TS2300: Duplicate identifier 'QueryServerClient'.

[gulp-typescript]
/home/runner/work/vscode-codeql/vscode-codeql/extensions/ql-vscode/src/extension.ts(1596,30):
error TS2345: Argument of type
'import("/home/runner/work/vscode-codeql/vscode-codeql/extensions/ql-vscode/src/legacy-query-server/queryserver-client").QueryServerClient'
is not assignable to parameter of type
'import("/home/runner/work/vscode-codeql/vscode-codeql/extensions/ql-vscode/src/query-server/queryserver-client").QueryServerClient'.

```
2022-12-01 09:10:47 +00:00
Elena Tanasoiu
99bb04b458 Enable eslint-plugin-github for vscode-tests folder 2022-12-01 09:10:47 +00:00
Elena Tanasoiu
8fcbee6ad4 Enable eslint-github-plugin for view folder 2022-12-01 09:10:47 +00:00
Elena Tanasoiu
195ef45600 Enable eslint-plugin-github for storybook
This also adds the recommended rules for React.
2022-12-01 09:10:46 +00:00
Elena Tanasoiu
56660b1720 Enable eslint-plugin-github in test folder 2022-12-01 09:10:46 +00:00
Elena Tanasoiu
b45c67f24f Autofix prefer-template 2022-12-01 09:10:46 +00:00
Elena Tanasoiu
30cf72b6c8 Autofix object-shorthand 2022-12-01 09:10:46 +00:00
Elena Tanasoiu
670c863f3f Autofix import/no-namespace
I'm leaving the rule turned off as it still has 100+ offenses that aren't
autofixable.
2022-12-01 09:10:44 +00:00
Elena Tanasoiu
754fa67231 Autofix import/no-duplicates 2022-12-01 09:08:33 +00:00
Elena Tanasoiu
706f2e3ca1 Autofix eslint-comments/no-unused-disable 2022-12-01 09:08:33 +00:00
Elena Tanasoiu
dc5d8daa84 Autofix @typescript-eslint/array-type 2022-12-01 09:08:33 +00:00
Elena Tanasoiu
0b9ba3cb94 Start by turning off all rules that have found offences
In the next commits we'll turn these rules on, one-by-one, and then
autofix the offenses.

At the end we'll be left with the rules that require manual attention.
2022-12-01 09:08:33 +00:00
Elena Tanasoiu
f539ba3b85 Enable eslint-plugin-github in main extension folder
There are 5 eslint config files. We're going to enable this plugin one file at a time
and then deal with the fixes.
2022-12-01 09:08:32 +00:00
Elena Tanasoiu
bccc573c6a Install eslint-plugin-github 2022-12-01 09:08:32 +00:00
Koen Vlaswinkel
b273db13d0 Merge pull request #1812 from github/koesie10/load-results-tests
Add tests for loading results
2022-12-01 09:55:25 +01:00
Koen Vlaswinkel
a704a2bf46 Merge pull request #1804 from github/koesie10/stop-monitor-after-remove
Stop variant analysis monitor after removing the variant analysis from the query history
2022-12-01 09:38:23 +01:00
Koen Vlaswinkel
bf328d56d7 Merge remote-tracking branch 'origin/main' into koesie10/stop-monitor-after-remove 2022-11-30 18:29:54 +01:00
Robert
10fe55cff5 Merge pull request #1815 from github/robertbrignull/view_paths
Add theme provider when rendering code flows
2022-11-30 17:26:52 +00:00
Koen Vlaswinkel
b3003fc0ba Merge remote-tracking branch 'origin/main' into koesie10/load-results-tests 2022-11-30 18:23:41 +01:00
Robert
125867d68c Merge pull request #1809 from github/robertbrignull/failed_analysis_spinner
Don't show spinner for a failed analysis
2022-11-30 17:19:33 +00:00
Charis Kyriakou
27b4203d8b Merge pull request #1813 from github/charisk/logging-tidy
Some further tidying up around logging
2022-11-30 16:59:10 +00:00
Robert
f9803fc760 Use toBeInTheDocument 2022-11-30 16:45:36 +00:00
Robert
c958fd2052 Remove unused mock 2022-11-30 16:40:46 +00:00
Robert
adea0b4d77 Add theme provider when rendering code flows 2022-11-30 16:34:50 +00:00
Nora
3dd6effce5 Adjust api response 2022-11-30 17:16:25 +01:00
Koen Vlaswinkel
f3e4766287 Merge pull request #1789 from github/koesie10/remove-variant-analysis-monitor-return-value
Remove variant analysis monitor return value
2022-11-30 16:47:23 +01:00
Robert
3751f3ec6c Add tests 2022-11-30 15:28:21 +00:00
Koen Vlaswinkel
2b9bff14f3 Switch to async methods for fs operations
Hopefully this fixes some issues on Windows.
2022-11-30 16:27:08 +01:00
Robert
45a87192de Merge pull request #1808 from github/robertbrignull/failed_analysis_pending
Don't show pending state when analysis has failed
2022-11-30 15:18:11 +00:00
Charis Kyriakou
c889c09584 Rename logger to extLogger 2022-11-30 13:53:17 +00:00
Charis Kyriakou
45ffd8a45c Tidy up logging docs 2022-11-30 13:28:29 +00:00