Skip to content

Commit d499ff3

Browse files
Merge branch 'main' into robertbrignull/telemetry
2 parents 4227ff6 + 1806108 commit d499ff3

File tree

165 files changed

+6906
-3218
lines changed

Some content is hidden

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

165 files changed

+6906
-3218
lines changed

.github/workflows/cli-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262

6363
- uses: actions/setup-node@v3
6464
with:
65-
node-version: '18.15.0'
65+
node-version-file: extensions/ql-vscode/.nvmrc
6666
cache: 'npm'
6767
cache-dependency-path: extensions/ql-vscode/package-lock.json
6868

.github/workflows/main.yml

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222

2323
- uses: actions/setup-node@v3
2424
with:
25-
node-version: '18.15.0'
25+
node-version-file: extensions/ql-vscode/.nvmrc
2626
cache: 'npm'
2727
cache-dependency-path: extensions/ql-vscode/package-lock.json
2828

@@ -64,7 +64,7 @@ jobs:
6464

6565
- uses: actions/setup-node@v3
6666
with:
67-
node-version: '18.15.0'
67+
node-version-file: extensions/ql-vscode/.nvmrc
6868
cache: 'npm'
6969
cache-dependency-path: extensions/ql-vscode/package-lock.json
7070

@@ -81,6 +81,8 @@ jobs:
8181
8282
- name: Lint
8383
working-directory: extensions/ql-vscode
84+
env:
85+
NODE_OPTIONS: '--max-old-space-size=4096'
8486
run: |
8587
npm run lint
8688
@@ -99,6 +101,42 @@ jobs:
99101
run: |
100102
npm run find-deadcode
101103
104+
generated:
105+
name: Check generated code
106+
runs-on: ubuntu-latest
107+
steps:
108+
- name: Checkout
109+
uses: actions/checkout@v4
110+
with:
111+
fetch-depth: 1
112+
113+
- uses: actions/setup-node@v3
114+
with:
115+
node-version-file: extensions/ql-vscode/.nvmrc
116+
cache: 'npm'
117+
cache-dependency-path: extensions/ql-vscode/package-lock.json
118+
119+
- name: Install dependencies
120+
working-directory: extensions/ql-vscode
121+
run: |
122+
npm ci
123+
shell: bash
124+
125+
- name: Check that repo is clean
126+
run: |
127+
git diff --exit-code
128+
git diff --exit-code --cached
129+
130+
- name: Generate code
131+
working-directory: extensions/ql-vscode
132+
run: |
133+
npm run generate
134+
135+
- name: Check for changes
136+
run: |
137+
git diff --exit-code
138+
git diff --exit-code --cached
139+
102140
unit-test:
103141
name: Unit Test
104142
runs-on: ${{ matrix.os }}
@@ -113,7 +151,7 @@ jobs:
113151

114152
- uses: actions/setup-node@v3
115153
with:
116-
node-version: '18.15.0'
154+
node-version-file: extensions/ql-vscode/.nvmrc
117155
cache: 'npm'
118156
cache-dependency-path: extensions/ql-vscode/package-lock.json
119157

@@ -147,7 +185,7 @@ jobs:
147185

148186
- uses: actions/setup-node@v3
149187
with:
150-
node-version: '18.15.0'
188+
node-version-file: extensions/ql-vscode/.nvmrc
151189
cache: 'npm'
152190
cache-dependency-path: extensions/ql-vscode/package-lock.json
153191

@@ -215,7 +253,7 @@ jobs:
215253

216254
- uses: actions/setup-node@v3
217255
with:
218-
node-version: '18.15.0'
256+
node-version-file: extensions/ql-vscode/.nvmrc
219257
cache: 'npm'
220258
cache-dependency-path: extensions/ql-vscode/package-lock.json
221259

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222

2323
- uses: actions/setup-node@v3
2424
with:
25-
node-version: '18.15.0'
25+
node-version-file: extensions/ql-vscode/.nvmrc
2626

2727
- name: Install dependencies
2828
run: |

docs/images/about-vscode.png

89.4 KB
Loading

docs/node-version.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Node version
2+
3+
The CodeQL for VS Code extension defines the version of Node.js that it is intended to run with. This Node.js version is used when running most CI and unit tests.
4+
5+
When running in production (i.e. as an extension for a VS Code application) it will use the Node.js version provided by VS Code. This can mean a different Node.js version is used by different users with different versions of VS Code.
6+
We should make sure the CodeQL for VS Code extension works with the Node.js version supplied by all versions of VS Code that we support.
7+
8+
## Checking the version of Node.js supplied by VS Code
9+
10+
You can find this info by seleting "About Visual Studio Code" from the top menu.
11+
12+
![about-vscode](images/about-vscode.png)
13+
14+
## Updating the Node.js version
15+
16+
The following files will need to be updated:
17+
18+
- `extensions/ql-vscode/.nvmrc` - this will enable nvm to automatically switch to the correct Node
19+
version when you're in the project folder. It will also change the Node version the GitHub Actions
20+
workflows use.
21+
- `extensions/ql-vscode/package.json` - the "engines.node: '[VERSION]'" setting
22+
- `extensions/ql-vscode/package.json` - the "@types/node: '[VERSION]'" dependency
23+
24+
Then run `npm install` to update the `extensions/ql-vscode/package-lock.json` file.
25+
26+
## Node.js version used in tests
27+
28+
Unit tests will use whatever version of Node.js is installed locally. In CI this will be the version specified in the workflow.
29+
30+
Integration tests download a copy of VS Code and then will use whatever version of Node.js is provided by VS Code. Our integration tests are currently pinned to an older version of VS Code. See [VS Code version used in tests](./vscode-version.md#vs-code-version-used-in-tests) for more information.

docs/releasing.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@
1111
* New telemetry events are added.
1212
* Deprecation or removal of commands.
1313
* 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.
14-
1. Double-check that the node version we're using matches the one used for VS Code. You can find this info by seleting "About Visual Studio Code" from the top menu. If it doesn't match, you will then need to update the node version in the following files:
15-
* `.nvmrc` - this will enable `nvm` to automatically switch to the correct node version when you're in the project folder
16-
* `.github/workflows/main.yml` - all the "node-version: '[VERSION]'" settings
17-
* `.github/workflows/release.yml` - the "node-version: '[VERSION]'" setting
14+
1. Double-check that the node version we're using matches the one used for VS Code. See the [Node.js version instructions](./node-version.md) for more information.
1815
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.
1916
1. Create a PR for this release:
2017
* 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.

docs/test-plan.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,8 @@ Note that this test requires the feature flag: `codeQL.model.llmGeneration`
173173

174174
#### Test Case 4: Model as dependency
175175

176+
Note that this test requires the feature flag: `codeQL.model.flowGeneration`
177+
176178
1. Click "Model as dependency"
177179
- Check that grouping are now per package (e.g. `com.alipay.sofa.rraft.option` or `com.google.protobuf`)
178180
2. Click "Generate".

docs/vscode-version.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# VS Code version
2+
3+
The CodeQL for VS Code extension specifies the versions of VS Code that it is compatible with. VS Code will only offer to install and upgrade the extension when this version range is satisfied.
4+
5+
## Where is the VS Code version specified
6+
7+
1. Hard limit in [`package.json`](https://github.com/github/vscode-codeql/blob/606bfd7f877d9fffe4ff83b78015ab15f8840b12/extensions/ql-vscode/package.json#L16)
8+
9+
This is the value that VS Code understands and respects. If a user does not meet this version requirement then VS Code will not offer to install the CodeQL for VS Code extension, and if the extension is already installed then it will silently refuse to upgrade the extension.
10+
11+
1. Soft limit in [`extension.ts`](https://github.com/github/vscode-codeql/blob/606bfd7f877d9fffe4ff83b78015ab15f8840b12/extensions/ql-vscode/src/extension.ts#L307)
12+
13+
This value is used internally by the CodeQL for VS Code extension and is used to provide a warning to users without blocking them from installing or upgrading. If the extension detects that this version range is not met it will output a warning message to the user prompting them to upgrade their VS Code version to ge the latest features of CodeQL.
14+
15+
## When to update the VS Code version
16+
17+
Generally we should aim to support as wide a range of VS Code versions as we can, so unless there is a reason to do so we do not update the minimum VS Code version requirement.
18+
Reasons for updating the minimum VS Code version include:
19+
20+
- A new feature is included in VS Code. We may want to ensure that it is available to use so we do not have to provide an alternative code path.
21+
- A breaking change has happened in VS Code, and it is not possible to support both new and old versions.
22+
23+
Also consider what percentage of our users are using each VS Code version. This information is available in our telemetry.
24+
25+
## How to update the VS Code version
26+
27+
To provide a good experience to users, it is recommented to update the `MIN_VERSION` in `extension.ts` first and release, and then update the `vscode` version in `package.json` and release again. By stagging this update across two releases it gives users on older VS Code versions a chance to upgrade before it silently refuses to upgrade them.
28+
29+
## VS Code version used in tests
30+
31+
Our integration tests are currently pinned to use an older version of VS Code due to <https://github.com/github/vscode-codeql/issues/2402>.
32+
This version is specified in [`jest-runner-vscode.config.base.js`](https://github.com/github/vscode-codeql/blob/d93f2b67c84e79737b0ce4bb74e31558b5f5166e/extensions/ql-vscode/test/vscode-tests/jest-runner-vscode.config.base.js#L17).
33+
Until this is resolved this will limit us updating our minimum supported version of VS Code.

extensions/ql-vscode/CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22

33
## [UNRELEASED]
44

5+
- Fix a bug where the query to Find Definitions in database source files would not be cancelled appropriately. [#2885](https://github.com/github/vscode-codeql/pull/2885)
6+
- It is now possible to show the language of query history items using the `%l` specifier in the `codeQL.queryHistory.format` setting. Note that this only works for queries run after this upgrade, and older items will show `unknown` as a language. [#2892](https://github.com/github/vscode-codeql/pull/2892)
7+
- Increase the required version of VS Code to 1.82.0. [#2877](https://github.com/github/vscode-codeql/pull/2877)
8+
- Fix a bug where the query server was restarted twice after configuration changes. [#2884](https://github.com/github/vscode-codeql/pull/2884).
9+
10+
## 1.9.1 - 29 September 2023
11+
12+
- Add warning when using a VS Code version older than 1.82.0. [#2854](https://github.com/github/vscode-codeql/pull/2854)
13+
- Fix a bug when parsing large evaluation log summaries. [#2858](https://github.com/github/vscode-codeql/pull/2858)
14+
- Right-align and format numbers in raw result tables. [#2864](https://github.com/github/vscode-codeql/pull/2864)
15+
- Remove rate limit warning notifications when using Code Search to add repositories to a variant analysis list. [#2812](https://github.com/github/vscode-codeql/pull/2812)
16+
517
## 1.9.0 - 19 September 2023
618

719
- Release the [CodeQL model editor](https://codeql.github.com/docs/codeql/codeql-for-visual-studio-code/using-the-codeql-model-editor) to create CodeQL model packs for Java frameworks. Open the editor using the "CodeQL: Open CodeQL Model Editor (Beta)" command. [#2823](https://github.com/github/vscode-codeql/pull/2823)

extensions/ql-vscode/media/dark/sort-alpha.svg

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)