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.
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.
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)
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.
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.
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.
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.
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?
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.