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.
This is blocking us from merging new PRs so while we figure out
how to fix them, let's skip the tests that are failing on our
`main` branch.
For full context: the tests started failing when a new version of
VSCode was released (1.75.0).
In our tests, we were writing settings files to disk because we were
using the VSCode configuration API which writes settings to files. This
results in flaky tests because concurrency can cause the VSCode API to
misbehave.
This will switch the tests to use a mocked API by default. For some
tests the real implementation is used, but the large majority of tests
is now using a mocked version which only keeps track of the
configuration in memory. This makes it easier to reset the state between
tests since we can just empty out the in-memory configuration.
We have a codespace template which houses our CodeQL tour:
https://github.com/github/codespaces-codeql
This contains a repo with a default databases already loaded
for the user so that they can start writing queries more quickly.
At the moment we're asking the user to manually right click on
the database folder ('codeql-tutorial-database') and set it as
the current database.
We can take this one step further by defining a command that gets
triggered when we arrive at the step for setting up the database.
The command ("codeQL.setDefaultTourDatabase") will build the URI
pointing to our preloaded database and set it as the current one.
We initially considered whether we can re-use the setCurrentDatabase
command and pass the URI of the database from the codespace itself,
but the URI would be hardcoded as:
```
file://0-62/workspaces/codespaces-codeql/codeql-tutorial-database
```
as we can only pass the codeTour extension a command and string
parameters.
This would have been brittle as the filepath for a codespace might
change in the future.
Instead we can define a custom tour command ("setDefaultTourDatabase")
to look at the current workspace folder and build the path to the
database in the CodeQL extension.
Co-authored-by: Shati Patel <shati-patel@github.com>
Instead of using the third party `peter-evans/create-pull-request`
action for creating a PR for releases, we can use the already present
`./.github/actions/create-pr` action which is also used for the PR for
bumping CLI versions.
Instead of having different ESLint configuration files in each
directory which don't seem to inherit the configuration correctly, this
will add `overrides` in the root file.
This will add a welcome view to the database panel which is shown when
the controller repository is not setup. This welcome view will show a
button which can be used to set up the controller repository.
3 seconds is a really long time to wait for downloads since a
significant percentage of downloads will complete within 3 seconds. This
changes the update delay to 500ms which should still give us good
performance, but also make the download feel more responsive.