Commit Graph

3330 Commits

Author SHA1 Message Date
Koen Vlaswinkel
0138df5da8 Merge pull request #2051 from github/koesie10/filter-vscode-output
Hide VSCode console output
2023-02-09 15:36:59 +01:00
Koen Vlaswinkel
212273791b Merge pull request #2054 from github/koesie10/codeql-pack-yml
Handle `codeql-pack.yml` files everywhere
2023-02-09 15:36:00 +01:00
Koen Vlaswinkel
6ed5c2a583 Merge remote-tracking branch 'origin/main' into koesie10/filter-vscode-output 2023-02-09 09:48:24 +00:00
Koen Vlaswinkel
752b6a7f8a Add tests for getQlPackPath 2023-02-08 17:17:10 +00:00
Koen Vlaswinkel
34bdbd158d Move qlpack functions/constants to pure 2023-02-08 17:12:22 +00:00
Koen Vlaswinkel
c71238c6d2 Merge pull request #2052 from github/koesie10/source-map-script-from-release-asset
Download sourcemaps from release asset if available
2023-02-08 14:49:28 +01:00
Koen Vlaswinkel
202c93b580 Merge pull request #2049 from github/koesie10/upload-sourcemaps-release
Upload sourcemaps as release asset
2023-02-08 14:46:39 +01:00
Koen Vlaswinkel
b03efa4f24 Merge remote-tracking branch 'origin/main' into koesie10/source-map-script-from-release-asset 2023-02-08 13:31:28 +00:00
Koen Vlaswinkel
1198a05776 Merge remote-tracking branch 'origin/main' into koesie10/upload-sourcemaps-release 2023-02-08 13:31:13 +00:00
Andrew Eisenberg
2b816f9f0f Merge pull request #2056 from github/github-action/bump-cli
Bump CLI Version to v2.12.2 for integration tests
2023-02-08 05:26:49 -08:00
Koen Vlaswinkel
708af3cbb9 Merge pull request #2057 from github/koesie10/version-number-advice
Add recommendation for version number bumps
2023-02-08 14:16:29 +01:00
Koen Vlaswinkel
ef1fe756cb Add recommendation for version number bumps 2023-02-08 11:21:33 +00:00
github-actions[bot]
977e3c099d Bump CLI version from v2.12.1 to v2.12.2 for integration tests 2023-02-07 21:39:28 +00:00
Koen Vlaswinkel
7d6461a10a Handle codeql-pack.yml files everywhere
This will add support for the `codeql-pack.yml` filename in all places
where we currently support `qlpack.yml`. It centralizes the list of the
supported filenames in a single place and a method that can figure out
the correct filename to use.
2023-02-07 17:55:50 +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
81502fefec Merge pull request #2039 from github/koesie10/source-map-script-stacktrace
Add source map support for full stacktraces
2023-02-07 18:04:14 +01:00
Koen Vlaswinkel
ac127b3a3d Merge remote-tracking branch 'origin/main' into koesie10/source-map-script-from-release-asset 2023-02-07 17:00:48 +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
648e6745a8 Merge pull request #2037 from github/koesie10/source-map-script
Add script for retrieving original source location
2023-02-07 17:37:19 +01: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
943229f065 Merge pull request #2033 from github/koesie10/mocked-config
Mock config instead of writing settings files
2023-02-07 15:50:32 +01:00
Koen Vlaswinkel
c42cd9059d Hide information about VSCode exit code and download 2023-02-07 14:45:50 +00:00
Koen Vlaswinkel
f7fb6a4920 Merge remote-tracking branch 'origin/main' into koesie10/mocked-config 2023-02-07 14:33:53 +00:00
Koen Vlaswinkel
5e8c2fa6db Hide VSCode console output
Most of the warnings that are currently being shown in CI are coming
from VSCode. We can hide the VSCode output to make the CI logs more
readable. This should not influence the tests; the output of tests
(in particular using `console.log`/`console.error` etc.) will still be
shown.

See: 0c98dc12ad/packages/jest-runner-vscode/src/public-types.ts (L58-L68)
2023-02-07 14:30:07 +00:00
Elena Tanasoiu
f7ab8b7ba0 Merge pull request #2042 from github/elena/add-more-test-coverage
Add test coverage for `openDatabase`
2023-02-07 14:03:09 +00:00
Elena Tanasoiu
b2fa85f5c5 Merge pull request #2036 from github/shati-elena/create-skeleton
Introduce command for creating skeleton QL packs
2023-02-07 12:49:13 +00:00
Elena Tanasoiu
72f3847a3e Add tests for openDatabase function 2023-02-07 11:45:01 +00:00
Elena Tanasoiu
f8d0f689a6 Move functions into class so they can be mocked
We'd like to add test coverage for the openDatabase function (which is
public).

At the moment, this relies on `resolveDatabaseContents` which is just
a standalone function.

This means we're unable to mock it using Jest.

So let's move it into its own class.

This method in turn depends on a `resolveDatabase` function, which we've
also moved into the new class.

The only usages I could find for there functions were from within
the `databases.ts` file.
2023-02-07 11:26:33 +00:00
Elena Tanasoiu
235fb83e8c Don't check for specific number of calls on callback
This is unrelated to the changes in this PR but it's causing CI to fail.

```
config listeners › CliConfigListener › should listen for changes to 'codeQL.runningTests.numberOfThreads'

    expect(jest.fn()).toHaveBeenCalledTimes(expected)

    Expected number of calls: 1
    Received number of calls: 2

      109 |           const newValue = listener[setting.property as keyof typeof listener];
      110 |           expect(newValue).toEqual(setting.values[1]);
    > 111 |           expect(onDidChangeConfiguration).toHaveBeenCalledTimes(1);
          |                                            ^
      112 |         });
      113 |       });
      114 |     });
```

We don't need to check that the callback is triggered a certain number of times, just that it works
so we can change this test to be more permissive.
2023-02-07 11:25:11 +00:00
Elena Tanasoiu
5c89952999 "select" -> "add" 2023-02-07 11:23:40 +00:00
Elena Tanasoiu
397aa2befe Mention language in pop-up message 2023-02-07 11:23:40 +00:00
Elena Tanasoiu
63add84bf3 Use triple equals 2023-02-07 11:23:40 +00:00
Elena Tanasoiu
037596cfb4 Create skeleton QL pack if in CodeTour
We'd like to make it easier for a user going through the CodeQL Tour to
write their queries.

To help them along, we can generate skeleton QL packs once we know which
database they're using, instead of expecting them to know how to create
this themselves.

We're then able to download the necessary dependencies for their CodeQL
queries.

This checks that we're running the CodeTour by looking for the
`codeQL.codespacesTemplate` setting.
2023-02-07 11:23:39 +00:00
Elena Tanasoiu
a85281e365 Be able to pass custom db options to mock
We will use this to set/unset the language on a database item.

This will then be used to determine whether we need to create a QL pack.
2023-02-07 11:23:39 +00:00
Elena Tanasoiu
99f3d28640 Introduce helper method to detect folder in workspace 2023-02-07 11:23:39 +00:00
Elena Tanasoiu
41256ec9fd Make it a little clearer which function the tests are checking 2023-02-07 11:23:39 +00:00
Koen Vlaswinkel
74581fb8e3 Merge pull request #2046 from github/koesie10/rename-last-commit-to-last-updated
Rename "Last commit" to "Last updated"
2023-02-07 12:15:04 +01:00
Koen Vlaswinkel
483d674da1 Upload sourcemaps as release asset
This will upload the sourcemaps produced as part of the release as a
release asset. This allows the sourcemaps to be downloaded and used
for decoding stack traces beyond the 90 day artifact limit of GitHub
Actions.
2023-02-07 11:06:03 +00:00
Koen Vlaswinkel
cff3d9508e Merge remote-tracking branch 'origin/main' into koesie10/rename-last-commit-to-last-updated 2023-02-07 11:00:31 +00:00
Robert
24e4708477 Merge pull request #2017 from github/robertbrignull/logged_error_telemetry
Introduce showAndLogExceptionWithTelemetry
2023-02-07 10:00:14 +00:00
Koen Vlaswinkel
4f0032d77b Merge pull request #2045 from github/koesie10/link-to-actions-workflow
Add link to Actions workflow when running MRVA
2023-02-07 10:48:22 +01:00
Robert
420fd8d48a Merge branch 'main' into robertbrignull/logged_error_telemetry 2023-02-07 09:42:54 +00:00
Charis Kyriakou
a901369c5e Enable eqeqeq ESLint rule and fix violations (#2043) 2023-02-07 09:36:18 +00:00
Elena Tanasoiu
b05697c327 Merge pull request #2044 from github/elena/remove-lint
Don't lint on `git push`
2023-02-07 09:23:11 +00:00
Koen Vlaswinkel
0cbc9916fc Rename "Last commit" to "Last updated"
Last commit is confusing because it's actually the `updated_at` of the
repository. By renaming it, this will be clearer to users.
2023-02-06 17:54:31 +00:00
Koen Vlaswinkel
f57b811585 Add link to Actions workflow when running MRVA 2023-02-06 17:46:35 +00:00
Elena Tanasoiu
0b9dcb44d9 Don't lint on git push
We run `npm run lint` every time we do a `git push`.

This takes quite a long time, and the lint command has already been run
when we created the commit in the first place.

Could we instead skip this and rely on CI to tell us if we've failed
to address a linting issue?
2023-02-06 17:36:24 +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
740cbc8dee Make onDidChangeConfiguration less strict
It seems like the `onDidChangeConfiguration` is being called multiple
times. It doesn't actually matter that it's being called twice, so we
just need to ensure it's called at least once.
2023-02-06 17:02:18 +00:00