Skip to content

Commit ae40ae4

Browse files
authored
Merge branch 'main' into koesie10/upgrade-ts-jest
2 parents c023741 + 82e3d48 commit ae40ae4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1791
-112
lines changed

.markdownlint.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"MD013": false,
3+
"MD041": false
4+
}

.vscode/extensions.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
// List of extensions which should be recommended for users of this workspace.
55
"recommendations": [
66
"amodio.tsl-problem-matcher",
7+
"DavidAnson.vscode-markdownlint",
78
"dbaeumer.vscode-eslint",
89
"esbenp.prettier-vscode",
910
"firsttris.vscode-jest-runner",

.vscode/settings.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,30 @@
4343
"TZ": "UTC"
4444
},
4545

46+
// These custom rules are read in extensions/ql-vscode/.markdownlint-cli2.cjs
47+
// but markdownlint only considers that config when linting files in
48+
// extensions/ql-vscode/ or its subfolders. Therefore, we have to explicitly
49+
// load the custom rules here too.
50+
"markdownlint.customRules": [
51+
"./extensions/ql-vscode/node_modules/@github/markdownlint-github/src/rules/no-default-alt-text.js",
52+
"./extensions/ql-vscode/node_modules/@github/markdownlint-github/src/rules/no-generic-link-text.js"
53+
],
54+
55+
// This ensures that the accessibility rule enablement done by github-markdownlint is
56+
// considered by the extension too.
57+
//
58+
// Unfortunately, we can only specify a single extends, so the config here isn't
59+
// identical since it can't also consider @github/markdownlint-github/style/base.json
60+
// That's not as bad as it could be since the full config is considered for anything
61+
// in extensions/ql-vscode/ or its subfolders anyway.
62+
//
63+
// Additional nonfiguration of the default rules is done in .markdownlint.json,
64+
// which is picked up by the extension automatically, and read explicitly in
65+
// .markdownlint-cli2.cjs
66+
"markdownlint.config": {
67+
"extends": "./extensions/ql-vscode/node_modules/@github/markdownlint-github/style/accessibility.json"
68+
},
69+
4670
// These options are used by the `jestrunner.debug` command.
4771
// They are not used by the `jestrunner.run` command.
4872
// After clicking "debug" over a test, continually invoke the

CODE_OF_CONDUCT.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,7 @@ members of the project's leadership.
6767

6868
## Attribution
6969

70-
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71-
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72-
73-
[homepage]: https://www.contributor-covenant.org
70+
This Code of Conduct is adapted from the [Contributor Covenant, version 1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html).
7471

7572
For answers to common questions about this code of conduct, see
76-
https://www.contributor-covenant.org/faq
73+
[the Contributor Covenant FAQ](https://www.contributor-covenant.org/faq). For more about Contributor Covenant, see [the Contributor Covenant website](https://www.contributor-covenant.org).

CONTRIBUTING.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ Please note that this project is released with a [Contributor Code of Conduct][c
2323
Here are a few things you can do that will increase the likelihood of your pull request being accepted:
2424

2525
* Follow the [style guide][style].
26-
* Write tests. Tests that don't require the VS Code API are located [here](extensions/ql-vscode/test). Integration tests that do require the VS Code API are located [here](extensions/ql-vscode/src/vscode-tests).
26+
* Write tests:
27+
* [Tests that don't require the VS Code API are located here](extensions/ql-vscode/test).
28+
* [Integration tests that do require the VS Code API are located here](extensions/ql-vscode/src/vscode-tests).
2729
* Keep your change as focused as possible. If there are multiple changes you would like to make that are not dependent upon each other, consider submitting them as separate pull requests.
2830
* Write a [good commit message](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).
2931

@@ -93,7 +95,7 @@ More information about Storybook can be found inside the **Overview** page once
9395

9496
### Testing
9597

96-
Information about testing can be found [here](./docs/testing.md).
98+
[Information about testing can be found here](./docs/testing.md).
9799

98100
## Resources
99101

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
1717
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
1818
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
1919
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ This project will track new feature development in CodeQL and, whenever appropri
2525

2626
This extension depends on the following two extensions for required functionality. They will be installed automatically when you install VS Code CodeQL.
2727

28-
- [Test Adapter Converter](https://marketplace.visualstudio.com/items?itemName=ms-vscode.test-adapter-converter)
29-
- [Test Explorer UI](https://marketplace.visualstudio.com/items?itemName=hbenl.vscode-test-explorer)
28+
* [Test Adapter Converter](https://marketplace.visualstudio.com/items?itemName=ms-vscode.test-adapter-converter)
29+
* [Test Explorer UI](https://marketplace.visualstudio.com/items?itemName=hbenl.vscode-test-explorer)
3030

3131
## Contributing
3232

docs/releasing.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
* Accumulation of many changes, none of which are individually big enough to warrant a minor bump, but which together are. This does not include changes which are purely internal to the extension, such as refactoring, or which are only available behind a feature flag.
1313
1. Double-check that the node version we're using matches the one used for VS Code. If it doesn't, you will then need to update the node version in the following files:
1414
* `.nvmrc` - this will enable `nvm` to automatically switch to the correct node version when you're in the project folder
15-
* `.github/workflows/main.yml` - all the "node-version: <version>" settings
16-
* `.github/workflows/release.yml` - the "node-version: <version>" setting
15+
* `.github/workflows/main.yml` - all the "node-version: '[VERSION]'" settings
16+
* `.github/workflows/release.yml` - the "node-version: '[VERSION]'" setting
1717
1. Double-check that the extension `package.json` and `package-lock.json` have the version you intend to release. If you are doing a patch release (as opposed to minor or major version) this should already be correct.
1818
1. Create a PR for this release:
1919
* This PR will contain any missing bits from steps 1, 2 and 3. Most of the time, this will just be updating `CHANGELOG.md` with today's date.
@@ -22,23 +22,26 @@
2222
* Create a PR for this branch.
2323
* Wait for the PR to be merged into `main`
2424
1. Switch to `main` branch and pull latest changes
25-
1. Lock the `main` branch.
25+
1. Lock the `main` branch.
2626
* Go to the [branch protection rules for the `main` branch](https://github.com/github/vscode-codeql/settings/branch_protection_rules/16447115)
2727
* Select "Lock branch"
2828
* Click "Save changes"
2929
1. Ensure that no PRs have been merged since the release PR that you merged. If there were, you might need to unlock `main` temporarily and update the CHANGELOG again.
3030
1. Build the extension `npm run build` and install it on your VS Code using "Install from VSIX".
3131
1. Go through [our test plan](./test-plan.md) to ensure that the extension is working as expected.
3232
1. Switch to `main` and add a new tag on the `main` branch with your new version (named after the release), e.g.
33+
3334
```bash
3435
git checkout main
3536
git tag v1.3.6
3637
```
3738

3839
If you've accidentally created a badly named tag, you can delete it via
39-
```bash
40-
git tag -d badly-named-tag
41-
```
40+
41+
```bash
42+
git tag -d badly-named-tag
43+
```
44+
4245
1. Unlock the main branch
4346
* Go to the [branch protection rules for the `main` branch](https://github.com/github/vscode-codeql/settings/branch_protection_rules/16447115)
4447
* Deselect "Lock branch"
@@ -68,7 +71,7 @@
6871
or look at the source if there's any doubt the right code is being shipped.
6972
1. Install the `.vsix` file into your vscode IDE and ensure the extension can load properly. Run a single command (like run query, or add database).
7073
1. Go to the actions tab of the vscode-codeql repository and select the [Release workflow](https://github.com/github/vscode-codeql/actions?query=workflow%3ARelease).
71-
- If there is an authentication failure when publishing, be sure to check that the authentication keys haven't expired. See below.
74+
* If there is an authentication failure when publishing, be sure to check that the authentication keys haven't expired. See below.
7275
1. Approve the deployments of the correct Release workflow. This will automatically publish to Open VSX and VS Code Marketplace.
7376
1. Go to the draft GitHub release in [the releases tab of the repository](https://github.com/github/vscode-codeql/releases), click 'Edit', add some summary description, and publish it.
7477
1. Confirm the new release is marked as the latest release at <https://github.com/github/vscode-codeql/releases>.

docs/test-plan.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ choose to go through some of the Optional Test Cases.
8383
### Test Case 5: MRVA - Canceling a variant analysis run
8484

8585
Run one of the above MRVAs, but cancel it from within VS Code:
86+
8687
- Check that the query is canceled and the query history item is updated.
8788
- Check that the workflow run is also canceled.
8889
- Check that any available results are visible in VS Code.
@@ -231,6 +232,7 @@ with this since it has quite a limited number of actions you can do.
231232

232233
This requires running a MRVA query and seeing the results view.
233234

235+
<!-- markdownlint-disable-next-line MD024 -->
234236
#### Test case 1: When variant analysis state is "pending"
235237

236238
1. Can open a results view

docs/testing.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Any test data you're using (sample projects, config files, etc.) must go in a `t
1818
## Running the tests
1919

2020
Pre-requisites:
21+
2122
1. Run `npm run build`.
2223
2. You will need to have `npm run watch` running in the background.
2324

@@ -29,7 +30,7 @@ Then, from the `extensions/ql-vscode` directory, use the appropriate command to
2930
* View Tests: `npm test:view`
3031
* VSCode integration tests: `npm run test:vscode-integration`
3132

32-
#### CLI integration tests
33+
#### Running CLI integration tests from the terminal
3334

3435
The CLI integration tests require the CodeQL standard libraries in order to run so you will need to clone a local copy of the `github/codeql` repository.
3536

@@ -51,7 +52,7 @@ You will need to run tests using a task from inside of VS Code, under the "Run a
5152
* View Tests: run the _Launch Unit Tests_ task
5253
* VSCode integration tests: run the _Launch Unit Tests - No Workspace_ and _Launch Unit Tests - Minimal Workspace_ tasks
5354

54-
#### CLI integration tests
55+
#### Running CLI integration tests from VSCode
5556

5657
The CLI integration tests require the CodeQL standard libraries in order to run so you will need to clone a local copy of the `github/codeql` repository.
5758

@@ -63,7 +64,7 @@ The CLI integration tests require the CodeQL standard libraries in order to run
6364

6465
## Running a single test
6566

66-
### 1. From the terminal
67+
### 1. Running a single test from the terminal
6768

6869
The easiest way to run a single test is to change the `it` of the test to `it.only` and then run the test command with some additional options
6970
to only run tests for this specific file. For example, to run the test `test/vscode-tests/cli-integration/run-queries.test.ts`:
@@ -78,7 +79,7 @@ You can also use the `--testNamePattern` option to run a specific test within a
7879
npm run test:cli-integration -- --runTestsByPath test/vscode-tests/cli-integration/run-queries.test.ts --testNamePattern "should create a QueryEvaluationInfo"
7980
```
8081

81-
### 2. From VSCode
82+
### 2. Running a single test from VSCode
8283

8384
Alternatively, you can run a single test inside VSCode. To do so, install the [Jest Runner](https://marketplace.visualstudio.com/items?itemName=firsttris.vscode-jest-runner) extension. Then,
8485
you will have quicklinks to run a single test from within test files. To run a single unit or integration test, click the "Run" button. Debugging a single test is currently only supported
@@ -94,7 +95,9 @@ Multi-Repo Variant Analyses (MRVA) rely on the GitHub API. In order to make deve
9495
### Using a pre-recorded test scenario
9596

9697
To run a mock MRVA scenario, follow these steps:
98+
9799
1. Enable the mock GitHub API server by adding the following in your VS Code user settings (which can be found by running the `Preferences: Open User Settings (JSON)` VS Code command):
100+
98101
```json
99102
"codeQL.mockGitHubApiServer": {
100103
"enabled": true
@@ -108,9 +111,11 @@ To run a mock MRVA scenario, follow these steps:
108111
If you want to replay the same scenario you should unload and reload it so requests are replayed from the start.
109112

110113
### Recording a new test scenario
114+
111115
To record a new mock MRVA scenario, follow these steps:
112116

113117
1. Enable the mock GitHub API server by adding the following in your VS Code user settings (which can be found by running the `Preferences: Open User Settings (JSON)` VS Code command):
118+
114119
```json
115120
"codeQL.mockGitHubApiServer": {
116121
"enabled": true

0 commit comments

Comments
 (0)