Commit Graph

3043 Commits

Author SHA1 Message Date
Nora
c436688eb2 Merge pull request #1830 from github/nora/selected-db-item
Create method that returns selected DbItem
2022-12-06 09:33:21 +01:00
darkred
127baea584 Update README.md to clarify that vscode-codeql also installs 'Test Adapter Converter' and 'Test Explorer UI' (#1831)
Co-authored-by: Andrew Eisenberg <aeisenberg@github.com>
2022-12-05 09:10:20 -08:00
Nora
425befa959 Add tests 2022-12-05 17:38:40 +01:00
Nora
1050968db1 Update extensions/ql-vscode/test/pure-tests/databases/db-item-selection.test.ts
Co-authored-by: Charis Kyriakou <charisk@users.noreply.github.com>
2022-12-05 16:57:30 +01:00
Nora
7a2f976199 Refactor selection method to allow all types of DbItem lists 2022-12-05 16:21:35 +01:00
Nora
9362881e22 Rename method on db Manager 2022-12-05 16:21:03 +01:00
Nora
60b1f141a1 Rename and reduce test lines 2022-12-05 16:20:49 +01:00
Koen Vlaswinkel
02c8df003a Fix missing error message on repository selection
The repository selection was structured such that you would get in the
`else` case if there was nothing selected, but this case would also be
used if for some other reason the selected item was not valid.

This restructures the conditions to first check whether the user
cancelled out of the operation and will silently return in that case. In
other cases where it cannot determine the repositories, it will now show
a user-visible error.
2022-12-05 15:17:31 +01:00
Koen Vlaswinkel
b91e31cb2c Merge pull request #1835 from github/koesie10/hide-analyzed-when-failed
Hide analyzed panel when it's empty
2022-12-05 14:51:11 +01:00
Koen Vlaswinkel
272aed7d31 Merge pull request #1836 from github/koesie10/fix-view-jest-config
Fix Jest config for view tests
2022-12-05 14:40:17 +01:00
Koen Vlaswinkel
96850e442f Hide analyzed panel when it's empty
This will hide the "Analyzed" panel when there are no scanned repos and
it's completely empty.

When all three panels are empty, this will also hide the search bar and
filters, and will skip rendering anything for the panels.
2022-12-05 14:06:07 +01:00
Koen Vlaswinkel
a19a3297c5 Fix Jest config for view tests
This will allow running the view tests in `src/view`, rather than
only allowing these tests to be run from the root directory.
2022-12-05 13:59:09 +01:00
Shati Patel
795a0bc46d Minor: make changelog entry more consistent (#1834) 2022-12-05 11:19:08 +00:00
Charis Kyriakou
2967777db1 Track parent list name for db items (#1833) 2022-12-05 10:48:33 +00:00
Koen Vlaswinkel
7bb0d0fda9 Restructure variant analysis manager tests
This restructures the variant analysis manager tests to follow this
pattern:
- Class
  - Method
    - Context
      - Context
        - ...
          - Test

Before, we were only using this pattern for some of the tests and this
made it confusing were which method was being tested.

By splitting this off, it will also be easier to move some of these
tests out of the cli-integration tests and into the no-workspace or
minimal-workspace tests.
2022-12-05 11:16:27 +01:00
Koen Vlaswinkel
0e744fdb5a Merge pull request #1822 from github/koesie10/consistent-query-text-file-commands
Make query text and file commands consistent
2022-12-05 10:46:29 +01:00
Koen Vlaswinkel
39a0ef00c4 Merge pull request #1825 from github/koesie10/add-swift-support
Add basic Swift support
2022-12-05 10:23:33 +01:00
Nora
9110af80d8 Add test 2022-12-05 10:08:04 +01:00
Nora
ee056ce2b3 Create method to expose selected DbItem 2022-12-05 10:08:04 +01:00
Nora
2db4a951c2 Merge pull request #1829 from github/nora/fix-vscode-test-setup
Fix problem running integration tests from VsCode test and debug panel
2022-12-05 09:58:03 +01:00
Koen Vlaswinkel
994ebaacd0 Merge pull request #1827 from github/koesie10/filter-sarif-snippets
Limit SARIF code snippet size
2022-12-02 18:46:19 +01:00
Nora
d00dde06ca Adjust launch.json 2022-12-02 16:36:43 +01:00
Koen Vlaswinkel
402b33830d Add tests for excluded snippets 2022-12-02 16:32:29 +01:00
Koen Vlaswinkel
735372ee72 Implement PR feedback 2022-12-02 16:26:24 +01:00
Koen Vlaswinkel
51d3a018de Add spinner when loading results
This will add a spinner to each repo row when the results for a
particular repo are loading. It will also disable the row to make clear
that it is loading and not clickable.
2022-12-02 16:19:56 +01:00
Koen Vlaswinkel
c0187a5650 Limit SARIF code snippet size
This adds a new filtering on SARIF code snippets for very large code
snippets (defined as 8MB or more). If less than 1% of such a snippet
is highlighted, it will not include the code snippet in the analysed
results, and it will thus not be shown in the UI.

This is to avoid very large SARIF files that can cause the extension
host to crash when the analysis results are send to the UI. I don't
think any of these snippets would ever be useful to show, so it should
be fine to just not include them.
2022-12-02 15:33:44 +01:00
Robert
008d7b363f Merge pull request #1826 from github/robertbrignull/check_status
Check variant analysis status in isVariantAnalysisComplete
2022-12-02 14:23:36 +00:00
Koen Vlaswinkel
c9d6bfd32e Merge pull request #1820 from github/koesie10/export-progress
Add progress notification to exporting results
2022-12-02 14:55:28 +01:00
Koen Vlaswinkel
dc2bb3a6e0 Merge remote-tracking branch 'origin/main' into koesie10/export-progress 2022-12-02 14:25:05 +01:00
Robert
1d4cbde48e Check variant analysis status in isVariantAnalysisComplete 2022-12-02 12:45:52 +00:00
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