49 Commits

Author SHA1 Message Date
Robert
f0ce52d01a Remove use of any in scripts/source-map.ts 2024-02-12 15:32:42 +00:00
Robert
31ff3577c4 Remove use of any in scripts/add-fields-to-scenarios.ts 2024-02-12 15:32:33 +00:00
Nora
6741f0c431 Merge branch 'main' into nora/add-e2e-tests 2024-01-19 18:32:37 +01:00
Nora
fc41360bad Check in npm run format 2024-01-19 10:15:00 +00:00
Nora
283d0070f7 Ignore playwright config on dead code 2024-01-12 14:05:51 +00:00
Koen Vlaswinkel
0534cb7514 Simplify custom Jest test runner
The custom Jest test runner was originally written to install the
required extensions for the CLI integration tests. This is no longer
necessary as of https://github.com/github/vscode-codeql/pull/3232, so
we can remove all code that deals with downloading VS Code and
installing extensions. The download of VS Code will now be handled by
the base `VSCodeTestRunner`.
2024-01-12 09:49:20 +01:00
Koen Vlaswinkel
21faed0191 Enforce consistent type specifiers 2024-01-05 17:15:58 +01:00
Koen Vlaswinkel
9d6962ede2 Enforce consistent type imports 2024-01-05 17:13:45 +01:00
Koen Vlaswinkel
45fe4aa1d4 Merge pull request #3186 from github/koesie10/generate-chromium-version
Rename update Chromium version script to generate Chromium version
2024-01-05 09:49:34 +01:00
Koen Vlaswinkel
47929943ba Merge pull request #3184 from github/koesie10/node-version
Use semver range for `@types/node`
2024-01-03 16:42:50 +01:00
Koen Vlaswinkel
9718aa5806 Rename update Chromium version to generate
This also adds the script as a script in the `package.json` with the
naming such that `npm generate` will re-generate the Chromium version
file. This will ensure that the CI checks fail when the Chromium version
doesn't match the minimum supported VS Code version.
2024-01-03 11:42:20 +01:00
Koen Vlaswinkel
cce0e146ff Merge pull request #3182 from github/koesie10/vscode-versions
Add scripts for updating the Node and Chromium versions
2024-01-03 11:36:35 +01:00
Koen Vlaswinkel
de24e25486 Use semver range for @types/node
According to the DefinitelyTyped documentation, the patch version of
the type declaration package is unrelated to the library patch version.
Therefore, we should use an X-range for `@types/node` to allow
newer patch versions to be installed automatically.
2024-01-03 11:08:44 +01:00
Koen Vlaswinkel
dc3e1ce096 Add script for updating Chromium version 2024-01-02 16:28:27 +01:00
Koen Vlaswinkel
4129962fa0 Use generated schema to validate qlpack file 2024-01-02 16:19:11 +01:00
Koen Vlaswinkel
49deb2e756 Add script for updating Node version 2024-01-02 16:00:55 +01:00
Koen Vlaswinkel
0be60f3e8f Extract functions to separate file 2024-01-02 16:00:55 +01:00
Koen Vlaswinkel
e294dfdf4a Add simple script for finding VS Code versions 2024-01-02 16:00:55 +01:00
Koen Vlaswinkel
4444951093 Merge remote-tracking branch 'origin/main' into koesie10/yauzl-concurrent 2023-12-20 10:10:47 +01:00
Koen Vlaswinkel
64ad40e369 Switch to yauzl for the source map script 2023-12-19 14:20:17 +01:00
Koen Vlaswinkel
2d5caa77bc Remove unnecessary casting 2023-10-17 15:19:04 +02:00
Koen Vlaswinkel
67f6f8f160 Fix decoding source map with VS Code internal files
This makes it possible to decode source maps containing references to
code that is not part of the extension. If it finds any such references,
it will simply not decode the source map and use the original stack
trace instead.
2023-10-17 13:34:11 +02:00
Koen Vlaswinkel
8b1c52886a Fix typing error for Octokit 2023-09-28 16:09:16 +02:00
Koen Vlaswinkel
9392fb75c8 Format generated schema files with Prettier 2023-09-25 15:35:02 +02:00
Koen Vlaswinkel
c55e87c64b Generate schema for extension pack file 2023-09-25 15:25:40 +02:00
Koen Vlaswinkel
db55e9cd42 Generate schema for extension pack metadata
After the upgrade to the correct types for js-yaml, the return type
of `load` is correctly typed as `unknown`. This means that we can't
use the return value directly, but need to validate it first.

This adds such validation by generating a JSON schema for a newly
created typed. The JSON schema generation is very similar to how we do
it in https://github.com/github/codeql-variant-analysis-action.
2023-09-25 15:25:37 +02:00
Robert
26c301603d Include .storybook in deadcode detection 2023-09-18 15:36:56 +01:00
Charis Kyriakou
4a752d27c4 Moves mock GitHub API to /common (#2728)
* Move mock GitHub API to /common

* Rename MRVA mock scenarios

* Update mock GitHub API docs
2023-08-21 08:49:27 +01:00
Robert
5572cece83 Convert find-deadcode to a script 2023-07-24 18:00:30 +01:00
Charis Kyriakou
431988f9fd Move mock GitHub API server files
:   scripts/lint-scenarios.ts
2023-04-27 15:24:09 +00:00
Koen Vlaswinkel
39d91788dc Rename remote-queries directories to variant-analysis 2023-02-17 11:38:24 +01:00
Robert
f69a6c523b More unnecessary awaits 2023-02-15 10:24:02 +00:00
Koen Vlaswinkel
f3f8de0e60 Merge remote-tracking branch 'origin/main' into koesie10/source-map-script-from-release-asset 2023-02-07 17:29:07 +00:00
Koen Vlaswinkel
465da69ecf Merge remote-tracking branch 'origin/main' into koesie10/source-map-script-stacktrace 2023-02-07 16:38:44 +00:00
Koen Vlaswinkel
5b9c09c958 Download sourcemaps from release asset if available
This download download the sourcemaps from the release asset if it is
available. Unfortunately, I'm not able to test this yet because we don't
yet have any releases with sourcemaps attached. As a fallback, it will
still try to download from the workflow run.
2023-02-07 15:16:10 +00:00
Koen Vlaswinkel
a5b95944fc Add radix to parseInt 2023-02-06 17:13:23 +00:00
Koen Vlaswinkel
6d1c66b121 Add example to source map script 2023-02-06 17:09:56 +00:00
Koen Vlaswinkel
0ed03c14bf Add source map support for full stacktraces
This adds support for mapping full stacktraces in the source map
script. This allows you to pass a full stacktrace to the script and get
back a stacktrace with all original positions.
2023-02-03 15:21:57 +01:00
Koen Vlaswinkel
92e2975c24 Add script for retrieving original source location
This adds a script that can be used for retrieving the original source
location when given a location in the released extension. It will
download the source map from the Actions workflow run of the release and
use the `source-map` library to extract the original location.
2023-02-03 12:15:57 +01:00
Robert
13dd5298bf Enforce that promise rejection values must have unknown type 2023-01-25 16:34:47 +00:00
Elena Tanasoiu
b45c67f24f Autofix prefer-template 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
Koen Vlaswinkel
e55b8a366e Clean up Mocha, Sinon and Chai
This removes the Mocha, Sinon and Chai-related packages and removes
unused code from the test suite.
2022-11-24 17:24:43 +01:00
Koen Vlaswinkel
ebcdf8ad0b Run Prettier on all files
This will change all existing files to match Prettier formatting.

The command used is `npm run format`.
2022-11-16 19:06:13 +01:00
Koen Vlaswinkel
06fd3a58a7 Add new GitHub API fields to scenario files
This uses a script to add the new `stargazers_count` and `updated_at` to
the scenario files. This is done by using the GitHub API to get the
information for each repo and then updating the scenario file.

The `updated_at` values are not completely representative since they are
the `updated_at` at time of running the script, rather than at the time
the variant analysis was run. However, this should not really matter in
practice. An alternative for scanned repositories might be getting the
creation time of the `database_commit_sha` commit.
2022-11-02 12:39:30 +01:00
Koen Vlaswinkel
762288b57f Add tsconfig.json file for scripts directory
This will fix linting errors when `lint-staged` is run and there are
changed files in the `scripts` directory.
2022-10-31 13:21:56 +01:00
Charis Kyriakou
b15626853b Add script to help with scenario recording (#1671) 2022-10-28 09:22:11 +00:00
Koen Vlaswinkel
104055e703 Add linter for scenario files
This adds a linter for JSON scenario files which will validate the JSON
files in the scenarios directory against the TypeScript types. It will
convert the TypeScript types to JSON schema to simplify this process.

Unfortunately, this will not currently allow adding scenarios with
failing requests since the types do not allow this. Rather than removing
this validation, we should fix the types. This can be done in a follow-up
PR.
2022-10-21 16:41:01 +02:00
Charis Kyriakou
3fc3b259ba Add pre-push hook check to block leftover .only()s (#1189) 2022-03-08 09:32:18 +00:00