Skip to content

Commit e8d5029

Browse files
author
Dave Bartolomeo
committed
Merge remote-tracking branch 'origin/main' into dbartol/join-order-temp
2 parents cb514f5 + b8cca29 commit e8d5029

127 files changed

Lines changed: 9483 additions & 1744 deletions

File tree

Some content is hidden

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

.github/workflows/main.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,17 @@ jobs:
118118
- name: Run integration tests (Linux)
119119
if: matrix.os == 'ubuntu-latest'
120120
working-directory: extensions/ql-vscode
121+
env:
122+
VSCODE_CODEQL_GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
121123
run: |
122124
sudo apt-get install xvfb
123125
/usr/bin/xvfb-run npm run integration
124126
125127
- name: Run integration tests (Windows)
126128
if: matrix.os == 'windows-latest'
127129
working-directory: extensions/ql-vscode
130+
env:
131+
VSCODE_CODEQL_GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
128132
run: |
129133
npm run integration
130134
@@ -135,7 +139,7 @@ jobs:
135139
strategy:
136140
matrix:
137141
os: [ubuntu-latest, windows-latest]
138-
version: ['v2.3.3', 'v2.4.6', 'v2.5.9', 'v2.6.3', 'v2.7.6', 'v2.8.5', 'v2.9.0', 'nightly']
142+
version: ['v2.6.3', 'v2.7.6', 'v2.8.5', 'v2.9.4', 'v2.10.2', 'nightly']
139143
env:
140144
CLI_VERSION: ${{ matrix.version }}
141145
NIGHTLY_URL: ${{ needs.find-nightly.outputs.url }}
@@ -168,9 +172,6 @@ jobs:
168172
if [[ "${{ matrix.version }}" == "nightly" ]]
169173
then
170174
REF="codeql-cli/latest"
171-
elif [[ "${{ matrix.version }}" == "v2.2.6" || "${{ matrix.version }}" == "v2.3.3" ]]
172-
then
173-
REF="codeql-cli/v2.4.5"
174175
else
175176
REF="codeql-cli/${{ matrix.version }}"
176177
fi

.vscode/launch.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
// Add a reference to a workspace to open. Eg-
1313
// "${workspaceRoot}/../vscode-codeql-starter/vscode-codeql-starter.code-workspace"
1414
],
15-
"stopOnEntry": false,
1615
"sourceMaps": true,
1716
"outFiles": [
1817
"${workspaceRoot}/extensions/ql-vscode/out/**/*.js",
@@ -46,7 +45,6 @@
4645
"ts-node/register",
4746
"test/pure-tests/**/*.ts"
4847
],
49-
"port": 9229,
5048
"stopOnEntry": false,
5149
"sourceMaps": true,
5250
"console": "integratedTerminal",
@@ -60,10 +58,10 @@
6058
"args": [
6159
"--extensionDevelopmentPath=${workspaceRoot}/extensions/ql-vscode",
6260
"--extensionTestsPath=${workspaceRoot}/extensions/ql-vscode/out/vscode-tests/no-workspace/index",
61+
"--disable-workspace-trust",
6362
"--disable-extensions",
6463
"--disable-gpu"
6564
],
66-
"stopOnEntry": false,
6765
"sourceMaps": true,
6866
"outFiles": [
6967
"${workspaceRoot}/extensions/ql-vscode/out/**/*.js",
@@ -77,11 +75,11 @@
7775
"args": [
7876
"--extensionDevelopmentPath=${workspaceRoot}/extensions/ql-vscode",
7977
"--extensionTestsPath=${workspaceRoot}/extensions/ql-vscode/out/vscode-tests/minimal-workspace/index",
78+
"--disable-workspace-trust",
8079
"--disable-extensions",
8180
"--disable-gpu",
8281
"${workspaceRoot}/extensions/ql-vscode/test/data"
8382
],
84-
"stopOnEntry": false,
8583
"sourceMaps": true,
8684
"outFiles": [
8785
"${workspaceRoot}/extensions/ql-vscode/out/**/*.js",
@@ -95,6 +93,7 @@
9593
"args": [
9694
"--extensionDevelopmentPath=${workspaceRoot}/extensions/ql-vscode",
9795
"--extensionTestsPath=${workspaceRoot}/extensions/ql-vscode/out/vscode-tests/cli-integration/index",
96+
"--disable-workspace-trust",
9897
"--disable-gpu",
9998
"--disable-extension",
10099
"eamodio.gitlens",
@@ -121,7 +120,6 @@
121120
// This option overrides the CLI_VERSION option.
122121
// "CLI_PATH": "${workspaceRoot}/../semmle-code/target/intree/codeql/codeql",
123122
},
124-
"stopOnEntry": false,
125123
"sourceMaps": true,
126124
"outFiles": [
127125
"${workspaceRoot}/extensions/ql-vscode/out/**/*.js",

CONTRIBUTING.md

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ Here are a few things you can do that will increase the likelihood of your pull
2929

3030
## Setting up a local build
3131

32-
Make sure you have installed recent versions of vscode (>= v1.52), node (>=12.16), and npm (>= 7.5.2). Earlier versions will probably work, but we no longer test against them.
32+
Make sure you have installed recent versions of vscode, node, and npm. Check the `engines` block in [`package.json`](https://github.com/github/vscode-codeql/blob/main/extensions/ql-vscode/package.json) file for compatible versions. Earlier versions may work, but we no longer test against them.
33+
34+
To automatically switch to the correct version of node, we recommend using [nvm](https://github.com/nvm-sh/nvm), which will pick-up the node version from `.nvmrc`.
3335

3436
### Installing all packages
3537

@@ -56,8 +58,6 @@ We recommend that you keep `npm run watch` running in the backgound and you only
5658

5759
1. on first checkout
5860
2. whenever any of the non-TypeScript resources have changed
59-
3. on any change to files included in one of the webviews
60-
- **Important**: This is easy to forget. You must explicitly run `npm run build` whenever one of the files in the webview is changed. These are the files in the `src/view` and `src/compare/view` folders.
6161

6262
### Installing the extension
6363

@@ -95,31 +95,56 @@ Running from a terminal, you _must_ set the `TEST_CODEQL_PATH` variable to point
9595

9696
### Running the integration tests
9797

98-
The _Launch Integration Tests - With CLI_ tests require a CLI instance in order to run. There are several environment variables you can use to configure this.
98+
You will need to run CLI tests using a task from inside of VS Code called _Launch Integration Tests - With CLI_.
99+
100+
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.
99101

100-
From inside of VSCode, open the `launch.json` file and in the _Launch Integration Tests - With CLI_ uncomment and change the environment variables appropriate for your purpose.
102+
From inside of VSCode, open the `launch.json` file and in the _Launch Integration Tests - With CLI_ task, uncomment the `"${workspaceRoot}/../codeql"` line. If necessary, replace value with a path to your checkout, and then run the task.
101103

102104
## Releasing (write access required)
103105

104106
1. Double-check the `CHANGELOG.md` contains all desired change comments and has the version to be released with date at the top.
105107
* Go through all recent PRs and make sure they are properly accounted for.
106108
* Make sure all changelog entries have links back to their PR(s) if appropriate.
109+
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:
110+
* `.nvmrc` - this will enable `nvm` to automatically switch to the correct node version when you're in the project folder
111+
* `.github/workflows/main.yml` - all the "node-version: <version>" settings
112+
* `.github/workflows/release.yml` - the "node-version: <version>" setting
107113
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.
108114
1. Create a PR for this release:
109115
* This PR will contain any missing bits from steps 1 and 2. Most of the time, this will just be updating `CHANGELOG.md` with today's date.
110116
* Create a new branch for the release named after the new version. For example: `v1.3.6`
111117
* Create a new commit with a message the same as the branch name.
112118
* Create a PR for this branch.
113119
* Wait for the PR to be merged into `main`
114-
1. Trigger a release build on Actions by adding a new tag on branch `main` named after the release, as above. Note that when you push to upstream, you will need to fully qualify the ref. A command like this will work:
120+
1. Switch to `main` and add a new tag on the `main` branch with your new version (named after the release), e.g.
121+
```bash
122+
git checkout main
123+
git tag v1.3.6
124+
```
125+
126+
If you've accidentally created a badly named tag, you can delete it via
127+
```bash
128+
git tag -d badly-named-tag
129+
```
130+
1. Push the new tag up:
131+
132+
a. If you're using a fork of the repo:
115133

116134
```bash
117135
git push upstream refs/tags/v1.3.6
118136
```
137+
138+
b. If you're working straight in this repo:
139+
140+
```bash
141+
git push origin refs/tags/v1.3.6
142+
```
143+
144+
This will trigger [a release build](https://github.com/github/vscode-codeql/releases) on Actions.
119145
120146
* **IMPORTANT** Make sure you are on the `main` branch and your local checkout is fully updated when you add the tag.
121147
* If you accidentally add the tag to the wrong ref, you can just force push it to the right one later.
122-
123148
1. Monitor the status of the release build in the `Release` workflow in the Actions tab.
124149
1. Download the VSIX from the draft GitHub release at the top of [the releases page](https://github.com/github/vscode-codeql/releases) that is created when the release build finishes.
125150
1. Unzip the `.vsix` and inspect its `package.json` to make sure the version is what you expect,

extensions/ql-vscode/.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v16.13.0

extensions/ql-vscode/CHANGELOG.md

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

33
## [UNRELEASED]
44

5+
## 1.6.9 - 20 July 2022
6+
7+
No user facing changes.
8+
9+
## 1.6.8 - 29 June 2022
10+
11+
- Fix a bug where quick queries cannot be compiled if the core libraries are not in the workspace. [#1411](https://github.com/github/vscode-codeql/pull/1411)
12+
- Fix a bug where quick evaluation of library files would display an error message when using CodeQL CLI v2.10.0. [#1412](https://github.com/github/vscode-codeql/pull/1412)
13+
14+
## 1.6.7 - 15 June 2022
15+
16+
- Prints end-of-query evaluator log summaries to the Query Log. [#1349](https://github.com/github/vscode-codeql/pull/1349)
17+
- Be consistent about casing in Query History menu. [#1369](https://github.com/github/vscode-codeql/pull/1369)
18+
- Fix quoting string columns in exported CSV results. [#1379](https://github.com/github/vscode-codeql/pull/1379)
19+
20+
## 1.6.6 - 17 May 2022
21+
22+
No user facing changes.
23+
524
## 1.6.5 - 25 April 2022
625

726
- Re-enable publishing to open-vsx. [#1285](https://github.com/github/vscode-codeql/pull/1285)

extensions/ql-vscode/gulpfile.ts/textmate.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,14 +219,14 @@ function transformFile(yaml: any) {
219219
}
220220

221221
export function transpileTextMateGrammar() {
222-
return through.obj((file: Vinyl, _encoding: string, callback: Function): void => {
222+
return through.obj((file: Vinyl, _encoding: string, callback: (err: string | null, file: Vinyl | PluginError) => void): void => {
223223
if (file.isNull()) {
224224
callback(null, file);
225225
}
226226
else if (file.isBuffer()) {
227227
const buf: Buffer = file.contents;
228228
const yamlText: string = buf.toString('utf8');
229-
const jsonData: any = jsYaml.safeLoad(yamlText);
229+
const jsonData: any = jsYaml.load(yamlText);
230230
transformFile(jsonData);
231231

232232
file.contents = Buffer.from(JSON.stringify(jsonData, null, 2), 'utf8');

0 commit comments

Comments
 (0)