Commit Graph

2787 Commits

Author SHA1 Message Date
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
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
Koen Vlaswinkel
6c3731fe98 Add tests for loading results
This adds tests for the `loadResults` method of the variant analysis
results manager. It tests that SARIF results can be successfully
loaded and that the `onResultLoaded` event is fired.
2022-11-30 13:52:33 +01:00
Charis Kyriakou
74e047cbd8 Move logging code to /common/logging and split into multiple files (#1800) 2022-11-30 09:45:29 +00:00
Koen Vlaswinkel
a9a5d098c7 Merge pull request #1811 from github/koesie10/fix-stat-item-header-color
Fix header color of stat item
2022-11-30 09:59:31 +01:00
Koen Vlaswinkel
8f0e6154ad Remove variant analysis monitor return value
The monitor return value was only used in tests, but we can also assert
the correct behavior using the calls it makes, rather than using the
result of the monitor.
2022-11-30 09:55:16 +01:00
Koen Vlaswinkel
2895e84586 Merge pull request #1798 from github/jest-migration/integration-tests
Migrate integration tests to Jest
2022-11-30 09:54:35 +01:00
Koen Vlaswinkel
56585b43e6 Merge remote-tracking branch 'origin/main' into jest-migration/integration-tests 2022-11-30 09:06:07 +01:00
Koen Vlaswinkel
6dc1f9f601 Merge pull request #1801 from github/jest-migration/retry-tests
Add retries of CLI integration tests
2022-11-30 08:49:49 +01:00
Andrew Eisenberg
91edad8df2 Merge pull request #1662 from github/alexet/update-lsp
Update languageserver-client
2022-11-29 10:37:19 -08:00
Alexander Eyers-Taylor
2637d6d00c Added changelog entry for updated vscode version. 2022-11-29 17:24:54 +00:00
Robert
4771d9b834 Add tests of a pending and failed variant analysis 2022-11-29 16:33:03 +00:00
Koen Vlaswinkel
e6fb4803d1 Merge pull request #1810 from github/koesie10/storybook-themes
Add additional Storybook VSCode themes
2022-11-29 17:21:36 +01:00
Koen Vlaswinkel
c7dbaebcec Fix header color of stat item
The header color of a stat item was using the badge foreground color,
but badges can have a different background color than the editor. For
some themes, this would result in unreadable text. By using the editor
foreground color, the header should be readable in many more themes.
2022-11-29 17:19:14 +01:00
Koen Vlaswinkel
3fdc328767 Add additional Storybook VSCode themes
This adds four new VSCode themes to Storybook which will allow us to
more easily test these themes in Storybook. These themes were chosen
because they are either used for accessibility (the high contrast
themes) or are currently not compatible with the variant analysis UI
(there are items that are not visible).
2022-11-29 16:49:04 +01:00
Koen Vlaswinkel
ec9d6b1907 Merge pull request #1806 from github/koesie10/fix-loading-results
Fix loading results in second opened view
2022-11-29 16:30:25 +01:00
Robert
2cdd6de38e Don't show spinner for a failed analysis 2022-11-29 15:00:41 +00:00
Robert
339819c82b Don't show pending state when analysis has failed 2022-11-29 14:56:09 +00:00
Shati Patel
75b684b00f MRVA: Fix typo in repo cancellation message (#1807) 2022-11-29 14:37:19 +00:00
Koen Vlaswinkel
bc65d8f311 Fix loading results in second opened view
When results were already cached in memory and the view requested the
result, it would not be loaded because the event would not be fired.
This fires the event when the result is loaded from cache as well, to
ensure that the view always receives the result.
2022-11-29 14:26:36 +01:00
Koen Vlaswinkel
0047186c83 Fix rehydration in variant analysis removal test 2022-11-29 11:41:57 +01:00
Koen Vlaswinkel
ff3b6091c6 Stop variant analysis monitor after removing it
This will stop the variant analysis monitor from monitoring when a
variant analysis is removed from the query history. Since the variant
analysis monitor cannot depend on the variant analysis manager (this
would create a circular dependency), a function is passed into the
variant analysis monitor for checking whether the variant analysis
should be cancelled.

This commit will also ensure that even if a variant analysis comes in
through the `onVariantAnalysisChange` callback, it won't be added to
the variant analysis map of the manager.
2022-11-29 11:12:46 +01:00
Koen Vlaswinkel
a1b81d9b6f Merge pull request #1802 from github/koesie10/path-basename
Show correct query filename on Windows
2022-11-29 09:03:11 +01:00
Koen Vlaswinkel
4bc97b850c Show correct query filename on Windows
On Windows, we were showing the full path to the query, rather than just
the filename. This is because the `path` package being imported was
actually `path-browserify` which only claims support for POSIX. Since
Windows uses backslashes rather than forward slashes for paths, this
resulted in the full path being shown.

This creates a new `basename` function that works on both POSIX and
Windows by detecting whether a POSIX or Windows path is given. This
ensures that the correct path is shown on Windows, and will also ensure
that we show the correct path on Linux if the user has opened a variant
analysis that was originally created on Windows.
2022-11-28 15:47:54 +01:00
Koen Vlaswinkel
7ba90275a8 Increase scenarios in which retries will be used
This will update the `jest-runner-vscode` patch to retry tests that fail
due to no test result being returned from the test runner.

This will also add some retries to the `minimal-workspace` and
`no-workspace` tests to help with flakiness.
2022-11-28 13:05:14 +01:00
Koen Vlaswinkel
9a9a8c5ac4 Fix multiple VSCode instances launching
Multiple VSCode instances were being launched when a second instance of
VSCode was being spawned with the same user data directory. This is
probably because VSCode restores the windows from the previous session,
even when `-n`/`--new-window` is passed.

This fixes it by patching `jest-runner-vscode` to always create a new
temporary user data directory, rather than re-using the same one for
all test suites.
2022-11-28 11:51:23 +01:00
Koen Vlaswinkel
644bea27ad Add retries of CLI integration tests
This will patch `jest-runner-vscode` to retry tests. This is a temporary
test to see if this will help with the flakiness of the CLI integration
tests.

The biggest problem with this is that it will launch multiple VSCode
instances on every retry:
- First try (not a retry): 1 instance
- Second try: 2 instances
- Third try: 3 instances
- etc.

I'm not sure why this is happening and can't really narrow it down to a
specific cause. Even if I change the `runVSCode` call for the retry by
a simple `cp.spawn` call, it still launches multiple instances.
2022-11-28 11:32:17 +01:00
Koen Vlaswinkel
68de9f09e4 Disable fail-fast for CLI integration tests 2022-11-25 18:37:15 +01:00