Compare commits

...

412 Commits

Author SHA1 Message Date
Michael Hohn
495b52661e add viewer configuration
Some checks failed
Run CLI tests / Find Nightly Release (push) Has been cancelled
Run CLI tests / Set Matrix for cli-test (push) Has been cancelled
Run CLI tests / CLI Test (push) Has been cancelled
Run CLI tests / Report failure on the default branch (push) Has been cancelled
Update Node version / Create PR (push) Has been cancelled
Bump CLI version / Build (push) Has been cancelled
Code Scanning - CodeQL / codeql (push) Has been cancelled
Release / Release (push) Has been cancelled
Release / Publish to VS Code Marketplace (push) Has been cancelled
Release / Publish to Open VSX Registry (push) Has been cancelled
2025-08-19 11:24:15 -07:00
Michael Hohn
9a6aa52a40 fix: reconciled status names between server/agent/vscode-codeql
Some checks failed
Update Node version / Create PR (push) Has been cancelled
Run CLI tests / Find Nightly Release (push) Has been cancelled
Run CLI tests / Set Matrix for cli-test (push) Has been cancelled
Run CLI tests / CLI Test (push) Has been cancelled
Run CLI tests / Report failure on the default branch (push) Has been cancelled
Code Scanning - CodeQL / codeql (push) Has been cancelled
Bump CLI version / Build (push) Has been cancelled
2025-03-14 12:45:36 -07:00
Michael Hohn
c106903f01 wip: update settings, push new images 2025-02-20 10:30:22 -08:00
Nicolas Will
d40cda150c WIP: standalone MRVA 2024-07-01 18:20:23 +02:00
Nora
d4df484acb Merge pull request #3645 from github/dependabot/npm_and_yarn/extensions/ql-vscode/storybook-445e2aa325
Bump the storybook group in /extensions/ql-vscode with 12 updates
2024-06-21 09:26:31 +02:00
Nora
3e1d924110 Merge pull request #3646 from github/dependabot/npm_and_yarn/extensions/ql-vscode/testing-library-f694122557
Bump @testing-library/jest-dom from 6.4.5 to 6.4.6 in /extensions/ql-vscode in the testing-library group
2024-06-21 09:26:06 +02:00
dependabot[bot]
cc4666a614 Bump @testing-library/jest-dom
Bumps the testing-library group in /extensions/ql-vscode with 1 update: [@testing-library/jest-dom](https://github.com/testing-library/jest-dom).


Updates `@testing-library/jest-dom` from 6.4.5 to 6.4.6
- [Release notes](https://github.com/testing-library/jest-dom/releases)
- [Changelog](https://github.com/testing-library/jest-dom/blob/main/CHANGELOG.md)
- [Commits](https://github.com/testing-library/jest-dom/compare/v6.4.5...v6.4.6)

---
updated-dependencies:
- dependency-name: "@testing-library/jest-dom"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: testing-library
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-20 13:19:50 +00:00
dependabot[bot]
51906bbcee Bump the storybook group in /extensions/ql-vscode with 12 updates
Bumps the storybook group in /extensions/ql-vscode with 12 updates:

| Package | From | To |
| --- | --- | --- |
| [@storybook/addon-a11y](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/a11y) | `8.1.8` | `8.1.10` |
| [@storybook/addon-actions](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/actions) | `8.1.8` | `8.1.10` |
| [@storybook/addon-essentials](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/essentials) | `8.1.8` | `8.1.10` |
| [@storybook/addon-interactions](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/interactions) | `8.1.8` | `8.1.10` |
| [@storybook/addon-links](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/links) | `8.1.8` | `8.1.10` |
| [@storybook/blocks](https://github.com/storybookjs/storybook/tree/HEAD/code/ui/blocks) | `8.1.8` | `8.1.10` |
| [@storybook/components](https://github.com/storybookjs/storybook/tree/HEAD/code/ui/components) | `8.1.8` | `8.1.10` |
| [@storybook/manager-api](https://github.com/storybookjs/storybook/tree/HEAD/code/lib/manager-api) | `8.1.8` | `8.1.10` |
| [@storybook/react](https://github.com/storybookjs/storybook/tree/HEAD/code/renderers/react) | `8.1.8` | `8.1.10` |
| [@storybook/react-vite](https://github.com/storybookjs/storybook/tree/HEAD/code/frameworks/react-vite) | `8.1.8` | `8.1.10` |
| [@storybook/theming](https://github.com/storybookjs/storybook/tree/HEAD/code/lib/theming) | `8.1.8` | `8.1.10` |
| [storybook](https://github.com/storybookjs/storybook/tree/HEAD/code/lib/cli) | `8.1.8` | `8.1.10` |


Updates `@storybook/addon-a11y` from 8.1.8 to 8.1.10
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.10/code/addons/a11y)

Updates `@storybook/addon-actions` from 8.1.8 to 8.1.10
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.10/code/addons/actions)

Updates `@storybook/addon-essentials` from 8.1.8 to 8.1.10
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.10/code/addons/essentials)

Updates `@storybook/addon-interactions` from 8.1.8 to 8.1.10
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.10/code/addons/interactions)

Updates `@storybook/addon-links` from 8.1.8 to 8.1.10
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.10/code/addons/links)

Updates `@storybook/blocks` from 8.1.8 to 8.1.10
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.10/code/ui/blocks)

Updates `@storybook/components` from 8.1.8 to 8.1.10
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.10/code/ui/components)

Updates `@storybook/manager-api` from 8.1.8 to 8.1.10
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.10/code/lib/manager-api)

Updates `@storybook/react` from 8.1.8 to 8.1.10
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.10/code/renderers/react)

Updates `@storybook/react-vite` from 8.1.8 to 8.1.10
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.10/code/frameworks/react-vite)

Updates `@storybook/theming` from 8.1.8 to 8.1.10
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.10/code/lib/theming)

Updates `storybook` from 8.1.8 to 8.1.10
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.10/code/lib/cli)

---
updated-dependencies:
- dependency-name: "@storybook/addon-a11y"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/addon-actions"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/addon-essentials"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/addon-interactions"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/addon-links"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/blocks"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/components"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/manager-api"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/react"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/react-vite"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/theming"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: storybook
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-20 13:19:27 +00:00
Robert
fcfa6979e2 Merge pull request #3643 from github/robertbrignull/re-enable-short-paths
Re-enable windows 8.3 paths in tests
2024-06-19 10:20:24 +01:00
Andrew Eisenberg
f0783ed274 Merge pull request #3644 from github/dependabot/npm_and_yarn/extensions/ql-vscode/ws-8.17.1
Bump ws from 8.15.0 to 8.17.1 in /extensions/ql-vscode
2024-06-18 14:33:18 -07:00
dependabot[bot]
fe45e00fb3 Bump ws from 8.15.0 to 8.17.1 in /extensions/ql-vscode
Bumps [ws](https://github.com/websockets/ws) from 8.15.0 to 8.17.1.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/8.15.0...8.17.1)

---
updated-dependencies:
- dependency-name: ws
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-18 21:07:21 +00:00
Robert
4a317d33a9 Enable 8.3 paths in unit tests 2024-06-18 10:08:18 +00:00
Robert
ffc7135c1f Revert "Remove short-paths.test.ts"
This reverts commit 10f4b47019.
2024-06-18 09:31:33 +00:00
Nora
c805b48f18 Merge pull request #3640 from github/nora/update-pr-template
Update vscode-codeql PR template
2024-06-17 17:32:50 +02:00
Nora
e1b95c2f7c Merge pull request #3641 from github/nora/update-outdated-readme-links
Update outdated links in VS Code extension README
2024-06-17 16:54:07 +02:00
Nora
481d2f5404 Remove language preference
Co-authored-by: Charis Kyriakou <charisk@users.noreply.github.com>
2024-06-17 09:22:55 +02:00
Nora
15fa23acb4 Fix grammatical issue
Co-authored-by: Charis Kyriakou <charisk@users.noreply.github.com>
2024-06-17 09:22:27 +02:00
Nora
a625d9aabe Update old links 2024-06-14 15:11:47 +00:00
Nora
cd70b19bb3 Add changelog reminder to PR submit guidance 2024-06-14 14:52:58 +00:00
Nora
7a58084df9 Remove checklist but keep a note on the changelog 2024-06-14 14:50:18 +00:00
Nora
916d16126b Merge pull request #3633 from github/github-action/bump-node-version
Bump Node version to v20.9.0
2024-06-14 14:42:54 +02:00
Nora
a5eb915267 Merge pull request #3632 from github/dependabot/npm_and_yarn/extensions/ql-vscode/ts-unused-exports-10.1.0
Bump ts-unused-exports from 10.0.1 to 10.1.0 in /extensions/ql-vscode
2024-06-14 14:42:44 +02:00
dependabot[bot]
a5440ef482 Bump ts-unused-exports from 10.0.1 to 10.1.0 in /extensions/ql-vscode
Bumps [ts-unused-exports](https://github.com/pzavolinsky/ts-unused-exports) from 10.0.1 to 10.1.0.
- [Changelog](https://github.com/pzavolinsky/ts-unused-exports/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pzavolinsky/ts-unused-exports/commits)

---
updated-dependencies:
- dependency-name: ts-unused-exports
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-14 12:26:39 +00:00
Nora
fc86be7687 Merge branch 'main' into github-action/bump-node-version 2024-06-14 12:24:20 +00:00
Nora
f0909a9d67 Merge pull request #3636 from github/github-action/bump-cli
Bump CLI Version to v2.17.5 for integration tests
2024-06-14 14:23:19 +02:00
Nora
40b5b5ba7e Merge pull request #3639 from github/dependabot/npm_and_yarn/extensions/ql-vscode/storybook-f899e8f28b
Bump the storybook group in /extensions/ql-vscode with 12 updates
2024-06-13 15:50:42 +02:00
dependabot[bot]
fa85bcfad6 Bump the storybook group in /extensions/ql-vscode with 12 updates
Bumps the storybook group in /extensions/ql-vscode with 12 updates:

| Package | From | To |
| --- | --- | --- |
| [@storybook/addon-a11y](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/a11y) | `8.1.6` | `8.1.8` |
| [@storybook/addon-actions](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/actions) | `8.1.6` | `8.1.8` |
| [@storybook/addon-essentials](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/essentials) | `8.1.6` | `8.1.8` |
| [@storybook/addon-interactions](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/interactions) | `8.1.6` | `8.1.8` |
| [@storybook/addon-links](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/links) | `8.1.6` | `8.1.8` |
| [@storybook/blocks](https://github.com/storybookjs/storybook/tree/HEAD/code/ui/blocks) | `8.1.6` | `8.1.8` |
| [@storybook/components](https://github.com/storybookjs/storybook/tree/HEAD/code/ui/components) | `8.1.6` | `8.1.8` |
| [@storybook/manager-api](https://github.com/storybookjs/storybook/tree/HEAD/code/lib/manager-api) | `8.1.6` | `8.1.8` |
| [@storybook/react](https://github.com/storybookjs/storybook/tree/HEAD/code/renderers/react) | `8.1.6` | `8.1.8` |
| [@storybook/react-vite](https://github.com/storybookjs/storybook/tree/HEAD/code/frameworks/react-vite) | `8.1.6` | `8.1.8` |
| [@storybook/theming](https://github.com/storybookjs/storybook/tree/HEAD/code/lib/theming) | `8.1.6` | `8.1.8` |
| [storybook](https://github.com/storybookjs/storybook/tree/HEAD/code/lib/cli) | `8.1.6` | `8.1.8` |


Updates `@storybook/addon-a11y` from 8.1.6 to 8.1.8
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.8/code/addons/a11y)

Updates `@storybook/addon-actions` from 8.1.6 to 8.1.8
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.8/code/addons/actions)

Updates `@storybook/addon-essentials` from 8.1.6 to 8.1.8
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.8/code/addons/essentials)

Updates `@storybook/addon-interactions` from 8.1.6 to 8.1.8
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.8/code/addons/interactions)

Updates `@storybook/addon-links` from 8.1.6 to 8.1.8
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.8/code/addons/links)

Updates `@storybook/blocks` from 8.1.6 to 8.1.8
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.8/code/ui/blocks)

Updates `@storybook/components` from 8.1.6 to 8.1.8
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.8/code/ui/components)

Updates `@storybook/manager-api` from 8.1.6 to 8.1.8
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.8/code/lib/manager-api)

Updates `@storybook/react` from 8.1.6 to 8.1.8
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.8/code/renderers/react)

Updates `@storybook/react-vite` from 8.1.6 to 8.1.8
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.8/code/frameworks/react-vite)

Updates `@storybook/theming` from 8.1.6 to 8.1.8
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.8/code/lib/theming)

Updates `storybook` from 8.1.6 to 8.1.8
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.8/code/lib/cli)

---
updated-dependencies:
- dependency-name: "@storybook/addon-a11y"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/addon-actions"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/addon-essentials"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/addon-interactions"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/addon-links"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/blocks"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/components"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/manager-api"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/react"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/react-vite"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/theming"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: storybook
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-13 13:36:58 +00:00
Chris Smowton
dd1b054f26 Merge branch 'main' into github-action/bump-cli 2024-06-13 14:33:51 +01:00
Kasper Svendsen
b96cd6c7e1 Merge pull request #3635 from github/kaspersv/clear-pkg-cache-on-dbscheme-changes
Clear query server package cache on dbscheme edits
2024-06-13 13:47:16 +02:00
Kasper Svendsen
b466d2aa36 Merge branch 'main' into kaspersv/clear-pkg-cache-on-dbscheme-changes 2024-06-13 13:34:18 +02:00
Robert
7f6c1ad7f7 Merge pull request #3637 from github/robertbrignull/remove_path_tests
Remove short-paths.test.ts
2024-06-13 12:26:39 +01:00
Robert
10f4b47019 Remove short-paths.test.ts 2024-06-13 11:03:37 +00:00
github-actions[bot]
b31a769fdd Bump CLI version from v2.17.4 to v2.17.5 for integration tests 2024-06-12 17:18:50 +00:00
github-actions[bot]
c4e2f11372 Bump Node version to v20.9.0 2024-06-12 12:25:46 +00:00
Kasper Svendsen
9494d32144 Clear query server package cache on dbscheme edits 2024-06-11 10:55:42 +00:00
Andrew Eisenberg
12555d90c1 Merge pull request #3630 from github/dependabot/npm_and_yarn/extensions/ql-vscode/storybook-a6a5a2e80a
Bump the storybook group in /extensions/ql-vscode with 13 updates
2024-06-06 09:48:18 -07:00
dependabot[bot]
d46e03b4cc Bump the storybook group in /extensions/ql-vscode with 13 updates
Bumps the storybook group in /extensions/ql-vscode with 13 updates:

| Package | From | To |
| --- | --- | --- |
| [@storybook/addon-a11y](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/a11y) | `8.1.5` | `8.1.6` |
| [@storybook/addon-actions](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/actions) | `8.1.5` | `8.1.6` |
| [@storybook/addon-essentials](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/essentials) | `8.1.5` | `8.1.6` |
| [@storybook/addon-interactions](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/interactions) | `8.1.5` | `8.1.6` |
| [@storybook/addon-links](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/links) | `8.1.5` | `8.1.6` |
| [@storybook/blocks](https://github.com/storybookjs/storybook/tree/HEAD/code/ui/blocks) | `8.1.5` | `8.1.6` |
| [@storybook/components](https://github.com/storybookjs/storybook/tree/HEAD/code/ui/components) | `8.1.5` | `8.1.6` |
| [@storybook/csf](https://github.com/ComponentDriven/csf) | `0.1.7` | `0.1.8` |
| [@storybook/manager-api](https://github.com/storybookjs/storybook/tree/HEAD/code/lib/manager-api) | `8.1.5` | `8.1.6` |
| [@storybook/react](https://github.com/storybookjs/storybook/tree/HEAD/code/renderers/react) | `8.1.5` | `8.1.6` |
| [@storybook/react-vite](https://github.com/storybookjs/storybook/tree/HEAD/code/frameworks/react-vite) | `8.1.5` | `8.1.6` |
| [@storybook/theming](https://github.com/storybookjs/storybook/tree/HEAD/code/lib/theming) | `8.1.5` | `8.1.6` |
| [storybook](https://github.com/storybookjs/storybook/tree/HEAD/code/lib/cli) | `8.1.5` | `8.1.6` |


Updates `@storybook/addon-a11y` from 8.1.5 to 8.1.6
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.6/code/addons/a11y)

Updates `@storybook/addon-actions` from 8.1.5 to 8.1.6
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.6/code/addons/actions)

Updates `@storybook/addon-essentials` from 8.1.5 to 8.1.6
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.6/code/addons/essentials)

Updates `@storybook/addon-interactions` from 8.1.5 to 8.1.6
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.6/code/addons/interactions)

Updates `@storybook/addon-links` from 8.1.5 to 8.1.6
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.6/code/addons/links)

Updates `@storybook/blocks` from 8.1.5 to 8.1.6
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.6/code/ui/blocks)

Updates `@storybook/components` from 8.1.5 to 8.1.6
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.6/code/ui/components)

Updates `@storybook/csf` from 0.1.7 to 0.1.8
- [Release notes](https://github.com/ComponentDriven/csf/releases)
- [Changelog](https://github.com/ComponentDriven/csf/blob/v0.1.8/CHANGELOG.md)
- [Commits](https://github.com/ComponentDriven/csf/compare/v0.1.7...v0.1.8)

Updates `@storybook/manager-api` from 8.1.5 to 8.1.6
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.6/code/lib/manager-api)

Updates `@storybook/react` from 8.1.5 to 8.1.6
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.6/code/renderers/react)

Updates `@storybook/react-vite` from 8.1.5 to 8.1.6
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.6/code/frameworks/react-vite)

Updates `@storybook/theming` from 8.1.5 to 8.1.6
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.6/code/lib/theming)

Updates `storybook` from 8.1.5 to 8.1.6
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.6/code/lib/cli)

---
updated-dependencies:
- dependency-name: "@storybook/addon-a11y"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/addon-actions"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/addon-essentials"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/addon-interactions"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/addon-links"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/blocks"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/components"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/csf"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/manager-api"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/react"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/react-vite"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/theming"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: storybook
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-06 14:20:38 +00:00
dependabot[bot]
f0e2285122 Bump @testing-library/react (#3631)
Bumps the testing-library group in /extensions/ql-vscode with 1 update: [@testing-library/react](https://github.com/testing-library/react-testing-library).


Updates `@testing-library/react` from 15.0.7 to 16.0.0
- [Release notes](https://github.com/testing-library/react-testing-library/releases)
- [Changelog](https://github.com/testing-library/react-testing-library/blob/main/CHANGELOG.md)
- [Commits](https://github.com/testing-library/react-testing-library/compare/v15.0.7...v16.0.0)

---
updated-dependencies:
- dependency-name: "@testing-library/react"
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: testing-library
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-06 15:16:43 +01:00
Koen Vlaswinkel
f4d0d23170 Merge pull request #3629 from github/github-action/bump-cli
Bump CLI Version to v2.17.4 for integration tests
2024-06-04 10:06:27 +02:00
github-actions[bot]
513fb65560 Bump CLI version from v2.17.3 to v2.17.4 for integration tests 2024-06-03 16:10:31 +00:00
Koen Vlaswinkel
7d353ced9b Merge pull request #3626 from github/dependabot/npm_and_yarn/extensions/ql-vscode/storybook-d4cb5c71ab
Bump the storybook group in /extensions/ql-vscode with 12 updates
2024-05-31 10:09:46 +02:00
dependabot[bot]
be3506d987 Bump the storybook group in /extensions/ql-vscode with 12 updates
Bumps the storybook group in /extensions/ql-vscode with 12 updates:

| Package | From | To |
| --- | --- | --- |
| [@storybook/addon-a11y](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/a11y) | `8.1.3` | `8.1.5` |
| [@storybook/addon-actions](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/actions) | `8.1.3` | `8.1.5` |
| [@storybook/addon-essentials](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/essentials) | `8.1.3` | `8.1.5` |
| [@storybook/addon-interactions](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/interactions) | `8.1.3` | `8.1.5` |
| [@storybook/addon-links](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/links) | `8.1.3` | `8.1.5` |
| [@storybook/blocks](https://github.com/storybookjs/storybook/tree/HEAD/code/ui/blocks) | `8.1.3` | `8.1.5` |
| [@storybook/components](https://github.com/storybookjs/storybook/tree/HEAD/code/ui/components) | `8.1.3` | `8.1.5` |
| [@storybook/manager-api](https://github.com/storybookjs/storybook/tree/HEAD/code/lib/manager-api) | `8.1.3` | `8.1.5` |
| [@storybook/react](https://github.com/storybookjs/storybook/tree/HEAD/code/renderers/react) | `8.1.3` | `8.1.5` |
| [@storybook/react-vite](https://github.com/storybookjs/storybook/tree/HEAD/code/frameworks/react-vite) | `8.1.3` | `8.1.5` |
| [@storybook/theming](https://github.com/storybookjs/storybook/tree/HEAD/code/lib/theming) | `8.1.3` | `8.1.5` |
| [storybook](https://github.com/storybookjs/storybook/tree/HEAD/code/lib/cli) | `8.1.3` | `8.1.5` |


Updates `@storybook/addon-a11y` from 8.1.3 to 8.1.5
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.5/code/addons/a11y)

Updates `@storybook/addon-actions` from 8.1.3 to 8.1.5
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.5/code/addons/actions)

Updates `@storybook/addon-essentials` from 8.1.3 to 8.1.5
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.5/code/addons/essentials)

Updates `@storybook/addon-interactions` from 8.1.3 to 8.1.5
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.5/code/addons/interactions)

Updates `@storybook/addon-links` from 8.1.3 to 8.1.5
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.5/code/addons/links)

Updates `@storybook/blocks` from 8.1.3 to 8.1.5
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.5/code/ui/blocks)

Updates `@storybook/components` from 8.1.3 to 8.1.5
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.5/code/ui/components)

Updates `@storybook/manager-api` from 8.1.3 to 8.1.5
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.5/code/lib/manager-api)

Updates `@storybook/react` from 8.1.3 to 8.1.5
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.5/code/renderers/react)

Updates `@storybook/react-vite` from 8.1.3 to 8.1.5
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.5/code/frameworks/react-vite)

Updates `@storybook/theming` from 8.1.3 to 8.1.5
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.5/code/lib/theming)

Updates `storybook` from 8.1.3 to 8.1.5
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.5/code/lib/cli)

---
updated-dependencies:
- dependency-name: "@storybook/addon-a11y"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/addon-actions"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/addon-essentials"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/addon-interactions"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/addon-links"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/blocks"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/components"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/manager-api"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/react"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/react-vite"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/theming"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: storybook
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-30 14:06:20 +00:00
dependabot[bot]
3fa6304050 Bump @babel/core from 7.24.4 to 7.24.6 in /extensions/ql-vscode (#3628)
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.24.4 to 7.24.6.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.24.6/packages/babel-core)

---
updated-dependencies:
- dependency-name: "@babel/core"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-30 07:03:18 -07:00
dependabot[bot]
bb40e5bcad Bump ts-jest from 29.1.2 to 29.1.4 in /extensions/ql-vscode (#3627)
Bumps [ts-jest](https://github.com/kulshekhar/ts-jest) from 29.1.2 to 29.1.4.
- [Release notes](https://github.com/kulshekhar/ts-jest/releases)
- [Changelog](https://github.com/kulshekhar/ts-jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/kulshekhar/ts-jest/compare/v29.1.2...v29.1.4)

---
updated-dependencies:
- dependency-name: ts-jest
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-30 07:02:48 -07:00
Koen Vlaswinkel
e2a8ae318b Merge pull request #3625 from github/koesie10/update-test-plan
Update test plan
2024-05-29 11:46:43 +02:00
Koen Vlaswinkel
79867e2f9d Merge pull request #3624 from github/version/bump-to-v1.13.2
Bump version to v1.13.2
2024-05-29 11:46:29 +02:00
Koen Vlaswinkel
1bc13d70ce Update test plan
This fixes the model pack query to account for the new MAD ID in the
`sinkModel` and removes the LLM section.
2024-05-29 11:22:04 +02:00
github-actions[bot]
0bd359997d Bump version to v1.13.2 2024-05-29 09:17:05 +00:00
Koen Vlaswinkel
28a7d1cf34 Merge pull request #3623 from github/v1.13.1
v1.13.1
2024-05-29 11:15:50 +02:00
Koen Vlaswinkel
1572c095ca v1.13.1
Some checks failed
Release / Release (push) Has been cancelled
Release / Publish to VS Code Marketplace (push) Has been cancelled
Release / Publish to Open VSX Registry (push) Has been cancelled
2024-05-29 10:43:56 +02:00
Nick Rolfe
83df05e731 Merge pull request #3622 from github/nickrolfe/eval-log-progress
Report progress for post-evaluation actions
2024-05-28 17:38:56 +01:00
Nick Rolfe
b43b1d4c8e Update changelog for progress reporting on post-evaluation steps 2024-05-28 11:06:00 +00:00
Nick Rolfe
79ff9e0378 Report progress for post-evaluation actions
Generating and parsing log summaries can be quite slow, so we should update the progress window with messages about what's being worked on.
2024-05-28 11:05:34 +00:00
Andrew Eisenberg
d7a82cc686 Merge pull request #3616 from github/aeisenberg/flush-cache-on-db-remove
Fix bug with reimporting test cases
2024-05-23 08:55:23 -07:00
Andrew Eisenberg
39ad5b28c7 Fix typo in comment
Co-authored-by: Koen Vlaswinkel <koesie10@users.noreply.github.com>
2024-05-23 08:43:03 -07:00
Robert
68c159f1fe Merge pull request #3619 from github/dependabot/npm_and_yarn/extensions/ql-vscode/storybook-23a9a17fad
Bump the storybook group in /extensions/ql-vscode with 12 updates
2024-05-23 15:55:29 +01:00
Robert
355a6fc552 Merge pull request #3621 from github/dependabot/npm_and_yarn/extensions/ql-vscode/markdownlint-cli2-formatter-pretty-0.0.6
Bump markdownlint-cli2-formatter-pretty from 0.0.5 to 0.0.6 in /extensions/ql-vscode
2024-05-23 14:52:49 +01:00
dependabot[bot]
6f54bebe35 Bump markdownlint-cli2-formatter-pretty in /extensions/ql-vscode
Bumps [markdownlint-cli2-formatter-pretty](https://github.com/DavidAnson/markdownlint-cli2) from 0.0.5 to 0.0.6.
- [Changelog](https://github.com/DavidAnson/markdownlint-cli2/blob/main/CHANGELOG.md)
- [Commits](https://github.com/DavidAnson/markdownlint-cli2/compare/v0.0.5...v0.0.6)

---
updated-dependencies:
- dependency-name: markdownlint-cli2-formatter-pretty
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-23 13:40:16 +00:00
dependabot[bot]
bea108a412 Bump the storybook group in /extensions/ql-vscode with 12 updates
Bumps the storybook group in /extensions/ql-vscode with 12 updates:

| Package | From | To |
| --- | --- | --- |
| [@storybook/addon-a11y](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/a11y) | `8.1.1` | `8.1.3` |
| [@storybook/addon-actions](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/actions) | `8.1.1` | `8.1.3` |
| [@storybook/addon-essentials](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/essentials) | `8.1.1` | `8.1.3` |
| [@storybook/addon-interactions](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/interactions) | `8.1.1` | `8.1.3` |
| [@storybook/addon-links](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/links) | `8.1.1` | `8.1.3` |
| [@storybook/blocks](https://github.com/storybookjs/storybook/tree/HEAD/code/ui/blocks) | `8.1.1` | `8.1.3` |
| [@storybook/components](https://github.com/storybookjs/storybook/tree/HEAD/code/ui/components) | `8.1.1` | `8.1.3` |
| [@storybook/manager-api](https://github.com/storybookjs/storybook/tree/HEAD/code/lib/manager-api) | `8.1.1` | `8.1.3` |
| [@storybook/react](https://github.com/storybookjs/storybook/tree/HEAD/code/renderers/react) | `8.1.1` | `8.1.3` |
| [@storybook/react-vite](https://github.com/storybookjs/storybook/tree/HEAD/code/frameworks/react-vite) | `8.1.1` | `8.1.3` |
| [@storybook/theming](https://github.com/storybookjs/storybook/tree/HEAD/code/lib/theming) | `8.1.1` | `8.1.3` |
| [storybook](https://github.com/storybookjs/storybook/tree/HEAD/code/lib/cli) | `8.1.1` | `8.1.3` |


Updates `@storybook/addon-a11y` from 8.1.1 to 8.1.3
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.3/code/addons/a11y)

Updates `@storybook/addon-actions` from 8.1.1 to 8.1.3
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.3/code/addons/actions)

Updates `@storybook/addon-essentials` from 8.1.1 to 8.1.3
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.3/code/addons/essentials)

Updates `@storybook/addon-interactions` from 8.1.1 to 8.1.3
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.3/code/addons/interactions)

Updates `@storybook/addon-links` from 8.1.1 to 8.1.3
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.3/code/addons/links)

Updates `@storybook/blocks` from 8.1.1 to 8.1.3
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.3/code/ui/blocks)

Updates `@storybook/components` from 8.1.1 to 8.1.3
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.3/code/ui/components)

Updates `@storybook/manager-api` from 8.1.1 to 8.1.3
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.3/code/lib/manager-api)

Updates `@storybook/react` from 8.1.1 to 8.1.3
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.3/code/renderers/react)

Updates `@storybook/react-vite` from 8.1.1 to 8.1.3
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.3/code/frameworks/react-vite)

Updates `@storybook/theming` from 8.1.1 to 8.1.3
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.3/code/lib/theming)

Updates `storybook` from 8.1.1 to 8.1.3
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.3/code/lib/cli)

---
updated-dependencies:
- dependency-name: "@storybook/addon-a11y"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/addon-actions"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/addon-essentials"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/addon-interactions"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/addon-links"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/blocks"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/components"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/manager-api"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/react"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/react-vite"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/theming"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: storybook
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-23 13:39:25 +00:00
Andrew Eisenberg
088d2fa91e Fix failing tests
Also:
- Address comments in PR
- Add changelog note
2024-05-22 23:05:12 +00:00
Andrew Eisenberg
6c92a5b800 Merge remote-tracking branch 'upstream/main' into aeisenberg/flush-cache-on-db-remove 2024-05-22 22:42:54 +00:00
Robert
db0d062443 Merge pull request #3618 from github/robertbrignull/delete-ghec-dr-flag
Remove the enableGhecDr flag
2024-05-22 11:47:11 +01:00
Robert
673ea13af8 Remove the enableGhecDr flag 2024-05-22 10:42:47 +01:00
Koen Vlaswinkel
2208b42485 Merge pull request #3615 from github/github-action/bump-cli
Bump CLI Version to v2.17.3 for integration tests
2024-05-21 10:47:38 +02:00
Andrew Eisenberg
376d6b75d6 Fix bug with reimporting test cases
When re-importing a test database, if the source archive for that
database is not in the workspace, then old source code will be seen when
inspected.

To reproduce:

1. Run a ql test file with a failure (I'm using a javascript DB).
2. Right click and import on the db that sticks around.
3. Change the JS source file for the test.
4. Re-run and still have a failure.
5. Re-import the database
6. Run the query under test
7. Click on a result item
8. **BUG:** The source code is old

The problem is that the source archive cache is not being flushed in
this case. I added a case to flush the source archive when the archive
was imported into the workspace as a folder, but not when the archive is
external.

The fix is to listen for database remove events in the archive
filesystem provider and flush the associated database source
archive.

There is a complication:

The database remove event didn't emit the removed database. This is
because the only place that consumed the event didn't need it.

To get around this, I changed the structure of the events. I added a
new `fullRefresh` boolean. If true, then the original database change
handler will ensure the entire tree is refreshed. If false, only the
selected database.
2024-05-17 23:10:56 +00:00
dependabot[bot]
d8a7dcd7d2 Bump react-dom and @types/react-dom in /extensions/ql-vscode (#3614)
Bumps [react-dom](https://github.com/facebook/react/tree/HEAD/packages/react-dom) and [@types/react-dom](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react-dom). These dependencies needed to be updated together.

Updates `react-dom` from 18.2.0 to 18.3.1
- [Release notes](https://github.com/facebook/react/releases)
- [Changelog](https://github.com/facebook/react/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/react/commits/v18.3.1/packages/react-dom)

Updates `@types/react-dom` from 18.2.18 to 18.3.0
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react-dom)

---
updated-dependencies:
- dependency-name: react-dom
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: "@types/react-dom"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-17 15:53:59 -07:00
github-actions[bot]
580257f024 Bump CLI version from v2.17.2 to v2.17.3 for integration tests 2024-05-17 17:05:04 +00:00
dependabot[bot]
233cb1cd41 Bump semver from 7.6.0 to 7.6.2 in /extensions/ql-vscode (#3613)
Bumps [semver](https://github.com/npm/node-semver) from 7.6.0 to 7.6.2.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/main/CHANGELOG.md)
- [Commits](https://github.com/npm/node-semver/compare/v7.6.0...v7.6.2)

---
updated-dependencies:
- dependency-name: semver
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-16 09:34:12 -07:00
dependabot[bot]
d9fcfa0374 Bump the storybook group in /extensions/ql-vscode with 12 updates (#3612)
Bumps the storybook group in /extensions/ql-vscode with 12 updates:

| Package | From | To |
| --- | --- | --- |
| [@storybook/addon-a11y](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/a11y) | `8.0.10` | `8.1.1` |
| [@storybook/addon-actions](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/actions) | `8.0.10` | `8.1.1` |
| [@storybook/addon-essentials](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/essentials) | `8.0.10` | `8.1.1` |
| [@storybook/addon-interactions](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/interactions) | `8.0.10` | `8.1.1` |
| [@storybook/addon-links](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/links) | `8.0.10` | `8.1.1` |
| [@storybook/blocks](https://github.com/storybookjs/storybook/tree/HEAD/code/ui/blocks) | `8.0.10` | `8.1.1` |
| [@storybook/components](https://github.com/storybookjs/storybook/tree/HEAD/code/ui/components) | `8.0.10` | `8.1.1` |
| [@storybook/manager-api](https://github.com/storybookjs/storybook/tree/HEAD/code/lib/manager-api) | `8.0.10` | `8.1.1` |
| [@storybook/react](https://github.com/storybookjs/storybook/tree/HEAD/code/renderers/react) | `8.0.10` | `8.1.1` |
| [@storybook/react-vite](https://github.com/storybookjs/storybook/tree/HEAD/code/frameworks/react-vite) | `8.0.10` | `8.1.1` |
| [@storybook/theming](https://github.com/storybookjs/storybook/tree/HEAD/code/lib/theming) | `8.0.10` | `8.1.1` |
| [storybook](https://github.com/storybookjs/storybook/tree/HEAD/code/lib/cli) | `8.0.10` | `8.1.1` |


Updates `@storybook/addon-a11y` from 8.0.10 to 8.1.1
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.1/code/addons/a11y)

Updates `@storybook/addon-actions` from 8.0.10 to 8.1.1
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.1/code/addons/actions)

Updates `@storybook/addon-essentials` from 8.0.10 to 8.1.1
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.1/code/addons/essentials)

Updates `@storybook/addon-interactions` from 8.0.10 to 8.1.1
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.1/code/addons/interactions)

Updates `@storybook/addon-links` from 8.0.10 to 8.1.1
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.1/code/addons/links)

Updates `@storybook/blocks` from 8.0.10 to 8.1.1
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.1/code/ui/blocks)

Updates `@storybook/components` from 8.0.10 to 8.1.1
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.1/code/ui/components)

Updates `@storybook/manager-api` from 8.0.10 to 8.1.1
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.1/code/lib/manager-api)

Updates `@storybook/react` from 8.0.10 to 8.1.1
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.1/code/renderers/react)

Updates `@storybook/react-vite` from 8.0.10 to 8.1.1
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.1/code/frameworks/react-vite)

Updates `@storybook/theming` from 8.0.10 to 8.1.1
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.1/code/lib/theming)

Updates `storybook` from 8.0.10 to 8.1.1
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.1.1/code/lib/cli)

---
updated-dependencies:
- dependency-name: "@storybook/addon-a11y"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: storybook
- dependency-name: "@storybook/addon-actions"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: storybook
- dependency-name: "@storybook/addon-essentials"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: storybook
- dependency-name: "@storybook/addon-interactions"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: storybook
- dependency-name: "@storybook/addon-links"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: storybook
- dependency-name: "@storybook/blocks"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: storybook
- dependency-name: "@storybook/components"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: storybook
- dependency-name: "@storybook/manager-api"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: storybook
- dependency-name: "@storybook/react"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: storybook
- dependency-name: "@storybook/react-vite"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: storybook
- dependency-name: "@storybook/theming"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: storybook
- dependency-name: storybook
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: storybook
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-16 09:33:50 -07:00
Ben Ahmady
1dc48b3309 Update links in VS Marketplace README (#3611) 2024-05-15 08:52:15 +00:00
Angela P Wen
2babb0b106 Handle exit and error events for query server child processes (#3610) 2024-05-14 18:48:29 -07:00
Koen Vlaswinkel
247df2e1f9 Merge pull request #3607 from github/koesie10/ghec-dr-variant-analysis
Add GHEC-DR support
2024-05-14 10:40:28 +02:00
Koen Vlaswinkel
ba9007e426 Fix typo in comment
Co-authored-by: Robert <robertbrignull@github.com>
2024-05-14 09:42:04 +02:00
Koen Vlaswinkel
616b613fbd Merge pull request #3608 from github/koesie10/fix-supported-cli-version-warning
Fix incorrect supported CLI version warning
2024-05-13 16:57:50 +02:00
Koen Vlaswinkel
47ae0fe9f5 Fix incorrect supported CLI version warning 2024-05-13 16:44:03 +02:00
Nora
9d6b4e8e5a Merge pull request #3603 from github/dependabot/npm_and_yarn/extensions/ql-vscode/storybook-7db07c6d5e
Bump the storybook group in /extensions/ql-vscode with 13 updates
2024-05-13 16:32:04 +02:00
Nora
5ae70696a8 Merge pull request #3604 from github/dependabot/npm_and_yarn/extensions/ql-vscode/testing-library-66b9683d1a
Bump the testing-library group in /extensions/ql-vscode with 2 updates
2024-05-13 16:30:18 +02:00
dependabot[bot]
712dd525ee Bump the storybook group in /extensions/ql-vscode with 13 updates
Bumps the storybook group in /extensions/ql-vscode with 13 updates:

| Package | From | To |
| --- | --- | --- |
| [@storybook/addon-a11y](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/a11y) | `8.0.9` | `8.0.10` |
| [@storybook/addon-actions](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/actions) | `8.0.9` | `8.0.10` |
| [@storybook/addon-essentials](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/essentials) | `8.0.9` | `8.0.10` |
| [@storybook/addon-interactions](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/interactions) | `8.0.9` | `8.0.10` |
| [@storybook/addon-links](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/links) | `8.0.9` | `8.0.10` |
| [@storybook/blocks](https://github.com/storybookjs/storybook/tree/HEAD/code/ui/blocks) | `8.0.9` | `8.0.10` |
| [@storybook/components](https://github.com/storybookjs/storybook/tree/HEAD/code/ui/components) | `8.0.9` | `8.0.10` |
| [@storybook/csf](https://github.com/ComponentDriven/csf) | `0.1.6` | `0.1.7` |
| [@storybook/manager-api](https://github.com/storybookjs/storybook/tree/HEAD/code/lib/manager-api) | `8.0.9` | `8.0.10` |
| [@storybook/react](https://github.com/storybookjs/storybook/tree/HEAD/code/renderers/react) | `8.0.9` | `8.0.10` |
| [@storybook/react-vite](https://github.com/storybookjs/storybook/tree/HEAD/code/frameworks/react-vite) | `8.0.9` | `8.0.10` |
| [@storybook/theming](https://github.com/storybookjs/storybook/tree/HEAD/code/lib/theming) | `8.0.9` | `8.0.10` |
| [storybook](https://github.com/storybookjs/storybook/tree/HEAD/code/lib/cli) | `8.0.9` | `8.0.10` |


Updates `@storybook/addon-a11y` from 8.0.9 to 8.0.10
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.10/code/addons/a11y)

Updates `@storybook/addon-actions` from 8.0.9 to 8.0.10
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.10/code/addons/actions)

Updates `@storybook/addon-essentials` from 8.0.9 to 8.0.10
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.10/code/addons/essentials)

Updates `@storybook/addon-interactions` from 8.0.9 to 8.0.10
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.10/code/addons/interactions)

Updates `@storybook/addon-links` from 8.0.9 to 8.0.10
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.10/code/addons/links)

Updates `@storybook/blocks` from 8.0.9 to 8.0.10
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.10/code/ui/blocks)

Updates `@storybook/components` from 8.0.9 to 8.0.10
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.10/code/ui/components)

Updates `@storybook/csf` from 0.1.6 to 0.1.7
- [Release notes](https://github.com/ComponentDriven/csf/releases)
- [Changelog](https://github.com/ComponentDriven/csf/blob/v0.1.7/CHANGELOG.md)
- [Commits](https://github.com/ComponentDriven/csf/compare/v0.1.6...v0.1.7)

Updates `@storybook/manager-api` from 8.0.9 to 8.0.10
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.10/code/lib/manager-api)

Updates `@storybook/react` from 8.0.9 to 8.0.10
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.10/code/renderers/react)

Updates `@storybook/react-vite` from 8.0.9 to 8.0.10
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.10/code/frameworks/react-vite)

Updates `@storybook/theming` from 8.0.9 to 8.0.10
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.10/code/lib/theming)

Updates `storybook` from 8.0.9 to 8.0.10
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.10/code/lib/cli)

---
updated-dependencies:
- dependency-name: "@storybook/addon-a11y"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/addon-actions"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/addon-essentials"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/addon-interactions"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/addon-links"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/blocks"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/components"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/csf"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/manager-api"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/react"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/react-vite"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/theming"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: storybook
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-13 14:19:37 +00:00
Nora
fdc5645928 Merge pull request #3606 from github/dependabot/npm_and_yarn/extensions/ql-vscode/eslint-plugin-github-4.10.2
Bump eslint-plugin-github from 4.10.1 to 4.10.2 in /extensions/ql-vscode
2024-05-13 16:18:42 +02:00
dependabot[bot]
5c81c0e9bf Bump the testing-library group in /extensions/ql-vscode with 2 updates
Bumps the testing-library group in /extensions/ql-vscode with 2 updates: [@testing-library/jest-dom](https://github.com/testing-library/jest-dom) and [@testing-library/react](https://github.com/testing-library/react-testing-library).


Updates `@testing-library/jest-dom` from 6.4.2 to 6.4.5
- [Release notes](https://github.com/testing-library/jest-dom/releases)
- [Changelog](https://github.com/testing-library/jest-dom/blob/main/CHANGELOG.md)
- [Commits](https://github.com/testing-library/jest-dom/compare/v6.4.2...v6.4.5)

Updates `@testing-library/react` from 15.0.6 to 15.0.7
- [Release notes](https://github.com/testing-library/react-testing-library/releases)
- [Changelog](https://github.com/testing-library/react-testing-library/blob/main/CHANGELOG.md)
- [Commits](https://github.com/testing-library/react-testing-library/compare/v15.0.6...v15.0.7)

---
updated-dependencies:
- dependency-name: "@testing-library/jest-dom"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: testing-library
- dependency-name: "@testing-library/react"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: testing-library
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-13 14:17:39 +00:00
dependabot[bot]
0e07e5e3eb Bump eslint-plugin-github from 4.10.1 to 4.10.2 in /extensions/ql-vscode
Bumps [eslint-plugin-github](https://github.com/github/eslint-plugin-github) from 4.10.1 to 4.10.2.
- [Release notes](https://github.com/github/eslint-plugin-github/releases)
- [Commits](https://github.com/github/eslint-plugin-github/compare/v4.10.1...v4.10.2)

---
updated-dependencies:
- dependency-name: eslint-plugin-github
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-13 14:05:08 +00:00
Koen Vlaswinkel
c90acdb4e1 Merge pull request #3600 from github/github-action/bump-cli
Bump CLI Version to v2.17.2 for integration tests
2024-05-13 13:17:54 +02:00
Koen Vlaswinkel
dad37f202d Merge pull request #3599 from github/koesie10/upgrade-publish-vsce
Use @vscode/vsce when publishing the extension
2024-05-13 13:04:42 +02:00
Koen Vlaswinkel
1f937ad208 Do not import from config in unit tests 2024-05-13 12:15:27 +02:00
Koen Vlaswinkel
086d8e2104 Update prompts to use GHEC-DR URL 2024-05-13 11:19:31 +02:00
Koen Vlaswinkel
c2ddd680c1 Use GHEC-DR URL in Octokit instance 2024-05-13 11:19:31 +02:00
Koen Vlaswinkel
9a14896a4e Use GHE auth provider if GHEC-DR URI is set 2024-05-13 11:19:31 +02:00
Koen Vlaswinkel
871fc0b817 Use GHEC-DR URL in file blob URL 2024-05-13 11:19:31 +02:00
Koen Vlaswinkel
ca092a1623 Use GHEC-DR URL in Actions workflow run URL 2024-05-13 11:19:30 +02:00
Koen Vlaswinkel
529bbe3ffa Handle GHEC-DR repository URLs 2024-05-13 11:19:30 +02:00
Koen Vlaswinkel
31b2d24ca9 Update custom errors to use GHEC-DR URL 2024-05-13 11:19:30 +02:00
github-actions[bot]
f54cace05b Bump CLI version from v2.17.1 to v2.17.2 for integration tests 2024-05-07 11:22:36 +00:00
Koen Vlaswinkel
f773f9f675 Use @vscode/vsce when publishing the extension 2024-05-06 15:31:05 +02:00
dependabot[bot]
67aa216ea1 Bump react and @types/react in /extensions/ql-vscode (#3596)
Bumps [react](https://github.com/facebook/react/tree/HEAD/packages/react) and [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react). These dependencies needed to be updated together.

Updates `react` from 18.2.0 to 18.3.1
- [Release notes](https://github.com/facebook/react/releases)
- [Changelog](https://github.com/facebook/react/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/react/commits/v18.3.1/packages/react)

Updates `@types/react` from 18.2.43 to 18.3.1
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react)

---
updated-dependencies:
- dependency-name: react
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: "@types/react"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-02 15:56:40 +01:00
dependabot[bot]
4b67f4dd54 Bump vite from 5.2.6 to 5.2.11 in /extensions/ql-vscode (#3597)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.2.6 to 5.2.11.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.2.11/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-02 15:37:22 +01:00
dependabot[bot]
572a8b7828 Bump styled-components from 6.1.8 to 6.1.9 in /extensions/ql-vscode (#3598)
Bumps [styled-components](https://github.com/styled-components/styled-components) from 6.1.8 to 6.1.9.
- [Release notes](https://github.com/styled-components/styled-components/releases)
- [Commits](https://github.com/styled-components/styled-components/compare/v6.1.8...v6.1.9)

---
updated-dependencies:
- dependency-name: styled-components
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-02 15:36:08 +01:00
dependabot[bot]
b7d6aeda3c Bump @testing-library/react (#3595)
Bumps the testing-library group in /extensions/ql-vscode with 1 update: [@testing-library/react](https://github.com/testing-library/react-testing-library).


Updates `@testing-library/react` from 15.0.5 to 15.0.6
- [Release notes](https://github.com/testing-library/react-testing-library/releases)
- [Changelog](https://github.com/testing-library/react-testing-library/blob/main/CHANGELOG.md)
- [Commits](https://github.com/testing-library/react-testing-library/compare/v15.0.5...v15.0.6)

---
updated-dependencies:
- dependency-name: "@testing-library/react"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: testing-library
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-02 15:35:27 +01:00
github-actions[bot]
2da77acd9e Bump CLI version from v2.17.0 to v2.17.1 for integration tests (#3577)
Co-authored-by: github-actions[bot] <github-actions@github.com>
2024-05-02 10:00:37 +00:00
Anders Starcke Henriksen
607a8380cc Merge pull request #3581 from github/dependabot/npm_and_yarn/extensions/ql-vscode/ts-json-schema-generator-2.1.1
Bump ts-json-schema-generator from 2.0.1 to 2.1.1 in /extensions/ql-vscode
2024-05-02 09:19:22 +02:00
Koen Vlaswinkel
f698ac321f Add back ts-node for Gulp 2024-05-01 14:59:02 +02:00
Koen Vlaswinkel
85abd9a1ac Switch from ts-node to vite-node
vite-node seems to have better support for mixed ESM and CJS modules and
makes the scripts work with both kinds of packages without having to
change the project configuration.
2024-05-01 14:50:12 +02:00
Anders Starcke Henriksen
329eba9536 Merge pull request #3592 from github/release-token
Update release with new PAT lifetime.
2024-05-01 14:49:03 +02:00
Anders Starcke Henriksen
733a0328d0 Merge pull request #3594 from github/version/bump-to-v1.13.1
Bump version to v1.13.1
2024-05-01 14:32:42 +02:00
dependabot[bot]
1c7f92b503 Bump ts-json-schema-generator in /extensions/ql-vscode
Bumps [ts-json-schema-generator](https://github.com/vega/ts-json-schema-generator) from 2.0.1 to 2.1.1.
- [Release notes](https://github.com/vega/ts-json-schema-generator/releases)
- [Changelog](https://github.com/vega/ts-json-schema-generator/blob/v2.1.1/CHANGELOG.md)
- [Commits](https://github.com/vega/ts-json-schema-generator/compare/v2.0.1...v2.1.1)

---
updated-dependencies:
- dependency-name: ts-json-schema-generator
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-01 12:13:48 +00:00
github-actions[bot]
884ec21e5a Bump version to v1.13.1 2024-05-01 11:44:41 +00:00
Anders Starcke Henriksen
35c533606f Merge pull request #3593 from github/v1.13.0
v1.13.0
2024-05-01 13:42:53 +02:00
Anders Starcke Henriksen
4adf60a978 v1.13.0
Some checks failed
Release / Release (push) Has been cancelled
Release / Publish to VS Code Marketplace (push) Has been cancelled
Release / Publish to Open VSX Registry (push) Has been cancelled
2024-05-01 10:36:40 +02:00
Koen Vlaswinkel
69775414f0 Merge pull request #3591 from github/koesie10/update-changelog
Add Ruby model editor support to CHANGELOG
2024-05-01 09:54:47 +02:00
Anders Starcke Henriksen
10c74d5d8c Update release with new PAT lifetime. 2024-05-01 09:54:04 +02:00
Koen Vlaswinkel
325f5d6667 Move up changelog entry 2024-05-01 09:42:03 +02:00
Koen Vlaswinkel
e968c226ba Add Ruby model editor support to CHANGELOG 2024-05-01 09:33:22 +02:00
dependabot[bot]
44429c2513 Bump husky from 8.0.3 to 9.0.11 in /extensions/ql-vscode (#3590)
Bumps [husky](https://github.com/typicode/husky) from 8.0.3 to 9.0.11.
- [Release notes](https://github.com/typicode/husky/releases)
- [Commits](https://github.com/typicode/husky/compare/v8.0.3...v9.0.11)

---
updated-dependencies:
- dependency-name: husky
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-30 09:26:20 -07:00
dependabot[bot]
96881f2bf2 Bump the testing-library group in /extensions/ql-vscode with 2 updates (#3589)
Bumps the testing-library group in /extensions/ql-vscode with 2 updates: [@testing-library/dom](https://github.com/testing-library/dom-testing-library) and [@testing-library/react](https://github.com/testing-library/react-testing-library).


Updates `@testing-library/dom` from 10.0.0 to 10.1.0
- [Release notes](https://github.com/testing-library/dom-testing-library/releases)
- [Changelog](https://github.com/testing-library/dom-testing-library/blob/main/CHANGELOG.md)
- [Commits](https://github.com/testing-library/dom-testing-library/compare/v10.0.0...v10.1.0)

Updates `@testing-library/react` from 15.0.4 to 15.0.5
- [Release notes](https://github.com/testing-library/react-testing-library/releases)
- [Changelog](https://github.com/testing-library/react-testing-library/blob/main/CHANGELOG.md)
- [Commits](https://github.com/testing-library/react-testing-library/compare/v15.0.4...v15.0.5)

---
updated-dependencies:
- dependency-name: "@testing-library/dom"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: testing-library
- dependency-name: "@testing-library/react"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: testing-library
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-30 09:25:56 -07:00
dependabot[bot]
06f4e33719 Bump @storybook/csf in /extensions/ql-vscode in the storybook group (#3588)
Bumps the storybook group in /extensions/ql-vscode with 1 update: [@storybook/csf](https://github.com/ComponentDriven/csf).


Updates `@storybook/csf` from 0.1.4 to 0.1.6
- [Release notes](https://github.com/ComponentDriven/csf/releases)
- [Changelog](https://github.com/ComponentDriven/csf/blob/v0.1.6/CHANGELOG.md)
- [Commits](https://github.com/ComponentDriven/csf/compare/v0.1.4...v0.1.6)

---
updated-dependencies:
- dependency-name: "@storybook/csf"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-30 09:25:14 -07:00
Koen Vlaswinkel
570e410e06 Merge pull request #3587 from github/koesie10/upgrade-e2e-tests
Upgrade E2E test dependencies
2024-04-30 17:24:33 +02:00
Koen Vlaswinkel
1d5b4f3fbb Merge pull request #3586 from github/koesie10/fix-e2e-tests
Always use the latest released CodeQL version in E2E tests
2024-04-30 16:30:42 +02:00
Koen Vlaswinkel
0e5b460e67 Upgrade Alpine to 3.19.1 2024-04-30 16:20:19 +02:00
Koen Vlaswinkel
a39f4582e3 Enable Dependabot for E2E docker image 2024-04-30 16:19:13 +02:00
Koen Vlaswinkel
18f12e53c9 Upgrade E2E tests to VS Code v1.88.1 2024-04-30 16:17:51 +02:00
Koen Vlaswinkel
ac8dd9189e Always use the latest released CodeQL version in E2E tests 2024-04-30 16:11:19 +02:00
Koen Vlaswinkel
7d564b50e7 Merge pull request #3584 from github/koesie10/add-ruby-as-supported-model-editor-language
Add Ruby as a fully-supported model editor language
2024-04-30 12:42:52 +02:00
Koen Vlaswinkel
013bf65c0a Merge pull request #3585 from github/koesie10/fix-modeled-method-fs-test
Fix modeled method FS test
2024-04-30 12:42:44 +02:00
Koen Vlaswinkel
bd6862efda Fix modeled method FS test 2024-04-30 11:53:15 +02:00
Koen Vlaswinkel
64f0115070 Add Ruby as a fully-supported model editor language 2024-04-26 17:00:06 +02:00
dependabot[bot]
596049a8cb Bump @testing-library/react (#3580)
Bumps the testing-library group in /extensions/ql-vscode with 1 update: [@testing-library/react](https://github.com/testing-library/react-testing-library).


Updates `@testing-library/react` from 15.0.2 to 15.0.4
- [Release notes](https://github.com/testing-library/react-testing-library/releases)
- [Changelog](https://github.com/testing-library/react-testing-library/blob/main/CHANGELOG.md)
- [Commits](https://github.com/testing-library/react-testing-library/compare/v15.0.2...v15.0.4)

---
updated-dependencies:
- dependency-name: "@testing-library/react"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: testing-library
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-25 15:00:47 +00:00
dependabot[bot]
58a5a43609 Bump the storybook group in /extensions/ql-vscode with 12 updates (#3579)
Bumps the storybook group in /extensions/ql-vscode with 12 updates:

| Package | From | To |
| --- | --- | --- |
| [@storybook/addon-a11y](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/a11y) | `8.0.8` | `8.0.9` |
| [@storybook/addon-actions](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/actions) | `8.0.8` | `8.0.9` |
| [@storybook/addon-essentials](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/essentials) | `8.0.8` | `8.0.9` |
| [@storybook/addon-interactions](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/interactions) | `8.0.8` | `8.0.9` |
| [@storybook/addon-links](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/links) | `8.0.8` | `8.0.9` |
| [@storybook/blocks](https://github.com/storybookjs/storybook/tree/HEAD/code/ui/blocks) | `8.0.8` | `8.0.9` |
| [@storybook/components](https://github.com/storybookjs/storybook/tree/HEAD/code/ui/components) | `8.0.8` | `8.0.9` |
| [@storybook/manager-api](https://github.com/storybookjs/storybook/tree/HEAD/code/lib/manager-api) | `8.0.8` | `8.0.9` |
| [@storybook/react](https://github.com/storybookjs/storybook/tree/HEAD/code/renderers/react) | `8.0.8` | `8.0.9` |
| [@storybook/react-vite](https://github.com/storybookjs/storybook/tree/HEAD/code/frameworks/react-vite) | `8.0.8` | `8.0.9` |
| [@storybook/theming](https://github.com/storybookjs/storybook/tree/HEAD/code/lib/theming) | `8.0.8` | `8.0.9` |
| [storybook](https://github.com/storybookjs/storybook/tree/HEAD/code/lib/cli) | `8.0.8` | `8.0.9` |


Updates `@storybook/addon-a11y` from 8.0.8 to 8.0.9
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.9/code/addons/a11y)

Updates `@storybook/addon-actions` from 8.0.8 to 8.0.9
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.9/code/addons/actions)

Updates `@storybook/addon-essentials` from 8.0.8 to 8.0.9
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.9/code/addons/essentials)

Updates `@storybook/addon-interactions` from 8.0.8 to 8.0.9
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.9/code/addons/interactions)

Updates `@storybook/addon-links` from 8.0.8 to 8.0.9
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.9/code/addons/links)

Updates `@storybook/blocks` from 8.0.8 to 8.0.9
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.9/code/ui/blocks)

Updates `@storybook/components` from 8.0.8 to 8.0.9
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.9/code/ui/components)

Updates `@storybook/manager-api` from 8.0.8 to 8.0.9
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.9/code/lib/manager-api)

Updates `@storybook/react` from 8.0.8 to 8.0.9
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.9/code/renderers/react)

Updates `@storybook/react-vite` from 8.0.8 to 8.0.9
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.9/code/frameworks/react-vite)

Updates `@storybook/theming` from 8.0.8 to 8.0.9
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.9/code/lib/theming)

Updates `storybook` from 8.0.8 to 8.0.9
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.9/code/lib/cli)

---
updated-dependencies:
- dependency-name: "@storybook/addon-a11y"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/addon-actions"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/addon-essentials"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/addon-interactions"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/addon-links"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/blocks"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/components"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/manager-api"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/react"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/react-vite"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/theming"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: storybook
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-25 15:46:04 +01:00
dependabot[bot]
67ad9cb6ce Bump nanoid from 5.0.6 to 5.0.7 in /extensions/ql-vscode (#3582)
Bumps [nanoid](https://github.com/ai/nanoid) from 5.0.6 to 5.0.7.
- [Release notes](https://github.com/ai/nanoid/releases)
- [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ai/nanoid/compare/5.0.6...5.0.7)

---
updated-dependencies:
- dependency-name: nanoid
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-25 14:59:18 +01:00
Robert
29c36584f8 Merge pull request #3576 from github/robertbrignull/disable-llm-proxima
Disable LLM model generation when not using github.com
2024-04-22 16:47:56 +01:00
Robert
e59145372e Disable LLM model generation when not using github.com 2024-04-22 16:28:52 +01:00
Robert
ad17a4f828 Merge pull request #3570 from github/robertbrignull/disable_top1000
Hide system defined lists when enterprise URI is set
2024-04-22 10:12:19 +01:00
dependabot[bot]
f17319a5cf Bump markdownlint-cli2 from 0.12.1 to 0.13.0 in /extensions/ql-vscode (#3571)
Bumps [markdownlint-cli2](https://github.com/DavidAnson/markdownlint-cli2) from 0.12.1 to 0.13.0.
- [Changelog](https://github.com/DavidAnson/markdownlint-cli2/blob/main/CHANGELOG.md)
- [Commits](https://github.com/DavidAnson/markdownlint-cli2/compare/v0.12.1...v0.13.0)

---
updated-dependencies:
- dependency-name: markdownlint-cli2
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-18 13:12:06 -07:00
dependabot[bot]
0d52be1dbf Bump @babel/preset-react from 7.23.3 to 7.24.1 in /extensions/ql-vscode (#3575)
Bumps [@babel/preset-react](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-react) from 7.23.3 to 7.24.1.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.24.1/packages/babel-preset-react)

---
updated-dependencies:
- dependency-name: "@babel/preset-react"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-18 13:11:46 -07:00
dependabot[bot]
13a61094c1 Bump @babel/preset-env from 7.24.0 to 7.24.4 in /extensions/ql-vscode (#3574)
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.24.0 to 7.24.4.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.24.4/packages/babel-preset-env)

---
updated-dependencies:
- dependency-name: "@babel/preset-env"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-18 19:40:48 +00:00
dependabot[bot]
230cdd024c Bump @babel/core from 7.24.0 to 7.24.4 in /extensions/ql-vscode (#3573)
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.24.0 to 7.24.4.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.24.4/packages/babel-core)

---
updated-dependencies:
- dependency-name: "@babel/core"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-18 12:26:36 -07:00
dependabot[bot]
29a47305a9 Bump eslint-plugin-react from 7.33.2 to 7.34.1 in /extensions/ql-vscode (#3572)
Bumps [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) from 7.33.2 to 7.34.1.
- [Release notes](https://github.com/jsx-eslint/eslint-plugin-react/releases)
- [Changelog](https://github.com/jsx-eslint/eslint-plugin-react/blob/v7.34.1/CHANGELOG.md)
- [Commits](https://github.com/jsx-eslint/eslint-plugin-react/compare/v7.33.2...v7.34.1)

---
updated-dependencies:
- dependency-name: eslint-plugin-react
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-18 12:26:18 -07:00
Robert
26ec371730 move onDidChangeConfiguration to be the last field in VariantAnalysisConfig 2024-04-18 09:59:50 +01:00
Robert
58de4864c0 Pass VariantAnalysisConfig into DbManager to avoid vscode dependency 2024-04-18 09:55:21 +01:00
Robert
17ff592a60 Hide system defined lists when enterprise URI is set 2024-04-17 14:31:14 +01:00
Robert
1c267e4c28 Merge pull request #3569 from github/robertbrignull/ghec_dr_mode
Detect when the github-enterprise.uri setting is set
2024-04-17 11:06:26 +01:00
Robert
2f67ccea56 Cover all cases of URIs and feature flags 2024-04-17 10:53:17 +01:00
Robert
b3fdb3a126 Use endsWith instead of regex 2024-04-17 09:37:53 +01:00
Robert
07ba537590 Make config field use camel-case 2024-04-17 09:37:38 +01:00
Robert
8abde36dcb Detect when the github-enterprise.uri setting is set 2024-04-16 17:18:49 +01:00
dependabot[bot]
27d6a749f8 Bump @floating-ui/react from 0.26.10 to 0.26.12 in /extensions/ql-vscode (#3567)
Bumps [@floating-ui/react](https://github.com/floating-ui/floating-ui/tree/HEAD/packages/react) from 0.26.10 to 0.26.12.
- [Release notes](https://github.com/floating-ui/floating-ui/releases)
- [Changelog](https://github.com/floating-ui/floating-ui/blob/master/packages/react/CHANGELOG.md)
- [Commits](https://github.com/floating-ui/floating-ui/commits/@floating-ui/react@0.26.12/packages/react)

---
updated-dependencies:
- dependency-name: "@floating-ui/react"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-16 16:39:37 +01:00
dependabot[bot]
e7af631737 Bump @testing-library/react (#3565)
Bumps the testing-library group in /extensions/ql-vscode with 1 update: [@testing-library/react](https://github.com/testing-library/react-testing-library).


Updates `@testing-library/react` from 15.0.1 to 15.0.2
- [Release notes](https://github.com/testing-library/react-testing-library/releases)
- [Changelog](https://github.com/testing-library/react-testing-library/blob/main/CHANGELOG.md)
- [Commits](https://github.com/testing-library/react-testing-library/compare/v15.0.1...v15.0.2)

---
updated-dependencies:
- dependency-name: "@testing-library/react"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: testing-library
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-16 16:24:37 +01:00
dependabot[bot]
cdd889452a Bump @storybook/csf in /extensions/ql-vscode in the storybook group (#3564)
Bumps the storybook group in /extensions/ql-vscode with 1 update: [@storybook/csf](https://github.com/ComponentDriven/csf).


Updates `@storybook/csf` from 0.1.3 to 0.1.4
- [Release notes](https://github.com/ComponentDriven/csf/releases)
- [Changelog](https://github.com/ComponentDriven/csf/blob/v0.1.4/CHANGELOG.md)
- [Commits](https://github.com/ComponentDriven/csf/compare/v0.1.3...v0.1.4)

---
updated-dependencies:
- dependency-name: "@storybook/csf"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-16 16:19:11 +01:00
dependabot[bot]
4abaa22f62 Bump ts-json-schema-generator in /extensions/ql-vscode (#3568)
Bumps [ts-json-schema-generator](https://github.com/vega/ts-json-schema-generator) from 1.5.0 to 2.0.1.
- [Release notes](https://github.com/vega/ts-json-schema-generator/releases)
- [Changelog](https://github.com/vega/ts-json-schema-generator/blob/v2.0.1/CHANGELOG.md)
- [Commits](https://github.com/vega/ts-json-schema-generator/compare/v1.5.0...v2.0.1)

---
updated-dependencies:
- dependency-name: ts-json-schema-generator
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-16 16:12:31 +01:00
dependabot[bot]
df322ce17d Bump applicationinsights from 2.9.4 to 2.9.5 in /extensions/ql-vscode (#3566)
Bumps [applicationinsights](https://github.com/microsoft/ApplicationInsights-node.js) from 2.9.4 to 2.9.5.
- [Release notes](https://github.com/microsoft/ApplicationInsights-node.js/releases)
- [Commits](https://github.com/microsoft/ApplicationInsights-node.js/compare/2.9.4...2.9.5)

---
updated-dependencies:
- dependency-name: applicationinsights
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-16 15:30:48 +01:00
Charis Kyriakou
0df508d1c6 Remove support for CodeQL CLI versions older than 2.14.6 (#3562) 2024-04-16 15:27:32 +01:00
Charis Kyriakou
2e7586c39f Exclude major version updates for the octokit group in dependabot (#3563)
* Exclude major version updates for the octokit group in dependabot

* Commit unstaged changes 🤦
2024-04-16 14:29:17 +01:00
Charis Kyriakou
f854ab50d5 Move octokit throttling plugin dependency out of dev dependencies (#3561) 2024-04-16 11:52:01 +00:00
Andrew Eisenberg
3cc4005500 Merge pull request #3556 from github/dependabot/npm_and_yarn/extensions/ql-vscode/msw-2.2.13
Bump msw from 2.0.13 to 2.2.13 in /extensions/ql-vscode
2024-04-16 01:24:44 -07:00
Koen Vlaswinkel
0d4a95d08e Merge pull request #3552 from github/koesie10/remove-enable-type-models
Remove `codeQL.model.showTypeModels` config
2024-04-16 10:16:52 +02:00
Koen Vlaswinkel
d67cf4b9f7 Remove codeQL.model.showTypeModels config
This removes the `codeQL.model.showTypeModels` setting. We will now
always show type models in the model editor. This also means that the
"auto-generation mode" needs to change to `models` to ensure that the
type models are actually shown to the user. This is done for Ruby, which
is currently the only language to show type models.
2024-04-15 16:52:27 +02:00
Koen Vlaswinkel
c37bd9969c Merge pull request #3550 from github/koesie10/separate-file
Add auto-model generation mode without separate file
2024-04-15 16:52:13 +02:00
Andrew Eisenberg
1dac41d8ea Merge pull request #3558 from github/dependabot/npm_and_yarn/extensions/ql-vscode/testing-library-0922f3acd1
Bump the testing-library group in /extensions/ql-vscode with 2 updates
2024-04-11 11:14:36 -07:00
dependabot[bot]
48a03bd383 Bump the testing-library group in /extensions/ql-vscode with 2 updates
Bumps the testing-library group in /extensions/ql-vscode with 2 updates: [@testing-library/dom](https://github.com/testing-library/dom-testing-library) and [@testing-library/react](https://github.com/testing-library/react-testing-library).


Updates `@testing-library/dom` from 9.3.4 to 10.0.0
- [Release notes](https://github.com/testing-library/dom-testing-library/releases)
- [Changelog](https://github.com/testing-library/dom-testing-library/blob/main/CHANGELOG.md)
- [Commits](https://github.com/testing-library/dom-testing-library/compare/v9.3.4...v10.0.0)

Updates `@testing-library/react` from 14.2.2 to 15.0.1
- [Release notes](https://github.com/testing-library/react-testing-library/releases)
- [Changelog](https://github.com/testing-library/react-testing-library/blob/main/CHANGELOG.md)
- [Commits](https://github.com/testing-library/react-testing-library/compare/v14.2.2...v15.0.1)

---
updated-dependencies:
- dependency-name: "@testing-library/dom"
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: testing-library
- dependency-name: "@testing-library/react"
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: testing-library
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-11 17:31:55 +00:00
dependabot[bot]
b6897e4faf Bump the storybook group in /extensions/ql-vscode with 12 updates (#3557)
Bumps the storybook group in /extensions/ql-vscode with 12 updates:

| Package | From | To |
| --- | --- | --- |
| [@storybook/addon-a11y](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/a11y) | `8.0.5` | `8.0.8` |
| [@storybook/addon-actions](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/actions) | `8.0.5` | `8.0.8` |
| [@storybook/addon-essentials](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/essentials) | `8.0.5` | `8.0.8` |
| [@storybook/addon-interactions](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/interactions) | `8.0.5` | `8.0.8` |
| [@storybook/addon-links](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/links) | `8.0.5` | `8.0.8` |
| [@storybook/blocks](https://github.com/storybookjs/storybook/tree/HEAD/code/ui/blocks) | `8.0.5` | `8.0.8` |
| [@storybook/components](https://github.com/storybookjs/storybook/tree/HEAD/code/ui/components) | `8.0.5` | `8.0.8` |
| [@storybook/manager-api](https://github.com/storybookjs/storybook/tree/HEAD/code/lib/manager-api) | `8.0.5` | `8.0.8` |
| [@storybook/react](https://github.com/storybookjs/storybook/tree/HEAD/code/renderers/react) | `8.0.5` | `8.0.8` |
| [@storybook/react-vite](https://github.com/storybookjs/storybook/tree/HEAD/code/frameworks/react-vite) | `8.0.5` | `8.0.8` |
| [@storybook/theming](https://github.com/storybookjs/storybook/tree/HEAD/code/lib/theming) | `8.0.5` | `8.0.8` |
| [storybook](https://github.com/storybookjs/storybook/tree/HEAD/code/lib/cli) | `8.0.5` | `8.0.8` |


Updates `@storybook/addon-a11y` from 8.0.5 to 8.0.8
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.8/code/addons/a11y)

Updates `@storybook/addon-actions` from 8.0.5 to 8.0.8
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.8/code/addons/actions)

Updates `@storybook/addon-essentials` from 8.0.5 to 8.0.8
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.8/code/addons/essentials)

Updates `@storybook/addon-interactions` from 8.0.5 to 8.0.8
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.8/code/addons/interactions)

Updates `@storybook/addon-links` from 8.0.5 to 8.0.8
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.8/code/addons/links)

Updates `@storybook/blocks` from 8.0.5 to 8.0.8
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.8/code/ui/blocks)

Updates `@storybook/components` from 8.0.5 to 8.0.8
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.8/code/ui/components)

Updates `@storybook/manager-api` from 8.0.5 to 8.0.8
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.8/code/lib/manager-api)

Updates `@storybook/react` from 8.0.5 to 8.0.8
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.8/code/renderers/react)

Updates `@storybook/react-vite` from 8.0.5 to 8.0.8
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.8/code/frameworks/react-vite)

Updates `@storybook/theming` from 8.0.5 to 8.0.8
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.8/code/lib/theming)

Updates `storybook` from 8.0.5 to 8.0.8
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.8/code/lib/cli)

---
updated-dependencies:
- dependency-name: "@storybook/addon-a11y"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/addon-actions"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/addon-essentials"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/addon-interactions"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/addon-links"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/blocks"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/components"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/manager-api"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/react"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/react-vite"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/theming"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: storybook
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-11 10:30:00 -07:00
dependabot[bot]
d20a1eb61b Bump ts-jest from 29.1.1 to 29.1.2 in /extensions/ql-vscode (#3555)
Bumps [ts-jest](https://github.com/kulshekhar/ts-jest) from 29.1.1 to 29.1.2.
- [Release notes](https://github.com/kulshekhar/ts-jest/releases)
- [Changelog](https://github.com/kulshekhar/ts-jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/kulshekhar/ts-jest/compare/v29.1.1...v29.1.2)

---
updated-dependencies:
- dependency-name: ts-jest
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-11 10:05:22 -07:00
dependabot[bot]
8ef3ae0ff5 Bump msw from 2.0.13 to 2.2.13 in /extensions/ql-vscode
Bumps [msw](https://github.com/mswjs/msw) from 2.0.13 to 2.2.13.
- [Release notes](https://github.com/mswjs/msw/releases)
- [Changelog](https://github.com/mswjs/msw/blob/main/CHANGELOG.md)
- [Commits](https://github.com/mswjs/msw/compare/v2.0.13...v2.2.13)

---
updated-dependencies:
- dependency-name: msw
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-11 13:40:56 +00:00
Koen Vlaswinkel
c7a048b0dc Merge pull request #3548 from github/koesie10/remove-access-path-suggestions-ff
Remove `codeQL.model.enableAccessPathSuggestions` config
2024-04-11 14:29:50 +02:00
Nora
9026076635 Merge pull request #3547 from github/version/bump-to-v1.12.6
Bump version to v1.12.6
2024-04-10 17:16:19 +02:00
Shati Patel
135dc7084a Remove rogue semmle link (#3549) 2024-04-10 15:05:20 +00:00
Koen Vlaswinkel
8c784d8391 Merge pull request #3543 from github/koesie10/pack-name-config
Add `codeQL.model.packName` setting
2024-04-10 17:03:36 +02:00
Koen Vlaswinkel
fed30b6fed Add auto-model generation mode without separate file 2024-04-10 16:46:45 +02:00
Koen Vlaswinkel
232d4c3f41 Remove unnecessary access path progress for unsupported languages 2024-04-10 16:05:56 +02:00
Koen Vlaswinkel
acb6b8b490 Remove enableAccessPathSuggestions config
Access path suggestions will now be enabled for all languages which
support it (which is currently only Ruby).
2024-04-10 15:46:29 +02:00
Koen Vlaswinkel
3f4ed48787 Trim whitespace and slashes in pack names 2024-04-10 15:08:35 +02:00
github-actions[bot]
e1d9aa813d Bump version to v1.12.6 2024-04-09 12:29:43 +00:00
Nora
8a3a6d7e7e Merge pull request #3546 from github/v1.12.5
v1.12.5
2024-04-09 14:27:59 +02:00
Nora
5b89b9608f Update changelog
Some checks failed
Release / Release (push) Has been cancelled
Release / Publish to VS Code Marketplace (push) Has been cancelled
Release / Publish to Open VSX Registry (push) Has been cancelled
2024-04-09 09:08:47 +00:00
Nora
999c73d05d Update version number in changelog 2024-04-09 08:54:07 +00:00
Charis Kyriakou
070df13947 Rename vscode-app -> extension-app file to match convention (#3545) 2024-04-08 16:11:22 +01:00
Koen Vlaswinkel
0c5b39945c Merge pull request #3544 from github/koesie10/python-parsing-unit-tests
Add unit tests for Python argument options
2024-04-08 16:36:40 +02:00
Koen Vlaswinkel
8e231d7b1d Add unit tests for Python argument options 2024-04-08 14:49:09 +02:00
Koen Vlaswinkel
bf9bfb13b7 Add codeQL.model.packName setting 2024-04-08 14:42:47 +02:00
Koen Vlaswinkel
4dc126d56d Merge pull request #3539 from github/koesie10/pack-location-config
Add `codeQL.model.packLocation` setting
2024-04-08 14:11:46 +02:00
Koen Vlaswinkel
9e729ba054 Merge pull request #3540 from github/koesie10/python-model-editor-args
Improve support for Python arguments
2024-04-08 13:59:45 +02:00
Koen Vlaswinkel
6146d7d78a Fix numbering in comment 2024-04-08 13:58:13 +02:00
Charis Kyriakou
6d8de1b3b8 Remove mocking of modeling events (#3542) 2024-04-08 11:19:02 +01:00
Nora
24e08f768c Merge pull request #3534 from github/dependabot/npm_and_yarn/extensions/ql-vscode/floating-ui/react-0.26.10
Bump @floating-ui/react from 0.26.9 to 0.26.10 in /extensions/ql-vscode
2024-04-08 10:35:52 +02:00
Nora
62e051b3d1 Merge pull request #3535 from github/dependabot/npm_and_yarn/extensions/ql-vscode/github/markdownlint-github-0.6.2
Bump @github/markdownlint-github from 0.6.0 to 0.6.2 in /extensions/ql-vscode
2024-04-08 10:16:20 +02:00
Koen Vlaswinkel
b6931dd79a Merge pull request #3541 from github/koesie10/upgrade-ts-eslint
Upgrade typescript-eslint to v7
2024-04-05 16:49:52 +02:00
Koen Vlaswinkel
70009cdc32 Upgrade typescript-eslint to v7 2024-04-05 16:21:16 +02:00
Koen Vlaswinkel
b3276f5cf5 Merge pull request #3538 from github/github-action/bump-node-version
Bump Node version to v18.18.2
2024-04-05 16:15:54 +02:00
Koen Vlaswinkel
1e3cb0772e Improve support for Python arguments 2024-04-05 15:39:44 +02:00
Koen Vlaswinkel
5fbd912abd Add codeQL.model.packLocation setting
This adds the `codeQL.model.packLocation` setting, which allows users to
specify the location of the CodeQL extension pack. This setting replaces
the `codeQL.model.extensionsDirectory` setting, which has been removed.

The pack location supports variable substitutions and supports both
absolute and relative paths. The default value is
`.github/codeql/extensions/${name}-${language}` which matches the
previous defaults.
2024-04-05 15:04:29 +02:00
github-actions[bot]
03c8748981 Bump Node version to v18.18.2 2024-04-05 12:25:06 +00:00
Koen Vlaswinkel
351bc648ef Merge pull request #3530 from github/koesie10/config-template
Add helper for substituting config variables
2024-04-05 11:15:33 +02:00
dependabot[bot]
8ccca1381a Bump eslint-plugin-jest-dom from 5.1.0 to 5.2.0 in /extensions/ql-vscode (#3536)
Bumps [eslint-plugin-jest-dom](https://github.com/testing-library/eslint-plugin-jest-dom) from 5.1.0 to 5.2.0.
- [Release notes](https://github.com/testing-library/eslint-plugin-jest-dom/releases)
- [Commits](https://github.com/testing-library/eslint-plugin-jest-dom/compare/v5.1.0...v5.2.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-jest-dom
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-04 13:28:39 -07:00
dependabot[bot]
85953ec9c3 Bump d3 from 7.8.5 to 7.9.0 in /extensions/ql-vscode (#3533)
Bumps [d3](https://github.com/d3/d3) from 7.8.5 to 7.9.0.
- [Release notes](https://github.com/d3/d3/releases)
- [Changelog](https://github.com/d3/d3/blob/main/CHANGES.md)
- [Commits](https://github.com/d3/d3/compare/v7.8.5...v7.9.0)

---
updated-dependencies:
- dependency-name: d3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-04 11:07:16 -07:00
github-actions[bot]
4a303fa48d Bump CLI version from v2.16.6 to v2.17.0 for integration tests (#3537)
Co-authored-by: github-actions[bot] <github-actions@github.com>
2024-04-04 15:53:15 +00:00
dependabot[bot]
48e66cbe25 Bump @github/markdownlint-github in /extensions/ql-vscode
Bumps [@github/markdownlint-github](https://github.com/github/markdownlint-github) from 0.6.0 to 0.6.2.
- [Release notes](https://github.com/github/markdownlint-github/releases)
- [Commits](https://github.com/github/markdownlint-github/compare/0.6.0...v0.6.2)

---
updated-dependencies:
- dependency-name: "@github/markdownlint-github"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-04 13:56:17 +00:00
dependabot[bot]
8787fcdd96 Bump @floating-ui/react from 0.26.9 to 0.26.10 in /extensions/ql-vscode
Bumps [@floating-ui/react](https://github.com/floating-ui/floating-ui/tree/HEAD/packages/react) from 0.26.9 to 0.26.10.
- [Release notes](https://github.com/floating-ui/floating-ui/releases)
- [Changelog](https://github.com/floating-ui/floating-ui/blob/master/packages/react/CHANGELOG.md)
- [Commits](https://github.com/floating-ui/floating-ui/commits/@floating-ui/react@0.26.10/packages/react)

---
updated-dependencies:
- dependency-name: "@floating-ui/react"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-04 13:56:05 +00:00
Nora
20cc5ad988 Merge pull request #3531 from github/dependabot/npm_and_yarn/extensions/ql-vscode/vite-5.2.6
Bump vite from 5.2.0 to 5.2.6 in /extensions/ql-vscode
2024-04-04 10:34:30 +02:00
dependabot[bot]
ecae6bdd99 Bump vite from 5.2.0 to 5.2.6 in /extensions/ql-vscode
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.2.0 to 5.2.6.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.2.6/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-03 16:47:45 +00:00
Andrew Eisenberg
00c0e70626 Merge pull request #3527 from aeisenberg/aeisenberg/fix-qlpack-schema
Fix the qlpack json schema
2024-04-03 09:46:11 -07:00
Koen Vlaswinkel
8cb2b34992 Add helper for substituting config variables 2024-04-03 14:42:31 +02:00
Robert
7da3740828 Merge pull request #3517 from github/robertbrignull/fix-token-alerts
Mark progress bars as cancellable where it appears we are respecting the token
2024-04-03 11:30:30 +01:00
Andrew Eisenberg
44c3c29857 Update changelog 2024-04-03 03:21:25 +00:00
Andrew Eisenberg
e6ebcf4245 Fix the qlpack json schema
This schema was incorrectly tagging `defaultSuite` properties that
aren't arrays as errors.

I think there are more, similar errors in this schema, but I only fixed
this one so that I can get `github/semmle-code` working with test
discovery.
2024-04-02 20:21:21 -07:00
Robert
4e43a07fb5 Merge branch 'main' into robertbrignull/fix-token-alerts 2024-04-02 17:27:53 +01:00
Charis Kyriakou
3508dc6d8c Tidy up some functions in the model evaluator (#3529)
* Rename model evaluator's updateVariantAnalysis -> setVariantAnalysis

* Merge updateRepoResults and updateReposResults into single setReposResults function
2024-04-02 12:32:50 +01:00
Koen Vlaswinkel
ff6f6cdf8a Merge pull request #3515 from github/koesie10/tee-logger-file-handle
Use file handle in TeeLogger
2024-04-02 10:02:41 +02:00
Robert
a5239fbede Merge pull request #3458 from github/robertbrignull/database-prompting
Refactor database-fetcher.ts into a class and simplify
2024-03-28 18:05:54 +00:00
Robert
7d259a9322 Fix dodgy imports 2024-03-28 17:51:22 +00:00
Koen Vlaswinkel
6f7b7cf84f Merge pull request #3525 from github/dependabot/npm_and_yarn/extensions/ql-vscode/types/semver-7.5.8
Bump @types/semver from 7.5.6 to 7.5.8 in /extensions/ql-vscode
2024-03-28 14:57:58 +01:00
Koen Vlaswinkel
c6865de312 Merge pull request #3526 from github/dependabot/npm_and_yarn/extensions/ql-vscode/express-4.19.2
Bump express from 4.18.2 to 4.19.2 in /extensions/ql-vscode
2024-03-28 14:57:18 +01:00
dependabot[bot]
133d5899af Bump @types/semver from 7.5.6 to 7.5.8 in /extensions/ql-vscode
Bumps [@types/semver](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/semver) from 7.5.6 to 7.5.8.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/semver)

---
updated-dependencies:
- dependency-name: "@types/semver"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-28 13:43:46 +00:00
dependabot[bot]
8d7d469803 Bump express from 4.18.2 to 4.19.2 in /extensions/ql-vscode
Bumps [express](https://github.com/expressjs/express) from 4.18.2 to 4.19.2.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.18.2...4.19.2)

---
updated-dependencies:
- dependency-name: express
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-28 13:43:32 +00:00
Koen Vlaswinkel
7575beac6b Merge pull request #3524 from github/dependabot/npm_and_yarn/extensions/ql-vscode/lint-staged-15.2.2
Bump lint-staged from 15.2.0 to 15.2.2 in /extensions/ql-vscode
2024-03-28 14:43:09 +01:00
Koen Vlaswinkel
9e5d0ae7c2 Merge pull request #3522 from github/dependabot/npm_and_yarn/extensions/ql-vscode/storybook-5df8c90cc2
Bump the storybook group in /extensions/ql-vscode with 12 updates
2024-03-28 14:42:31 +01:00
dependabot[bot]
ae6b9df9e7 Bump lint-staged from 15.2.0 to 15.2.2 in /extensions/ql-vscode
Bumps [lint-staged](https://github.com/okonet/lint-staged) from 15.2.0 to 15.2.2.
- [Release notes](https://github.com/okonet/lint-staged/releases)
- [Changelog](https://github.com/lint-staged/lint-staged/blob/master/CHANGELOG.md)
- [Commits](https://github.com/okonet/lint-staged/compare/v15.2.0...v15.2.2)

---
updated-dependencies:
- dependency-name: lint-staged
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-28 13:29:17 +00:00
dependabot[bot]
5ff353962f Bump the storybook group in /extensions/ql-vscode with 12 updates
Bumps the storybook group in /extensions/ql-vscode with 12 updates:

| Package | From | To |
| --- | --- | --- |
| [@storybook/addon-a11y](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/a11y) | `8.0.2` | `8.0.5` |
| [@storybook/addon-actions](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/actions) | `8.0.2` | `8.0.5` |
| [@storybook/addon-essentials](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/essentials) | `8.0.2` | `8.0.5` |
| [@storybook/addon-interactions](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/interactions) | `8.0.2` | `8.0.5` |
| [@storybook/addon-links](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/links) | `8.0.2` | `8.0.5` |
| [@storybook/blocks](https://github.com/storybookjs/storybook/tree/HEAD/code/ui/blocks) | `8.0.2` | `8.0.5` |
| [@storybook/components](https://github.com/storybookjs/storybook/tree/HEAD/code/ui/components) | `8.0.2` | `8.0.5` |
| [@storybook/manager-api](https://github.com/storybookjs/storybook/tree/HEAD/code/lib/manager-api) | `8.0.2` | `8.0.5` |
| [@storybook/react](https://github.com/storybookjs/storybook/tree/HEAD/code/renderers/react) | `8.0.2` | `8.0.5` |
| [@storybook/react-vite](https://github.com/storybookjs/storybook/tree/HEAD/code/frameworks/react-vite) | `8.0.2` | `8.0.5` |
| [@storybook/theming](https://github.com/storybookjs/storybook/tree/HEAD/code/lib/theming) | `8.0.2` | `8.0.5` |
| [storybook](https://github.com/storybookjs/storybook/tree/HEAD/code/lib/cli) | `8.0.2` | `8.0.5` |


Updates `@storybook/addon-a11y` from 8.0.2 to 8.0.5
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.5/code/addons/a11y)

Updates `@storybook/addon-actions` from 8.0.2 to 8.0.5
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.5/code/addons/actions)

Updates `@storybook/addon-essentials` from 8.0.2 to 8.0.5
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.5/code/addons/essentials)

Updates `@storybook/addon-interactions` from 8.0.2 to 8.0.5
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.5/code/addons/interactions)

Updates `@storybook/addon-links` from 8.0.2 to 8.0.5
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.5/code/addons/links)

Updates `@storybook/blocks` from 8.0.2 to 8.0.5
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.5/code/ui/blocks)

Updates `@storybook/components` from 8.0.2 to 8.0.5
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.5/code/ui/components)

Updates `@storybook/manager-api` from 8.0.2 to 8.0.5
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.5/code/lib/manager-api)

Updates `@storybook/react` from 8.0.2 to 8.0.5
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.5/code/renderers/react)

Updates `@storybook/react-vite` from 8.0.2 to 8.0.5
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.5/code/frameworks/react-vite)

Updates `@storybook/theming` from 8.0.2 to 8.0.5
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.5/code/lib/theming)

Updates `storybook` from 8.0.2 to 8.0.5
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.5/code/lib/cli)

---
updated-dependencies:
- dependency-name: "@storybook/addon-a11y"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/addon-actions"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/addon-essentials"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/addon-interactions"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/addon-links"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/blocks"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/components"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/manager-api"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/react"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/react-vite"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: "@storybook/theming"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
- dependency-name: storybook
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-28 13:28:32 +00:00
Robert
3cae3ccc3c Merge branch 'main' into robertbrignull/database-prompting 2024-03-28 13:12:00 +00:00
Shati Patel
7a41d9c605 Add unit test for createModeledMethodKey (#3521) 2024-03-28 11:32:34 +00:00
Robert
d3476259b3 Unexport ProgressTask 2024-03-28 11:07:57 +00:00
Robert
28bf345ea8 Make trim cache not cancellable 2024-03-28 10:58:42 +00:00
Robert
e23d4a9d9f Make restarting the query server not cancellable, because in practice it wasn't 2024-03-28 10:51:00 +00:00
Robert
47a5993333 Make clearCacheInDatabase not take a cancellation token 2024-03-28 10:45:17 +00:00
Shati Patel
45e20f405b Link from alerts indicator to model alerts view (#3520) 2024-03-28 10:31:29 +00:00
Shati Patel
fcf74b337f Refactor: extract function for canonicalising modeled methods (#3518) 2024-03-27 14:40:57 +00:00
Shati Patel
c84fa538ba Fire an event when clicking the "model alerts indicator" button (#3516) 2024-03-27 12:47:22 +00:00
Shati Patel
317d3b3c0e Fix "View" link in model alerts view (#3519) 2024-03-27 12:16:09 +00:00
Koen Vlaswinkel
e52a08db4d Safely close file handle in all cases 2024-03-27 10:46:56 +01:00
Koen Vlaswinkel
139c4555d9 Use Disposable type instead of isDisposable function 2024-03-27 10:43:31 +01:00
Shati Patel
a502e52d37 Add "view" button in model alerts view (#3514) 2024-03-26 17:51:37 +00:00
Robert
6b0f7e86fa Mark progress bars as cancellable where it appears we are respecting the token 2024-03-26 17:05:22 +00:00
Andrew Eisenberg
5d45a114be Merge pull request #3510 from github/aeisenberg/flush-archive-files
Flush archive file systems when removed
2024-03-26 08:11:36 -07:00
Koen Vlaswinkel
b53b33e3b6 Use file handle in TeeLogger
This switches the `TeeLogger` from using the `appendFile` function to
manually opening and closing a file handle and calling `appendFile` on
the file handle. This results in a more efficient implementation as the
file handle is only opened once and closed once, instead of being
opened and closed for every log message. This should result in less
"too many open files" errors.
2024-03-26 15:58:44 +01:00
Shati Patel
ccd53133a9 Use wider type for "reveal in model editor" (#3512) 2024-03-26 13:54:42 +00:00
Koen Vlaswinkel
38e862c1e0 Merge pull request #3513 from github/github-action/bump-cli
Bump CLI Version to v2.16.6 for integration tests
2024-03-26 14:12:44 +01:00
Koen Vlaswinkel
8de85453ec Merge pull request #3511 from github/koesie10/update-kinds
Update supported sink and source kinds in the model editor
2024-03-26 13:54:16 +01:00
github-actions[bot]
6d535ab0ad Bump CLI version from v2.16.5 to v2.16.6 for integration tests 2024-03-26 12:24:52 +00:00
Koen Vlaswinkel
61fa841784 Update CHANGELOG 2024-03-26 12:20:45 +01:00
Koen Vlaswinkel
b3c83d175a Update supported sink and source kinds 2024-03-26 12:09:51 +01:00
Koen Vlaswinkel
bd57005832 Split Java and C# model editor languages 2024-03-26 11:55:20 +01:00
Andrew Eisenberg
e939750822 Flush archive file systems when removed
This change will remove a file system archive from the cache when the associated folder is removed from the workspace.

This avoids the following bug:

1. Import a database and add its source folder
2. Remove the database (source folder is removed as well automatically).
3. Change the source code and recreate the database
4. Reimport the database and source folder
5. BUG: You see the original source folder, not the new source folder
2024-03-25 16:29:02 -07:00
Charis Kyriakou
21c33b762c Added filtering and sorting in the model alerts view (#3509) 2024-03-25 17:18:09 +00:00
Charis Kyriakou
8b6a9352f6 Update model alert processing to track repo results (#3508) 2024-03-25 12:15:16 +00:00
Charis Kyriakou
dea68e928a Extract re-usable SearchBox component (#3507) 2024-03-25 10:34:23 +00:00
Charis Kyriakou
a6b3d38939 Re-use setRepoResults instead of having a setReposResult message (#3506) 2024-03-22 16:01:02 +00:00
Koen Vlaswinkel
1739af4013 Merge pull request #3505 from github/koesie10/fix-python-model-editor
Fix detection of Python instance methods
2024-03-22 15:39:58 +01:00
Charis Kyriakou
cbc6b73759 Wire up processing model evaluation run results and showing alerts (#3503) 2024-03-22 14:33:36 +00:00
Koen Vlaswinkel
5c43018692 Merge pull request #3504 from github/koesie10/downgrade-typescript-eslint
Downgrade `@typescript-eslint/eslint-plugin` to v6
2024-03-22 13:10:03 +01:00
Koen Vlaswinkel
895673188f Fix detection of Python instance methods 2024-03-22 13:09:21 +01:00
Koen Vlaswinkel
38327c7b7f Downgrade @typescript-eslint/eslint-plugin to v6
Version 7 of `@typescript-eslint` is not compatible with Node 18.17 and
requires Node 18.18+ or Node 20. The latest minor/patch version of v7
started enforcing this requirement, but this was already part of the
breaking changes for v7.
2024-03-22 12:21:32 +01:00
Koen Vlaswinkel
161fe3d5a7 Merge pull request #3502 from github/dependabot/npm_and_yarn/extensions/ql-vscode/vscode/debugprotocol-1.65.0
Bump @vscode/debugprotocol from 1.64.0 to 1.65.0 in /extensions/ql-vscode
2024-03-21 14:48:18 +01:00
Koen Vlaswinkel
b99caf7bc1 Merge pull request #3499 from github/dependabot/npm_and_yarn/extensions/ql-vscode/storybook-e497c5f385
Bump the storybook group in /extensions/ql-vscode with 1 update
2024-03-21 14:47:21 +01:00
Koen Vlaswinkel
bd7d8ddaf0 Merge pull request #3501 from github/dependabot/npm_and_yarn/extensions/ql-vscode/typescript-eslint-09a1cc5d51
Bump the typescript-eslint group in /extensions/ql-vscode with 1 update
2024-03-21 14:47:05 +01:00
Koen Vlaswinkel
5c0ecd4041 Merge pull request #3500 from github/dependabot/npm_and_yarn/extensions/ql-vscode/testing-library-79d2cbd4c7
Bump the testing-library group in /extensions/ql-vscode with 1 update
2024-03-21 14:46:43 +01:00
dependabot[bot]
bfdb04bf69 Bump @vscode/debugprotocol in /extensions/ql-vscode
Bumps [@vscode/debugprotocol](https://github.com/microsoft/vscode-debugadapter-node) from 1.64.0 to 1.65.0.
- [Commits](https://github.com/microsoft/vscode-debugadapter-node/compare/v1.64.0...v1.65.0)

---
updated-dependencies:
- dependency-name: "@vscode/debugprotocol"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-21 13:33:52 +00:00
dependabot[bot]
c8f9381af2 Bump the typescript-eslint group in /extensions/ql-vscode with 1 update
Bumps the typescript-eslint group in /extensions/ql-vscode with 1 update: [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin).


Updates `@typescript-eslint/eslint-plugin` from 7.2.0 to 7.3.1
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.3.1/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: typescript-eslint
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-21 13:33:38 +00:00
dependabot[bot]
189a460621 Bump the testing-library group in /extensions/ql-vscode with 1 update
Bumps the testing-library group in /extensions/ql-vscode with 1 update: [@testing-library/react](https://github.com/testing-library/react-testing-library).


Updates `@testing-library/react` from 14.2.1 to 14.2.2
- [Release notes](https://github.com/testing-library/react-testing-library/releases)
- [Changelog](https://github.com/testing-library/react-testing-library/blob/main/CHANGELOG.md)
- [Commits](https://github.com/testing-library/react-testing-library/compare/v14.2.1...v14.2.2)

---
updated-dependencies:
- dependency-name: "@testing-library/react"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: testing-library
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-21 13:33:15 +00:00
dependabot[bot]
79967b8aed Bump the storybook group in /extensions/ql-vscode with 1 update
Bumps the storybook group in /extensions/ql-vscode with 1 update: [@storybook/csf](https://github.com/ComponentDriven/csf).


Updates `@storybook/csf` from 0.1.2 to 0.1.3
- [Release notes](https://github.com/ComponentDriven/csf/releases)
- [Changelog](https://github.com/ComponentDriven/csf/blob/v0.1.3/CHANGELOG.md)
- [Commits](https://github.com/ComponentDriven/csf/compare/v0.1.2...v0.1.3)

---
updated-dependencies:
- dependency-name: "@storybook/csf"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: storybook
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-21 13:32:57 +00:00
Arthur Baars
cdacde3121 Merge pull request #3498 from github/github-action/bump-cli
Bump CLI Version to v2.16.5 for integration tests
2024-03-21 14:29:09 +01:00
github-actions[bot]
219840200c Bump CLI version from v2.16.4 to v2.16.5 for integration tests 2024-03-21 12:36:34 +00:00
Charis Kyriakou
175907d39c Add React components for showing model alert results (#3495) 2024-03-20 15:00:33 +00:00
Charis Kyriakou
a8a63a4633 Remove repoStates state tracking from model evaluation (#3496) 2024-03-20 14:59:58 +00:00
Shati Patel
83b0614162 Fix code scanning alert about duplicate command usage (#3497) 2024-03-20 14:37:45 +00:00
Koen Vlaswinkel
9e1ca91676 Merge pull request #3480 from github/dependabot/npm_and_yarn/extensions/ql-vscode/storybook-ea1bb043e9
Bump the storybook group in /extensions/ql-vscode with 11 updates
2024-03-20 14:50:38 +01:00
Charis Kyriakou
6c3b0b5bb1 Move AnalysisAlert mock creation to a factory module (#3493) 2024-03-20 12:03:06 +00:00
Robert
e7d2a59756 Merge pull request #3478 from github/robertbrignull/token-query
Simplify query now we've deleted withInheritedProgress
2024-03-20 11:38:42 +00:00
Koen Vlaswinkel
8c3d3b62f5 Move @storybook/icons to devDependencies 2024-03-20 12:28:47 +01:00
Koen Vlaswinkel
c110fd3e0b Switch from Webpack to Vite for Storybook
This simplifies the setup and makes it more similar to the "real"
extension setup since it also uses ESBuild (which is also used by Vite).
2024-03-20 12:26:59 +01:00
Koen Vlaswinkel
47cdd109a4 Merge pull request #3494 from github/version/bump-to-v1.12.5
Bump version to v1.12.5
2024-03-20 12:13:49 +01:00
Koen Vlaswinkel
c553b1cb1d Run storybook migrate mdx-to-csf 2024-03-20 12:08:36 +01:00
Koen Vlaswinkel
ee4b13c9e9 Fix deprecation warning 2024-03-20 12:06:08 +01:00
github-actions[bot]
1982ad45b8 Bump version to v1.12.5 2024-03-20 10:54:17 +00:00
Koen Vlaswinkel
fb77d628f1 Merge pull request #3492 from github/v1.12.4
v1.12.4
2024-03-20 11:52:56 +01:00
Shati Patel
36236680a4 Add model alerts stats to the view (#3481) 2024-03-20 10:14:39 +00:00
Koen Vlaswinkel
876af669cb v1.12.4
Some checks failed
Release / Release (push) Has been cancelled
Release / Publish to VS Code Marketplace (push) Has been cancelled
Release / Publish to Open VSX Registry (push) Has been cancelled
2024-03-20 10:28:24 +01:00
Charis Kyriakou
3519139e68 Update MethodName component to receive specific props (#3491) 2024-03-20 09:03:13 +00:00
Charis Kyriakou
724370fb40 Fix ModelAlerts view stories (#3490) 2024-03-19 16:07:39 +00:00
Andrew Eisenberg
4deae2f79d Merge pull request #3486 from github/aeisenberg/ignore-missing-database
Three minor improvements to `testproj` import
2024-03-18 12:47:43 -07:00
Charis Kyriakou
3f817b3c0f Don't show notification after local query cancellation (#3489)
* Don't show notification after local query cancellation

* Update CHANGELOG
2024-03-18 15:57:21 +00:00
Charis Kyriakou
2d1c2349f8 Add 'stop evaluation' action to Model Alerts view (#3487) 2024-03-18 15:41:33 +00:00
Charis Kyriakou
46efb7c971 Center align model evaluation run link (#3488) 2024-03-18 13:56:51 +00:00
Charis Kyriakou
79d4e8cb78 Wire up variant analysis updates to Model Alerts view (#3485) 2024-03-18 11:35:45 +00:00
Andrew Eisenberg
31cfaebb59 Ensure database sources are zipped on re-import 2024-03-17 11:51:58 -07:00
Andrew Eisenberg
fe957db17a When importing from a directory, check for testproj
Use the testproj style import when using the folder icon to import a
database. This means that if the database directory ends with `testproj`
copy the database into workspace storage and make it available for
re-importing when the origin database changes.
2024-03-17 11:27:35 -07:00
Andrew Eisenberg
d57255152c Safely check for out of date databases
When checking to re-import test databases, if the target database is
missing or otherwise unavailable, avoid the check and just continue.

This avoids a bug where a user would delete a test database and there
would be an error when trying to run a query.
2024-03-17 11:25:05 -07:00
Charis Kyriakou
752ec04400 Added error handling on webview message processing (#3470) 2024-03-15 12:27:26 +00:00
dependabot[bot]
ec31b97de8 Bump @types/jest from 29.5.11 to 29.5.12 in /extensions/ql-vscode (#3483)
Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 29.5.11 to 29.5.12.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest)

---
updated-dependencies:
- dependency-name: "@types/jest"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-14 10:45:42 -07:00
dependabot[bot]
c447548db3 Bump the typescript-eslint group in /extensions/ql-vscode with 1 update (#3482)
Bumps the typescript-eslint group in /extensions/ql-vscode with 1 update: [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin).


Updates `@typescript-eslint/eslint-plugin` from 6.19.0 to 7.2.0
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.2.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: typescript-eslint
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-14 10:45:11 -07:00
dependabot[bot]
f5c3502202 Bump @babel/preset-env from 7.23.9 to 7.24.0 in /extensions/ql-vscode (#3475)
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.23.9 to 7.24.0.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.24.0/packages/babel-preset-env)

---
updated-dependencies:
- dependency-name: "@babel/preset-env"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-14 10:43:59 -07:00
Charis Kyriakou
5427c169b9 Show model packs in Model Alerts view (#3484) 2024-03-14 17:11:14 +00:00
dependabot[bot]
de2fc2966d Bump the storybook group in /extensions/ql-vscode with 11 updates
Bumps the storybook group in /extensions/ql-vscode with 11 updates:

| Package | From | To |
| --- | --- | --- |
| [@storybook/addon-a11y](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/a11y) | `7.6.15` | `8.0.0` |
| [@storybook/addon-actions](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/actions) | `7.6.4` | `8.0.0` |
| [@storybook/addon-essentials](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/essentials) | `7.6.4` | `8.0.0` |
| [@storybook/addon-interactions](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/interactions) | `7.6.4` | `8.0.0` |
| [@storybook/addon-links](https://github.com/storybookjs/storybook/tree/HEAD/code/addons/links) | `7.6.4` | `8.0.0` |
| [@storybook/components](https://github.com/storybookjs/storybook/tree/HEAD/code/ui/components) | `7.6.17` | `8.0.0` |
| [@storybook/manager-api](https://github.com/storybookjs/storybook/tree/HEAD/code/lib/manager-api) | `7.6.7` | `8.0.0` |
| [@storybook/react](https://github.com/storybookjs/storybook/tree/HEAD/code/renderers/react) | `7.6.12` | `8.0.0` |
| [@storybook/react-webpack5](https://github.com/storybookjs/storybook/tree/HEAD/code/frameworks/react-webpack5) | `7.6.12` | `8.0.0` |
| [@storybook/theming](https://github.com/storybookjs/storybook/tree/HEAD/code/lib/theming) | `7.6.17` | `8.0.0` |
| [storybook](https://github.com/storybookjs/storybook/tree/HEAD/code/lib/cli) | `7.6.15` | `8.0.0` |


Updates `@storybook/addon-a11y` from 7.6.15 to 8.0.0
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.0/code/addons/a11y)

Updates `@storybook/addon-actions` from 7.6.4 to 8.0.0
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.0/code/addons/actions)

Updates `@storybook/addon-essentials` from 7.6.4 to 8.0.0
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.0/code/addons/essentials)

Updates `@storybook/addon-interactions` from 7.6.4 to 8.0.0
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.0/code/addons/interactions)

Updates `@storybook/addon-links` from 7.6.4 to 8.0.0
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.0/code/addons/links)

Updates `@storybook/components` from 7.6.17 to 8.0.0
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.0/code/ui/components)

Updates `@storybook/manager-api` from 7.6.7 to 8.0.0
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.0/code/lib/manager-api)

Updates `@storybook/react` from 7.6.12 to 8.0.0
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.0/code/renderers/react)

Updates `@storybook/react-webpack5` from 7.6.12 to 8.0.0
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.0/code/frameworks/react-webpack5)

Updates `@storybook/theming` from 7.6.17 to 8.0.0
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.0/code/lib/theming)

Updates `storybook` from 7.6.15 to 8.0.0
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v8.0.0/code/lib/cli)

---
updated-dependencies:
- dependency-name: "@storybook/addon-a11y"
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: storybook
- dependency-name: "@storybook/addon-actions"
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: storybook
- dependency-name: "@storybook/addon-essentials"
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: storybook
- dependency-name: "@storybook/addon-interactions"
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: storybook
- dependency-name: "@storybook/addon-links"
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: storybook
- dependency-name: "@storybook/components"
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: storybook
- dependency-name: "@storybook/manager-api"
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: storybook
- dependency-name: "@storybook/react"
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: storybook
- dependency-name: "@storybook/react-webpack5"
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: storybook
- dependency-name: "@storybook/theming"
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: storybook
- dependency-name: storybook
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: storybook
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-14 16:19:27 +00:00
Koen Vlaswinkel
f06bc88b59 Merge pull request #3477 from github/koesie10/grouped-dependabot-updates
Group some npm dependency updates
2024-03-14 17:15:15 +01:00
Robert
d65e6bea53 Simplify now we've deleted withInheritedProgress 2024-03-14 16:02:37 +00:00
Charis Kyriakou
115ff838c5 Add model packs to variant analyses (#3472) 2024-03-14 14:39:30 +00:00
Koen Vlaswinkel
41524cf45c Group some npm dependency updates 2024-03-14 15:05:29 +01:00
Robert
9777cb1c66 Merge pull request #3464 from github/robertbrignull/token-not-used
Create token-not-used.ql to catch cases where we aren't using the progress bar token correctly
2024-03-14 13:46:30 +00:00
Robert
d9ac8744b6 Merge pull request #3466 from github/robertbrignull/remove_withInheritedProgress
Delete withInheritedProgress and ProgressContext
2024-03-14 13:44:22 +00:00
Robert
fffb0349a6 Apply suggestions from code review
Co-authored-by: Koen Vlaswinkel <koesie10@users.noreply.github.com>
2024-03-14 13:33:06 +00:00
Robert
0454130821 Merge branch 'main' into robertbrignull/remove_withInheritedProgress 2024-03-14 13:24:36 +00:00
Shati Patel
06f9f2c687 Add title to model alerts view (#3465) 2024-03-14 11:46:36 +00:00
Charis Kyriakou
dd90e38b7a Add new ModelPacks component (#3469) 2024-03-14 11:34:34 +00:00
Charis Kyriakou
aa2f371583 Close Model Alerts view when Model editor closes (#3468) 2024-03-14 10:39:44 +00:00
Charis Kyriakou
bbc881e7c7 Move LinkIconButton to common dir (#3467) 2024-03-14 09:39:59 +00:00
Andrew Eisenberg
4cdbdd0d7d Merge pull request #3433 from github/aeisenberg/re-import-test-db
Import testproj databases into workspace storage
2024-03-13 12:34:01 -07:00
Robert
ff889b73e1 Make documentation of fields more consistent 2024-03-13 18:09:51 +00:00
Robert
834b6a649e Use jest.MockedFunction 2024-03-13 18:06:44 +00:00
Robert
16b8f848b5 Delete ProgressContext 2024-03-13 17:57:08 +00:00
Robert
bf58e311dd Delete withInheritedProgress because we always have a progress context 2024-03-13 17:37:21 +00:00
Robert
84df4b64d8 Update messages/descriptions with how to fix the alert 2024-03-13 17:24:09 +00:00
Robert
4346cc6e98 Link to cancellable property 2024-03-13 17:08:55 +00:00
Robert
73bece6f38 Add query for using token when not cancellable 2024-03-13 16:43:59 +00:00
Robert
280bf8b7b2 Convert to an abstract class 2024-03-13 16:43:42 +00:00
Koen Vlaswinkel
a559a0a3e2 Merge pull request #3454 from github/koesie10/cancellable-variant-analysis
Make the "Run variant analysis against published pack" command cancellable
2024-03-13 16:10:18 +01:00
Koen Vlaswinkel
695cf340b7 Do not make model evaluator cancellable 2024-03-13 15:48:52 +01:00
Shati Patel
84a8ffdad2 Only allow one open model alerts view (#3461) 2024-03-13 14:05:47 +00:00
Koen Vlaswinkel
d56f71710e Use MultiCancellationToken in model evaluator 2024-03-13 13:03:46 +01:00
Robert
826175ccd5 Create token-not-used.ql 2024-03-13 11:32:57 +00:00
Shati Patel
3005dacf4e Use VSCodeBadge component (#3462) 2024-03-13 10:12:48 +00:00
Koen Vlaswinkel
8bb0085992 Enable forceExit for CLI tests 2024-03-13 10:20:55 +01:00
Koen Vlaswinkel
992a836ccb Use tree-kill for killing CLI process 2024-03-13 10:19:39 +01:00
Andrew Eisenberg
2d85018d1d Add better log messages 2024-03-12 16:32:24 -07:00
Andrew Eisenberg
f84f792c5f Merge remote-tracking branch 'upstream/main' into aeisenberg/re-import-test-db 2024-03-12 14:50:50 -07:00
Robert
55b9b2e891 Use mocks instead of spies in tests 2024-03-12 15:44:17 +00:00
Robert
ec42728367 Only construct DatabaseFetcher once in extension.ts 2024-03-12 15:38:27 +00:00
Robert
9fa6d99f09 Have the skeleton query wizard call promptImportGithubDatabase so we can make more methods private 2024-03-12 15:32:44 +00:00
Robert
f29aff6303 Inline isFile 2024-03-12 15:32:44 +00:00
Robert
3ee081e8c6 Move commonly-used field to DatabaseFetcher constructor 2024-03-12 15:32:40 +00:00
Robert
18f1a46493 Naively convert DatabaseFetcher to a class 2024-03-12 15:14:00 +00:00
Shati Patel
eb1a5cfba3 Add "model alerts indicator" component (#3441) 2024-03-12 14:08:49 +00:00
Koen Vlaswinkel
0cbd96ff7c Add error listener 2024-03-12 13:43:15 +01:00
Koen Vlaswinkel
3050437cab Clean up process 2024-03-12 13:43:15 +01:00
Koen Vlaswinkel
27bb46ab4c Make more parts of running a variant analysis cancellable 2024-03-12 13:43:14 +01:00
Koen Vlaswinkel
24b7adfb92 Allow cancelling pack download 2024-03-12 13:42:40 +01:00
Koen Vlaswinkel
97eaaacce6 Run pack bundle in separate process and allow cancelling it 2024-03-12 13:42:24 +01:00
Koen Vlaswinkel
b961a7ae55 Extract RunOptions 2024-03-12 13:42:24 +01:00
Koen Vlaswinkel
23003ec8bf Extract process output handling in CLI server 2024-03-12 13:42:24 +01:00
Koen Vlaswinkel
c32065e895 Merge pull request #3457 from github/koesie10/query-suite-code-scanning
Use suite file instead of manually filtering queries
2024-03-12 13:06:12 +01:00
Koen Vlaswinkel
b71a536e00 Use include instructions for suite file 2024-03-12 11:44:30 +01:00
Andrew Eisenberg
fd3acfb1c9 Address pull request comments 2024-03-11 16:01:25 -07:00
github-actions[bot]
66de756d88 Bump CLI Version to v2.16.4 for integration tests (#3459)
* Bump CLI version from v2.16.3 to v2.16.4 for integration tests

* Remove extraneous `v2.16.2` from supported list

We only need to keep the most recent patch version for each minor version.

---------

Co-authored-by: github-actions[bot] <github-actions@github.com>
Co-authored-by: Angela P Wen <angelapwen@github.com>
2024-03-11 14:10:03 -07:00
Koen Vlaswinkel
16a0fce7ce Merge pull request #3456 from github/koesie10/unique-database-names
Make database storage paths more unique
2024-03-11 16:40:46 +01:00
Koen Vlaswinkel
0feef365d9 Clean up temporary file in finally block 2024-03-11 14:39:07 +01:00
Koen Vlaswinkel
e003175f76 Reduce nanoid tries 2024-03-11 14:17:16 +01:00
Koen Vlaswinkel
0e3665b5fc Improve readability of duplicate filename logic 2024-03-11 14:16:53 +01:00
Koen Vlaswinkel
7681a56a16 Fix location of removing dots 2024-03-11 14:14:28 +01:00
Koen Vlaswinkel
bbc09f3ae5 Merge remote-tracking branch 'origin/main' into koesie10/unique-database-names 2024-03-11 12:49:32 +01:00
Koen Vlaswinkel
fe0136091d Use readdir instead of repeated pathExists calls 2024-03-11 12:41:26 +01:00
Koen Vlaswinkel
1ab3deab4d Merge pull request #3455 from github/koesie10/extension-managed-location
Fix incomplete removal of databases
2024-03-11 12:20:14 +01:00
Robert
650b09cf6a Merge pull request #3444 from github/robertbrignull/start-modeling-test
Add tests of MethodModelingViewProvider.viewLoaded
2024-03-11 11:18:56 +00:00
Robert
18f9b5fe15 Use jest.MockedFunction 2024-03-11 11:04:58 +00:00
Robert
dbd5d0f406 Remove unused arguments from resolveWebviewView 2024-03-11 11:02:37 +00:00
Robert
b436fbd73b Merge pull request #3453 from github/robertbrignull/convertGithubNwoToDatabaseUrl
Move convertGithubNwoToDatabaseUrl to databases/github-databases/api.ts
2024-03-11 10:58:15 +00:00
Robert
5402cab05a Merge pull request #3452 from github/robertbrignull/findDirWithFile
Move findDirWithFile to files.ts
2024-03-11 10:57:36 +00:00
Koen Vlaswinkel
e8efbbb9fd Introduce createFilenameFromString function 2024-03-11 11:31:43 +01:00
Koen Vlaswinkel
82741e95c3 Add test for extension-managed db location 2024-03-11 11:15:15 +01:00
Koen Vlaswinkel
35267bb3fd Use suite file instead of manually filtering queries 2024-03-08 16:12:56 +01:00
Koen Vlaswinkel
2c35a97b09 Make database storage paths more unique 2024-03-08 14:56:06 +01:00
Koen Vlaswinkel
f426178b96 Fix incomplete removal of databases 2024-03-08 13:45:59 +01:00
Shati Patel
dbd5078424 Fix warning in package.json about "editor.wordBasedSuggestions" (#3451) 2024-03-07 16:48:29 +00:00
Robert
66879ef626 Move convertGithubNwoToDatabaseUrl to databases/github-databases/api.ts 2024-03-07 16:36:29 +00:00
Robert
fe6dc8a7a3 Move findDirWithFile to files.ts 2024-03-07 16:31:01 +00:00
Robert
8b2355acc3 Merge pull request #3447 from github/dependabot/npm_and_yarn/extensions/ql-vscode/vscode/vsce-2.24.0
Bump @vscode/vsce from 2.22.0 to 2.24.0 in /extensions/ql-vscode
2024-03-07 14:12:01 +00:00
dependabot[bot]
be06026832 Bump @vscode/vsce from 2.22.0 to 2.24.0 in /extensions/ql-vscode
Bumps [@vscode/vsce](https://github.com/Microsoft/vsce) from 2.22.0 to 2.24.0.
- [Release notes](https://github.com/Microsoft/vsce/releases)
- [Commits](https://github.com/Microsoft/vsce/compare/v2.22.0...v2.24.0)

---
updated-dependencies:
- dependency-name: "@vscode/vsce"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-07 13:58:43 +00:00
Robert
d7ef716d63 Merge pull request #3446 from github/dependabot/npm_and_yarn/extensions/ql-vscode/vscode/test-electron-2.3.9
Bump @vscode/test-electron from 2.3.8 to 2.3.9 in /extensions/ql-vscode
2024-03-07 13:57:22 +00:00
Robert
cd9a0287fb Merge pull request #3448 from github/dependabot/npm_and_yarn/extensions/ql-vscode/nanoid-5.0.6
Bump nanoid from 5.0.4 to 5.0.6 in /extensions/ql-vscode
2024-03-07 13:56:03 +00:00
Robert
4187fd6e91 Merge pull request #3445 from github/dependabot/npm_and_yarn/extensions/ql-vscode/tar-stream-3.1.7
Bump tar-stream from 3.1.6 to 3.1.7 in /extensions/ql-vscode
2024-03-07 13:55:38 +00:00
dependabot[bot]
651a9a627e Bump nanoid from 5.0.4 to 5.0.6 in /extensions/ql-vscode
Bumps [nanoid](https://github.com/ai/nanoid) from 5.0.4 to 5.0.6.
- [Release notes](https://github.com/ai/nanoid/releases)
- [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ai/nanoid/compare/5.0.4...5.0.6)

---
updated-dependencies:
- dependency-name: nanoid
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-07 13:37:01 +00:00
dependabot[bot]
cd2fdf9d2e Bump @vscode/test-electron from 2.3.8 to 2.3.9 in /extensions/ql-vscode
Bumps [@vscode/test-electron](https://github.com/Microsoft/vscode-test) from 2.3.8 to 2.3.9.
- [Changelog](https://github.com/microsoft/vscode-test/blob/main/CHANGELOG.md)
- [Commits](https://github.com/Microsoft/vscode-test/commits/v2.3.9)

---
updated-dependencies:
- dependency-name: "@vscode/test-electron"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-07 13:36:36 +00:00
dependabot[bot]
7ad9507910 Bump tar-stream from 3.1.6 to 3.1.7 in /extensions/ql-vscode
Bumps [tar-stream](https://github.com/mafintosh/tar-stream) from 3.1.6 to 3.1.7.
- [Commits](https://github.com/mafintosh/tar-stream/compare/v3.1.6...v3.1.7)

---
updated-dependencies:
- dependency-name: tar-stream
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-07 13:36:25 +00:00
Robert
54cf5c55a8 Add tests of MethodModelingViewProvider viewLoaded 2024-03-07 10:10:33 +00:00
Robert
659da6cee1 Merge pull request #3440 from github/robertbrignull/database-download-creds
Push decision to use credentials or not down to where the creds are used
2024-03-06 16:43:19 +00:00
Robert
707cdec1ec Update CHANGELOG.md 2024-03-06 16:28:37 +00:00
Robert
ee5ccecbd3 Merge pull request #3443 from github/robertbrignull/delete_hasStateForActiveDb
Delete hasStateForActiveDb as it is unused
2024-03-06 16:26:33 +00:00
Robert
4a662eabfa Merge pull request #3442 from github/robertbrignull/cancellationTokenSource
Use CancellationTokenSource instead of casting dummy objects
2024-03-06 16:18:59 +00:00
Robert
0cdcd2ce67 Delete hasStateForActiveDb as it is unused 2024-03-06 14:52:48 +00:00
Robert
2bc261eacf Use CancellationTokenSource instead of casting dummy objects 2024-03-06 12:28:30 +00:00
Robert
83a6b5a054 Merge pull request #3439 from github/robertbrignull/modeling-mode
Refactor events to fix the method modeling panel getting stuck showing "start modeling"
2024-03-06 12:06:22 +00:00
Robert
5d263bb1a3 Push decision to use credentials or not down to where the creds are used 2024-03-05 15:11:00 +00:00
Shati Patel
cffecafb61 Add a new "model alerts" webview (for showing results from model evaluation) (#3436) 2024-03-05 14:39:30 +00:00
Rasmus Wriedt Larsen
6f1504aaff Merge pull request #3438 from github/RasmusWL/fix-quick-eval-counts
Fix `isQuickEvalCount` logic
2024-03-05 13:34:00 +01:00
Robert
ce12c67469 Merge pull request #3437 from github/robertbrignull/testplan-table-query
Avoid using a @treemap query in testplan
2024-03-05 12:14:12 +00:00
Robert
dc08da924f Inline showMethod 2024-03-05 11:56:37 +00:00
Robert
fdd45e8dbd Make revealItem private by listening to onSelectedMethodChanged 2024-03-05 11:56:31 +00:00
Robert
2f49ac83de Remove setMethod which was only called from onSelectedMethodChanged which we already listen to 2024-03-05 11:05:07 +00:00
Rasmus Wriedt Larsen
c69cea1f8e Apply suggestions from code review
Co-authored-by: Robert <robertbrignull@github.com>
2024-03-05 11:51:51 +01:00
Rasmus Wriedt Larsen
e6b1d8d616 Fix isQuickEvalCount logic
Since `false !== undefined` evaluates to true, we would assign the wrong
value to `isQuickEvalCount` when
`selectedQuery.quickEval?.quickEvalCount` is false
2024-03-05 11:21:43 +01:00
Robert
08c6c8a50c Introduce SetNoMethodSelectedMessage 2024-03-05 09:57:01 +00:00
Robert
d4413424c1 Rewrite setInitialState to always set all fields 2024-03-05 09:57:01 +00:00
Robert
a82be4258c Pull out setSelectedMethod method 2024-03-05 09:57:01 +00:00
Robert
b946f3a509 Pull out setDatabaseItem method 2024-03-05 09:57:00 +00:00
Robert
6402f05624 Avoid using a @treemap query in testplan 2024-03-05 09:42:07 +00:00
Shati Patel
ad9f78ca2b Add link to open "Evaluation Run" from the model editor (#3435) 2024-03-04 17:07:32 +00:00
Robert
54737a0221 Merge pull request #3434 from github/robertbrignull/node-version-workflow
Mention that an automated workflow exists for updating the node version
2024-03-04 16:04:01 +00:00
Robert
ff664dd18c Mention that an automated workflow exists for updating the node version 2024-03-04 11:14:50 +00:00
Andrew Eisenberg
0ed9242b81 Try waiting a few seconds before renaming 2024-03-02 20:43:55 -08:00
Andrew Eisenberg
3497219c68 Use unzipToDirectoryConcurrently instead of the unzipper package 2024-03-01 16:16:59 -05:00
Andrew Eisenberg
4450237612 Add changelog note
And fix linting error.
2024-03-01 15:41:26 -05:00
Koen Vlaswinkel
b7be98b627 Merge pull request #3414 from github/koesie10/verify-valid-sarif
Add check for id property when running variant analysis
2024-03-01 11:20:42 +01:00
Charis Kyriakou
96b7722f26 Add logic to stop an evaluation run (#3421) 2024-03-01 09:25:03 +00:00
Andrew Eisenberg
361fed622b Ask user if they want to re-import outdated testproj dbs
Before running a query now, do the following:

1. Check if the selected database is imported from a testproj
2. If so, check the last modified time of the `codeql-datase.yml` file
   of the imported database with that of its origin.
3. If the origin database has a file that is newer, assume that the
   database has been recreated since the last time it was imported.
4. If newer, then ask the user if they want to re-import before running
   the query.

Also, this change appends the `(test)` label to all test databases in
the database list.
2024-03-01 10:16:16 +01:00
Shati Patel
df782592bc Extract "ModelEvaluation" component (#3432) 2024-02-29 16:42:38 +00:00
dependabot[bot]
30fd1226d5 Bump @babel/core from 7.23.6 to 7.24.0 in /extensions/ql-vscode (#3429)
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.23.6 to 7.24.0.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.24.0/packages/babel-core)

---
updated-dependencies:
- dependency-name: "@babel/core"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-29 06:47:04 -08:00
dependabot[bot]
d810ed823a Bump eslint-plugin-storybook in /extensions/ql-vscode (#3431)
Bumps [eslint-plugin-storybook](https://github.com/storybookjs/eslint-plugin-storybook) from 0.6.15 to 0.8.0.
- [Release notes](https://github.com/storybookjs/eslint-plugin-storybook/releases)
- [Changelog](https://github.com/storybookjs/eslint-plugin-storybook/blob/main/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/eslint-plugin-storybook/compare/v0.6.15...v0.8.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-storybook
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-29 06:23:01 -08:00
dependabot[bot]
567a0bb194 Bump applicationinsights from 2.9.2 to 2.9.4 in /extensions/ql-vscode (#3430)
Bumps [applicationinsights](https://github.com/microsoft/ApplicationInsights-node.js) from 2.9.2 to 2.9.4.
- [Release notes](https://github.com/microsoft/ApplicationInsights-node.js/releases)
- [Commits](https://github.com/microsoft/ApplicationInsights-node.js/compare/2.9.2...2.9.4)

---
updated-dependencies:
- dependency-name: applicationinsights
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-29 06:22:37 -08:00
Charis Kyriakou
f283df0225 Update model evaluation notification (#3426) 2024-02-29 14:19:34 +00:00
dependabot[bot]
a70fd835f1 Bump mini-css-extract-plugin in /extensions/ql-vscode (#3428)
Bumps [mini-css-extract-plugin](https://github.com/webpack-contrib/mini-css-extract-plugin) from 2.8.0 to 2.8.1.
- [Release notes](https://github.com/webpack-contrib/mini-css-extract-plugin/releases)
- [Changelog](https://github.com/webpack-contrib/mini-css-extract-plugin/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v2.8.0...v2.8.1)

---
updated-dependencies:
- dependency-name: mini-css-extract-plugin
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-29 06:12:11 -08:00
Charis Kyriakou
a51bd76392 Skip logging warning for multi-query variant analyses (#3425) 2024-02-29 13:50:19 +00:00
Charis Kyriakou
1ac92ad79c Don't open variant analysis view when running a model evaluation run (#3424) 2024-02-29 13:38:21 +00:00
Koen Vlaswinkel
b168ce708b Check against problem and path-problem aliases 2024-02-29 14:01:32 +01:00
Anders Starcke Henriksen
fc5d462dc5 Merge pull request #3423 from github/version/bump-to-v1.12.4
Bump version to v1.12.4
2024-02-29 12:17:11 +01:00
github-actions[bot]
30da5d5b62 Bump version to v1.12.4 2024-02-29 10:42:04 +00:00
Anders Starcke Henriksen
b301c4a08c Merge pull request #3422 from github/v1.12.3
v1.12.3
2024-02-29 11:40:21 +01:00
Koen Vlaswinkel
5521c00346 Add check for id property when running variant analysis 2024-02-28 11:17:15 +01:00
Koen Vlaswinkel
eb71df84a7 Move query metadata retrieval before pack bundling 2024-02-28 11:15:00 +01:00
Andrew Eisenberg
ca21ed18d0 Import testproj databases into workspace storage
If a folder that ends with `.testproj` is encountered, assume it is a
database created by a codeql test. When the user wants to import this
database, copy it into workspace storage. The database can be
re-imported, which first removes the old version before importing it
again.
2024-02-25 18:39:41 -05:00
229 changed files with 11889 additions and 10105 deletions

16
.github/codeql/queries/ProgressBar.qll vendored Normal file
View File

@@ -0,0 +1,16 @@
import javascript
class WithProgressCall extends CallExpr {
WithProgressCall() { this.getCalleeName() = "withProgress" }
predicate usesToken() { exists(this.getTokenParameter()) }
Parameter getTokenParameter() { result = this.getArgument(0).(Function).getParameter(1) }
Property getCancellableProperty() { result = this.getArgument(1).(ObjectExpr).getPropertyByName("cancellable") }
predicate isCancellable() {
this.getCancellableProperty().getInit().(BooleanLiteral).getBoolValue() =
true
}
}

View File

@@ -0,0 +1,20 @@
/**
* @name Using token for non-cancellable progress bar
* @kind problem
* @problem.severity warning
* @id vscode-codeql/progress-not-cancellable
* @description If we call `withProgress` without `cancellable: true` then the
* token that is given to us should be ignored because it won't ever be cancelled.
* This makes the code more confusing as it tries to account for cases that can't
* happen. The fix is to either not use the token or make the progress bar cancellable.
*/
import javascript
import ProgressBar
from WithProgressCall t
where not t.isCancellable() and t.usesToken()
select t,
"The $@ should not be used when the progress bar is not cancellable. Either stop using the $@ or mark the progress bar as cancellable.",
t.getTokenParameter(), t.getTokenParameter().getName(), t.getTokenParameter(),
t.getTokenParameter().getName()

View File

@@ -0,0 +1,18 @@
/**
* @name Don't ignore the token for a cancellable progress bar
* @kind problem
* @problem.severity warning
* @id vscode-codeql/token-not-used
* @description If we call `withProgress` with `cancellable: true` but then
* ignore the token that is given to us, it will lead to a poor user experience
* because the progress bar will appear to be canceled but it will not actually
* affect the background process. Either check the token and respect when it
* has been cancelled, or mark the progress bar as not cancellable.
*/
import javascript
import ProgressBar
from WithProgressCall t
where t.isCancellable() and not t.usesToken()
select t, "This progress bar is $@ but the token is not used. Either use the token or mark the progress bar as not cancellable.", t.getCancellableProperty(), "cancellable"

View File

@@ -13,6 +13,23 @@ updates:
# are unrelated to the Node version, so we allow those.
- dependency-name: "@types/node"
update-types: ["version-update:semver-major", "version-update:semver-minor"]
groups:
octokit:
patterns:
- "@octokit/*"
update-types:
- "minor"
- "patch"
storybook:
patterns:
- "@storybook/*"
- "storybook"
testing-library:
patterns:
- "@testing-library/*"
typescript-eslint:
patterns:
- "@typescript-eslint/*"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
@@ -20,3 +37,10 @@ updates:
day: "thursday" # Thursday is arbitrary
labels:
- "Update dependencies"
- package-ecosystem: docker
directory: "extensions/ql-vscode/test/e2e"
schedule:
interval: "weekly"
day: "thursday" # Thursday is arbitrary
labels:
- "Update dependencies"

View File

@@ -5,8 +5,4 @@
Replace this with a description of the changes your pull request makes.
## Checklist
- [ ] [CHANGELOG.md](https://github.com/github/vscode-codeql/blob/main/extensions/ql-vscode/CHANGELOG.md) has been updated to incorporate all user visible changes made by this pull request.
- [ ] Issues have been created for any UI or other user-facing changes made by this pull request.
- [ ] _[Maintainers only]_ If this pull request makes user-facing changes that require documentation changes, open a corresponding docs pull request in the [github/codeql](https://github.com/github/codeql/tree/main/docs/codeql/codeql-for-visual-studio-code) repo and add the `ready-for-doc-review` label there.
Remember to update the [changelog](https://github.com/github/vscode-codeql/blob/main/extensions/ql-vscode/CHANGELOG.md) if there have been user-facing changes!

View File

@@ -144,6 +144,19 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest]
steps:
# Enable 8.3 filename creation. This is not required to run the extension but it is required for the unit tests to pass.
# This feature is currently enabled by default in Windows 11 for the C: drive and therefore we must maintain support for it.
# This setting needs to be enabled before files are created, i.e. before we checkout the repository.
- name: Enable 8.3 filenames
shell: pwsh
if: ${{ matrix.os == 'windows-latest' }}
run: |
$shortNameEnableProcess = Start-Process -FilePath fsutil.exe -ArgumentList ('8dot3name', 'set', '0') -Wait -PassThru
$shortNameEnableExitCode = $shortNameEnableProcess.ExitCode
if ($shortNameEnableExitCode -ne 0) {
exit $shortNameEnableExitCode
}
- name: Checkout
uses: actions/checkout@v4
with:

View File

@@ -134,7 +134,7 @@ jobs:
- name: Publish to Registry
run: |
npx vsce publish -p $VSCE_TOKEN --packagePath *.vsix
npx @vscode/vsce publish -p $VSCE_TOKEN --packagePath *.vsix
open-vsx-publish:
name: Publish to Open VSX Registry

View File

@@ -111,4 +111,10 @@
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
},
"github.copilot.advanced": {
},
"codeQL.variantAnalysis.enableGhecDr": true,
"github-enterprise.uri": "http://server:8080/"
}

View File

@@ -28,6 +28,7 @@ Here are a few things you can do that will increase the likelihood of your pull
- [Integration tests that do require the VS Code API are located here](extensions/ql-vscode/src/vscode-tests).
- 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.
- Write a [good commit message](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).
- Update the [changelog](https://github.com/github/vscode-codeql/blob/main/extensions/ql-vscode/CHANGELOG.md) if you are making user-facing changes.
## Setting up a local build

View File

@@ -1,5 +1,8 @@
# Node version
> [!NOTE]
> It should not be necessary to update the Node.js version manually. The [update-node-version.yml](https://github.com/github/vscode-codeql/blob/main/.github/workflows/update-node-version.yml) workflow runs daily and will open a pull request if the Node.js version needs to be updated.
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.
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.

View File

@@ -1,5 +1,6 @@
# Releasing (write access required)
1. Make sure the needed authentication keys are valid. Most likely the Azure DevOps PAT needs to be regenerated. See below.
1. Determine the new version number. We default to increasing the patch version number, but make our own judgement about whether a change is big enough to warrant a minor version bump. Common reasons for a minor bump could include:
- Making substantial new features available to all users. This can include lifting a feature flag.
- Breakage in compatibility with recent versions of the CLI.
@@ -60,7 +61,7 @@
## Secrets and authentication for publishing
Repository administrators, will need to manage the authentication keys for publishing to the VS Code marketplace and Open VSX. Each requires an authentication token. The VS Code marketplace token expires yearly.
Repository administrators, will need to manage the authentication keys for publishing to the VS Code marketplace and Open VSX. Each requires an authentication token.
To regenerate the Open VSX token:
@@ -69,4 +70,4 @@ To regenerate the Open VSX token:
1. Go to the [Access Tokens](https://open-vsx.org/user-settings/tokens) page and generate a new token.
1. Update the secret in the `publish-open-vsx` environment in the project settings.
To regenerate the VSCode Marketplace token, please see our internal documentation. Note that Azure DevOps PATs expire every 90 days and must be regenerated.
To regenerate the VSCode Marketplace token, please see our internal documentation. Note that Azure DevOps PATs expire every 7 days and must be regenerated.

View File

@@ -53,11 +53,11 @@ choose to go through some of the Optional Test Cases.
#### Test case 3: Running a non-problem query and viewing results
1. Open the [cpp FunLinesOfCode query](https://github.com/github/codeql/blob/main/cpp/ql/src/Metrics/Functions/FunLinesOfCode.ql).
1. Open the [cpp HubClasses query](https://github.com/github/codeql/blob/main/cpp/ql/src/Architecture/General%20Class-Level%20Information/HubClasses.ql).
2. Select the `google/brotli` database (or download it if you don't have one already)
3. Run a local query.
4. Once the query completes:
- Chose the `#select` result set from the drop-down
- Check that the `#select` result set is shown
- Check that the results table is rendered
- Check that result locations can be clicked on
@@ -179,7 +179,7 @@ Run one of the above MRVAs, but cancel it from within VS Code:
import semmle.python.frameworks.data.internal.ApiGraphModelsExtensions
from string path, string kind
where sinkModel("vscode-codeql", path, kind)
where sinkModel("vscode-codeql", path, kind, _)
select path, kind
```
@@ -210,17 +210,7 @@ Run one of the above MRVAs, but cancel it from within VS Code:
4. Open the ".model.yml" file corresponding to the library that was changed.
- Check that the file contains entries for the methods that were modeled.
#### Test Case 3: Model with AI
Note that this test requires the feature flag: `codeQL.model.llmGeneration`
A package that the AI normally gives models for is `javax.servlet-api` from the `jhy/jsoup` repository.
1. Click "Model with AI".
- Check that rows change to "Thinking".
- Check that results come back and rows get filled out.
#### Test Case 4: Model as dependency
#### Test Case 3: Model as dependency
Note that this test requires the feature flag: `codeQL.model.flowGeneration`

View File

@@ -1,16 +0,0 @@
{
"sourceType": "unambiguous",
"presets": [
[
"@babel/preset-env",
{
"targets": {
"chrome": 100
}
}
],
"@babel/preset-typescript",
"@babel/preset-react"
],
"plugins": []
}

View File

@@ -1 +1 @@
v18.17.1
v20.9.0

View File

@@ -1,7 +1,7 @@
import type { StorybookConfig } from "@storybook/react-webpack5";
import type { StorybookConfig } from "@storybook/react-vite";
const config: StorybookConfig = {
stories: ["../src/**/*.stories.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
@@ -10,7 +10,7 @@ const config: StorybookConfig = {
"./vscode-theme-addon/preset.ts",
],
framework: {
name: "@storybook/react-webpack5",
name: "@storybook/react-vite",
options: {},
},
docs: {

View File

@@ -5,10 +5,10 @@ import { useCallback } from "react";
import { useGlobals } from "@storybook/manager-api";
import {
IconButton,
Icons,
TooltipLinkList,
WithTooltip,
} from "@storybook/components";
import { DashboardIcon } from "@storybook/icons";
import { themeNames, VSCodeTheme } from "./theme";
@@ -53,7 +53,7 @@ export const ThemeSelector: FunctionComponent = () => {
title="Change the theme of the preview"
active={vscodeTheme !== VSCodeTheme.Dark}
>
<Icons icon="dashboard" />
<DashboardIcon />
</IconButton>
</WithTooltip>
);

View File

@@ -1,3 +1,5 @@
/// <reference types="vite/client" />
import { useEffect } from "react";
import type {
PartialStoryFn as StoryFunction,
@@ -6,31 +8,20 @@ import type {
import { VSCodeTheme } from "./theme";
import darkThemeStyle from "../../src/stories/vscode-theme-dark.css?url";
import lightThemeStyle from "../../src/stories/vscode-theme-light.css?url";
import lightHighContrastThemeStyle from "../../src/stories/vscode-theme-light-high-contrast.css?url";
import darkHighContrastThemeStyle from "../../src/stories/vscode-theme-dark-high-contrast.css?url";
import githubLightDefaultThemeStyle from "../../src/stories/vscode-theme-github-light-default.css?url";
import githubDarkDefaultThemeStyle from "../../src/stories/vscode-theme-github-dark-default.css?url";
const themeFiles: { [key in VSCodeTheme]: string } = {
[VSCodeTheme.Dark]:
// eslint-disable-next-line @typescript-eslint/no-var-requires,import/no-commonjs,import/no-webpack-loader-syntax
require("!file-loader?modules!../../src/stories/vscode-theme-dark.css")
.default,
[VSCodeTheme.Light]:
// eslint-disable-next-line @typescript-eslint/no-var-requires,import/no-commonjs,import/no-webpack-loader-syntax
require("!file-loader?modules!../../src/stories/vscode-theme-light.css")
.default,
[VSCodeTheme.LightHighContrast]:
// eslint-disable-next-line @typescript-eslint/no-var-requires,import/no-commonjs,import/no-webpack-loader-syntax
require("!file-loader?modules!../../src/stories/vscode-theme-light-high-contrast.css")
.default,
[VSCodeTheme.DarkHighContrast]:
// eslint-disable-next-line @typescript-eslint/no-var-requires,import/no-commonjs,import/no-webpack-loader-syntax
require("!file-loader?modules!../../src/stories/vscode-theme-dark-high-contrast.css")
.default,
[VSCodeTheme.GitHubLightDefault]:
// eslint-disable-next-line @typescript-eslint/no-var-requires,import/no-commonjs,import/no-webpack-loader-syntax
require("!file-loader?modules!../../src/stories/vscode-theme-github-light-default.css")
.default,
[VSCodeTheme.GitHubDarkDefault]:
// eslint-disable-next-line @typescript-eslint/no-var-requires,import/no-commonjs,import/no-webpack-loader-syntax
require("!file-loader?modules!../../src/stories/vscode-theme-github-dark-default.css")
.default,
[VSCodeTheme.Dark]: darkThemeStyle,
[VSCodeTheme.Light]: lightThemeStyle,
[VSCodeTheme.LightHighContrast]: lightHighContrastThemeStyle,
[VSCodeTheme.DarkHighContrast]: darkHighContrastThemeStyle,
[VSCodeTheme.GitHubLightDefault]: githubLightDefaultThemeStyle,
[VSCodeTheme.GitHubDarkDefault]: githubDarkDefaultThemeStyle,
};
export const withTheme = (StoryFn: StoryFunction, context: StoryContext) => {

View File

@@ -1,10 +1,34 @@
# CodeQL for Visual Studio Code: Changelog
## [UNRELEASED]
## 1.13.1 - 29 May 2024
- Fix a bug when re-importing test databases that erroneously showed old source code. [#3616](https://github.com/github/vscode-codeql/pull/3616)
- Update the progress window with details on potentially long-running post-processing steps after running a query. [#3622](https://github.com/github/vscode-codeql/pull/3622)
## 1.13.0 - 1 May 2024
- Add Ruby support to the CodeQL Model Editor. [#3584](https://github.com/github/vscode-codeql/pull/3584)
- Remove support for CodeQL CLI versions older than 2.14.6. [#3562](https://github.com/github/vscode-codeql/pull/3562)
## 1.12.5 - 9 April 2024
- Add new supported source and sink kinds in the CodeQL Model Editor [#3511](https://github.com/github/vscode-codeql/pull/3511)
- Fix a bug where the test explorer wouldn't display certain tests. [#3527](https://github.com/github/vscode-codeql/pull/3527)
- The "model dependency" operation in the model editor can now be cancelled. [#3517](https://github.com/github/vscode-codeql/pull/3517)
## 1.12.4 - 20 March 2024
- Don't show notification after local query cancellation. [#3489](https://github.com/github/vscode-codeql/pull/3489)
- Databases created from [CodeQL test cases](https://docs.github.com/en/code-security/codeql-cli/using-the-advanced-functionality-of-the-codeql-cli/testing-custom-queries) are now copied into a shared VS Code storage location. This avoids a bug where re-running test cases would fail if the test's database is already imported into the workspace. [#3433](https://github.com/github/vscode-codeql/pull/3433)
## 1.12.3 - 29 February 2024
- Update variant analysis view to show when cancelation is in progress. [#3405](https://github.com/github/vscode-codeql/pull/3405)
- Remove support for CodeQL CLI versions older than 2.13.5. [#3371](https://github.com/github/vscode-codeql/pull/3371)
- Add a timeout to downloading databases and the CodeQL CLI. These can be changed using the `codeQL.addingDatabases.downloadTimeout` and `codeQL.cli.downloadTimeout` settings respectively. [#3373](https://github.com/github/vscode-codeql/pull/3373)
- When downloading a CodeQL database through the model editor, only use credentials when in canary mode. [#3440](https://github.com/github/vscode-codeql/pull/3440)
## 1.12.2 - 14 February 2024
@@ -480,7 +504,7 @@ No user facing changes.
- Allow setting `codeQL.runningQueries.numberOfThreads` and `codeQL.runningTests.numberOfThreads` to 0, (which is interpreted as 'use one thread per core on the machine').
- Clear the problems view of all CodeQL query results when a database is removed.
- Add a `View DIL` command on query history items. This opens a text editor containing the Datalog Intermediary Language representation of the compiled query.
- Remove feature flag for the AST Viewer. For more information on how to use the AST Viewer, [see the documentation](https://help.semmle.com/codeql/codeql-for-vscode/procedures/exploring-the-structure-of-your-source-code.html).
- Remove feature flag for the AST Viewer. For more information on how to use the AST Viewer, [see the documentation](https://codeql.github.com/docs/codeql-for-visual-studio-code/exploring-the-structure-of-your-source-code/).
- The `codeQL.runningTests.numberOfThreads` setting is now used correctly when running tests.
- Alter structure of the _Test Explorer_ tree. It now follows the structure of the filesystem instead of the qlpacks.
- Ensure output of CodeQL test runs includes compilation error messages and test failure messages.

View File

@@ -9,10 +9,12 @@ This project is an extension for Visual Studio Code that adds rich language supp
To see what has changed in the last few versions of the extension, see the [Changelog](https://github.com/github/vscode-codeql/blob/main/extensions/ql-vscode/CHANGELOG.md).
You can also read full documentation for the extension on the [GitHub documentation website](https://docs.github.com/code-security/codeql-for-vs-code/using-the-advanced-functionality-of-the-codeql-for-vs-code-extension).
## Quick start overview
The information in this `README` file describes the quickest way to start using CodeQL.
For information about other configurations, see the separate [CodeQL help](https://codeql.github.com/docs/codeql-for-visual-studio-code/).
For information about other configurations, see "[Using the advanced functionality of the CodeQL for VS Code extension](https://docs.github.com/code-security/codeql-for-vs-code/using-the-advanced-functionality-of-the-codeql-for-vs-code-extension)" in the GitHub documentation.
### Quick start: Installing and configuring the extension
@@ -42,7 +44,7 @@ The CodeQL extension requires a minimum of Visual Studio Code 1.39. Older versio
The extension uses the [CodeQL CLI](https://codeql.github.com/docs/codeql-cli/) to compile and run queries. The extension automatically manages access to the CLI for you by default (recommended). To check for updates to the CodeQL CLI, you can use the **CodeQL: Check for CLI Updates** command.
If you want to override the default behavior and use a CodeQL CLI that's already on your machine, see [Configuring access to the CodeQL CLI](https://codeql.github.com/docs/codeql-for-visual-studio-code/setting-up-codeql-in-visual-studio-code/#configuring-access-to-the-codeql-cli).
If you want to override the default behavior and use a CodeQL CLI that's already on your machine, see "[Configuring access to the CodeQL CLI](https://docs.github.com/code-security/codeql-for-vs-code/using-the-advanced-functionality-of-the-codeql-for-vs-code-extension/configuring-access-to-the-codeql-cli)" in the GitHub documentation.
If you have any difficulty with CodeQL CLI access, see the **CodeQL Extension Log** in the **Output** view for any error messages.
@@ -52,7 +54,7 @@ When you're working with CodeQL, you need access to the standard CodeQL librarie
Initially, we recommend that you clone and use the ready-to-use [starter workspace](https://github.com/github/vscode-codeql-starter/).
This includes libraries and queries for the main supported languages, with folders set up ready for your custom queries. After cloning the workspace (use `git clone --recursive`), you can use it in the same way as any other VS Code workspace—with the added advantage that you can easily update the CodeQL libraries.
For information about configuring an existing workspace for CodeQL, [see the documentation](https://codeql.github.com/docs/codeql-for-visual-studio-code/setting-up-codeql-in-visual-studio-code/#updating-an-existing-workspace-for-codeql).
For information about configuring an existing workspace for CodeQL, see "[Setting up a CodeQL workspace](https://docs.github.com/code-security/codeql-for-vs-code/using-the-advanced-functionality-of-the-codeql-for-vs-code-extension/setting-up-a-codeql-workspace#option-2-updating-an-existing-workspace-for-codeql-advanced)" in the GitHub documentation.
## Upgrading CodeQL standard libraries
@@ -85,7 +87,7 @@ While you can use the [CodeQL CLI to create your own databases](https://codeql.g
1. Select the language for the database you want to download (only required if the project has databases for multiple languages).
1. Once the CodeQL database has been imported, it is displayed in the Databases view.
For more information, see [Choosing a database](https://codeql.github.com/docs/codeql-for-visual-studio-code/analyzing-your-projects/#choosing-a-database) on codeql.github.com.
For more information, see "[Managing CodeQL databases](https://docs.github.com/code-security/codeql-for-vs-code/getting-started-with-codeql-for-vs-code/managing-codeql-databases#choosing-a-database-to-analyze)" in the GitHub documentation.
### Running a query
@@ -106,12 +108,12 @@ If you wish to navigate the query results from your keyboard, you can bind short
## What next?
For more information about the CodeQL extension, [see the documentation](https://codeql.github.com/docs/codeql-for-visual-studio-code/). Otherwise, you could:
We recommend reading the [full documentation for the extension](https://docs.github.com/code-security/codeql-for-vs-code/) on the GitHub documentation website. You may also find the following resources useful:
- [Create a database for a different codebase](https://codeql.github.com/docs/codeql-cli/creating-codeql-databases/).
- [Try out variant analysis](https://help.semmle.com/QL/learn-ql/ql-training.html).
- [Try out variant analysis](https://docs.github.com/code-security/codeql-for-vs-code/getting-started-with-codeql-for-vs-code/running-codeql-queries-at-scale-with-multi-repository-variant-analysis).
- [Learn more about CodeQL](https://codeql.github.com/docs/).
- [Read how security researchers use CodeQL to find CVEs](https://securitylab.github.com/research).
- [Read how security researchers use CodeQL to find CVEs](https://github.blog/tag/github-security-lab/).
## License
@@ -119,4 +121,4 @@ The CodeQL extension for Visual Studio Code is [licensed](LICENSE.md) under the
## Data and Telemetry
If you specifically opt-in to permit GitHub to do so, GitHub will collect usage data and metrics for the purposes of helping the core developers to improve the CodeQL extension for VS Code. This data will not be shared with any parties outside of GitHub. IP addresses and installation IDs will be retained for a maximum of 30 days. Anonymous data will be retained for a maximum of 180 days. For more information about telemetry, [see the documentation](https://codeql.github.com/docs/codeql-for-visual-studio-code/about-telemetry-in-codeql-for-visual-studio-code).
If you specifically opt-in to permit GitHub to do so, GitHub will collect usage data and metrics for the purposes of helping the core developers to improve the CodeQL extension for VS Code. This data will not be shared with any parties outside of GitHub. IP addresses and installation IDs will be retained for a maximum of 30 days. Anonymous data will be retained for a maximum of 180 days. For more information, see "[Telemetry in CodeQL for Visual Studio Code](https://docs.github.com/code-security/codeql-for-vs-code/using-the-advanced-functionality-of-the-codeql-for-vs-code-extension/telemetry-in-codeql-for-visual-studio-code)" in the GitHub documentation.

File diff suppressed because it is too large Load Diff

View File

@@ -4,7 +4,7 @@
"description": "CodeQL for Visual Studio Code",
"author": "GitHub",
"private": true,
"version": "1.12.3",
"version": "1.13.2",
"publisher": "GitHub",
"license": "MIT",
"icon": "media/VS-marketplace-CodeQL-icon.png",
@@ -14,7 +14,7 @@
},
"engines": {
"vscode": "^1.82.0",
"node": "^18.17.1",
"node": "^20.9.0",
"npm": ">=7.20.6"
},
"categories": [
@@ -53,10 +53,10 @@
"configurationDefaults": {
"[ql]": {
"debug.saveBeforeStart": "nonUntitledEditorsInActiveGroup",
"editor.wordBasedSuggestions": false
"editor.wordBasedSuggestions": "off"
},
"[dbscheme]": {
"editor.wordBasedSuggestions": false
"editor.wordBasedSuggestions": "off"
}
},
"debuggers": [
@@ -339,13 +339,6 @@
"title": "Variant analysis",
"order": 5,
"properties": {
"codeQL.variantAnalysis.controllerRepo": {
"type": "string",
"default": "",
"pattern": "^$|^(?:[a-zA-Z0-9]+-)*[a-zA-Z0-9]+/[a-zA-Z0-9-_]+$",
"patternErrorMessage": "Please enter a valid GitHub repository",
"markdownDescription": "[For internal use only] The name of the GitHub repository in which the GitHub Actions workflow is run when using the \"Run Variant Analysis\" command. The repository should be of the form `<owner>/<repo>`)."
},
"codeQL.variantAnalysis.defaultResultsFilter": {
"type": "string",
"default": "all",
@@ -463,8 +456,25 @@
},
{
"type": "object",
"title": "Log insights",
"title": "Model Editor",
"order": 9,
"properties": {
"codeQL.model.packLocation": {
"type": "string",
"default": ".github/codeql/extensions/${name}-${language}",
"markdownDescription": "Location for newly created CodeQL model packs. The location can be either absolute or relative. If relative, it is relative to the workspace root.\n\nThe following variables are supported:\n* **${database}** - the name of the database\n* **${language}** - the name of the language\n* **${name}** - the name of the GitHub repository, or the name of the database if the database was not downloaded from GitHub\n* **${owner}** - the owner of the GitHub repository, or an empty string if the database was not downloaded from GitHub"
},
"codeQL.model.packName": {
"type": "string",
"default": "${owner}/${name}-${language}",
"markdownDescription": "Name of newly created CodeQL model packs. If the result is not a valid pack name, it will be converted to a valid pack name.\n\nThe following variables are supported:\n* **${database}** - the name of the database\n* **${language}** - the name of the language\n* **${name}** - the name of the GitHub repository, or the name of the database if the database was not downloaded from GitHub\n* **${owner}** - the owner of the GitHub repository, or an empty string if the database was not downloaded from GitHub"
}
}
},
{
"type": "object",
"title": "Log insights",
"order": 10,
"properties": {
"codeQL.logInsights.joinOrderWarningThreshold": {
"type": "number",
@@ -478,7 +488,7 @@
{
"type": "object",
"title": "Telemetry",
"order": 10,
"order": 11,
"properties": {
"codeQL.telemetry.enableTelemetry": {
"type": "boolean",
@@ -738,6 +748,10 @@
"command": "codeQL.setCurrentDatabase",
"title": "CodeQL: Set Current Database"
},
{
"command": "codeQL.importTestDatabase",
"title": "CodeQL: (Re-)Import Test Database"
},
{
"command": "codeQL.getCurrentDatabase",
"title": "CodeQL: Get Current Database"
@@ -1322,7 +1336,12 @@
{
"command": "codeQL.setCurrentDatabase",
"group": "9_qlCommands",
"when": "resourceScheme == codeql-zip-archive || explorerResourceIsFolder || resourceExtname == .zip"
"when": "resourceExtname != .testproj && (resourceScheme == codeql-zip-archive || explorerResourceIsFolder || resourceExtname == .zipz)"
},
{
"command": "codeQL.importTestDatabase",
"group": "9_qlCommands",
"when": "explorerResourceIsFolder && resourceExtname == .testproj"
},
{
"command": "codeQL.viewAstContextExplorer",
@@ -1476,6 +1495,10 @@
"command": "codeQL.setCurrentDatabase",
"when": "false"
},
{
"command": "codeQL.importTestDatabase",
"when": "false"
},
{
"command": "codeQL.getCurrentDatabase",
"when": "false"
@@ -1901,11 +1924,6 @@
{
"view": "codeQLEvalLogViewer",
"contents": "Run the 'Show Evaluator Log (UI)' command on a CodeQL query run in the Query History view."
},
{
"view": "codeQLVariantAnalysisRepositories",
"contents": "Set up a controller repository to start using variant analysis. [Learn more](https://codeql.github.com/docs/codeql-for-visual-studio-code/running-codeql-queries-at-scale-with-mrva#controller-repository) about controller repositories. \n[Set up controller repository](command:codeQLVariantAnalysisRepositories.setupControllerRepository)",
"when": "!config.codeQL.variantAnalysis.controllerRepo"
}
]
},
@@ -1925,44 +1943,45 @@
"format": "prettier --write **/*.{ts,tsx} && eslint . --ext .ts,.tsx --fix",
"lint": "eslint . --ext .js,.ts,.tsx --max-warnings=0",
"lint:markdown": "markdownlint-cli2 \"../../**/*.{md,mdx}\" \"!**/node_modules/**\" \"!**/.vscode-test/**\" \"!**/build/cli/v*/**\"",
"find-deadcode": "ts-node scripts/find-deadcode.ts",
"find-deadcode": "vite-node scripts/find-deadcode.ts",
"format-staged": "lint-staged",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build",
"lint:scenarios": "ts-node scripts/lint-scenarios.ts",
"lint:scenarios": "vite-node scripts/lint-scenarios.ts",
"generate": "npm-run-all -p generate:*",
"generate:schemas": "ts-node scripts/generate-schemas.ts",
"generate:chromium-version": "ts-node scripts/generate-chromium-version.ts",
"generate:schemas": "vite-node scripts/generate-schemas.ts",
"generate:chromium-version": "vite-node scripts/generate-chromium-version.ts",
"check-types": "find . -type f -name \"tsconfig.json\" -not -path \"./node_modules/*\" | sed -r 's|/[^/]+$||' | sort | uniq | xargs -I {} sh -c \"echo Checking types in {} && cd {} && npx tsc --noEmit\"",
"postinstall": "patch-package",
"prepare": "cd ../.. && husky install"
},
"dependencies": {
"@floating-ui/react": "^0.26.9",
"@floating-ui/react": "^0.26.12",
"@octokit/plugin-retry": "^6.0.1",
"@octokit/plugin-throttling": "^8.0.0",
"@octokit/rest": "^20.0.2",
"@vscode/codicons": "^0.0.35",
"@vscode/debugadapter": "^1.59.0",
"@vscode/debugprotocol": "^1.59.0",
"@vscode/debugprotocol": "^1.65.0",
"@vscode/webview-ui-toolkit": "^1.0.1",
"ajv": "^8.11.0",
"child-process-promise": "^2.2.1",
"chokidar": "^3.6.0",
"d3": "^7.6.1",
"d3": "^7.9.0",
"d3-graphviz": "^5.0.2",
"fs-extra": "^11.1.1",
"js-yaml": "^4.1.0",
"msw": "^2.0.13",
"nanoid": "^5.0.1",
"msw": "^2.2.13",
"nanoid": "^5.0.7",
"node-fetch": "^2.6.7",
"p-queue": "^8.0.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"semver": "^7.6.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"semver": "^7.6.2",
"source-map": "^0.7.4",
"source-map-support": "^0.5.21",
"stream-json": "^1.7.3",
"styled-components": "^6.1.8",
"styled-components": "^6.1.9",
"tmp": "^0.2.1",
"tmp-promise": "^3.0.2",
"tree-kill": "^1.2.2",
@@ -1973,29 +1992,30 @@
"zip-a-folder": "^3.1.6"
},
"devDependencies": {
"@babel/core": "^7.18.13",
"@babel/core": "^7.24.6",
"@babel/plugin-transform-modules-commonjs": "^7.18.6",
"@babel/preset-env": "^7.23.9",
"@babel/preset-react": "^7.18.6",
"@babel/preset-env": "^7.24.4",
"@babel/preset-react": "^7.24.1",
"@babel/preset-typescript": "^7.21.4",
"@faker-js/faker": "^8.4.1",
"@github/markdownlint-github": "^0.6.0",
"@octokit/plugin-throttling": "^8.0.0",
"@github/markdownlint-github": "^0.6.2",
"@playwright/test": "^1.40.1",
"@storybook/addon-a11y": "^7.6.15",
"@storybook/addon-actions": "^7.1.0",
"@storybook/addon-essentials": "^7.1.0",
"@storybook/addon-interactions": "^7.1.0",
"@storybook/addon-links": "^7.1.0",
"@storybook/components": "^7.6.17",
"@storybook/csf": "^0.1.1",
"@storybook/manager-api": "^7.6.7",
"@storybook/react": "^7.1.0",
"@storybook/react-webpack5": "^7.6.12",
"@storybook/theming": "^7.6.12",
"@testing-library/dom": "^9.3.4",
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/react": "^14.2.1",
"@storybook/addon-a11y": "^8.1.10",
"@storybook/addon-actions": "^8.1.10",
"@storybook/addon-essentials": "^8.1.10",
"@storybook/addon-interactions": "^8.1.10",
"@storybook/addon-links": "^8.1.10",
"@storybook/blocks": "^8.0.2",
"@storybook/components": "^8.0.2",
"@storybook/csf": "^0.1.8",
"@storybook/icons": "^1.2.9",
"@storybook/manager-api": "^8.1.10",
"@storybook/react": "^8.1.10",
"@storybook/react-vite": "^8.1.10",
"@storybook/theming": "^8.1.10",
"@testing-library/dom": "^10.1.0",
"@testing-library/jest-dom": "^6.4.6",
"@testing-library/react": "^16.0.0",
"@testing-library/user-event": "^14.5.2",
"@types/child-process-promise": "^2.2.1",
"@types/d3": "^7.4.0",
@@ -2004,71 +2024,68 @@
"@types/fs-extra": "^11.0.1",
"@types/gulp": "^4.0.9",
"@types/gulp-replace": "^1.1.0",
"@types/jest": "^29.0.2",
"@types/jest": "^29.5.12",
"@types/js-yaml": "^4.0.6",
"@types/nanoid": "^3.0.0",
"@types/node": "18.17.*",
"@types/node": "20.9.*",
"@types/node-fetch": "^2.5.2",
"@types/react": "^18.0.28",
"@types/react-dom": "^18.2.18",
"@types/react": "^18.3.1",
"@types/react-dom": "^18.3.0",
"@types/sarif": "^2.1.2",
"@types/semver": "^7.2.0",
"@types/semver": "^7.5.8",
"@types/stream-json": "^1.7.1",
"@types/styled-components": "^5.1.11",
"@types/tar-stream": "^3.1.3",
"@types/through2": "^2.0.36",
"@types/tmp": "^0.2.6",
"@types/unzipper": "^0.10.1",
"@types/vscode": "^1.82.0",
"@types/yauzl": "^2.10.3",
"@typescript-eslint/eslint-plugin": "^6.19.0",
"@typescript-eslint/parser": "^6.21.0",
"@vscode/test-electron": "^2.2.0",
"@vscode/vsce": "^2.19.0",
"@typescript-eslint/eslint-plugin": "^7.5.0",
"@typescript-eslint/parser": "^7.5.0",
"@vscode/test-electron": "^2.3.9",
"@vscode/vsce": "^2.24.0",
"ansi-colors": "^4.1.1",
"applicationinsights": "^2.9.2",
"applicationinsights": "^2.9.5",
"cosmiconfig": "^9.0.0",
"cross-env": "^7.0.3",
"css-loader": "^6.10.0",
"del": "^6.0.0",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.0.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-deprecation": "^2.0.0",
"eslint-plugin-etc": "^2.0.2",
"eslint-plugin-github": "^4.4.1",
"eslint-plugin-github": "^4.10.2",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jest-dom": "^5.0.1",
"eslint-plugin-jest-dom": "^5.2.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react": "^7.31.8",
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-storybook": "^0.6.4",
"file-loader": "^6.2.0",
"eslint-plugin-storybook": "^0.8.0",
"glob": "^10.0.0",
"gulp": "^4.0.2",
"gulp-esbuild": "^0.12.0",
"gulp-replace": "^1.1.3",
"gulp-typescript": "^5.0.1",
"husky": "^8.0.0",
"husky": "^9.1.7",
"jest": "^29.0.3",
"jest-environment-jsdom": "^29.0.3",
"jest-runner-vscode": "^3.0.1",
"lint-staged": "^15.0.2",
"markdownlint-cli2": "^0.12.1",
"markdownlint-cli2-formatter-pretty": "^0.0.5",
"mini-css-extract-plugin": "^2.8.0",
"lint-staged": "^15.2.2",
"markdownlint-cli2": "^0.13.0",
"markdownlint-cli2-formatter-pretty": "^0.0.6",
"npm-run-all": "^4.1.5",
"patch-package": "^8.0.0",
"prettier": "^3.2.5",
"storybook": "^7.6.15",
"tar-stream": "^3.0.0",
"storybook": "^8.1.10",
"tar-stream": "^3.1.7",
"through2": "^4.0.2",
"ts-jest": "^29.0.1",
"ts-json-schema-generator": "^1.1.2",
"ts-loader": "^9.4.2",
"ts-node": "^10.7.0",
"ts-unused-exports": "^10.0.0",
"typescript": "^5.0.2"
"ts-jest": "^29.1.4",
"ts-json-schema-generator": "^2.1.1",
"ts-node": "^10.9.2",
"ts-unused-exports": "^10.1.0",
"typescript": "^5.0.2",
"vite": "^5.2.11",
"vite-node": "^1.5.3"
},
"lint-staged": {
"./**/*.{json,css,scss}": [

View File

@@ -36,6 +36,7 @@ import type { Position } from "../query-server/messages";
import { LOGGING_FLAGS } from "./cli-command";
import type { CliFeatures, VersionAndFeatures } from "./cli-version";
import { ExitCodeError, getCliError } from "./cli-errors";
import { UserCancellationException } from "../common/vscode/progress";
/**
* The version of the SARIF format that we are using.
@@ -217,6 +218,37 @@ type VersionChangedListener = (
newVersionAndFeatures: VersionAndFeatures | undefined,
) => void;
type RunOptions = {
/**
* Used to output progress messages, e.g. to the status bar.
*/
progressReporter?: ProgressReporter;
/**
* Used for responding to interactive output on stdout/stdin.
*/
onLine?: OnLineCallback;
/**
* If true, don't print logs to the CodeQL extension log.
*/
silent?: boolean;
/**
* If true, run this command in a new process rather than in the CLI server.
*/
runInNewProcess?: boolean;
/**
* If runInNewProcess is true, allows cancelling the command. If runInNewProcess
* is false or not specified, this option is ignored.
*/
token?: CancellationToken;
};
type JsonRunOptions = RunOptions & {
/**
* Whether to add commandline arguments to specify the format as JSON.
*/
addFormat?: boolean;
};
/**
* This class manages a cli server started by `codeql execute cli-server` to
* run commands without the overhead of starting a new java
@@ -369,9 +401,6 @@ export class CodeQLCliServer implements Disposable {
onLine?: OnLineCallback,
silent?: boolean,
): Promise<string> {
const stderrBuffers: Buffer[] = [];
// The current buffer of stderr of a single line. To be used for logging.
let currentLineStderrBuffer: Buffer = Buffer.alloc(0);
if (this.commandInProcess) {
throw new Error("runCodeQlCliInternal called while cli was running");
}
@@ -383,8 +412,6 @@ export class CodeQLCliServer implements Disposable {
}
// Grab the process so that typescript know that it is always defined.
const process = this.process;
// The array of fragments of stdout
const stdoutBuffers: Buffer[] = [];
// Compute the full args array
const args = command.concat(LOGGING_FLAGS).concat(commandArgs);
@@ -396,26 +423,160 @@ export class CodeQLCliServer implements Disposable {
);
}
try {
await new Promise<void>((resolve, reject) => {
// Start listening to stdout
process.stdout.addListener("data", (newData: Buffer) => {
if (onLine) {
void (async () => {
const response = await onLine(newData.toString("utf-8"));
return await this.handleProcessOutput(process, {
handleNullTerminator: true,
onListenStart: (process) => {
// Write the command followed by a null terminator.
process.stdin.write(JSON.stringify(args), "utf8");
process.stdin.write(this.nullBuffer);
},
description,
args,
silent,
onLine,
});
} catch (err) {
// Kill the process if it isn't already dead.
this.killProcessIfRunning();
if (!response) {
return;
}
throw err;
}
} finally {
this.commandInProcess = false;
// start running the next command immediately
this.runNext();
}
}
process.stdin.write(`${response}${EOL}`);
private async runCodeQlCliInNewProcess(
command: string[],
commandArgs: string[],
description: string,
onLine?: OnLineCallback,
silent?: boolean,
token?: CancellationToken,
): Promise<string> {
const codeqlPath = await this.getCodeQlPath();
// Remove newData from stdoutBuffers because the data has been consumed
// by the onLine callback.
stdoutBuffers.splice(stdoutBuffers.indexOf(newData), 1);
})();
}
const args = command.concat(LOGGING_FLAGS).concat(commandArgs);
const argsString = args.join(" ");
stdoutBuffers.push(newData);
// If we are running silently, we don't want to print anything to the console.
if (!silent) {
void this.logger.log(`${description} using CodeQL CLI: ${argsString}...`);
}
const abortController = new AbortController();
const process = spawnChildProcess(codeqlPath, args, {
signal: abortController.signal,
});
if (!process || !process.pid) {
throw new Error(
`Failed to start ${description} using command ${codeqlPath} ${argsString}.`,
);
}
// We need to ensure that we're not killing the same process twice (since this may kill
// another process with the same PID), so keep track of whether we've already exited.
let exited = false;
process.on("exit", () => {
exited = true;
});
const cancellationRegistration = token?.onCancellationRequested((_e) => {
abortController.abort("Token was cancelled.");
if (process.pid && !exited) {
tk(process.pid);
}
});
try {
return await this.handleProcessOutput(process, {
handleNullTerminator: false,
description,
args,
silent,
onLine,
});
} catch (e) {
// If cancellation was requested, the error is probably just because the process was exited with SIGTERM.
if (token?.isCancellationRequested) {
void this.logger.log(
`The process was cancelled and exited with: ${getErrorMessage(e)}`,
);
throw new UserCancellationException(
`Command ${argsString} was cancelled.`,
true, // Don't show a warning message when the user manually cancelled the command.
);
}
throw e;
} finally {
process.stdin.end();
if (!exited) {
tk(process.pid);
}
process.stdout.destroy();
process.stderr.destroy();
cancellationRegistration?.dispose();
}
}
private async handleProcessOutput(
process: ChildProcessWithoutNullStreams,
{
handleNullTerminator,
args,
description,
onLine,
onListenStart,
silent,
}: {
handleNullTerminator: boolean;
args: string[];
description: string;
onLine?: OnLineCallback;
onListenStart?: (process: ChildProcessWithoutNullStreams) => void;
silent?: boolean;
},
): Promise<string> {
const stderrBuffers: Buffer[] = [];
// The current buffer of stderr of a single line. To be used for logging.
let currentLineStderrBuffer: Buffer = Buffer.alloc(0);
// The listeners of the process. Declared here so they can be removed in the finally block.
let stdoutListener: ((newData: Buffer) => void) | undefined = undefined;
let stderrListener: ((newData: Buffer) => void) | undefined = undefined;
let closeListener: ((code: number | null) => void) | undefined = undefined;
let errorListener: ((err: Error) => void) | undefined = undefined;
try {
// The array of fragments of stdout
const stdoutBuffers: Buffer[] = [];
await new Promise<void>((resolve, reject) => {
stdoutListener = (newData: Buffer) => {
if (onLine) {
void (async () => {
const response = await onLine(newData.toString("utf-8"));
if (!response) {
return;
}
process.stdin.write(`${response}${EOL}`);
// Remove newData from stdoutBuffers because the data has been consumed
// by the onLine callback.
stdoutBuffers.splice(stdoutBuffers.indexOf(newData), 1);
})();
}
stdoutBuffers.push(newData);
if (handleNullTerminator) {
// If the buffer ends in '0' then exit.
// We don't have to check the middle as no output will be written after the null until
// the next command starts
@@ -425,89 +586,112 @@ export class CodeQLCliServer implements Disposable {
) {
resolve();
}
});
// Listen to stderr
process.stderr.addListener("data", (newData: Buffer) => {
stderrBuffers.push(newData);
}
};
stderrListener = (newData: Buffer) => {
stderrBuffers.push(newData);
if (!silent) {
currentLineStderrBuffer = Buffer.concat([
currentLineStderrBuffer,
newData,
]);
if (!silent) {
currentLineStderrBuffer = Buffer.concat([
currentLineStderrBuffer,
newData,
]);
// Print the stderr to the logger as it comes in. We need to ensure that
// we don't split messages on the same line, so we buffer the stderr and
// split it on EOLs.
const eolBuffer = Buffer.from(EOL);
// Print the stderr to the logger as it comes in. We need to ensure that
// we don't split messages on the same line, so we buffer the stderr and
// split it on EOLs.
const eolBuffer = Buffer.from(EOL);
let hasCreatedSubarray = false;
let hasCreatedSubarray = false;
let eolIndex;
while (
(eolIndex = currentLineStderrBuffer.indexOf(eolBuffer)) !== -1
) {
const line = currentLineStderrBuffer.subarray(0, eolIndex);
void this.logger.log(line.toString("utf-8"));
currentLineStderrBuffer = currentLineStderrBuffer.subarray(
eolIndex + eolBuffer.length,
);
hasCreatedSubarray = true;
}
// We have created a subarray, which means that the complete original buffer is now referenced
// by the subarray. We need to create a new buffer to avoid memory leaks.
if (hasCreatedSubarray) {
currentLineStderrBuffer = Buffer.from(currentLineStderrBuffer);
}
let eolIndex;
while (
(eolIndex = currentLineStderrBuffer.indexOf(eolBuffer)) !== -1
) {
const line = currentLineStderrBuffer.subarray(0, eolIndex);
void this.logger.log(line.toString("utf-8"));
currentLineStderrBuffer = currentLineStderrBuffer.subarray(
eolIndex + eolBuffer.length,
);
hasCreatedSubarray = true;
}
});
// Listen for process exit.
process.addListener("close", (code) =>
reject(new ExitCodeError(code)),
);
// Write the command followed by a null terminator.
process.stdin.write(JSON.stringify(args), "utf8");
process.stdin.write(this.nullBuffer);
});
// Join all the data together
const fullBuffer = Buffer.concat(stdoutBuffers);
// Make sure we remove the terminator;
const data = fullBuffer.toString("utf8", 0, fullBuffer.length - 1);
if (!silent) {
void this.logger.log(currentLineStderrBuffer.toString("utf8"));
currentLineStderrBuffer = Buffer.alloc(0);
void this.logger.log("CLI command succeeded.");
}
return data;
} catch (err) {
// Kill the process if it isn't already dead.
this.killProcessIfRunning();
// Report the error (if there is a stderr then use that otherwise just report the error code or nodejs error)
const cliError = getCliError(
err,
stderrBuffers.length > 0
? Buffer.concat(stderrBuffers).toString("utf8")
: undefined,
description,
args,
);
cliError.stack += getErrorStack(err);
throw cliError;
} finally {
if (!silent && currentLineStderrBuffer.length > 0) {
void this.logger.log(currentLineStderrBuffer.toString("utf8"));
}
// Remove the listeners we set up.
process.stdout.removeAllListeners("data");
process.stderr.removeAllListeners("data");
process.removeAllListeners("close");
// We have created a subarray, which means that the complete original buffer is now referenced
// by the subarray. We need to create a new buffer to avoid memory leaks.
if (hasCreatedSubarray) {
currentLineStderrBuffer = Buffer.from(currentLineStderrBuffer);
}
}
};
closeListener = (code) => {
if (handleNullTerminator) {
reject(new ExitCodeError(code));
} else {
if (code === 0) {
resolve();
} else {
reject(new ExitCodeError(code));
}
}
};
errorListener = (err) => {
reject(err);
};
// Start listening to stdout
process.stdout.addListener("data", stdoutListener);
// Listen to stderr
process.stderr.addListener("data", stderrListener);
// Listen for process exit.
process.addListener("close", closeListener);
// Listen for errors
process.addListener("error", errorListener);
onListenStart?.(process);
});
// Join all the data together
const fullBuffer = Buffer.concat(stdoutBuffers);
// Make sure we remove the terminator
const data = fullBuffer.toString(
"utf8",
0,
handleNullTerminator ? fullBuffer.length - 1 : fullBuffer.length,
);
if (!silent) {
void this.logger.log(currentLineStderrBuffer.toString("utf8"));
currentLineStderrBuffer = Buffer.alloc(0);
void this.logger.log("CLI command succeeded.");
}
return data;
} catch (err) {
// Report the error (if there is a stderr then use that otherwise just report the error code or nodejs error)
const cliError = getCliError(
err,
stderrBuffers.length > 0
? Buffer.concat(stderrBuffers).toString("utf8")
: undefined,
description,
args,
);
cliError.stack += getErrorStack(err);
throw cliError;
} finally {
this.commandInProcess = false;
// start running the next command immediately
this.runNext();
if (!silent && currentLineStderrBuffer.length > 0) {
void this.logger.log(currentLineStderrBuffer.toString("utf8"));
}
// Remove the listeners we set up.
if (stdoutListener) {
process.stdout.removeListener("data", stdoutListener);
}
if (stderrListener) {
process.stderr.removeListener("data", stderrListener);
}
if (closeListener) {
process.removeListener("close", closeListener);
}
if (errorListener) {
process.removeListener("error", errorListener);
}
}
}
@@ -624,6 +808,10 @@ export class CodeQLCliServer implements Disposable {
* @param description Description of the action being run, to be shown in log and error messages.
* @param progressReporter Used to output progress messages, e.g. to the status bar.
* @param onLine Used for responding to interactive output on stdout/stdin.
* @param silent If true, don't print logs to the CodeQL extension log.
* @param runInNewProcess If true, run this command in a new process rather than in the CLI server.
* @param token If runInNewProcess is true, allows cancelling the command. If runInNewProcess
* is false or not specified, this option is ignored.
* @returns The contents of the command's stdout, if the command succeeded.
*/
runCodeQlCliCommand(
@@ -634,16 +822,25 @@ export class CodeQLCliServer implements Disposable {
progressReporter,
onLine,
silent = false,
}: {
progressReporter?: ProgressReporter;
onLine?: OnLineCallback;
silent?: boolean;
} = {},
runInNewProcess = false,
token,
}: RunOptions = {},
): Promise<string> {
if (progressReporter) {
progressReporter.report({ message: description });
}
if (runInNewProcess) {
return this.runCodeQlCliInNewProcess(
command,
commandArgs,
description,
onLine,
silent,
token,
);
}
return new Promise((resolve, reject) => {
// Construct the command that actually does the work
const callback = (): void => {
@@ -676,24 +873,13 @@ export class CodeQLCliServer implements Disposable {
* @param description Description of the action being run, to be shown in log and error messages.
* @param addFormat Whether or not to add commandline arguments to specify the format as JSON.
* @param progressReporter Used to output progress messages, e.g. to the status bar.
* @param onLine Used for responding to interactive output on stdout/stdin.
* @returns The contents of the command's stdout, if the command succeeded.
*/
async runJsonCodeQlCliCommand<OutputType>(
command: string[],
commandArgs: string[],
description: string,
{
addFormat = true,
progressReporter,
onLine,
silent = false,
}: {
addFormat?: boolean;
progressReporter?: ProgressReporter;
onLine?: OnLineCallback;
silent?: boolean;
} = {},
{ addFormat = true, ...runOptions }: JsonRunOptions = {},
): Promise<OutputType> {
let args: string[] = [];
if (addFormat) {
@@ -701,11 +887,12 @@ export class CodeQLCliServer implements Disposable {
args = args.concat(["--format", "json"]);
}
args = args.concat(commandArgs);
const result = await this.runCodeQlCliCommand(command, args, description, {
progressReporter,
onLine,
silent,
});
const result = await this.runCodeQlCliCommand(
command,
args,
description,
runOptions,
);
try {
return JSON.parse(result) as OutputType;
} catch (err) {
@@ -733,21 +920,14 @@ export class CodeQLCliServer implements Disposable {
* @param command The `codeql` command to be run, provided as an array of command/subcommand names.
* @param commandArgs The arguments to pass to the `codeql` command.
* @param description Description of the action being run, to be shown in log and error messages.
* @param addFormat Whether or not to add commandline arguments to specify the format as JSON.
* @param progressReporter Used to output progress messages, e.g. to the status bar.
* @param runOptions Options for running the command.
* @returns The contents of the command's stdout, if the command succeeded.
*/
async runJsonCodeQlCliCommandWithAuthentication<OutputType>(
command: string[],
commandArgs: string[],
description: string,
{
addFormat,
progressReporter,
}: {
addFormat?: boolean;
progressReporter?: ProgressReporter;
} = {},
runOptions: Omit<JsonRunOptions, "onLine"> = {},
): Promise<OutputType> {
const accessToken = await this.app.credentials.getExistingAccessToken();
@@ -758,8 +938,7 @@ export class CodeQLCliServer implements Disposable {
[...extraArgs, ...commandArgs],
description,
{
addFormat,
progressReporter,
...runOptions,
onLine: async (line) => {
if (line.startsWith("Enter value for --github-auth-stdin")) {
try {
@@ -1432,12 +1611,20 @@ export class CodeQLCliServer implements Disposable {
/**
* Downloads a specified pack.
* @param packs The `<package-scope/name[@version]>` of the packs to download.
* @param token The cancellation token. If not specified, the command will be run in the CLI server.
*/
async packDownload(packs: string[]): Promise<PackDownloadResult> {
async packDownload(
packs: string[],
token?: CancellationToken,
): Promise<PackDownloadResult> {
return this.runJsonCodeQlCliCommandWithAuthentication(
["pack", "download"],
packs,
"Downloading packs",
{
runInNewProcess: !!token, // Only run in a new process if a token is provided
token,
},
);
}
@@ -1473,6 +1660,7 @@ export class CodeQLCliServer implements Disposable {
* @param outputBundleFile The path to the output bundle file.
* @param outputPackDir The directory to contain the unbundled output pack.
* @param moreOptions Additional options to be passed to `codeql pack bundle`.
* @param token Cancellation token for the operation.
*/
async packBundle(
sourcePackDir: string,
@@ -1480,6 +1668,7 @@ export class CodeQLCliServer implements Disposable {
outputBundleFile: string,
outputPackDir: string,
moreOptions: string[],
token?: CancellationToken,
): Promise<void> {
const args = [
"-o",
@@ -1495,6 +1684,10 @@ export class CodeQLCliServer implements Disposable {
["pack", "bundle"],
args,
"Bundling pack",
{
runInNewProcess: true,
token,
},
);
}
@@ -1719,22 +1912,7 @@ function shouldDebugCliServer() {
export class CliVersionConstraint {
// The oldest version of the CLI that we support. This is used to determine
// whether to show a warning about the CLI being too old on startup.
public static OLDEST_SUPPORTED_CLI_VERSION = new SemVer("2.13.5");
/**
* CLI version where the `generate extensible-predicate-metadata`
* command was implemented.
*/
public static CLI_VERSION_WITH_EXTENSIBLE_PREDICATE_METADATA = new SemVer(
"2.14.3",
);
/**
* CLI version where the langauge server supports visisbility change notifications.
*/
public static CLI_VERSION_WITH_VISIBILITY_NOTIFICATIONS = new SemVer(
"2.14.0",
);
public static OLDEST_SUPPORTED_CLI_VERSION = new SemVer("2.14.6");
/**
* CLI version where the query server supports the `evaluation/trimCache` method
@@ -1759,18 +1937,6 @@ export class CliVersionConstraint {
return (await this.cli.getVersion()).compare(v) >= 0;
}
async supportsVisibilityNotifications() {
return this.isVersionAtLeast(
CliVersionConstraint.CLI_VERSION_WITH_VISIBILITY_NOTIFICATIONS,
);
}
async supportsGenerateExtensiblePredicateMetadata() {
return this.isVersionAtLeast(
CliVersionConstraint.CLI_VERSION_WITH_EXTENSIBLE_PREDICATE_METADATA,
);
}
async preservesExtensiblePredicatesInMrvaPack() {
// Negated, because we _stopped_ preserving these in 2.16.1.
return !(await this.isVersionAtLeast(

View File

@@ -1,5 +1,5 @@
import type { CodeQLCliServer } from "./cli";
import type { Uri } from "vscode";
import type { CancellationToken, Uri } from "vscode";
import { window } from "vscode";
import {
getLanguageDisplayName,
@@ -50,6 +50,7 @@ export async function findLanguage(
export async function askForLanguage(
cliServer: CodeQLCliServer,
throwOnEmpty = true,
token?: CancellationToken,
): Promise<QueryLanguage | undefined> {
const supportedLanguages = await cliServer.getSupportedLanguages();
@@ -62,10 +63,14 @@ export async function askForLanguage(
}))
.sort((a, b) => a.label.localeCompare(b.label));
const selectedItem = await window.showQuickPick(items, {
placeHolder: "Select target query language",
ignoreFocusOut: true,
});
const selectedItem = await window.showQuickPick(
items,
{
placeHolder: "Select target query language",
ignoreFocusOut: true,
},
token,
);
if (!selectedItem) {
// This only happens if the user cancels the quick pick.
if (throwOnEmpty) {

View File

@@ -31,4 +31,9 @@ export interface Credentials {
* @returns An OAuth access token, or undefined.
*/
getExistingAccessToken(): Promise<string | undefined>;
/**
* Returns the ID of the authentication provider to use.
*/
authProviderId: string;
}

View File

@@ -220,6 +220,7 @@ export type LocalDatabasesCommands = {
// Explorer context menu
"codeQL.setCurrentDatabase": (uri: Uri) => Promise<void>;
"codeQL.importTestDatabase": (uri: Uri) => Promise<void>;
// Database panel view title commands
"codeQLDatabases.chooseDatabaseFolder": () => Promise<void>;
@@ -272,6 +273,9 @@ export type VariantAnalysisCommands = {
"codeQL.openVariantAnalysisLogs": (
variantAnalysisId: number,
) => Promise<void>;
"codeQLModelAlerts.openVariantAnalysisLogs": (
variantAnalysisId: number,
) => Promise<void>;
"codeQL.openVariantAnalysisView": (
variantAnalysisId: number,
) => Promise<void>;
@@ -286,7 +290,6 @@ export type DatabasePanelCommands = {
"codeQLVariantAnalysisRepositories.openConfigFile": () => Promise<void>;
"codeQLVariantAnalysisRepositories.addNewDatabase": () => Promise<void>;
"codeQLVariantAnalysisRepositories.addNewList": () => Promise<void>;
"codeQLVariantAnalysisRepositories.setupControllerRepository": () => Promise<void>;
"codeQLVariantAnalysisRepositories.setSelectedItem": TreeViewContextSingleSelectionCommandFunction<DbTreeViewItem>;
"codeQLVariantAnalysisRepositories.setSelectedItemContextMenu": TreeViewContextSingleSelectionCommandFunction<DbTreeViewItem>;

View File

@@ -0,0 +1,57 @@
// Based on https://github.com/microsoft/vscode/blob/edfd5b8ba54d50f3f5c2ebee877af088803def88/src/vs/base/common/labels.ts#L316C1-L400
/**
* Helper to insert values for specific template variables into the string. E.g. "this ${is} a ${template}" can be
* passed to this function together with an object that maps "is" and "template" to strings to have them replaced.
*
* @param template string to which template is applied
* @param values the values of the templates to use
*/
export function substituteConfigVariables(
template: string,
values: {
[key: string]: string | undefined | null;
},
): string {
const segments: string[] = [];
let inVariable = false;
let currentValue = "";
for (const char of template) {
// Beginning of variable
if (char === "$" || (inVariable && char === "{")) {
if (currentValue) {
segments.push(currentValue);
}
currentValue = "";
inVariable = true;
}
// End of variable
else if (char === "}" && inVariable) {
const resolved = values[currentValue];
// Variable
if (resolved && resolved.length > 0) {
segments.push(resolved);
}
// If the variable, doesn't exist, we discard it (i.e. replace it by the empty string)
currentValue = "";
inVariable = false;
}
// Text or Variable Name
else {
currentValue += char;
}
}
// Tail
if (currentValue && !inVariable) {
segments.push(currentValue);
}
return segments.join("");
}

View File

@@ -0,0 +1,44 @@
type FilenameOptions = {
removeDots?: boolean;
};
/**
* This will create a filename from an arbitrary string by removing
* all characters which are not allowed in filenames and making them
* more filesystem-friendly be replacing undesirable characters with
* hyphens. The result will always be lowercase ASCII.
*
* @param str The string to create a filename from
* @param removeDots Whether to remove dots from the filename [default: false]
* @returns The filename
*/
export function createFilenameFromString(
str: string,
{ removeDots }: FilenameOptions = {},
) {
let fileName = str;
// Lowercase everything
fileName = fileName.toLowerCase();
// Replace all spaces, underscores, slashes, and backslashes with hyphens
fileName = fileName.replaceAll(/[\s_/\\]+/g, "-");
// Replace all characters which are not allowed by empty strings
fileName = fileName.replaceAll(/[^a-z0-9.-]/g, "");
// Remove any leading or trailing hyphens or dots
fileName = fileName.replaceAll(/^[.-]+|[.-]+$/g, "");
// Replace dots by hyphens if dots are not allowed
if (removeDots) {
fileName = fileName.replaceAll(/\./g, "-");
}
// Remove any duplicate hyphens
fileName = fileName.replaceAll(/-{2,}/g, "-");
// Remove any duplicate dots
fileName = fileName.replaceAll(/\.{2,}/g, ".");
return fileName;
}

View File

@@ -176,3 +176,32 @@ export function findCommonParentDir(...paths: string[]): string {
function isTopLevelPath(path: string): boolean {
return dirname(path) === path;
}
/**
* Recursively looks for a file in a directory. If the file exists, then returns the directory containing the file.
*
* @param dir The directory to search
* @param toFind The file to recursively look for in this directory
*
* @returns the directory containing the file, or undefined if not found.
*/
export async function findDirWithFile(
dir: string,
...toFind: string[]
): Promise<string | undefined> {
if (!(await stat(dir)).isDirectory()) {
return;
}
const files = await readdir(dir);
if (toFind.some((file) => files.includes(file))) {
return dir;
}
for (const file of files) {
const newPath = join(dir, file);
const result = await findDirWithFile(newPath, ...toFind);
if (result) {
return result;
}
}
return;
}

View File

@@ -29,37 +29,45 @@ function validGitHubNwoOrOwner(
/**
* Extracts an NWO from a GitHub URL.
* @param githubUrl The GitHub repository URL
* @param repositoryUrl The GitHub repository URL
* @param githubUrl The URL of the GitHub instance
* @return The corresponding NWO, or undefined if the URL is not valid
*/
export function getNwoFromGitHubUrl(githubUrl: string): string | undefined {
return getNwoOrOwnerFromGitHubUrl(githubUrl, "nwo");
export function getNwoFromGitHubUrl(
repositoryUrl: string,
githubUrl: URL,
): string | undefined {
return getNwoOrOwnerFromGitHubUrl(repositoryUrl, githubUrl, "nwo");
}
/**
* Extracts an owner from a GitHub URL.
* @param githubUrl The GitHub repository URL
* @param repositoryUrl The GitHub repository URL
* @param githubUrl The URL of the GitHub instance
* @return The corresponding Owner, or undefined if the URL is not valid
*/
export function getOwnerFromGitHubUrl(githubUrl: string): string | undefined {
return getNwoOrOwnerFromGitHubUrl(githubUrl, "owner");
export function getOwnerFromGitHubUrl(
repositoryUrl: string,
githubUrl: URL,
): string | undefined {
return getNwoOrOwnerFromGitHubUrl(repositoryUrl, githubUrl, "owner");
}
function getNwoOrOwnerFromGitHubUrl(
githubUrl: string,
repositoryUrl: string,
githubUrl: URL,
kind: "owner" | "nwo",
): string | undefined {
const validHostnames = [githubUrl.hostname, `www.${githubUrl.hostname}`];
try {
let paths: string[];
const urlElements = githubUrl.split("/");
if (
urlElements[0] === "github.com" ||
urlElements[0] === "www.github.com"
) {
paths = githubUrl.split("/").slice(1);
const urlElements = repositoryUrl.split("/");
if (validHostnames.includes(urlElements[0])) {
paths = repositoryUrl.split("/").slice(1);
} else {
const uri = new URL(githubUrl);
if (uri.hostname !== "github.com" && uri.hostname !== "www.github.com") {
const uri = new URL(repositoryUrl);
if (!validHostnames.includes(uri.hostname)) {
return;
}
paths = uri.pathname.split("/").filter((segment: string) => segment);

View File

@@ -10,10 +10,11 @@ import type {
} from "../variant-analysis/shared/variant-analysis-filter-sort";
import type { ErrorLike } from "../common/errors";
import type { DataFlowPaths } from "../variant-analysis/shared/data-flow-paths";
import type { Method } from "../model-editor/method";
import type { Method, MethodSignature } from "../model-editor/method";
import type { ModeledMethod } from "../model-editor/modeled-method";
import type {
MethodModelingPanelViewState,
ModelAlertsViewState,
ModelEditorViewState,
} from "../model-editor/shared/view-state";
import type { Mode } from "../model-editor/shared/mode";
@@ -600,6 +601,15 @@ interface StopModelEvaluationMessage {
t: "stopModelEvaluation";
}
interface OpenModelAlertsViewMessage {
t: "openModelAlertsView";
}
interface RevealInModelAlertsViewMessage {
t: "revealInModelAlertsView";
modeledMethod: ModeledMethod;
}
interface ModelDependencyMessage {
t: "modelDependency";
}
@@ -671,11 +681,13 @@ export type FromModelEditorMessage =
| HideModeledMethodsMessage
| SetMultipleModeledMethodsMessage
| StartModelEvaluationMessage
| StopModelEvaluationMessage;
| StopModelEvaluationMessage
| OpenModelAlertsViewMessage
| RevealInModelAlertsViewMessage;
interface RevealInEditorMessage {
t: "revealInModelEditor";
method: Method;
method: MethodSignature;
}
interface StartModelingMessage {
@@ -693,16 +705,15 @@ interface SetMethodModelingPanelViewStateMessage {
viewState: MethodModelingPanelViewState;
}
interface SetMethodMessage {
t: "setMethod";
method: Method | undefined;
}
interface SetMethodModifiedMessage {
t: "setMethodModified";
isModified: boolean;
}
interface SetNoMethodSelectedMessage {
t: "setNoMethodSelected";
}
interface SetSelectedMethodMessage {
t: "setSelectedMethod";
method: Method;
@@ -714,10 +725,47 @@ interface SetSelectedMethodMessage {
export type ToMethodModelingMessage =
| SetMethodModelingPanelViewStateMessage
| SetMethodMessage
| SetMultipleModeledMethodsMessage
| SetMethodModifiedMessage
| SetNoMethodSelectedMessage
| SetSelectedMethodMessage
| SetInModelingModeMessage
| SetInProgressMessage
| SetProcessedByAutoModelMessage;
interface SetModelAlertsViewStateMessage {
t: "setModelAlertsViewState";
viewState: ModelAlertsViewState;
}
interface OpenModelPackMessage {
t: "openModelPack";
path: string;
}
interface OpenActionsLogsMessage {
t: "openActionsLogs";
variantAnalysisId: number;
}
interface StopEvaluationRunMessage {
t: "stopEvaluationRun";
}
interface RevealModelMessage {
t: "revealModel";
modeledMethod: ModeledMethod;
}
export type ToModelAlertsMessage =
| SetModelAlertsViewStateMessage
| SetVariantAnalysisMessage
| SetRepoResultsMessage
| RevealModelMessage;
export type FromModelAlertsMessage =
| CommonFromViewMessages
| OpenModelPackMessage
| OpenActionsLogsMessage
| StopEvaluationRunMessage
| RevealInEditorMessage;

View File

@@ -1,7 +1,10 @@
import { appendFile, ensureFile } from "fs-extra";
import { ensureFile } from "fs-extra";
import { open } from "node:fs/promises";
import type { FileHandle } from "node:fs/promises";
import { isAbsolute } from "path";
import { getErrorMessage } from "../helpers-pure";
import type { Logger, LogOptions } from "./logger";
import type { Disposable } from "../disposable-object";
/**
* An implementation of {@link Logger} that sends the output both to another {@link Logger}
@@ -10,9 +13,10 @@ import type { Logger, LogOptions } from "./logger";
* The first time a message is written, an additional banner is written to the underlying logger
* pointing the user to the "side log" file.
*/
export class TeeLogger implements Logger {
export class TeeLogger implements Logger, Disposable {
private emittedRedirectMessage = false;
private error = false;
private fileHandle: FileHandle | undefined = undefined;
public constructor(
private readonly logger: Logger,
@@ -37,11 +41,15 @@ export class TeeLogger implements Logger {
if (!this.error) {
try {
const trailingNewline = options.trailingNewline ?? true;
await ensureFile(this.location);
if (!this.fileHandle) {
await ensureFile(this.location);
await appendFile(
this.location,
this.fileHandle = await open(this.location, "a");
}
const trailingNewline = options.trailingNewline ?? true;
await this.fileHandle.appendFile(
message + (trailingNewline ? "\n" : ""),
{
encoding: "utf8",
@@ -50,6 +58,14 @@ export class TeeLogger implements Logger {
} catch (e) {
// Write an error message to the primary log, and stop trying to write to the side log.
this.error = true;
try {
await this.fileHandle?.close();
} catch (e) {
void this.logger.log(
`Failed to close file handle: ${getErrorMessage(e)}`,
);
}
this.fileHandle = undefined;
const errorMessage = getErrorMessage(e);
await this.logger.log(
`Error writing to additional log file: ${errorMessage}`,
@@ -65,4 +81,15 @@ export class TeeLogger implements Logger {
show(preserveFocus?: boolean): void {
this.logger.show(preserveFocus);
}
dispose(): void {
try {
void this.fileHandle?.close();
} catch (e) {
void this.logger.log(
`Failed to close file handle: ${getErrorMessage(e)}`,
);
}
this.fileHandle = undefined;
}
}

View File

@@ -0,0 +1,4 @@
export interface ModelPackDetails {
name: string;
path: string;
}

View File

@@ -0,0 +1,17 @@
export const SARIF_RESULTS_QUERY_KINDS = [
"problem",
"alert",
"path-problem",
"path-alert",
];
/**
* Returns whether this query kind supports producing SARIF results.
*/
export function isSarifResultsQueryKind(kind: string | undefined): boolean {
if (!kind) {
return false;
}
return SARIF_RESULTS_QUERY_KINDS.includes(kind);
}

View File

@@ -1,9 +1,4 @@
import type {
CancellationToken,
WebviewView,
WebviewViewProvider,
WebviewViewResolveContext,
} from "vscode";
import type { WebviewView, WebviewViewProvider } from "vscode";
import { Uri } from "vscode";
import type { WebviewKind, WebviewMessage } from "./webview-html";
import { getHtmlForWebview } from "./webview-html";
@@ -28,11 +23,7 @@ export abstract class AbstractWebviewViewProvider<
* This is called when a view first becomes visible. This may happen when the view is
* first loaded or when the user hides and then shows a view again.
*/
public resolveWebviewView(
webviewView: WebviewView,
_context: WebviewViewResolveContext,
_token: CancellationToken,
) {
public resolveWebviewView(webviewView: WebviewView) {
webviewView.webview.options = {
enableScripts: true,
localResourceRoots: [Uri.file(this.app.extensionPath)],

View File

@@ -13,6 +13,8 @@ import { tmpDir } from "../../tmp-dir";
import type { WebviewMessage, WebviewKind } from "./webview-html";
import { getHtmlForWebview } from "./webview-html";
import type { DeepReadonly } from "../readonly";
import { runWithErrorHandling } from "./error-handling";
import { telemetryListener } from "./telemetry";
export type WebviewPanelConfig = {
viewId: string;
@@ -117,7 +119,12 @@ export abstract class AbstractWebview<
);
this.push(
panel.webview.onDidReceiveMessage(
async (e) => this.onMessage(e),
async (e) =>
runWithErrorHandling(
() => this.onMessage(e),
this.app.logger,
telemetryListener,
),
undefined,
),
);

View File

@@ -26,6 +26,8 @@ import {
// All path operations in this file must be on paths *within* the zip
// archive.
import { posix } from "path";
import { DatabaseEventKind } from "../../databases/local-databases/database-events";
import type { DatabaseManager } from "../../databases/local-databases/database-manager";
const path = posix;
@@ -242,6 +244,10 @@ export class ArchiveFileSystemProvider implements FileSystemProvider {
root = new Directory("");
flushCache(zipPath: string) {
this.archives.delete(zipPath);
}
// metadata
async stat(uri: Uri): Promise<FileStat> {
@@ -355,15 +361,35 @@ export class ArchiveFileSystemProvider implements FileSystemProvider {
*/
export const zipArchiveScheme = "codeql-zip-archive";
export function activate(ctx: ExtensionContext) {
export function activate(ctx: ExtensionContext, dbm?: DatabaseManager) {
const afsp = new ArchiveFileSystemProvider();
if (dbm) {
ctx.subscriptions.push(
dbm.onDidChangeDatabaseItem(async ({ kind, item: db }) => {
if (kind === DatabaseEventKind.Remove) {
if (db?.sourceArchive) {
afsp.flushCache(db.sourceArchive.fsPath);
}
}
}),
);
}
ctx.subscriptions.push(
workspace.registerFileSystemProvider(
zipArchiveScheme,
new ArchiveFileSystemProvider(),
{
isCaseSensitive: true,
isReadonly: true,
},
),
// When a file system archive is removed from the workspace, we should
// also remove it from our cache.
workspace.onDidChangeWorkspaceFolders((event) => {
for (const removed of event.removed) {
const zipPath = removed.uri.fsPath;
afsp.flushCache(zipPath);
}
}),
);
ctx.subscriptions.push(
workspace.registerFileSystemProvider(zipArchiveScheme, afsp, {
isCaseSensitive: true,
isReadonly: true,
}),
);
}

View File

@@ -2,8 +2,8 @@ import { authentication } from "vscode";
import type { Octokit } from "@octokit/rest";
import type { Credentials } from "../authentication";
import { AppOctokit } from "../octokit";
export const GITHUB_AUTH_PROVIDER_ID = "github";
import { hasGhecDrUri } from "../../config";
import { getOctokitBaseUrl } from "./octokit";
// We need 'repo' scope for triggering workflows, 'gist' scope for exporting results to Gist,
// and 'read:packages' for reading private CodeQL packages.
@@ -16,30 +16,24 @@ const SCOPES = ["repo", "gist", "read:packages"];
*/
export class VSCodeCredentials implements Credentials {
/**
* A specific octokit to return, otherwise a new authenticated octokit will be created when needed.
*/
private octokit: Octokit | undefined;
/**
* Creates or returns an instance of Octokit.
* Creates or returns an instance of Octokit. The returned instance should
* not be stored and reused, as it may become out-of-date with the current
* authentication session.
*
* @returns An instance of Octokit.
*/
async getOctokit(): Promise<Octokit> {
if (this.octokit) {
return this.octokit;
}
const accessToken = await this.getAccessToken();
return new AppOctokit({
auth: accessToken,
baseUrl: getOctokitBaseUrl(),
});
}
async getAccessToken(): Promise<string> {
const session = await authentication.getSession(
GITHUB_AUTH_PROVIDER_ID,
this.authProviderId,
SCOPES,
{ createIfNone: true },
);
@@ -49,11 +43,18 @@ export class VSCodeCredentials implements Credentials {
async getExistingAccessToken(): Promise<string | undefined> {
const session = await authentication.getSession(
GITHUB_AUTH_PROVIDER_ID,
this.authProviderId,
SCOPES,
{ createIfNone: false },
);
return session?.accessToken;
}
public get authProviderId(): string {
if (hasGhecDrUri()) {
return "github-enterprise";
}
return "github";
}
}

View File

@@ -3,18 +3,10 @@ import { commands } from "vscode";
import type { CommandFunction } from "../../packages/commands";
import { CommandManager } from "../../packages/commands";
import type { NotificationLogger } from "../logging";
import {
showAndLogWarningMessage,
showAndLogExceptionWithTelemetry,
} from "../logging";
import { extLogger } from "../logging/vscode";
import { asError, getErrorMessage } from "../../common/helpers-pure";
import { redactableError } from "../../common/errors";
import { UserCancellationException } from "./progress";
import { telemetryListener } from "./telemetry";
import type { AppTelemetry } from "../telemetry";
import { CliError } from "../../codeql-cli/cli-errors";
import { EOL } from "os";
import { runWithErrorHandling } from "./error-handling";
/**
* Create a command manager for VSCode, wrapping registerCommandWithErrorHandling
@@ -48,50 +40,9 @@ export function registerCommandWithErrorHandling<
logger: NotificationLogger = extLogger,
telemetry: AppTelemetry | undefined = telemetryListener,
): Disposable {
return commands.registerCommand(commandId, async (...args: Parameters<T>) => {
const startTime = Date.now();
let error: Error | undefined;
try {
return await task(...args);
} catch (e) {
error = asError(e);
const errorMessage = redactableError(error)`${
getErrorMessage(e) || e
} (${commandId})`;
if (e instanceof UserCancellationException) {
// User has cancelled this action manually
if (e.silent) {
void logger.log(errorMessage.fullMessage);
} else {
void showAndLogWarningMessage(logger, errorMessage.fullMessage);
}
} else if (e instanceof CliError) {
const fullMessage = `${e.commandDescription} failed with args:${EOL} ${e.commandArgs.join(" ")}${EOL}${
e.stderr ?? e.cause
}`;
void showAndLogExceptionWithTelemetry(logger, telemetry, errorMessage, {
fullMessage,
extraTelemetryProperties: {
command: commandId,
},
});
} else {
// Include the full stack in the error log only.
const fullMessage = errorMessage.fullMessageWithStack;
void showAndLogExceptionWithTelemetry(logger, telemetry, errorMessage, {
fullMessage,
extraTelemetryProperties: {
command: commandId,
},
});
}
return undefined;
} finally {
const executionTime = Date.now() - startTime;
telemetryListener?.sendCommandUsage(commandId, executionTime, error);
}
});
return commands.registerCommand(commandId, async (...args: Parameters<T>) =>
runWithErrorHandling(task, logger, telemetry, commandId, ...args),
);
}
/**

View File

@@ -0,0 +1,81 @@
import {
showAndLogWarningMessage,
showAndLogExceptionWithTelemetry,
} from "../logging";
import type { NotificationLogger } from "../logging";
import { extLogger } from "../logging/vscode";
import type { AppTelemetry } from "../telemetry";
import { telemetryListener } from "./telemetry";
import { asError, getErrorMessage } from "../helpers-pure";
import { redactableError } from "../errors";
import { UserCancellationException } from "./progress";
import { CliError } from "../../codeql-cli/cli-errors";
import { EOL } from "os";
/**
* Executes a task with error handling. It provides a uniform way to handle errors.
*
* @template T - A function type that takes an unknown number of arguments and returns a Promise.
* @param {T} task - The task to be executed.
* @param {NotificationLogger} [logger=extLogger] - The logger to use for error reporting.
* @param {AppTelemetry | undefined} [telemetry=telemetryListener] - The telemetry listener to use for error reporting.
* @param {string} [commandId] - The optional command id associated with the task.
* @param {...unknown} args - The arguments to be passed to the task.
* @returns {Promise<unknown>} The result of the task, or undefined if an error occurred.
* @throws {Error} If an error occurs during the execution of the task.
*/
export async function runWithErrorHandling<
T extends (...args: unknown[]) => Promise<unknown>,
>(
task: T,
logger: NotificationLogger = extLogger,
telemetry: AppTelemetry | undefined = telemetryListener,
commandId?: string,
...args: unknown[]
): Promise<unknown> {
const startTime = Date.now();
let error: Error | undefined;
try {
return await task(...args);
} catch (e) {
error = asError(e);
const errorMessage = redactableError(error)`${
getErrorMessage(e) || e
}${commandId ? ` (${commandId})` : ""}`;
const extraTelemetryProperties = commandId
? { command: commandId }
: undefined;
if (e instanceof UserCancellationException) {
// User has cancelled this action manually
if (e.silent) {
void logger.log(errorMessage.fullMessage);
} else {
void showAndLogWarningMessage(logger, errorMessage.fullMessage);
}
} else if (e instanceof CliError) {
const fullMessage = `${e.commandDescription} failed with args:${EOL} ${e.commandArgs.join(" ")}${EOL}${
e.stderr ?? e.cause
}`;
void showAndLogExceptionWithTelemetry(logger, telemetry, errorMessage, {
fullMessage,
extraTelemetryProperties,
});
} else {
// Include the full stack in the error log only.
const fullMessage = errorMessage.fullMessageWithStack;
void showAndLogExceptionWithTelemetry(logger, telemetry, errorMessage, {
fullMessage,
extraTelemetryProperties,
});
}
return undefined;
} finally {
if (commandId) {
const executionTime = Date.now() - startTime;
telemetryListener?.sendCommandUsage(commandId, executionTime, error);
}
}
}

View File

@@ -0,0 +1,15 @@
import { getGitHubInstanceApiUrl } from "../../config";
/**
* Returns the Octokit base URL to use based on the GitHub instance URL.
*
* This is necessary because the Octokit base URL should not have a trailing
* slash, but this is included by default in a URL.
*/
export function getOctokitBaseUrl(): string {
let apiUrl = getGitHubInstanceApiUrl().toString();
if (apiUrl.endsWith("/")) {
apiUrl = apiUrl.slice(0, -1);
}
return apiUrl;
}

View File

@@ -33,6 +33,14 @@ export interface ProgressUpdate {
message: string;
}
export function progressUpdate(
step: number,
maxStep: number,
message: string,
): ProgressUpdate {
return { step, maxStep, message };
}
export type ProgressCallback = (p: ProgressUpdate) => void;
// Make certain properties within a type optional
@@ -48,7 +56,7 @@ type ProgressOptions = Optional<VSCodeProgressOptions, "location">;
* denote some progress being achieved on this task.
* @param token a cancellation token
*/
export type ProgressTask<R> = (
type ProgressTask<R> = (
progress: ProgressCallback,
token: CancellationToken,
) => Thenable<R>;
@@ -85,29 +93,6 @@ export function withProgress<R>(
);
}
export interface ProgressContext {
progress: ProgressCallback;
token: CancellationToken;
}
/**
* Like `withProgress()`, except that the caller is not required to provide a progress context. If
* the caller does provide one, any long-running operations performed by `task` will use the
* supplied progress context. Otherwise, this function wraps `task` in a new progress context with
* the supplied options.
*/
export function withInheritedProgress<R>(
parent: ProgressContext | undefined,
task: ProgressTask<R>,
options: ProgressOptions,
): Thenable<R> {
if (parent !== undefined) {
return task(parent.progress, parent.token);
} else {
return withProgress(task, options);
}
}
/**
* Displays a progress monitor that indicates how much progess has been made
* reading from a stream.

View File

@@ -10,7 +10,8 @@ export type WebviewKind =
| "variant-analysis"
| "data-flow-paths"
| "model-editor"
| "method-modeling";
| "method-modeling"
| "model-alerts";
export interface WebviewMessage {
t: string;

View File

@@ -4,7 +4,7 @@ import type {
ConfigurationScope,
Event,
} from "vscode";
import { ConfigurationTarget, EventEmitter, workspace } from "vscode";
import { ConfigurationTarget, EventEmitter, workspace, Uri } from "vscode";
import type { DistributionManager } from "./codeql-cli/distribution";
import { extLogger } from "./common/logging/vscode";
import { ONE_DAY_IN_MS } from "./common/time";
@@ -13,6 +13,8 @@ import {
FilterKey,
SortKey,
} from "./variant-analysis/shared/variant-analysis-filter-sort";
import { substituteConfigVariables } from "./common/config-template";
import { getErrorMessage } from "./common/helpers-pure";
export const ALL_SETTINGS: Setting[] = [];
@@ -68,6 +70,97 @@ export const VSCODE_SAVE_BEFORE_START_SETTING = new Setting(
VSCODE_DEBUG_SETTING,
);
const VSCODE_GITHUB_ENTERPRISE_SETTING = new Setting(
"github-enterprise",
undefined,
);
export const VSCODE_GITHUB_ENTERPRISE_URI_SETTING = new Setting(
"uri",
VSCODE_GITHUB_ENTERPRISE_SETTING,
);
/**
* Get the value of the `github-enterprise.uri` setting, parsed as a URI.
* If the value is not set or cannot be parsed, return `undefined`.
*/
export function getEnterpriseUri(): Uri | undefined {
const config = VSCODE_GITHUB_ENTERPRISE_URI_SETTING.getValue<string>();
if (config) {
try {
let uri = Uri.parse(config, true);
if (uri.scheme === "http") {
uri = uri.with({ scheme: "https" });
}
return uri;
} catch (e) {
void extLogger.log(
`Failed to parse the GitHub Enterprise URI: ${getErrorMessage(e)}`,
);
}
}
return undefined;
}
/**
* Is the GitHub Enterprise URI set?
*/
export function hasEnterpriseUri(): boolean {
return getEnterpriseUri() !== undefined;
}
/**
* Does the uri look like GHEC-DR?
*/
function isGhecDrUri(uri: Uri | undefined): boolean {
return (
uri !== undefined && !uri.authority.toLowerCase().endsWith("github.com")
);
}
/**
* Is the GitHub Enterprise URI set to something that looks like GHEC-DR?
*/
export function hasGhecDrUri(): boolean {
const uri = getEnterpriseUri();
return isGhecDrUri(uri);
}
/**
* The URI for GitHub.com.
*/
export const GITHUB_URL = new URL("https://github.com");
export const GITHUB_API_URL = new URL("https://api.github.com");
/**
* If the GitHub Enterprise URI is set to something that looks like GHEC-DR, return it.
*/
export function getGhecDrUri(): Uri | undefined {
const uri = getEnterpriseUri();
if (isGhecDrUri(uri)) {
return uri;
} else {
return undefined;
}
}
export function getGitHubInstanceUrl(): URL {
const ghecDrUri = getGhecDrUri();
if (ghecDrUri) {
return new URL(ghecDrUri.toString());
}
return GITHUB_URL;
}
export function getGitHubInstanceApiUrl(): URL {
const ghecDrUri = getGhecDrUri();
if (ghecDrUri) {
const url = new URL(ghecDrUri.toString());
url.hostname = `api.${url.hostname}`;
return url;
}
return GITHUB_API_URL;
}
const ROOT_SETTING = new Setting("codeQL");
// Telemetry configuration
@@ -500,27 +593,13 @@ export const NO_CACHE_CONTEXTUAL_QUERIES = new Setting(
// Settings for variant analysis
const VARIANT_ANALYSIS_SETTING = new Setting("variantAnalysis", ROOT_SETTING);
/**
* The name of the "controller" repository that you want to use with the "Run Variant Analysis" command.
* Note: This command is only available for internal users.
*
* This setting should be a GitHub repository of the form `<owner>/<repo>`.
*/
const REMOTE_CONTROLLER_REPO = new Setting(
"controllerRepo",
VARIANT_ANALYSIS_SETTING,
);
export function getRemoteControllerRepo(): string | undefined {
return REMOTE_CONTROLLER_REPO.getValue<string>() || undefined;
}
export async function setRemoteControllerRepo(repo: string | undefined) {
await REMOTE_CONTROLLER_REPO.updateValue(repo, ConfigurationTarget.Global);
}
export interface VariantAnalysisConfig {
controllerRepo: string | undefined;
showSystemDefinedRepositoryLists: boolean;
/**
* This uses a URL instead of a URI because the URL class is available in
* unit tests and is fully browser-compatible.
*/
githubUrl: URL;
onDidChangeConfiguration?: Event<void>;
}
@@ -530,13 +609,17 @@ export class VariantAnalysisConfigListener
{
protected handleDidChangeConfiguration(e: ConfigurationChangeEvent): void {
this.handleDidChangeConfigurationForRelevantSettings(
[VARIANT_ANALYSIS_SETTING],
[VARIANT_ANALYSIS_SETTING, VSCODE_GITHUB_ENTERPRISE_URI_SETTING],
e,
);
}
public get controllerRepo(): string | undefined {
return getRemoteControllerRepo();
public get showSystemDefinedRepositoryLists(): boolean {
return !hasEnterpriseUri();
}
public get githubUrl(): URL {
return getGitHubInstanceUrl();
}
}
@@ -724,7 +807,6 @@ export async function setAutogenerateQlPacks(choice: AutogenerateQLPacks) {
const MODEL_SETTING = new Setting("model", ROOT_SETTING);
const FLOW_GENERATION = new Setting("flowGeneration", MODEL_SETTING);
const LLM_GENERATION = new Setting("llmGeneration", MODEL_SETTING);
const SHOW_TYPE_MODELS = new Setting("showTypeModels", MODEL_SETTING);
const LLM_GENERATION_BATCH_SIZE = new Setting(
"llmGenerationBatchSize",
MODEL_SETTING,
@@ -734,25 +816,34 @@ const LLM_GENERATION_DEV_ENDPOINT = new Setting(
MODEL_SETTING,
);
const MODEL_EVALUATION = new Setting("evaluation", MODEL_SETTING);
const EXTENSIONS_DIRECTORY = new Setting("extensionsDirectory", MODEL_SETTING);
const MODEL_PACK_LOCATION = new Setting("packLocation", MODEL_SETTING);
const MODEL_PACK_NAME = new Setting("packName", MODEL_SETTING);
const ENABLE_PYTHON = new Setting("enablePython", MODEL_SETTING);
const ENABLE_ACCESS_PATH_SUGGESTIONS = new Setting(
"enableAccessPathSuggestions",
MODEL_SETTING,
);
export type ModelConfigPackVariables = {
database: string;
owner: string;
name: string;
language: string;
};
export interface ModelConfig {
flowGeneration: boolean;
llmGeneration: boolean;
showTypeModels: boolean;
getExtensionsDirectory(languageId: string): string | undefined;
getPackLocation(
languageId: string,
variables: ModelConfigPackVariables,
): string;
getPackName(languageId: string, variables: ModelConfigPackVariables): string;
enablePython: boolean;
enableAccessPathSuggestions: boolean;
}
export class ModelConfigListener extends ConfigListener implements ModelConfig {
protected handleDidChangeConfiguration(e: ConfigurationChangeEvent): void {
this.handleDidChangeConfigurationForRelevantSettings([MODEL_SETTING], e);
this.handleDidChangeConfigurationForRelevantSettings(
[MODEL_SETTING, VSCODE_GITHUB_ENTERPRISE_URI_SETTING],
e,
);
}
public get flowGeneration(): boolean {
@@ -760,11 +851,7 @@ export class ModelConfigListener extends ConfigListener implements ModelConfig {
}
public get llmGeneration(): boolean {
return !!LLM_GENERATION.getValue<boolean>();
}
public get showTypeModels(): boolean {
return !!SHOW_TYPE_MODELS.getValue<boolean>();
return !!LLM_GENERATION.getValue<boolean>() && !hasEnterpriseUri();
}
/**
@@ -787,19 +874,33 @@ export class ModelConfigListener extends ConfigListener implements ModelConfig {
return !!MODEL_EVALUATION.getValue<boolean>();
}
public getExtensionsDirectory(languageId: string): string | undefined {
return EXTENSIONS_DIRECTORY.getValue<string>({
languageId,
});
public getPackLocation(
languageId: string,
variables: ModelConfigPackVariables,
): string {
return substituteConfigVariables(
MODEL_PACK_LOCATION.getValue<string>({
languageId,
}),
variables,
);
}
public getPackName(
languageId: string,
variables: ModelConfigPackVariables,
): string {
return substituteConfigVariables(
MODEL_PACK_NAME.getValue<string>({
languageId,
}),
variables,
);
}
public get enablePython(): boolean {
return !!ENABLE_PYTHON.getValue<boolean>();
}
public get enableAccessPathSuggestions(): boolean {
return !!ENABLE_ACCESS_PATH_SUGGESTIONS.getValue<boolean>();
}
}
const GITHUB_DATABASE_SETTING = new Setting("githubDatabase", ROOT_SETTING);

View File

@@ -7,6 +7,7 @@ import { AppOctokit } from "../common/octokit";
import type { ProgressCallback } from "../common/vscode/progress";
import { UserCancellationException } from "../common/vscode/progress";
import type { EndpointDefaults } from "@octokit/types";
import { getOctokitBaseUrl } from "../common/vscode/octokit";
export async function getCodeSearchRepositories(
query: string,
@@ -54,6 +55,7 @@ async function provideOctokitWithThrottling(
const octokit = new MyOctokit({
auth,
baseUrl: getOctokitBaseUrl(),
throttle: {
onRateLimit: (retryAfter: number, options: EndpointDefaults): boolean => {
void logger.log(

File diff suppressed because it is too large Load Diff

View File

@@ -16,6 +16,7 @@ import {
} from "./db-item-selection";
import { createRemoteTree } from "./db-tree-creator";
import type { DbConfigValidationError } from "./db-validation-errors";
import type { VariantAnalysisConfig } from "../config";
export class DbManager extends DisposableObject {
public readonly onDbItemsChanged: AppEvent<void>;
@@ -25,6 +26,7 @@ export class DbManager extends DisposableObject {
constructor(
private readonly app: App,
private readonly dbConfigStore: DbConfigStore,
private readonly variantAnalysisConfigListener: VariantAnalysisConfig,
) {
super();
@@ -36,6 +38,10 @@ export class DbManager extends DisposableObject {
this.dbConfigStore.onDidChangeConfig(() => {
this.onDbItemsChangesEventEmitter.fire();
});
this.variantAnalysisConfigListener.onDidChangeConfiguration?.(() => {
this.onDbItemsChangesEventEmitter.fire();
});
}
public getSelectedDbItem(): DbItem | undefined {
@@ -56,7 +62,11 @@ export class DbManager extends DisposableObject {
const expandedItems = this.getExpandedItems();
const remoteTree = createRemoteTree(configResult.value, expandedItems);
const remoteTree = createRemoteTree(
configResult.value,
this.variantAnalysisConfigListener,
expandedItems,
);
return ValueResult.ok(remoteTree.children);
}

View File

@@ -7,6 +7,7 @@ import { DbManager } from "./db-manager";
import { DbPanel } from "./ui/db-panel";
import { DbSelectionDecorationProvider } from "./ui/db-selection-decoration-provider";
import type { DatabasePanelCommands } from "../common/commands";
import { VariantAnalysisConfigListener } from "../config";
export class DbModule extends DisposableObject {
public readonly dbManager: DbManager;
@@ -17,7 +18,13 @@ export class DbModule extends DisposableObject {
super();
this.dbConfigStore = new DbConfigStore(app);
this.dbManager = this.push(new DbManager(app, this.dbConfigStore));
this.dbManager = this.push(
new DbManager(
app,
this.dbConfigStore,
new VariantAnalysisConfigListener(),
),
);
}
public static async initialize(app: App): Promise<DbModule> {

View File

@@ -1,3 +1,4 @@
import type { VariantAnalysisConfig } from "../config";
import type { DbConfig, RemoteRepositoryList } from "./config/db-config";
import { SelectedDbItemKind } from "./config/db-config";
import type {
@@ -13,13 +14,17 @@ import { ExpandedDbItemKind } from "./db-item-expansion";
export function createRemoteTree(
dbConfig: DbConfig,
variantAnalysisConfig: VariantAnalysisConfig,
expandedItems: ExpandedDbItem[],
): RootRemoteDbItem {
const systemDefinedLists = [
createSystemDefinedList(10, dbConfig),
createSystemDefinedList(100, dbConfig),
createSystemDefinedList(1000, dbConfig),
];
const systemDefinedLists =
variantAnalysisConfig.showSystemDefinedRepositoryLists
? [
createSystemDefinedList(10, dbConfig),
createSystemDefinedList(100, dbConfig),
createSystemDefinedList(1000, dbConfig),
]
: [];
const userDefinedRepoLists =
dbConfig.databases.variantAnalysis.repositoryLists.map((r) =>

View File

@@ -3,8 +3,14 @@ import type { Octokit } from "@octokit/rest";
import type { RestEndpointMethodTypes } from "@octokit/plugin-rest-endpoint-methods";
import { showNeverAskAgainDialog } from "../../common/vscode/dialog";
import type { GitHubDatabaseConfig } from "../../config";
import { hasGhecDrUri } from "../../config";
import type { Credentials } from "../../common/authentication";
import { AppOctokit } from "../../common/octokit";
import type { ProgressCallback } from "../../common/vscode/progress";
import { getErrorMessage } from "../../common/helpers-pure";
import { getLanguageDisplayName } from "../../common/query-language";
import { window } from "vscode";
import { extLogger } from "../../common/logging/vscode";
export type CodeqlDatabase =
RestEndpointMethodTypes["codeScanning"]["listCodeqlDatabases"]["response"]["data"][number];
@@ -62,7 +68,10 @@ export async function listDatabases(
credentials: Credentials,
config: GitHubDatabaseConfig,
): Promise<ListDatabasesResult | undefined> {
const hasAccessToken = !!(await credentials.getExistingAccessToken());
// On GHEC-DR, unauthenticated requests will never work, so we should always ask
// for authentication.
const hasAccessToken =
!!(await credentials.getExistingAccessToken()) || hasGhecDrUri();
let octokit = hasAccessToken
? await credentials.getOctokit()
@@ -108,3 +117,92 @@ export async function listDatabases(
octokit,
};
}
export async function convertGithubNwoToDatabaseUrl(
nwo: string,
octokit: Octokit,
progress: ProgressCallback,
language?: string,
): Promise<
| {
databaseUrl: string;
owner: string;
name: string;
databaseId: number;
databaseCreatedAt: string;
commitOid: string | null;
}
| undefined
> {
try {
const [owner, repo] = nwo.split("/");
const response = await octokit.rest.codeScanning.listCodeqlDatabases({
owner,
repo,
});
const languages = response.data.map((db) => db.language);
if (!language || !languages.includes(language)) {
language = await promptForLanguage(languages, progress);
if (!language) {
return;
}
}
const databaseForLanguage = response.data.find(
(db) => db.language === language,
);
if (!databaseForLanguage) {
throw new Error(`No database found for language '${language}'`);
}
return {
databaseUrl: databaseForLanguage.url,
owner,
name: repo,
databaseId: databaseForLanguage.id,
databaseCreatedAt: databaseForLanguage.created_at,
commitOid: databaseForLanguage.commit_oid ?? null,
};
} catch (e) {
void extLogger.log(`Error: ${getErrorMessage(e)}`);
throw new Error(`Unable to get database for '${nwo}'`);
}
}
async function promptForLanguage(
languages: string[],
progress: ProgressCallback | undefined,
): Promise<string | undefined> {
progress?.({
message: "Choose language",
step: 2,
maxStep: 2,
});
if (!languages.length) {
throw new Error("No databases found");
}
if (languages.length === 1) {
return languages[0];
}
const items = languages
.map((language) => ({
label: getLanguageDisplayName(language),
description: language,
language,
}))
.sort((a, b) => a.label.localeCompare(b.label));
const selectedItem = await window.showQuickPick(items, {
placeHolder: "Select the database language to download:",
ignoreFocusOut: true,
});
if (!selectedItem) {
return undefined;
}
return selectedItem.language;
}

View File

@@ -2,10 +2,8 @@ import { window } from "vscode";
import type { Octokit } from "@octokit/rest";
import { showNeverAskAgainDialog } from "../../common/vscode/dialog";
import { getLanguageDisplayName } from "../../common/query-language";
import { downloadGitHubDatabaseFromUrl } from "../database-fetcher";
import type { DatabaseFetcher } from "../database-fetcher";
import { withProgress } from "../../common/vscode/progress";
import type { DatabaseManager } from "../local-databases";
import type { CodeQLCliServer } from "../../codeql-cli/cli";
import type { AppCommandManager } from "../../common/commands";
import type { GitHubDatabaseConfig } from "../../config";
import type { CodeqlDatabase } from "./api";
@@ -58,9 +56,7 @@ export async function downloadDatabaseFromGitHub(
owner: string,
repo: string,
databases: CodeqlDatabase[],
databaseManager: DatabaseManager,
storagePath: string,
cliServer: CodeQLCliServer,
databaseFetcher: DatabaseFetcher,
commandManager: AppCommandManager,
): Promise<void> {
const selectedDatabases = await promptForDatabases(databases);
@@ -72,7 +68,7 @@ export async function downloadDatabaseFromGitHub(
selectedDatabases.map((database) =>
withProgress(
async (progress) => {
await downloadGitHubDatabaseFromUrl(
await databaseFetcher.downloadGitHubDatabaseFromUrl(
database.url,
database.id,
database.created_at,
@@ -81,9 +77,6 @@ export async function downloadDatabaseFromGitHub(
repo,
octokit,
progress,
databaseManager,
storagePath,
cliServer,
true,
false,
);

View File

@@ -14,7 +14,6 @@ import {
} from "./download";
import type { GitHubDatabaseConfig } from "../../config";
import type { DatabaseManager } from "../local-databases";
import type { CodeQLCliServer } from "../../codeql-cli/cli";
import type { CodeqlDatabase, ListDatabasesResult } from "./api";
import { listDatabases } from "./api";
import type { DatabaseUpdate } from "./updates";
@@ -24,6 +23,7 @@ import {
isNewerDatabaseAvailable,
} from "./updates";
import type { Octokit } from "@octokit/rest";
import type { DatabaseFetcher } from "../database-fetcher";
export class GitHubDatabasesModule extends DisposableObject {
/**
@@ -33,8 +33,7 @@ export class GitHubDatabasesModule extends DisposableObject {
constructor(
private readonly app: App,
private readonly databaseManager: DatabaseManager,
private readonly databaseStoragePath: string,
private readonly cliServer: CodeQLCliServer,
private readonly databaseFetcher: DatabaseFetcher,
private readonly config: GitHubDatabaseConfig,
) {
super();
@@ -43,15 +42,13 @@ export class GitHubDatabasesModule extends DisposableObject {
public static async initialize(
app: App,
databaseManager: DatabaseManager,
databaseStoragePath: string,
cliServer: CodeQLCliServer,
databaseFetcher: DatabaseFetcher,
config: GitHubDatabaseConfig,
): Promise<GitHubDatabasesModule> {
const githubDatabasesModule = new GitHubDatabasesModule(
app,
databaseManager,
databaseStoragePath,
cliServer,
databaseFetcher,
config,
);
app.subscriptions.push(githubDatabasesModule);
@@ -185,9 +182,7 @@ export class GitHubDatabasesModule extends DisposableObject {
owner,
repo,
databases,
this.databaseManager,
this.databaseStoragePath,
this.cliServer,
this.databaseFetcher,
this.app.commands,
);
}
@@ -212,8 +207,7 @@ export class GitHubDatabasesModule extends DisposableObject {
repo,
databaseUpdates,
this.databaseManager,
this.databaseStoragePath,
this.cliServer,
this.databaseFetcher,
this.app.commands,
);
}

View File

@@ -1,11 +1,10 @@
import type { CodeqlDatabase } from "./api";
import type { DatabaseItem, DatabaseManager } from "../local-databases";
import type { Octokit } from "@octokit/rest";
import type { CodeQLCliServer } from "../../codeql-cli/cli";
import type { AppCommandManager } from "../../common/commands";
import { getLanguageDisplayName } from "../../common/query-language";
import { showNeverAskAgainDialog } from "../../common/vscode/dialog";
import { downloadGitHubDatabaseFromUrl } from "../database-fetcher";
import type { DatabaseFetcher } from "../database-fetcher";
import { withProgress } from "../../common/vscode/progress";
import { window } from "vscode";
import type { GitHubDatabaseConfig } from "../../config";
@@ -156,8 +155,7 @@ export async function downloadDatabaseUpdateFromGitHub(
repo: string,
updates: DatabaseUpdate[],
databaseManager: DatabaseManager,
storagePath: string,
cliServer: CodeQLCliServer,
databaseFetcher: DatabaseFetcher,
commandManager: AppCommandManager,
): Promise<void> {
const selectedDatabases = await promptForDatabases(
@@ -179,21 +177,19 @@ export async function downloadDatabaseUpdateFromGitHub(
return withProgress(
async (progress) => {
const newDatabase = await downloadGitHubDatabaseFromUrl(
database.url,
database.id,
database.created_at,
database.commit_oid ?? null,
owner,
repo,
octokit,
progress,
databaseManager,
storagePath,
cliServer,
databaseManager.currentDatabaseItem === update.databaseItem,
update.databaseItem.hasSourceArchiveInExplorer(),
);
const newDatabase =
await databaseFetcher.downloadGitHubDatabaseFromUrl(
database.url,
database.id,
database.created_at,
database.commit_oid ?? null,
owner,
repo,
octokit,
progress,
databaseManager.currentDatabaseItem === update.databaseItem,
update.databaseItem.hasSourceArchiveInExplorer(),
);
if (newDatabase === undefined) {
return;
}

View File

@@ -16,7 +16,6 @@ import {
ThemeIcon,
ThemeColor,
workspace,
ProgressLocation,
} from "vscode";
import { pathExists, stat, readdir, remove } from "fs-extra";
@@ -25,13 +24,9 @@ import type {
DatabaseItem,
DatabaseManager,
} from "./local-databases";
import type {
ProgressCallback,
ProgressContext,
} from "../common/vscode/progress";
import type { ProgressCallback } from "../common/vscode/progress";
import {
UserCancellationException,
withInheritedProgress,
withProgress,
} from "../common/vscode/progress";
import {
@@ -42,14 +37,9 @@ import {
showAndLogExceptionWithTelemetry,
showAndLogErrorMessage,
} from "../common/logging";
import {
importArchiveDatabase,
promptImportGithubDatabase,
promptImportInternetDatabase,
} from "./database-fetcher";
import type { DatabaseFetcher } from "./database-fetcher";
import { asError, asyncFilter, getErrorMessage } from "../common/helpers-pure";
import type { QueryRunner } from "../query-server";
import { isCanary } from "../config";
import type { App } from "../common/app";
import { redactableError } from "../common/errors";
import type { LocalDatabasesCommands } from "../common/commands";
@@ -119,9 +109,8 @@ class DatabaseTreeDataProvider
// Note that events from the database manager are instances of DatabaseChangedEvent
// and events fired by the UI are instances of DatabaseItem
// When event.item is undefined, then the entire tree is refreshed.
// When event.item is a db item, then only that item is refreshed.
this._onDidChangeTreeData.fire(event.item);
// When a full refresh has occurred, then all items are refreshed by passing undefined.
this._onDidChangeTreeData.fire(event.fullRefresh ? undefined : event.item);
}
private handleDidChangeCurrentDatabaseItem(
@@ -146,7 +135,8 @@ class DatabaseTreeDataProvider
item.iconPath = new ThemeIcon("error", new ThemeColor("errorForeground"));
}
item.tooltip = element.databaseUri.fsPath;
item.description = element.language;
item.description =
element.language + (element.origin?.type === "testproj" ? " (test)" : "");
return item;
}
@@ -253,6 +243,7 @@ export class DatabaseUI extends DisposableObject {
public constructor(
private app: App,
private databaseManager: DatabaseManager,
private readonly databaseFetcher: DatabaseFetcher,
languageContext: LanguageContextStore,
private readonly queryServer: QueryRunner,
private readonly storagePath: string,
@@ -282,6 +273,7 @@ export class DatabaseUI extends DisposableObject {
this.handleChooseDatabaseInternet.bind(this),
"codeQL.chooseDatabaseGithub": this.handleChooseDatabaseGithub.bind(this),
"codeQL.setCurrentDatabase": this.handleSetCurrentDatabase.bind(this),
"codeQL.importTestDatabase": this.handleImportTestDatabase.bind(this),
"codeQL.setDefaultTourDatabase":
this.handleSetDefaultTourDatabase.bind(this),
"codeQL.upgradeCurrentDatabase":
@@ -331,10 +323,9 @@ export class DatabaseUI extends DisposableObject {
private async chooseDatabaseFolder(
progress: ProgressCallback,
token: CancellationToken,
): Promise<void> {
try {
await this.chooseAndSetDatabase(true, { progress, token });
await this.chooseAndSetDatabase(true, progress);
} catch (e) {
void showAndLogExceptionWithTelemetry(
this.app.logger,
@@ -348,8 +339,8 @@ export class DatabaseUI extends DisposableObject {
private async handleChooseDatabaseFolder(): Promise<void> {
return withProgress(
async (progress, token) => {
await this.chooseDatabaseFolder(progress, token);
async (progress) => {
await this.chooseDatabaseFolder(progress);
},
{
title: "Adding database from folder",
@@ -359,8 +350,8 @@ export class DatabaseUI extends DisposableObject {
private async handleChooseDatabaseFolderFromPalette(): Promise<void> {
return withProgress(
async (progress, token) => {
await this.chooseDatabaseFolder(progress, token);
async (progress) => {
await this.chooseDatabaseFolder(progress);
},
{
title: "Choose a Database from a Folder",
@@ -501,10 +492,9 @@ export class DatabaseUI extends DisposableObject {
private async chooseDatabaseArchive(
progress: ProgressCallback,
token: CancellationToken,
): Promise<void> {
try {
await this.chooseAndSetDatabase(false, { progress, token });
await this.chooseAndSetDatabase(false, progress);
} catch (e: unknown) {
void showAndLogExceptionWithTelemetry(
this.app.logger,
@@ -518,8 +508,8 @@ export class DatabaseUI extends DisposableObject {
private async handleChooseDatabaseArchive(): Promise<void> {
return withProgress(
async (progress, token) => {
await this.chooseDatabaseArchive(progress, token);
async (progress) => {
await this.chooseDatabaseArchive(progress);
},
{
title: "Adding database from archive",
@@ -529,8 +519,8 @@ export class DatabaseUI extends DisposableObject {
private async handleChooseDatabaseArchiveFromPalette(): Promise<void> {
return withProgress(
async (progress, token) => {
await this.chooseDatabaseArchive(progress, token);
async (progress) => {
await this.chooseDatabaseArchive(progress);
},
{
title: "Choose a Database from an Archive",
@@ -541,13 +531,7 @@ export class DatabaseUI extends DisposableObject {
private async handleChooseDatabaseInternet(): Promise<void> {
return withProgress(
async (progress) => {
await promptImportInternetDatabase(
this.app.commands,
this.databaseManager,
this.storagePath,
progress,
this.queryServer.cliServer,
);
await this.databaseFetcher.promptImportInternetDatabase(progress);
},
{
title: "Adding database from URL",
@@ -558,16 +542,7 @@ export class DatabaseUI extends DisposableObject {
private async handleChooseDatabaseGithub(): Promise<void> {
return withProgress(
async (progress) => {
const credentials = isCanary() ? this.app.credentials : undefined;
await promptImportGithubDatabase(
this.app.commands,
this.databaseManager,
this.storagePath,
credentials,
progress,
this.queryServer.cliServer,
);
await this.databaseFetcher.promptImportGithubDatabase(progress);
},
{
title: "Adding database from GitHub",
@@ -669,14 +644,13 @@ export class DatabaseUI extends DisposableObject {
private async handleClearCache(): Promise<void> {
return withProgress(
async (_progress, token) => {
async () => {
if (
this.queryServer !== undefined &&
this.databaseManager.currentDatabaseItem !== undefined
) {
await this.queryServer.clearCacheInDatabase(
this.databaseManager.currentDatabaseItem,
token,
);
}
},
@@ -688,14 +662,13 @@ export class DatabaseUI extends DisposableObject {
private async handleTrimCache(): Promise<void> {
return withProgress(
async (_progress, token) => {
async () => {
if (
this.queryServer !== undefined &&
this.databaseManager.currentDatabaseItem !== undefined
) {
await this.queryServer.trimCacheInDatabase(
this.databaseManager.currentDatabaseItem,
token,
);
}
},
@@ -716,13 +689,9 @@ export class DatabaseUI extends DisposableObject {
try {
// Assume user has selected an archive if the file has a .zip extension
if (uri.path.endsWith(".zip")) {
await importArchiveDatabase(
this.app.commands,
await this.databaseFetcher.importLocalDatabase(
uri.toString(true),
this.databaseManager,
this.storagePath,
progress,
this.queryServer.cliServer,
);
} else {
await this.databaseManager.openDatabase(uri, {
@@ -744,6 +713,56 @@ export class DatabaseUI extends DisposableObject {
);
}
private async handleImportTestDatabase(uri: Uri): Promise<void> {
return withProgress(
async (progress) => {
try {
if (!uri.path.endsWith(".testproj")) {
throw new Error(
"Please select a valid test database to import. Test databases end with `.testproj`.",
);
}
// Check if the database is already in the workspace. If
// so, delete it first before importing the new one.
const existingItem = this.databaseManager.findTestDatabase(uri);
const baseName = basename(uri.fsPath);
if (existingItem !== undefined) {
progress({
maxStep: 9,
step: 1,
message: `Removing existing test database ${baseName}`,
});
await this.databaseManager.removeDatabaseItem(existingItem);
}
await this.databaseFetcher.importLocalDatabase(
uri.toString(true),
progress,
);
if (existingItem !== undefined) {
progress({
maxStep: 9,
step: 9,
message: `Successfully re-imported ${baseName}`,
});
}
} catch (e) {
// rethrow and let this be handled by default error handling.
throw new Error(
`Could not set database to ${basename(
uri.fsPath,
)}. Reason: ${getErrorMessage(e)}`,
);
}
},
{
title: "(Re-)importing test database from directory",
},
);
}
private async handleRemoveDatabase(
databaseItems: DatabaseItem[],
): Promise<void> {
@@ -799,9 +818,8 @@ export class DatabaseUI extends DisposableObject {
*/
public async getDatabaseItem(
progress: ProgressCallback,
token: CancellationToken,
): Promise<DatabaseItem | undefined> {
return await this.getDatabaseItemInternal({ progress, token });
return await this.getDatabaseItemInternal(progress);
}
/**
@@ -814,10 +832,10 @@ export class DatabaseUI extends DisposableObject {
* notification if it tries to perform any long-running operations.
*/
private async getDatabaseItemInternal(
progressContext: ProgressContext | undefined,
progress: ProgressCallback | undefined,
): Promise<DatabaseItem | undefined> {
if (this.databaseManager.currentDatabaseItem === undefined) {
progressContext?.progress({
progress?.({
maxStep: 2,
step: 1,
message: "Choosing database",
@@ -944,41 +962,28 @@ export class DatabaseUI extends DisposableObject {
*/
private async chooseAndSetDatabase(
byFolder: boolean,
progress: ProgressContext | undefined,
progress: ProgressCallback,
): Promise<DatabaseItem | undefined> {
const uri = await chooseDatabaseDir(byFolder);
if (!uri) {
return undefined;
}
return await withInheritedProgress(
progress,
async (progress) => {
if (byFolder) {
const fixedUri = await this.fixDbUri(uri);
// we are selecting a database folder
return await this.databaseManager.openDatabase(fixedUri, {
type: "folder",
});
} else {
// we are selecting a database archive. Must unzip into a workspace-controlled area
// before importing.
return await importArchiveDatabase(
this.app.commands,
uri.toString(true),
this.databaseManager,
this.storagePath,
progress,
this.queryServer.cliServer,
);
}
},
{
location: ProgressLocation.Notification,
cancellable: true,
title: "Opening database",
},
);
if (byFolder && !uri.fsPath.endsWith("testproj")) {
const fixedUri = await this.fixDbUri(uri);
// we are selecting a database folder
return await this.databaseManager.openDatabase(fixedUri, {
type: "folder",
});
} else {
// we are selecting a database archive or a testproj.
// Unzip archives (if an archive) and copy into a workspace-controlled area
// before importing.
return await this.databaseFetcher.importLocalDatabase(
uri.toString(true),
progress,
);
}
}
/**

View File

@@ -1,4 +1,7 @@
import { pathExists, remove } from "fs-extra";
import { join } from "path";
import type { Uri } from "vscode";
import { zip } from "zip-a-folder";
/**
* The layout of the database.
@@ -28,3 +31,26 @@ export interface DatabaseContents {
export interface DatabaseContentsWithDbScheme extends DatabaseContents {
dbSchemeUri: Uri; // Always present
}
/**
* Databases created by the old odasa tool will not have a zipped
* source location. However, this extension works better if sources
* are zipped.
*
* This function ensures that the source location is zipped. If the
* `src` folder exists and the `src.zip` file does not, the `src`
* folder will be zipped and then deleted.
*
* @param databasePath The full path to the unzipped database
*/
export async function ensureZippedSourceLocation(
databasePath: string,
): Promise<void> {
const srcFolderPath = join(databasePath, "src");
const srcZipPath = `${srcFolderPath}.zip`;
if ((await pathExists(srcFolderPath)) && !(await pathExists(srcZipPath))) {
await zip(srcFolderPath, srcZipPath);
await remove(srcFolderPath);
}
}

View File

@@ -16,4 +16,8 @@ export enum DatabaseEventKind {
export interface DatabaseChangedEvent {
kind: DatabaseEventKind;
item: DatabaseItem | undefined;
// If true, event handlers should consider the database manager
// to have been fully refreshed. Any state managed by the
// event handler should be fully refreshed as well.
fullRefresh: boolean;
}

View File

@@ -66,6 +66,10 @@ export class DatabaseItemImpl implements DatabaseItem {
return this.options.origin;
}
public get extensionManagedLocation(): string | undefined {
return this.options.extensionManagedLocation;
}
public resolveSourceFile(uriStr: string | undefined): Uri {
const sourceArchive = this.sourceArchive;
const uri = uriStr ? Uri.parse(uriStr, true) : undefined;

View File

@@ -31,6 +31,12 @@ export interface DatabaseItem {
*/
readonly origin: DatabaseOrigin | undefined;
/**
* The location of the base storage location as managed by the extension, or undefined
* if unknown or not managed by the extension.
*/
readonly extensionManagedLocation: string | undefined;
/** If the database is invalid, describes why. */
readonly error: Error | undefined;

View File

@@ -18,7 +18,10 @@ import {
import { join } from "path";
import type { FullDatabaseOptions } from "./database-options";
import { DatabaseItemImpl } from "./database-item-impl";
import { showNeverAskAgainDialog } from "../../common/vscode/dialog";
import {
showBinaryChoiceDialog,
showNeverAskAgainDialog,
} from "../../common/vscode/dialog";
import {
getFirstWorkspaceFolder,
isFolderAlreadyInWorkspace,
@@ -32,7 +35,7 @@ import { QlPackGenerator } from "../../local-queries/qlpack-generator";
import { asError, getErrorMessage } from "../../common/helpers-pure";
import type { DatabaseItem, PersistedDatabaseItem } from "./database-item";
import { redactableError } from "../../common/errors";
import { remove } from "fs-extra";
import { copy, remove, stat } from "fs-extra";
import { containsPath } from "../../common/files";
import type { DatabaseChangedEvent } from "./database-events";
import { DatabaseEventKind } from "./database-events";
@@ -40,6 +43,7 @@ import { DatabaseResolver } from "./database-resolver";
import { telemetryListener } from "../../common/vscode/telemetry";
import type { LanguageContextStore } from "../../language-context-store";
import type { DatabaseOrigin } from "./database-origin";
import { ensureZippedSourceLocation } from "./database-contents";
/**
* The name of the key in the workspaceState dictionary in which we
@@ -82,6 +86,10 @@ function eventFired<T>(
}
type OpenDatabaseOptions = {
/**
* A location that is managed by the extension.
*/
extensionManagedLocation?: string;
isTutorialDatabase?: boolean;
/**
* Whether to add a workspace folder containing the source archive to the workspace. Default is true.
@@ -116,6 +124,7 @@ export class DatabaseManager extends DisposableObject {
super();
qs.onStart(this.reregisterDatabases.bind(this));
qs.onQueryRunStarting(this.maybeReimportTestDatabase.bind(this));
this.push(
this.languageContext.onLanguageContextChanged(async () => {
@@ -141,6 +150,7 @@ export class DatabaseManager extends DisposableObject {
makeSelected = true,
displayName?: string,
{
extensionManagedLocation,
isTutorialDatabase = false,
addSourceArchiveFolder = addDatabaseSourceToWorkspace(),
}: OpenDatabaseOptions = {},
@@ -149,6 +159,7 @@ export class DatabaseManager extends DisposableObject {
uri,
origin,
displayName,
extensionManagedLocation,
);
return await this.addExistingDatabaseItem(
@@ -159,6 +170,108 @@ export class DatabaseManager extends DisposableObject {
);
}
/**
* Finds a test database that was originally imported from `uri`.
* A test database is creeated by the `codeql test run` command
* and ends with `.testproj`.
* @param uri The original location of the database
* @returns The first database item found that matches the uri
*/
public findTestDatabase(uri: vscode.Uri): DatabaseItem | undefined {
const originPath = uri.fsPath;
for (const item of this._databaseItems) {
if (item.origin?.type === "testproj" && item.origin.path === originPath) {
return item;
}
}
return undefined;
}
public async maybeReimportTestDatabase(
databaseUri: vscode.Uri,
forceImport = false,
): Promise<void> {
const res = await this.isTestDatabaseOutdated(databaseUri);
if (!res) {
return;
}
const doit =
forceImport ||
(await showBinaryChoiceDialog(
"This test database is outdated. Do you want to reimport it?",
));
if (doit) {
await this.reimportTestDatabase(databaseUri);
}
}
/**
* Checks if the origin of the imported database is newer.
* The imported database must be a test database.
* @param databaseUri the URI of the imported database to check
* @returns true if both databases exist and the origin database is newer.
*/
private async isTestDatabaseOutdated(
databaseUri: vscode.Uri,
): Promise<boolean> {
const dbItem = this.findDatabaseItem(databaseUri);
if (dbItem === undefined || dbItem.origin?.type !== "testproj") {
return false;
}
// Compare timestmps of the codeql-database.yml files of the original and the
// imported databases.
const originDbYml = join(dbItem.origin.path, "codeql-database.yml");
const importedDbYml = join(
dbItem.databaseUri.fsPath,
"codeql-database.yml",
);
let originStat;
try {
originStat = await stat(originDbYml);
} catch (e) {
// if there is an error here, assume that the origin database
// is no longer available. Safely ignore and do not try to re-import.
return false;
}
try {
const importedStat = await stat(importedDbYml);
return originStat.mtimeMs > importedStat.mtimeMs;
} catch (e) {
// If either of the files does not exist, we assume the origin is newer.
// This shouldn't happen unless the user manually deleted one of the files.
return true;
}
}
/**
* Reimport the specified imported database from its origin.
* The imported databsae must be a testproj database.
*
* @param databaseUri the URI of the imported database to reimport
*/
private async reimportTestDatabase(databaseUri: vscode.Uri): Promise<void> {
const dbItem = this.findDatabaseItem(databaseUri);
if (dbItem === undefined || dbItem.origin?.type !== "testproj") {
throw new Error(`Database ${databaseUri} is not a testproj.`);
}
await this.removeDatabaseItem(dbItem);
await copy(dbItem.origin.path, databaseUri.fsPath);
await ensureZippedSourceLocation(databaseUri.fsPath);
const newDbItem = new DatabaseItemImpl(databaseUri, dbItem.contents, {
dateAdded: Date.now(),
language: dbItem.language,
origin: dbItem.origin,
extensionManagedLocation: dbItem.extensionManagedLocation,
});
await this.addDatabaseItem(newDbItem);
await this.setCurrentDatabaseItem(newDbItem);
}
/**
* Adds a {@link DatabaseItem} to the list of open databases, if that database is not already on
* the list.
@@ -202,6 +315,7 @@ export class DatabaseManager extends DisposableObject {
uri: vscode.Uri,
origin: DatabaseOrigin | undefined,
displayName: string | undefined,
extensionManagedLocation?: string,
): Promise<DatabaseItemImpl> {
const contents = await DatabaseResolver.resolveDatabaseContents(uri);
const fullOptions: FullDatabaseOptions = {
@@ -210,6 +324,7 @@ export class DatabaseManager extends DisposableObject {
dateAdded: Date.now(),
language: await this.getPrimaryLanguage(uri.fsPath),
origin,
extensionManagedLocation,
};
const databaseItem = new DatabaseItemImpl(uri, contents, fullOptions);
@@ -370,6 +485,7 @@ export class DatabaseManager extends DisposableObject {
let dateAdded = undefined;
let language = undefined;
let origin = undefined;
let extensionManagedLocation = undefined;
if (state.options) {
if (typeof state.options.displayName === "string") {
displayName = state.options.displayName;
@@ -379,6 +495,7 @@ export class DatabaseManager extends DisposableObject {
}
language = state.options.language;
origin = state.options.origin;
extensionManagedLocation = state.options.extensionManagedLocation;
}
const dbBaseUri = vscode.Uri.parse(state.uri, true);
@@ -392,6 +509,7 @@ export class DatabaseManager extends DisposableObject {
dateAdded,
language,
origin,
extensionManagedLocation,
};
const item = new DatabaseItemImpl(dbBaseUri, undefined, fullOptions);
@@ -495,6 +613,7 @@ export class DatabaseManager extends DisposableObject {
this._onDidChangeCurrentDatabaseItem.fire({
item,
kind: DatabaseEventKind.Change,
fullRefresh: false,
});
}
}
@@ -544,8 +663,9 @@ export class DatabaseManager extends DisposableObject {
}
// note that we use undefined as the item in order to reset the entire tree
this._onDidChangeDatabaseItem.fire({
item: undefined,
item,
kind: DatabaseEventKind.Add,
fullRefresh: true,
});
}
@@ -553,9 +673,9 @@ export class DatabaseManager extends DisposableObject {
item.name = newName;
await this.updatePersistedDatabaseList();
this._onDidChangeDatabaseItem.fire({
// pass undefined so that the entire tree is rebuilt in order to re-sort
item: undefined,
item,
kind: DatabaseEventKind.Rename,
fullRefresh: true,
});
}
@@ -583,24 +703,29 @@ export class DatabaseManager extends DisposableObject {
// Remove this database item from the allow-list
await this.deregisterDatabase(item);
// Find whether we know directly which directory we should remove
const directoryToRemove = item.extensionManagedLocation
? vscode.Uri.file(item.extensionManagedLocation)
: item.databaseUri;
// Delete folder from file system only if it is controlled by the extension
if (this.isExtensionControlledLocation(item.databaseUri)) {
if (this.isExtensionControlledLocation(directoryToRemove)) {
void extLogger.log("Deleting database from filesystem.");
await remove(item.databaseUri.fsPath).then(
() => void extLogger.log(`Deleted '${item.databaseUri.fsPath}'`),
await remove(directoryToRemove.fsPath).then(
() => void extLogger.log(`Deleted '${directoryToRemove.fsPath}'`),
(e: unknown) =>
void extLogger.log(
`Failed to delete '${
item.databaseUri.fsPath
directoryToRemove.fsPath
}'. Reason: ${getErrorMessage(e)}`,
),
);
}
// note that we use undefined as the item in order to reset the entire tree
this._onDidChangeDatabaseItem.fire({
item: undefined,
item,
kind: DatabaseEventKind.Remove,
fullRefresh: true,
});
}
@@ -653,6 +778,7 @@ export class DatabaseManager extends DisposableObject {
this._onDidChangeDatabaseItem.fire({
kind: DatabaseEventKind.Refresh,
item: databaseItem,
fullRefresh: false,
});
}
}

View File

@@ -5,10 +5,12 @@ export interface DatabaseOptions {
dateAdded?: number | undefined;
language?: string;
origin?: DatabaseOrigin;
extensionManagedLocation?: string;
}
export interface FullDatabaseOptions extends DatabaseOptions {
dateAdded: number | undefined;
language: string | undefined;
origin: DatabaseOrigin | undefined;
extensionManagedLocation: string | undefined;
}

View File

@@ -24,9 +24,15 @@ interface DatabaseOriginDebugger {
type: "debugger";
}
interface DatabaseOriginTestProj {
type: "testproj";
path: string;
}
export type DatabaseOrigin =
| DatabaseOriginFolder
| DatabaseOriginArchive
| DatabaseOriginGitHub
| DatabaseOriginInternet
| DatabaseOriginDebugger;
| DatabaseOriginDebugger
| DatabaseOriginTestProj;

View File

@@ -18,13 +18,12 @@ import type { DbManager } from "../db-manager";
import { DbTreeDataProvider } from "./db-tree-data-provider";
import type { DbTreeViewItem } from "./db-tree-view-item";
import { getGitHubUrl } from "./db-tree-view-item-action";
import { getControllerRepo } from "../../variant-analysis/run-remote-query";
import { getErrorMessage } from "../../common/helpers-pure";
import type { DatabasePanelCommands } from "../../common/commands";
import type { App } from "../../common/app";
import { QueryLanguage } from "../../common/query-language";
import { getCodeSearchRepositories } from "../code-search-api";
import { showAndLogErrorMessage } from "../../common/logging";
import { getGitHubInstanceUrl } from "../../config";
export interface RemoteDatabaseQuickPickItem extends QuickPickItem {
remoteDatabaseKind: string;
@@ -73,9 +72,6 @@ export class DbPanel extends DisposableObject {
this.addNewRemoteDatabase.bind(this),
"codeQLVariantAnalysisRepositories.addNewList":
this.addNewList.bind(this),
"codeQLVariantAnalysisRepositories.setupControllerRepository":
this.setupControllerRepository.bind(this),
"codeQLVariantAnalysisRepositories.setSelectedItem":
this.setSelectedItem.bind(this),
"codeQLVariantAnalysisRepositories.setSelectedItemContextMenu":
@@ -146,16 +142,19 @@ export class DbPanel extends DisposableObject {
}
private async addNewRemoteRepo(parentList?: string): Promise<void> {
const instanceUrl = getGitHubInstanceUrl();
const repoName = await window.showInputBox({
title: "Add a repository",
prompt: "Insert a GitHub repository URL or name with owner",
placeHolder: "<owner>/<repo> or https://github.com/<owner>/<repo>",
placeHolder: `<owner>/<repo> or ${new URL("/", instanceUrl).toString()}<owner>/<repo>`,
});
if (!repoName) {
return;
}
const nwo = getNwoFromGitHubUrl(repoName) || repoName;
const nwo =
getNwoFromGitHubUrl(repoName, getGitHubInstanceUrl()) || repoName;
if (!isValidGitHubNwo(nwo)) {
void showAndLogErrorMessage(
this.app.logger,
@@ -176,17 +175,20 @@ export class DbPanel extends DisposableObject {
}
private async addNewRemoteOwner(): Promise<void> {
const instanceUrl = getGitHubInstanceUrl();
const ownerName = await window.showInputBox({
title: "Add all repositories of a GitHub org or owner",
prompt: "Insert a GitHub organization or owner name",
placeHolder: "<owner> or https://github.com/<owner>",
placeHolder: `<owner> or ${new URL("/", instanceUrl).toString()}<owner>`,
});
if (!ownerName) {
return;
}
const owner = getOwnerFromGitHubUrl(ownerName) || ownerName;
const owner =
getOwnerFromGitHubUrl(ownerName, getGitHubInstanceUrl()) || ownerName;
if (!isValidGitHubOwner(owner)) {
void showAndLogErrorMessage(
this.app.logger,
@@ -411,7 +413,7 @@ export class DbPanel extends DisposableObject {
if (treeViewItem.dbItem === undefined) {
throw new Error("Unable to open on GitHub. Please select a valid item.");
}
const githubUrl = getGitHubUrl(treeViewItem.dbItem);
const githubUrl = getGitHubUrl(treeViewItem.dbItem, getGitHubInstanceUrl());
if (!githubUrl) {
throw new Error(
"Unable to open on GitHub. Please select a variant analysis repository or owner.",
@@ -420,22 +422,4 @@ export class DbPanel extends DisposableObject {
await this.app.commands.execute("vscode.open", Uri.parse(githubUrl));
}
private async setupControllerRepository(): Promise<void> {
try {
// This will also validate that the controller repository is valid
await getControllerRepo(this.app.credentials);
} catch (e: unknown) {
if (e instanceof UserCancellationException) {
return;
}
void showAndLogErrorMessage(
this.app.logger,
`An error occurred while setting up the controller repository: ${getErrorMessage(
e,
)}`,
);
}
}
}

View File

@@ -83,11 +83,6 @@ export class DbTreeDataProvider
}
private createTree(): DbTreeViewItem[] {
// Returning an empty tree here will show the welcome view
if (!this.variantAnalysisConfig.controllerRepo) {
return [];
}
const dbItemsResult = this.dbManager.getDbItems();
if (dbItemsResult.isFailure) {

View File

@@ -62,12 +62,15 @@ function canImportCodeSearch(dbItem: DbItem): boolean {
return DbItemKind.RemoteUserDefinedList === dbItem.kind;
}
export function getGitHubUrl(dbItem: DbItem): string | undefined {
export function getGitHubUrl(
dbItem: DbItem,
githubUrl: URL,
): string | undefined {
switch (dbItem.kind) {
case DbItemKind.RemoteOwner:
return `https://github.com/${dbItem.ownerName}`;
return new URL(`/${dbItem.ownerName}`, githubUrl).toString();
case DbItemKind.RemoteRepo:
return `https://github.com/${dbItem.repoFullName}`;
return new URL(`/${dbItem.repoFullName}`, githubUrl).toString();
default:
return undefined;
}

View File

@@ -135,7 +135,7 @@ class QLDebugAdapterTracker
): Promise<void> {
if (this.localQueryRun !== undefined) {
const results: CoreQueryResults = body;
await this.localQueryRun.complete(results);
await this.localQueryRun.complete(results, (_) => {});
this.localQueryRun = undefined;
}
}

View File

@@ -31,6 +31,7 @@ import {
joinOrderWarningThreshold,
QueryHistoryConfigListener,
QueryServerConfigListener,
VariantAnalysisConfigListener,
} from "./config";
import {
AstViewer,
@@ -109,7 +110,7 @@ import { VariantAnalysisManager } from "./variant-analysis/variant-analysis-mana
import { createVariantAnalysisContentProvider } from "./variant-analysis/variant-analysis-content-provider";
import { VSCodeMockGitHubApiServer } from "./common/mock-gh-api/vscode/vscode-mock-gh-api-server";
import { VariantAnalysisResultsManager } from "./variant-analysis/variant-analysis-results-manager";
import { ExtensionApp } from "./common/vscode/vscode-app";
import { ExtensionApp } from "./common/vscode/extension-app";
import { DbModule } from "./databases/db-module";
import { redactableError } from "./common/errors";
import { QLDebugAdapterDescriptorFactory } from "./debugger/debugger-factory";
@@ -133,6 +134,7 @@ import { OpenReferencedFileCodeLensProvider } from "./local-queries/open-referen
import { LanguageContextStore } from "./language-context-store";
import { LanguageSelectionPanel } from "./language-selection-panel/language-selection-panel";
import { GitHubDatabasesModule } from "./databases/github-databases";
import { DatabaseFetcher } from "./databases/database-fetcher";
/**
* extension.ts
@@ -183,11 +185,11 @@ function getCommands(
const restartQueryServer = async () =>
withProgress(
async (progress: ProgressCallback, token: CancellationToken) => {
async (progress: ProgressCallback) => {
// Restart all of the spawned servers: cli, query, and language.
cliServer.restartCliServer();
await Promise.all([
queryRunner.restartQueryServer(progress, token),
queryRunner.restartQueryServer(progress),
async () => {
if (languageClient.isRunning()) {
await languageClient.restart();
@@ -445,8 +447,9 @@ export async function activate(
}
if (
CliVersionConstraint.OLDEST_SUPPORTED_CLI_VERSION.compare(ver.version) <
0
CliVersionConstraint.OLDEST_SUPPORTED_CLI_VERSION.compare(
ver.version,
) <= 0
) {
return;
}
@@ -714,12 +717,13 @@ async function installOrUpdateThenTryActivate(
return undefined;
}
const PACK_GLOBS = [
const CLEAR_PACK_CACHE_ON_EDIT_GLOBS = [
"**/codeql-pack.yml",
"**/qlpack.yml",
"**/queries.xml",
"**/codeql-pack.lock.yml",
"**/qlpack.lock.yml",
"**/*.dbscheme",
".codeqlmanifest.json",
"codeql-workspace.yml",
];
@@ -766,7 +770,7 @@ async function activateWithInstalledDistribution(
ctx,
);
for (const glob of PACK_GLOBS) {
for (const glob of CLEAR_PACK_CACHE_ON_EDIT_GLOBS) {
const fsWatcher = workspace.createFileSystemWatcher(glob);
ctx.subscriptions.push(fsWatcher);
@@ -799,12 +803,20 @@ async function activateWithInstalledDistribution(
// Let this run async.
void dbm.loadPersistedState();
const databaseFetcher = new DatabaseFetcher(
app,
dbm,
getContextStoragePath(ctx),
cliServer,
);
ctx.subscriptions.push(dbm);
void extLogger.log("Initializing database panel.");
const databaseUI = new DatabaseUI(
app,
dbm,
databaseFetcher,
languageContext,
qs,
getContextStoragePath(ctx),
@@ -855,8 +867,10 @@ async function activateWithInstalledDistribution(
"variant-analyses",
);
await ensureDir(variantAnalysisStorageDir);
const variantAnalysisConfig = new VariantAnalysisConfigListener();
const variantAnalysisResultsManager = new VariantAnalysisResultsManager(
cliServer,
variantAnalysisConfig,
extLogger,
);
@@ -866,6 +880,7 @@ async function activateWithInstalledDistribution(
variantAnalysisStorageDir,
variantAnalysisResultsManager,
dbModule.dbManager,
variantAnalysisConfig,
);
ctx.subscriptions.push(variantAnalysisManager);
ctx.subscriptions.push(variantAnalysisResultsManager);
@@ -881,8 +896,7 @@ async function activateWithInstalledDistribution(
await GitHubDatabasesModule.initialize(
app,
dbm,
getContextStoragePath(ctx),
cliServer,
databaseFetcher,
githubDatabaseConfigListener,
);
@@ -934,7 +948,7 @@ async function activateWithInstalledDistribution(
ctx.subscriptions.push(compareView);
void extLogger.log("Initializing source archive filesystem provider.");
archiveFilesystemProvider_activate(ctx);
archiveFilesystemProvider_activate(ctx, dbm);
const qhelpTmpDir = dirSync({
prefix: "qhelp_",
@@ -953,6 +967,7 @@ async function activateWithInstalledDistribution(
qs,
qhm,
dbm,
databaseFetcher,
cliServer,
databaseUI,
localQueryResultsView,
@@ -977,6 +992,7 @@ async function activateWithInstalledDistribution(
const modelEditorModule = await ModelEditorModule.initialize(
app,
dbm,
databaseFetcher,
variantAnalysisManager,
cliServer,
qs,
@@ -1068,14 +1084,12 @@ async function activateWithInstalledDistribution(
});
// Handle visibility changes in the CodeQL language client.
if (await cliServer.cliConstraints.supportsVisibilityNotifications()) {
Window.onDidChangeVisibleTextEditors((editors) => {
languageClient.notifyVisibilityChange(editors);
});
// Send an inital notification to the language server
// to set the initial state of the visible editors.
languageClient.notifyVisibilityChange(Window.visibleTextEditors);
}
Window.onDidChangeVisibleTextEditors((editors) => {
languageClient.notifyVisibilityChange(editors);
});
// Send an inital notification to the language server
// to set the initial state of the visible editors.
languageClient.notifyVisibilityChange(Window.visibleTextEditors);
// Jump-to-definition and find-references
void extLogger.log("Registering jump-to-definition handlers.");

View File

@@ -92,11 +92,12 @@ export async function runContextualQuery(
void extLogger.log(
`Running contextual query ${query}; results will be stored in ${queryRun.outputDir.querySaveDir}`,
);
const results = await queryRun.evaluate(
progress,
token,
new TeeLogger(qs.logger, queryRun.outputDir.logPath),
);
await cleanup?.();
return results;
const teeLogger = new TeeLogger(qs.logger, queryRun.outputDir.logPath);
try {
return await queryRun.evaluate(progress, token, teeLogger);
} finally {
await cleanup?.();
teeLogger.dispose();
}
}

View File

@@ -2,7 +2,10 @@ import type {
ProgressCallback,
ProgressUpdate,
} from "../common/vscode/progress";
import { withProgress } from "../common/vscode/progress";
import {
UserCancellationException,
withProgress,
} from "../common/vscode/progress";
import type { CancellationToken, Range, TabInputText } from "vscode";
import { CancellationTokenSource, Uri, window } from "vscode";
import {
@@ -10,7 +13,7 @@ import {
showAndLogErrorMessage,
showAndLogWarningMessage,
} from "../common/logging";
import { isCanary, MAX_QUERIES } from "../config";
import { MAX_QUERIES } from "../config";
import { gatherQlFiles } from "../common/files";
import { basename } from "path";
import { showBinaryChoiceDialog } from "../common/vscode/dialog";
@@ -50,7 +53,8 @@ import { findLanguage } from "../codeql-cli/query-language";
import type { QueryTreeViewItem } from "../queries-panel/query-tree-view-item";
import { tryGetQueryLanguage } from "../common/query-language";
import type { LanguageContextStore } from "../language-context-store";
import type { ExtensionApp } from "../common/vscode/vscode-app";
import type { ExtensionApp } from "../common/vscode/extension-app";
import type { DatabaseFetcher } from "../databases/database-fetcher";
export enum QuickEvalType {
None,
@@ -66,6 +70,7 @@ export class LocalQueries extends DisposableObject {
private readonly queryRunner: QueryRunner,
private readonly queryHistoryManager: QueryHistoryManager,
private readonly databaseManager: DatabaseManager,
private readonly databaseFetcher: DatabaseFetcher,
private readonly cliServer: CodeQLCliServer,
private readonly databaseUI: DatabaseUI,
private readonly localQueryResultsView: ResultsView,
@@ -290,14 +295,8 @@ export class LocalQueries extends DisposableObject {
private async quickQuery(): Promise<void> {
await withProgress(
async (progress, token) =>
displayQuickQuery(
this.app,
this.cliServer,
this.databaseUI,
progress,
token,
),
async (progress) =>
displayQuickQuery(this.app, this.cliServer, this.databaseUI, progress),
{
title: "Run Quick Query",
},
@@ -322,17 +321,13 @@ export class LocalQueries extends DisposableObject {
private async createSkeletonQuery(): Promise<void> {
await withProgress(
async (progress: ProgressCallback) => {
const credentials = isCanary() ? this.app.credentials : undefined;
const contextStoragePath =
this.app.workspaceStoragePath || this.app.globalStoragePath;
const language = this.languageContextStore.selectedLanguage;
const skeletonQueryWizard = new SkeletonQueryWizard(
this.cliServer,
progress,
credentials,
this.app,
this.databaseManager,
contextStoragePath,
this.databaseFetcher,
this.selectedQueryTreeViewItems,
language,
);
@@ -447,7 +442,7 @@ export class LocalQueries extends DisposableObject {
// If no databaseItem is specified, use the database currently selected in the Databases UI
databaseItem =
databaseItem ?? (await this.databaseUI.getDatabaseItem(progress, token));
databaseItem ?? (await this.databaseUI.getDatabaseItem(progress));
if (databaseItem === undefined) {
throw new Error("Can't run query without a selected database");
}
@@ -490,7 +485,7 @@ export class LocalQueries extends DisposableObject {
localQueryRun.logger,
);
await localQueryRun.complete(results);
await localQueryRun.complete(results, progress);
return results;
} catch (e) {
@@ -500,7 +495,12 @@ export class LocalQueries extends DisposableObject {
// to unify both error handling paths.
const err = asError(e);
await localQueryRun.fail(err);
throw e;
if (token.isCancellationRequested) {
throw new UserCancellationException(err.message, true);
} else {
throw e;
}
}
} finally {
source.dispose();

View File

@@ -25,6 +25,9 @@ import { redactableError } from "../common/errors";
import type { LocalQueries } from "./local-queries";
import { tryGetQueryMetadata } from "../codeql-cli/query-metadata";
import { telemetryListener } from "../common/vscode/telemetry";
import type { Disposable } from "../common/disposable-object";
import type { ProgressCallback } from "../common/vscode/progress";
import { progressUpdate } from "../common/vscode/progress";
function formatResultMessage(result: CoreQueryResults): string {
switch (result.resultType) {
@@ -61,7 +64,11 @@ export class LocalQueryRun {
private readonly localQueries: LocalQueries,
private readonly queryInfo: LocalQueryInfo,
private readonly dbItem: DatabaseItem,
public readonly logger: Logger, // Public so that other clients, like the debug adapter, know where to send log output
/**
* The logger is only available while the query is running and will be disposed of when the
* query completes.
*/
public readonly logger: Logger & Disposable, // Public so that other clients, like the debug adapter, know where to send log output
private readonly queryHistoryManager: QueryHistoryManager,
private readonly cliServer: CodeQLCliServer,
) {}
@@ -74,24 +81,34 @@ export class LocalQueryRun {
* This function must be called when the evaluation completes, whether the evaluation was
* successful or not.
* */
public async complete(results: CoreQueryResults): Promise<void> {
public async complete(
results: CoreQueryResults,
progress: ProgressCallback,
): Promise<void> {
const evalLogPaths = await this.summarizeEvalLog(
results.resultType,
this.outputDir,
this.logger,
progress,
);
if (evalLogPaths !== undefined) {
this.queryInfo.setEvaluatorLogPaths(evalLogPaths);
}
progress(progressUpdate(1, 4, "Getting completed query info"));
const queryWithResults = await this.getCompletedQueryInfo(results);
progress(progressUpdate(2, 4, "Updating query history"));
this.queryHistoryManager.completeQuery(this.queryInfo, queryWithResults);
progress(progressUpdate(3, 4, "Showing results"));
await this.localQueries.showResultsForCompletedQuery(
this.queryInfo as CompletedLocalQueryInfo,
WebviewReveal.Forced,
);
// Note we must update the query history view after showing results as the
// display and sorting might depend on the number of results
progress(progressUpdate(4, 4, "Updating query history"));
await this.queryHistoryManager.refreshTreeView();
this.logger.dispose();
}
/**
@@ -102,6 +119,7 @@ export class LocalQueryRun {
QueryResultType.OTHER_ERROR,
this.outputDir,
this.logger,
(_) => {},
);
if (evalLogPaths !== undefined) {
this.queryInfo.setEvaluatorLogPaths(evalLogPaths);
@@ -110,6 +128,8 @@ export class LocalQueryRun {
err.message = `Error running query: ${err.message}`;
this.queryInfo.failureReason = err.message;
await this.queryHistoryManager.refreshTreeView();
this.logger.dispose();
}
/**
@@ -119,10 +139,12 @@ export class LocalQueryRun {
resultType: QueryResultType,
outputDir: QueryOutputDir,
logger: BaseLogger,
progress: ProgressCallback,
): Promise<EvaluatorLogPaths | undefined> {
const evalLogPaths = await generateEvalLogSummaries(
this.cliServer,
outputDir,
progress,
);
if (evalLogPaths !== undefined) {
if (evalLogPaths.endSummary !== undefined) {

View File

@@ -1,7 +1,6 @@
import { ensureDir, writeFile, pathExists, readFile } from "fs-extra";
import { dump, load } from "js-yaml";
import { basename, join } from "path";
import type { CancellationToken } from "vscode";
import { window as Window, workspace, Uri } from "vscode";
import { LSPErrorCodes, ResponseError } from "vscode-languageclient";
import type { CodeQLCliServer } from "../codeql-cli/cli";
@@ -13,7 +12,7 @@ import { UserCancellationException } from "../common/vscode/progress";
import { getErrorMessage } from "../common/helpers-pure";
import { FALLBACK_QLPACK_FILENAME, getQlPackFilePath } from "../common/ql";
import type { App } from "../common/app";
import type { ExtensionApp } from "../common/vscode/vscode-app";
import type { ExtensionApp } from "../common/vscode/extension-app";
import type { QlPackFile } from "../packaging/qlpack-file";
const QUICK_QUERIES_DIR_NAME = "quick-queries";
@@ -56,7 +55,6 @@ export async function displayQuickQuery(
cliServer: CodeQLCliServer,
databaseUI: DatabaseUI,
progress: ProgressCallback,
token: CancellationToken,
) {
try {
// If there is already a quick query open, don't clobber it, just
@@ -111,7 +109,7 @@ export async function displayQuickQuery(
}
// We're going to infer which qlpack to use from the current database
const dbItem = await databaseUI.getDatabaseItem(progress, token);
const dbItem = await databaseUI.getDatabaseItem(progress);
if (dbItem === undefined) {
throw new Error("Can't start quick query without a selected database");
}

View File

@@ -47,21 +47,27 @@ export async function runQuery({
undefined,
);
const completedQuery = await queryRun.evaluate(
progress,
token,
new TeeLogger(queryRunner.logger, queryRun.outputDir.logPath),
const teeLogger = new TeeLogger(
queryRunner.logger,
queryRun.outputDir.logPath,
);
if (completedQuery.resultType !== QueryResultType.SUCCESS) {
void showAndLogExceptionWithTelemetry(
extLogger,
telemetryListener,
redactableError`Failed to run ${basename(queryPath)} query: ${
completedQuery.message ?? "No message"
}`,
);
return;
try {
const completedQuery = await queryRun.evaluate(progress, token, teeLogger);
if (completedQuery.resultType !== QueryResultType.SUCCESS) {
void showAndLogExceptionWithTelemetry(
extLogger,
telemetryListener,
redactableError`Failed to run ${basename(queryPath)} query: ${
completedQuery.message ?? "No message"
}`,
);
return;
}
return completedQuery;
} finally {
teeLogger.dispose();
}
return completedQuery;
}

View File

@@ -2,7 +2,6 @@ import { dirname, join } from "path";
import { Uri, window, window as Window, workspace } from "vscode";
import type { CodeQLCliServer } from "../codeql-cli/cli";
import { showAndLogExceptionWithTelemetry } from "../common/logging";
import type { Credentials } from "../common/authentication";
import type { QueryLanguage } from "../common/query-language";
import { getLanguageDisplayName } from "../common/query-language";
import {
@@ -20,10 +19,7 @@ import {
UserCancellationException,
withProgress,
} from "../common/vscode/progress";
import {
askForGitHubRepo,
downloadGitHubDatabase,
} from "../databases/database-fetcher";
import type { DatabaseFetcher } from "../databases/database-fetcher";
import {
getQlPackLocation,
isCodespacesTemplate,
@@ -61,10 +57,9 @@ export class SkeletonQueryWizard {
constructor(
private readonly cliServer: CodeQLCliServer,
private readonly progress: ProgressCallback,
private readonly credentials: Credentials | undefined,
private readonly app: App,
private readonly databaseManager: DatabaseManager,
private readonly databaseStoragePath: string | undefined,
private readonly databaseFetcher: DatabaseFetcher,
private readonly selectedItems: readonly QueryTreeViewItem[],
private language: QueryLanguage | undefined = undefined,
) {}
@@ -365,10 +360,6 @@ export class SkeletonQueryWizard {
}
private async downloadDatabase(progress: ProgressCallback) {
if (this.databaseStoragePath === undefined) {
throw new Error("Database storage path is undefined");
}
if (this.language === undefined) {
throw new Error("Language is undefined");
}
@@ -380,20 +371,10 @@ export class SkeletonQueryWizard {
});
const githubRepoNwo = QUERY_LANGUAGE_TO_DATABASE_REPO[this.language];
const chosenRepo = await askForGitHubRepo(undefined, githubRepoNwo);
if (!chosenRepo) {
throw new UserCancellationException("No GitHub repository provided");
}
await downloadGitHubDatabase(
chosenRepo,
this.databaseManager,
this.databaseStoragePath,
this.credentials,
await this.databaseFetcher.promptImportGithubDatabase(
progress,
this.cliServer,
this.language,
githubRepoNwo,
);
}

View File

@@ -67,6 +67,9 @@
"$ref": "#/definitions/SuiteInstruction"
}
},
{
"$ref": "#/definitions/SuiteInstruction"
},
{
"type": "null"
}
@@ -93,24 +96,41 @@
"include": {
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"type": "string"
}
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "string"
}
]
}
},
"exclude": {
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"type": "string"
}
"anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "string"
}
]
}
},
"description": {
"type": "string"
},
"import": {
"type": "string"
},
"from": {
"type": "string"
}

View File

@@ -1,3 +1,5 @@
import { createFilenameFromString } from "../common/filenames";
const packNamePartRegex = /[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/;
const packNameRegex = new RegExp(
`^(?<scope>${packNamePartRegex.source})/(?<name>${packNamePartRegex.source})$`,
@@ -13,17 +15,29 @@ export function formatPackName(packName: ExtensionPackName): string {
return `${packName.scope}/${packName.name}`;
}
export function autoNameExtensionPack(
name: string,
language: string,
): ExtensionPackName | undefined {
let packName = `${name}-${language}`;
export function sanitizePackName(userPackName: string): ExtensionPackName {
let packName = userPackName;
packName = packName.trim();
while (packName.startsWith("/")) {
packName = packName.slice(1);
}
while (packName.endsWith("/")) {
packName = packName.slice(0, -1);
}
if (!packName.includes("/")) {
packName = `pack/${packName}`;
}
const parts = packName.split("/");
const sanitizedParts = parts.map((part) => sanitizeExtensionPackName(part));
const sanitizedParts = parts.map((part) =>
createFilenameFromString(part, {
removeDots: true,
}),
);
// If the scope is empty (e.g. if the given name is "-/b"), then we need to still set a scope
if (sanitizedParts[0].length === 0) {
@@ -37,25 +51,6 @@ export function autoNameExtensionPack(
};
}
function sanitizeExtensionPackName(name: string) {
// Lowercase everything
name = name.toLowerCase();
// Replace all spaces, dots, and underscores with hyphens
name = name.replaceAll(/[\s._]+/g, "-");
// Replace all characters which are not allowed by empty strings
name = name.replaceAll(/[^a-z0-9-]/g, "");
// Remove any leading or trailing hyphens
name = name.replaceAll(/^-|-$/g, "");
// Remove any duplicate hyphens
name = name.replaceAll(/-{2,}/g, "-");
return name;
}
export function parsePackName(packName: string): ExtensionPackName | undefined {
const matches = packNameRegex.exec(packName);
if (!matches?.groups) {

View File

@@ -2,7 +2,6 @@ import { join } from "path";
import { outputFile, pathExists, readFile } from "fs-extra";
import { dump as dumpYaml, load as loadYaml } from "js-yaml";
import type { CancellationToken } from "vscode";
import { Uri } from "vscode";
import Ajv from "ajv";
import type { CodeQLCliServer } from "../codeql-cli/cli";
import { getOnDiskWorkspaceFolders } from "../common/vscode/workspace-folders";
@@ -14,10 +13,17 @@ import { getErrorMessage } from "../common/helpers-pure";
import type { ExtensionPack } from "./shared/extension-pack";
import type { NotificationLogger } from "../common/logging";
import { showAndLogErrorMessage } from "../common/logging";
import type { ModelConfig } from "../config";
import type { ModelConfig, ModelConfigPackVariables } from "../config";
import type { ExtensionPackName } from "./extension-pack-name";
import { autoNameExtensionPack, formatPackName } from "./extension-pack-name";
import { autoPickExtensionsDirectory } from "./extensions-workspace-folder";
import {
validatePackName,
sanitizePackName,
formatPackName,
} from "./extension-pack-name";
import {
ensurePackLocationIsInWorkspaceFolder,
packLocationToAbsolute,
} from "./extensions-workspace-folder";
import type { ExtensionPackMetadata } from "./extension-pack-metadata";
import extensionPackMetadataSchemaJson from "./extension-pack-metadata.schema.json";
@@ -27,7 +33,7 @@ const extensionPackValidate = ajv.compile(extensionPackMetadataSchemaJson);
export async function pickExtensionPack(
cliServer: Pick<CodeQLCliServer, "resolveQlpacks">,
databaseItem: Pick<DatabaseItem, "name" | "language">,
databaseItem: Pick<DatabaseItem, "name" | "language" | "origin">,
modelConfig: ModelConfig,
logger: NotificationLogger,
progress: ProgressCallback,
@@ -64,29 +70,34 @@ export async function pickExtensionPack(
maxStep,
});
// Get the `codeQL.model.extensionsDirectory` setting for the language
const userExtensionsDirectory = modelConfig.getExtensionsDirectory(
databaseItem.language,
// The default is .github/codeql/extensions/${name}-${language}
const packPath = await packLocationToAbsolute(
modelConfig.getPackLocation(
databaseItem.language,
getModelConfigPackVariables(databaseItem),
),
logger,
);
// If the setting is not set, automatically pick a suitable directory
const extensionsDirectory = userExtensionsDirectory
? Uri.file(userExtensionsDirectory)
: await autoPickExtensionsDirectory(logger);
if (!extensionsDirectory) {
if (!packPath) {
return undefined;
}
// Generate the name of the extension pack
const packName = autoNameExtensionPack(
databaseItem.name,
await ensurePackLocationIsInWorkspaceFolder(packPath, modelConfig, logger);
const userPackName = modelConfig.getPackName(
databaseItem.language,
getModelConfigPackVariables(databaseItem),
);
if (!packName) {
// Generate the name of the extension pack
const packName = sanitizePackName(userPackName);
// Validate that the name isn't too long etc.
const packNameError = validatePackName(formatPackName(packName));
if (packNameError) {
void showAndLogErrorMessage(
logger,
`Could not automatically name extension pack for database ${databaseItem.name}`,
`Invalid model pack name '${formatPackName(packName)}' for database ${databaseItem.name}: ${packNameError}`,
);
return undefined;
@@ -139,14 +150,12 @@ export async function pickExtensionPack(
return undefined;
}
const packPath = join(extensionsDirectory.fsPath, packName.name);
if (await pathExists(packPath)) {
void showAndLogErrorMessage(
logger,
`Directory ${packPath} already exists for extension pack ${formatPackName(
packName,
)}`,
)}, but wasn't returned by codeql resolve qlpacks --kind extension --no-recursive`,
);
return undefined;
@@ -155,6 +164,26 @@ export async function pickExtensionPack(
return writeExtensionPack(packPath, packName, databaseItem.language);
}
function getModelConfigPackVariables(
databaseItem: Pick<DatabaseItem, "name" | "language" | "origin">,
): ModelConfigPackVariables {
const database = databaseItem.name;
const language = databaseItem.language;
let name = databaseItem.name;
let owner = "";
if (databaseItem.origin?.type === "github") {
[owner, name] = databaseItem.origin.repository.split("/");
}
return {
database,
language,
name,
owner,
};
}
async function writeExtensionPack(
packPath: string,
packName: ExtensionPackName,

View File

@@ -1,9 +1,12 @@
import type { WorkspaceFolder } from "vscode";
import { FileType, Uri, workspace } from "vscode";
import { getOnDiskWorkspaceFoldersObjects } from "../common/vscode/workspace-folders";
import { tmpdir } from "../common/files";
import { containsPath, tmpdir } from "../common/files";
import type { NotificationLogger } from "../common/logging";
import { showAndLogErrorMessage } from "../common/logging";
import { isAbsolute, normalize, resolve } from "path";
import { nanoid } from "nanoid";
import type { ModelConfig } from "../config";
/**
* Returns the ancestors of this path in order from furthest to closest (i.e. root of filesystem to parent directory)
@@ -22,26 +25,17 @@ function getAncestors(uri: Uri): Uri[] {
return ancestors;
}
async function getRootWorkspaceDirectory(): Promise<Uri | undefined> {
// If there is a valid workspace file, just use its directory as the directory for the extensions
const workspaceFile = workspace.workspaceFile;
if (workspaceFile?.scheme === "file") {
return Uri.joinPath(workspaceFile, "..");
function findCommonAncestor(uris: Uri[]): Uri | undefined {
if (uris.length === 0) {
return undefined;
}
const allWorkspaceFolders = getOnDiskWorkspaceFoldersObjects();
// Get the system temp directory and convert it to a URI so it's normalized
const systemTmpdir = Uri.file(tmpdir());
const workspaceFolders = allWorkspaceFolders.filter((folder) => {
// Never use a workspace folder that is in the system temp directory
return !folder.uri.fsPath.startsWith(systemTmpdir.fsPath);
});
if (uris.length === 1) {
return uris[0];
}
// Find the common root directory of all workspace folders by finding the longest common prefix
const commonRoot = workspaceFolders.reduce((commonRoot, folder) => {
const folderUri = folder.uri;
const commonRoot = uris.reduce((commonRoot, folderUri) => {
const ancestors = getAncestors(folderUri);
const minLength = Math.min(commonRoot.length, ancestors.length);
@@ -55,10 +49,10 @@ async function getRootWorkspaceDirectory(): Promise<Uri | undefined> {
}
return commonRoot.slice(0, commonLength);
}, getAncestors(workspaceFolders[0].uri));
}, getAncestors(uris[0]));
if (commonRoot.length === 0) {
return await findGitFolder(workspaceFolders);
return undefined;
}
// The path closest to the workspace folders is the last element of the common root
@@ -67,6 +61,54 @@ async function getRootWorkspaceDirectory(): Promise<Uri | undefined> {
// If we are at the root of the filesystem, we can't go up any further and there's something
// wrong, so just return undefined
if (commonRootUri.fsPath === Uri.joinPath(commonRootUri, "..").fsPath) {
return undefined;
}
return commonRootUri;
}
/**
* Finds the root directory of this workspace. It is determined
* heuristically based on the on-disk workspace folders.
*
* The heuristic is as follows:
* 1. If there is a workspace file (`<basename>.code-workspace`), use the directory containing that file
* 2. If there is only 1 workspace folder, use that folder
* 3. If there is a common root directory for all workspace folders, use that directory
* - Workspace folders in the system temp directory are ignored
* - If the common root directory is the root of the filesystem, then it's not used
* 4. If there is a .git directory in any workspace folder, use the directory containing that .git directory
* for which the .git directory is closest to a workspace folder
* 5. If none of the above apply, return `undefined`
*/
export async function getRootWorkspaceDirectory(): Promise<Uri | undefined> {
// If there is a valid workspace file, just use its directory as the directory for the extensions
const workspaceFile = workspace.workspaceFile;
if (workspaceFile?.scheme === "file") {
return Uri.joinPath(workspaceFile, "..");
}
const allWorkspaceFolders = getOnDiskWorkspaceFoldersObjects();
if (allWorkspaceFolders.length === 1) {
return allWorkspaceFolders[0].uri;
}
// Get the system temp directory and convert it to a URI so it's normalized
const systemTmpdir = Uri.file(tmpdir());
const workspaceFolders = allWorkspaceFolders.filter((folder) => {
// Never use a workspace folder that is in the system temp directory
return !folder.uri.fsPath.startsWith(systemTmpdir.fsPath);
});
// The path closest to the workspace folders is the last element of the common root
const commonRootUri = findCommonAncestor(
workspaceFolders.map((folder) => folder.uri),
);
// If there is no common root URI, try to find a .git folder in the workspace folders
if (commonRootUri === undefined) {
return await findGitFolder(workspaceFolders);
}
@@ -126,90 +168,130 @@ async function findGitFolder(
return closestFolder?.[1];
}
/**
* Finds a suitable directory for extension packs to be created in. This will
* always be a path ending in `.github/codeql/extensions`. The parent directory
* will be determined heuristically based on the on-disk workspace folders.
*
* The heuristic is as follows (`.github/codeql/extensions` is added automatically unless
* otherwise specified):
* 1. If there is only 1 workspace folder, use that folder
* 2. If there is a workspace folder for which the path ends in `.github/codeql/extensions`, use that folder
* - If there are multiple such folders, use the first one
* - Does not append `.github/codeql/extensions` to the path
* 3. If there is a workspace file (`<basename>.code-workspace`), use the directory containing that file
* 4. If there is a common root directory for all workspace folders, use that directory
* - Workspace folders in the system temp directory are ignored
* - If the common root directory is the root of the filesystem, then it's not used
* 5. If there is a .git directory in any workspace folder, use the directory containing that .git directory
* for which the .git directory is closest to a workspace folder
* 6. If none of the above apply, return `undefined`
*/
export async function autoPickExtensionsDirectory(
export async function packLocationToAbsolute(
packLocation: string,
logger: NotificationLogger,
): Promise<Uri | undefined> {
const workspaceFolders = getOnDiskWorkspaceFoldersObjects();
): Promise<string | undefined> {
let userPackLocation = packLocation.trim();
// If there are no on-disk workspace folders, we can't do anything
if (workspaceFolders.length === 0) {
if (!isAbsolute(userPackLocation)) {
const rootDirectory = await getRootWorkspaceDirectory();
if (!rootDirectory) {
void logger.log("Unable to determine root workspace directory");
return undefined;
}
userPackLocation = resolve(rootDirectory.fsPath, userPackLocation);
}
userPackLocation = normalize(userPackLocation);
if (!isAbsolute(userPackLocation)) {
// This shouldn't happen, but just in case
void showAndLogErrorMessage(
logger,
`Could not find any on-disk workspace folders. Please ensure that you have opened a folder or workspace.`,
`Invalid pack location: ${userPackLocation}`,
);
return undefined;
}
// If there's only 1 workspace folder, use the `.github/codeql/extensions` directory in that folder
if (workspaceFolders.length === 1) {
return Uri.joinPath(
workspaceFolders[0].uri,
".github",
"codeql",
"extensions",
);
}
// Now try to find a workspace folder for which the path ends in `.github/codeql/extensions`
const workspaceFolderForExtensions = workspaceFolders.find((folder) =>
// Using path instead of fsPath because path always uses forward slashes
folder.uri.path.endsWith(".github/codeql/extensions"),
);
if (workspaceFolderForExtensions) {
return workspaceFolderForExtensions.uri;
}
// Get the root workspace directory, i.e. the common root directory of all workspace folders
const rootDirectory = await getRootWorkspaceDirectory();
if (!rootDirectory) {
void logger.log("Unable to determine root workspace directory");
return undefined;
}
// We'll create a new workspace folder for the extensions in the root workspace directory
// at `.github/codeql/extensions`
const extensionsUri = Uri.joinPath(
rootDirectory,
".github",
"codeql",
"extensions",
// If we are at the root of the filesystem, then something is wrong since
// this should never be the location of a pack
if (userPackLocation === resolve(userPackLocation, "..")) {
void showAndLogErrorMessage(
logger,
`Invalid pack location: ${userPackLocation}`,
);
return undefined;
}
return userPackLocation;
}
/**
* This function will try to add the pack location as a workspace folder if it's not already in a
* workspace folder and the workspace is a multi-root workspace.
*/
export async function ensurePackLocationIsInWorkspaceFolder(
packLocation: string,
modelConfig: ModelConfig,
logger: NotificationLogger,
): Promise<void> {
const workspaceFolders = getOnDiskWorkspaceFoldersObjects();
const existsInWorkspaceFolder = workspaceFolders.some((folder) =>
containsPath(folder.uri.fsPath, packLocation),
);
if (existsInWorkspaceFolder) {
// If the pack location is already in a workspace folder, we don't need to do anything
return;
}
if (workspace.workspaceFile === undefined) {
// If we're not in a workspace, we can't add a workspace folder without reloading the window,
// so we'll not do anything
return;
}
// To find the "correct" directory to add as a workspace folder, we'll generate a few different
// pack locations and find the common ancestor of the directories. This is the directory that
// we'll add as a workspace folder.
// Generate a few different pack locations to get an accurate common ancestor
const otherPackLocations = await Promise.all(
Array.from({ length: 3 }).map(() =>
packLocationToAbsolute(
modelConfig.getPackLocation(nanoid(), {
database: nanoid(),
language: nanoid(),
name: nanoid(),
owner: nanoid(),
}),
logger,
),
),
);
const otherPackLocationUris = otherPackLocations
.filter((loc): loc is string => loc !== undefined)
.map((loc) => Uri.file(loc));
if (otherPackLocationUris.length === 0) {
void logger.log(
`Failed to generate different pack locations, not adding workspace folder.`,
);
return;
}
const commonRootUri = findCommonAncestor([
Uri.file(packLocation),
...otherPackLocationUris,
]);
if (commonRootUri === undefined) {
void logger.log(
`Failed to find common ancestor for ${packLocation} and ${otherPackLocationUris[0].fsPath}, not adding workspace folder.`,
);
return;
}
if (
!workspace.updateWorkspaceFolders(
workspace.workspaceFolders?.length ?? 0,
0,
{
name: "CodeQL Extension Packs",
uri: extensionsUri,
uri: commonRootUri,
},
)
) {
void logger.log(
`Failed to add workspace folder for extensions at ${extensionsUri.fsPath}`,
`Failed to add workspace folder for extensions at ${commonRootUri.fsPath}`,
);
return undefined;
return;
}
return extensionsUri;
}

View File

@@ -0,0 +1,21 @@
import type { ModelsAsDataLanguage } from "../models-as-data";
import { staticLanguage } from "../static";
export const csharp: ModelsAsDataLanguage = {
...staticLanguage,
predicates: {
...staticLanguage.predicates,
sink: {
...staticLanguage.predicates.sink,
},
source: {
...staticLanguage.predicates.source,
supportedKinds: [
...staticLanguage.predicates.source.supportedKinds,
// https://github.com/github/codeql/blob/0c5ea975a4c4dc5c439b908c006e440cb9bdf926/shared/mad/codeql/mad/ModelValidation.qll#L122-L123
"file-write",
"windows-registry",
],
},
},
};

View File

@@ -0,0 +1,42 @@
import type { ModelsAsDataLanguage } from "../models-as-data";
import { staticLanguage } from "../static";
export const java: ModelsAsDataLanguage = {
...staticLanguage,
predicates: {
...staticLanguage.predicates,
sink: {
...staticLanguage.predicates.sink,
supportedKinds: [
...staticLanguage.predicates.sink.supportedKinds,
// https://github.com/github/codeql/blob/0c5ea975a4c4dc5c439b908c006e440cb9bdf926/shared/mad/codeql/mad/ModelValidation.qll#L32-L37
"bean-validation",
"fragment-injection",
"groovy-injection",
"hostname-verification",
"information-leak",
"intent-redirection",
"jexl-injection",
"jndi-injection",
"mvel-injection",
"notification",
"ognl-injection",
"pending-intents",
"response-splitting",
"trust-boundary-violation",
"template-injection",
"xpath-injection",
"xslt-injection",
],
},
source: {
...staticLanguage.predicates.source,
supportedKinds: [
...staticLanguage.predicates.source.supportedKinds,
// https://github.com/github/codeql/blob/0c5ea975a4c4dc5c439b908c006e440cb9bdf926/shared/mad/codeql/mad/ModelValidation.qll#L120-L121
"android-external-storage-dir",
"contentprovider",
],
},
},
};

View File

@@ -3,13 +3,14 @@ import type {
ModelsAsDataLanguage,
ModelsAsDataLanguagePredicates,
} from "./models-as-data";
import { csharp } from "./csharp";
import { java } from "./java";
import { python } from "./python";
import { ruby } from "./ruby";
import { staticLanguage } from "./static";
const languages: Partial<Record<QueryLanguage, ModelsAsDataLanguage>> = {
[QueryLanguage.CSharp]: staticLanguage,
[QueryLanguage.Java]: staticLanguage,
[QueryLanguage.CSharp]: csharp,
[QueryLanguage.Java]: java,
[QueryLanguage.Python]: python,
[QueryLanguage.Ruby]: ruby,
};

View File

@@ -20,7 +20,7 @@ import type { AccessPathSuggestionRow } from "../suggestions";
// This is a subset of the model config that doesn't import the vscode module.
// It only includes settings that are actually used.
export type ModelConfig = {
showTypeModels: boolean;
flowGeneration: boolean;
};
/**
@@ -32,12 +32,12 @@ export type ModelConfig = {
*/
export function createModelConfig(modelConfig: ModelConfig): ModelConfig {
return {
showTypeModels: modelConfig.showTypeModels,
flowGeneration: modelConfig.flowGeneration,
};
}
export const defaultModelConfig: ModelConfig = {
showTypeModels: false,
flowGeneration: false,
};
type GenerateMethodDefinition<T> = (method: T) => DataTuple[];
@@ -105,15 +105,34 @@ type ParseResultsToYaml = (
logger: BaseLogger,
) => ModelExtension[];
export enum AutoModelGenerationType {
/**
* Auto model generation is disabled and will not be run.
*/
Disabled = "disabled",
/**
* The models are generated to a separate file (suffixed with .model.generated.yml).
*/
SeparateFile = "separateFile",
/**
* The models are added as a model in the model editor, but are not automatically saved.
* The user can view them and choose to save them.
*/
Models = "models",
}
type ModelsAsDataLanguageAutoModelGeneration = {
queryConstraints: (mode: Mode) => QueryConstraints;
filterQueries?: (queryPath: string) => boolean;
/**
* This function is only used when type is `separateFile`.
*/
parseResultsToYaml: ParseResultsToYaml;
/**
* By default, auto model generation is enabled for all modes. This function can be used to
* override that behavior.
* This function is only used when type is `models`.
*/
enabled?: (context: GenerationContext) => boolean;
parseResults: ParseGenerationResults;
type: (context: GenerationContext) => AutoModelGenerationType;
};
type ModelsAsDataLanguageAccessPathSuggestions = {

View File

@@ -112,7 +112,10 @@ export function pythonPath(
export function pythonEndpointType(
method: Omit<MethodDefinition, "endpointType">,
): EndpointType {
if (method.methodParameters.startsWith("(self,")) {
if (
method.methodParameters.startsWith("(self,") ||
method.methodParameters === "(self)"
) {
return EndpointType.Method;
}
return EndpointType.Function;

View File

@@ -177,28 +177,49 @@ export const python: ModelsAsDataLanguage = {
// Argument and Parameter are equivalent in Python, but we'll use Argument in the model editor
const argumentsList = getArgumentsList(method.methodParameters).map(
(argument, index): MethodArgument => {
if (argument.endsWith(":")) {
if (
method.endpointType === EndpointType.Method &&
argument === "self" &&
index === 0
) {
return {
path: `Argument[${argument}]`,
label: `Argument[${argument}]`,
path: "Argument[self]",
label: "Argument[self]: self",
};
}
// If this is a method, self does not count as an argument index, so we
// should start at 0 for the second argument
if (method.endpointType === EndpointType.Method) {
index -= 1;
}
// Keyword-only arguments end with `:` in the query
if (argument.endsWith(":")) {
return {
path: `Argument[${argument}]`,
label: `Argument[${argument}]: ${argument.substring(0, argument.length - 1)}`,
};
}
// Positional-only arguments end with `/` in the query
if (argument.endsWith("/")) {
return {
path: `Argument[${index}]`,
label: `Argument[${index}]: ${argument.substring(0, argument.length - 1)}`,
};
}
// All other arguments are both keyword and positional
return {
path: `Argument[${index}]`,
label: `Argument[${index}]: ${argument}`,
path: `Argument[${index},${argument}:]`,
label: `Argument[${index},${argument}:]: ${argument}`,
};
},
);
return {
options: [
{
path: "Argument[self]",
label: "Argument[self]",
},
...argumentsList,
],
options: argumentsList,
// If there are no arguments, we will default to "Argument[self]"
defaultArgumentPath:
argumentsList.length > 0 ? argumentsList[0].path : "Argument[self]",

View File

@@ -1,9 +1,6 @@
import type { BaseLogger } from "../../../common/logging";
import type { DecodedBqrs } from "../../../common/bqrs-cli-types";
import type {
GenerationContext,
ModelsAsDataLanguage,
} from "../models-as-data";
import type { ModelsAsDataLanguage } from "../models-as-data";
import type { ModeledMethod } from "../../modeled-method";
import type { DataTuple } from "../../model-extension-file";
@@ -12,21 +9,10 @@ export function parseGenerateModelResults(
bqrs: DecodedBqrs,
modelsAsDataLanguage: ModelsAsDataLanguage,
logger: BaseLogger,
{ config }: GenerationContext,
): ModeledMethod[] {
const modeledMethods: ModeledMethod[] = [];
for (const resultSetName in bqrs) {
if (
resultSetName ===
modelsAsDataLanguage.predicates.type?.extensiblePredicate &&
!config.showTypeModels
) {
// Don't load generated type results when type models are hidden. These are already
// automatically generated on start-up.
continue;
}
const definition = Object.values(modelsAsDataLanguage.predicates).find(
(definition) => definition.extensiblePredicate === resultSetName,
);

View File

@@ -1,4 +1,5 @@
import type { ModelsAsDataLanguage } from "../models-as-data";
import { AutoModelGenerationType } from "../models-as-data";
import { sharedExtensiblePredicates, sharedKinds } from "../shared";
import { Mode } from "../../shared/mode";
import { parseGenerateModelResults } from "./generate";
@@ -169,7 +170,6 @@ export const ruby: ModelsAsDataLanguage = {
methodParameters: "",
};
},
isHidden: ({ config }) => !config.showTypeModels,
},
},
modelGeneration: {
@@ -209,9 +209,32 @@ export const ruby: ModelsAsDataLanguage = {
},
];
},
parseResults: (queryPath, bqrs, modelsAsDataLanguage, logger) => {
// Only parse type models when automatically generating models
const typePredicate = modelsAsDataLanguage.predicates.type;
if (!typePredicate) {
throw new Error("Type predicate not found");
}
const typeTuples = bqrs[typePredicate.extensiblePredicate];
if (!typeTuples) {
return [];
}
return parseGenerateModelResults(
queryPath,
{
[typePredicate.extensiblePredicate]: typeTuples,
},
modelsAsDataLanguage,
logger,
);
},
// Only enabled for framework mode when type models are hidden
enabled: ({ mode, config }) =>
mode === Mode.Framework && !config.showTypeModels,
type: ({ mode }) =>
mode === Mode.Framework
? AutoModelGenerationType.Models
: AutoModelGenerationType.Disabled,
},
accessPathSuggestions: {
queryConstraints: (mode) => ({

View File

@@ -6,10 +6,13 @@ export const sharedExtensiblePredicates = {
};
export const sharedKinds = {
source: ["local", "remote"],
// https://github.com/github/codeql/blob/0c5ea975a4c4dc5c439b908c006e440cb9bdf926/shared/mad/codeql/mad/ModelValidation.qll#L118-L119
source: ["local", "remote", "file", "commandargs", "database", "environment"],
// Bhttps://github.com/github/codeql/blob/0c5ea975a4c4dc5c439b908c006e440cb9bdf926/shared/mad/codeql/mad/ModelValidation.qll#L28-L31
sink: [
"code-injection",
"command-injection",
"environment-injection",
"file-content-store",
"html-injection",
"js-injection",
@@ -20,6 +23,8 @@ export const sharedKinds = {
"sql-injection",
"url-redirection",
],
// https://github.com/github/codeql/blob/0c5ea975a4c4dc5c439b908c006e440cb9bdf926/shared/mad/codeql/mad/ModelValidation.qll#L142-L143
summary: ["taint", "value"],
// https://github.com/github/codeql/blob/0c5ea975a4c4dc5c439b908c006e440cb9bdf926/shared/mad/codeql/mad/ModelValidation.qll#L155-L156
neutral: ["summary", "source", "sink"],
};

View File

@@ -10,7 +10,7 @@ function readRowToMethod(row: DataTuple[]): string {
return `${row[0]}.${row[1]}#${row[3]}${row[4]}`;
}
export const staticLanguage: ModelsAsDataLanguage = {
export const staticLanguage = {
createMethodSignature: ({
packageName,
typeName,
@@ -168,4 +168,4 @@ export const staticLanguage: ModelsAsDataLanguage = {
argumentsList.length > 0 ? argumentsList[0].path : "Argument[this]",
};
},
};
} satisfies ModelsAsDataLanguage;

View File

@@ -2,10 +2,8 @@ import { window } from "vscode";
import type { App } from "../../common/app";
import { DisposableObject } from "../../common/disposable-object";
import { MethodModelingViewProvider } from "./method-modeling-view-provider";
import type { Method } from "../method";
import type { ModelingStore } from "../modeling-store";
import { ModelConfigListener } from "../../config";
import type { DatabaseItem } from "../../databases/local-databases";
import type { ModelingEvents } from "../modeling-events";
export class MethodModelingPanel extends DisposableObject {
@@ -36,11 +34,4 @@ export class MethodModelingPanel extends DisposableObject {
),
);
}
public async setMethod(
databaseItem: DatabaseItem,
method: Method,
): Promise<void> {
await this.provider.setMethod(databaseItem, method);
}
}

View File

@@ -6,7 +6,7 @@ import { telemetryListener } from "../../common/vscode/telemetry";
import { showAndLogExceptionWithTelemetry } from "../../common/logging/notifications";
import type { App } from "../../common/app";
import { redactableError } from "../../common/errors";
import type { Method } from "../method";
import type { Method, MethodSignature } from "../method";
import type { ModelingStore } from "../modeling-store";
import { AbstractWebviewViewProvider } from "../../common/vscode/abstract-webview-view-provider";
import { assertNever } from "../../common/helpers-pure";
@@ -16,6 +16,7 @@ import type { ModelingEvents } from "../modeling-events";
import type { QueryLanguage } from "../../common/query-language";
import { tryGetQueryLanguage } from "../../common/query-language";
import { createModelConfig } from "../languages";
import type { ModeledMethod } from "../modeled-method";
export class MethodModelingViewProvider extends AbstractWebviewViewProvider<
ToMethodModelingMessage,
@@ -37,7 +38,7 @@ export class MethodModelingViewProvider extends AbstractWebviewViewProvider<
}
protected override async onWebViewLoaded(): Promise<void> {
await Promise.all([this.setViewState(), this.setInitialState()]);
await this.setInitialState();
this.registerToModelingEvents();
this.registerToModelConfigEvents();
}
@@ -52,46 +53,60 @@ export class MethodModelingViewProvider extends AbstractWebviewViewProvider<
});
}
public async setMethod(
databaseItem: DatabaseItem | undefined,
method: Method | undefined,
private async setDatabaseItem(databaseItem: DatabaseItem): Promise<void> {
this.databaseItem = databaseItem;
await this.postMessage({
t: "setInModelingMode",
inModelingMode: true,
});
this.language = tryGetQueryLanguage(databaseItem.language);
await this.setViewState();
}
private async setSelectedMethod(
databaseItem: DatabaseItem,
method: Method,
modeledMethods: readonly ModeledMethod[],
isModified: boolean,
isInProgress: boolean,
processedByAutoModel: boolean,
): Promise<void> {
this.method = method;
this.databaseItem = databaseItem;
this.language = databaseItem && tryGetQueryLanguage(databaseItem.language);
this.language = tryGetQueryLanguage(databaseItem.language);
if (this.isShowingView) {
await this.postMessage({
t: "setMethod",
method,
});
}
await this.postMessage({
t: "setSelectedMethod",
method,
modeledMethods,
isModified,
isInProgress,
processedByAutoModel,
});
}
private async setInitialState(): Promise<void> {
if (this.modelingStore.hasStateForActiveDb()) {
const selectedMethod = this.modelingStore.getSelectedMethodDetails();
if (selectedMethod) {
this.databaseItem = selectedMethod.databaseItem;
this.language = tryGetQueryLanguage(
selectedMethod.databaseItem.language,
);
this.method = selectedMethod.method;
await this.setViewState();
await this.postMessage({
t: "setSelectedMethod",
method: selectedMethod.method,
modeledMethods: selectedMethod.modeledMethods,
isModified: selectedMethod.isModified,
isInProgress: selectedMethod.isInProgress,
processedByAutoModel: selectedMethod.processedByAutoModel,
});
}
const stateForActiveDb = this.modelingStore.getStateForActiveDb();
if (!stateForActiveDb) {
return;
}
await this.postMessage({
t: "setInModelingMode",
inModelingMode: true,
});
await this.setDatabaseItem(stateForActiveDb.databaseItem);
const selectedMethod = this.modelingStore.getSelectedMethodDetails();
if (selectedMethod) {
await this.setSelectedMethod(
stateForActiveDb.databaseItem,
selectedMethod.method,
selectedMethod.modeledMethods,
selectedMethod.isModified,
selectedMethod.isInProgress,
selectedMethod.processedByAutoModel,
);
}
}
@@ -148,7 +163,7 @@ export class MethodModelingViewProvider extends AbstractWebviewViewProvider<
}
}
private async revealInModelEditor(method: Method): Promise<void> {
private async revealInModelEditor(method: MethodSignature): Promise<void> {
if (!this.databaseItem) {
return;
}
@@ -183,33 +198,21 @@ export class MethodModelingViewProvider extends AbstractWebviewViewProvider<
this.push(
this.modelingEvents.onSelectedMethodChanged(async (e) => {
if (this.webviewView) {
this.method = e.method;
this.databaseItem = e.databaseItem;
this.language = tryGetQueryLanguage(e.databaseItem.language);
await this.postMessage({
t: "setSelectedMethod",
method: e.method,
modeledMethods: e.modeledMethods,
isModified: e.isModified,
isInProgress: e.isInProgress,
processedByAutoModel: e.processedByAutoModel,
});
await this.setSelectedMethod(
e.databaseItem,
e.method,
e.modeledMethods,
e.isModified,
e.isInProgress,
e.processedByAutoModel,
);
}
}),
);
this.push(
this.modelingEvents.onDbOpened(async (databaseItem) => {
this.databaseItem = databaseItem;
await this.postMessage({
t: "setInModelingMode",
inModelingMode: true,
});
this.language = tryGetQueryLanguage(databaseItem.language);
await this.setViewState();
await this.setDatabaseItem(databaseItem);
}),
);
@@ -223,7 +226,9 @@ export class MethodModelingViewProvider extends AbstractWebviewViewProvider<
}
if (dbUri === this.databaseItem?.databaseUri.toString()) {
await this.setMethod(undefined, undefined);
await this.postMessage({
t: "setNoMethodSelected",
});
}
}),
);

View File

@@ -57,7 +57,7 @@ export class MethodsUsagePanel extends DisposableObject {
};
}
public async revealItem(
private async revealItem(
methodSignature: string,
usage: Usage,
): Promise<void> {
@@ -108,6 +108,12 @@ export class MethodsUsagePanel extends DisposableObject {
}
}),
);
this.push(
this.modelingEvents.onSelectedMethodChanged(async (event) => {
await this.revealItem(event.method.signature, event.usage);
}),
);
}
private async handleStateChangeEvent(): Promise<void> {

View File

@@ -0,0 +1,100 @@
import type { AnalysisAlert } from "../../variant-analysis/shared/analysis-result";
import type { ModeledMethod } from "../modeled-method";
import { EndpointType } from "../method";
import type { ModelAlerts } from "./model-alerts";
import type {
VariantAnalysis,
VariantAnalysisScannedRepositoryResult,
} from "../../variant-analysis/shared/variant-analysis";
/**
* Calculate which model has contributed to each alert.
* @param alerts The alerts to process.
* @param repoResults The analysis results for each repo.
* @returns The alerts grouped by modeled method.
*/
export function calculateModelAlerts(
variantAnalysis: VariantAnalysis,
repoResults: VariantAnalysisScannedRepositoryResult[],
): ModelAlerts[] {
// For now we just return some mock data, but once we have provenance information
// we'll be able to calculate this properly based on the alerts that are passed in
// and potentially some other information.
const modelAlerts: ModelAlerts[] = [];
const repoMap = new Map<number, string>();
for (const scannedRepo of variantAnalysis.scannedRepos || []) {
repoMap.set(scannedRepo.repository.id, scannedRepo.repository.fullName);
}
for (const [i, repoResult] of repoResults.entries()) {
const results = repoResult.interpretedResults || [];
const repository = {
id: repoResult.repositoryId,
fullName: repoMap.get(repoResult.repositoryId) || "",
};
const alerts = results.map(() => {
return {
alert: createMockAlert(),
repository,
};
});
modelAlerts.push({
model: createModeledMethod(i.toString()),
alerts,
});
}
return modelAlerts;
}
function createModeledMethod(suffix: string): ModeledMethod {
return {
libraryVersion: "1.6.0",
signature: `org.sql2o.Connection#createQuery${suffix}(String)`,
endpointType: EndpointType.Method,
packageName: "org.sql2o",
typeName: "Connection",
methodName: `createQuery${suffix}`,
methodParameters: "(String)",
type: "sink",
input: "Argument[0]",
kind: "path-injection",
provenance: "manual",
};
}
function createMockAlert(): AnalysisAlert {
return {
message: {
tokens: [
{
t: "text",
text: "This is an empty block.",
},
],
},
shortDescription: "This is an empty block.",
fileLink: {
fileLinkPrefix:
"https://github.com/expressjs/express/blob/33e8dc303af9277f8a7e4f46abfdcb5e72f6797b",
filePath: "test/app.options.js",
},
severity: "Warning",
codeSnippet: {
startLine: 10,
endLine: 14,
text: " app.del('/', function(){});\n app.get('/users', function(req, res){});\n app.put('/users', function(req, res){});\n\n request(app)\n",
},
highlightedRegion: {
startLine: 12,
startColumn: 41,
endLine: 12,
endColumn: 43,
},
codeFlows: [],
};
}

View File

@@ -0,0 +1,205 @@
import { Uri, ViewColumn } from "vscode";
import type { WebviewPanelConfig } from "../../common/vscode/abstract-webview";
import { AbstractWebview } from "../../common/vscode/abstract-webview";
import { assertNever } from "../../common/helpers-pure";
import { telemetryListener } from "../../common/vscode/telemetry";
import type {
FromModelAlertsMessage,
ToModelAlertsMessage,
} from "../../common/interface-types";
import type { App } from "../../common/app";
import { redactableError } from "../../common/errors";
import { extLogger } from "../../common/logging/vscode";
import { showAndLogExceptionWithTelemetry } from "../../common/logging";
import type { ModelingEvents } from "../modeling-events";
import type { ModelingStore } from "../modeling-store";
import type { DatabaseItem } from "../../databases/local-databases";
import type { ExtensionPack } from "../shared/extension-pack";
import type {
VariantAnalysis,
VariantAnalysisScannedRepositoryResult,
} from "../../variant-analysis/shared/variant-analysis";
import type { AppEvent, AppEventEmitter } from "../../common/events";
import type { ModeledMethod } from "../modeled-method";
import type { MethodSignature } from "../method";
export class ModelAlertsView extends AbstractWebview<
ToModelAlertsMessage,
FromModelAlertsMessage
> {
public static readonly viewType = "codeQL.modelAlerts";
public readonly onEvaluationRunStopClicked: AppEvent<void>;
private readonly onEvaluationRunStopClickedEventEmitter: AppEventEmitter<void>;
public constructor(
app: App,
private readonly modelingEvents: ModelingEvents,
private readonly modelingStore: ModelingStore,
private readonly dbItem: DatabaseItem,
private readonly extensionPack: ExtensionPack,
) {
super(app);
this.registerToModelingEvents();
this.onEvaluationRunStopClickedEventEmitter = this.push(
app.createEventEmitter<void>(),
);
this.onEvaluationRunStopClicked =
this.onEvaluationRunStopClickedEventEmitter.event;
}
public async showView(
reposResults: VariantAnalysisScannedRepositoryResult[],
) {
const panel = await this.getPanel();
panel.reveal(undefined, true);
await this.waitForPanelLoaded();
await this.setViewState();
await this.setReposResults(reposResults);
}
protected async getPanelConfig(): Promise<WebviewPanelConfig> {
return {
viewId: ModelAlertsView.viewType,
title: "Model Alerts",
viewColumn: ViewColumn.Active,
preserveFocus: true,
view: "model-alerts",
};
}
protected onPanelDispose(): void {
this.modelingStore.updateIsModelAlertsViewOpen(this.dbItem, false);
}
protected async onMessage(msg: FromModelAlertsMessage): Promise<void> {
switch (msg.t) {
case "viewLoaded":
this.onWebViewLoaded();
break;
case "telemetry":
telemetryListener?.sendUIInteraction(msg.action);
break;
case "unhandledError":
void showAndLogExceptionWithTelemetry(
extLogger,
telemetryListener,
redactableError(
msg.error,
)`Unhandled error in model alerts view: ${msg.error.message}`,
);
break;
case "openModelPack":
await this.app.commands.execute("revealInExplorer", Uri.file(msg.path));
break;
case "openActionsLogs":
await this.app.commands.execute(
"codeQLModelAlerts.openVariantAnalysisLogs",
msg.variantAnalysisId,
);
break;
case "stopEvaluationRun":
await this.stopEvaluationRun();
break;
case "revealInModelEditor":
await this.revealInModelEditor(msg.method);
break;
default:
assertNever(msg);
}
}
private async setViewState(): Promise<void> {
await this.postMessage({
t: "setModelAlertsViewState",
viewState: {
title: this.extensionPack.name,
},
});
}
public async setVariantAnalysis(
variantAnalysis: VariantAnalysis,
): Promise<void> {
if (!this.isShowingPanel) {
return;
}
await this.postMessage({
t: "setVariantAnalysis",
variantAnalysis,
});
}
public async setReposResults(
repoResults: VariantAnalysisScannedRepositoryResult[],
): Promise<void> {
if (!this.isShowingPanel) {
return;
}
await this.postMessage({
t: "setRepoResults",
repoResults,
});
}
public async focusView(): Promise<void> {
this.panel?.reveal();
}
private registerToModelingEvents() {
this.push(
this.modelingEvents.onFocusModelAlertsView(async (event) => {
if (event.dbUri === this.dbItem.databaseUri.toString()) {
await this.focusView();
}
}),
);
this.push(
this.modelingEvents.onDbClosed(async (event) => {
if (event === this.dbItem.databaseUri.toString()) {
this.dispose();
}
}),
);
this.push(
this.modelingEvents.onRevealInModelAlertsView(async (event) => {
if (event.dbUri === this.dbItem.databaseUri.toString()) {
await this.revealMethod(event.modeledMethod);
}
}),
);
}
private async stopEvaluationRun() {
this.onEvaluationRunStopClickedEventEmitter.fire();
}
private async revealInModelEditor(method: MethodSignature): Promise<void> {
if (!this.dbItem) {
return;
}
this.modelingEvents.fireRevealInModelEditorEvent(
this.dbItem.databaseUri.toString(),
method,
);
}
private async revealMethod(method: ModeledMethod): Promise<void> {
const panel = await this.getPanel();
panel?.reveal();
await this.postMessage({
t: "revealModel",
modeledMethod: method,
});
}
}

View File

@@ -0,0 +1,13 @@
import type { AnalysisAlert } from "../../variant-analysis/shared/analysis-result";
import type { ModeledMethod } from "../modeled-method";
export interface ModelAlerts {
model: ModeledMethod;
alerts: Array<{
alert: AnalysisAlert;
repository: {
id: number;
fullName: string;
};
}>;
}

View File

@@ -32,18 +32,18 @@ import { INITIAL_MODE } from "./shared/mode";
import { isSupportedLanguage } from "./supported-languages";
import { DefaultNotifier, checkConsistency } from "./consistency-check";
import type { VariantAnalysisManager } from "../variant-analysis/variant-analysis-manager";
import type { DatabaseFetcher } from "../databases/database-fetcher";
export class ModelEditorModule extends DisposableObject {
private readonly queryStorageDir: string;
private readonly modelingStore: ModelingStore;
private readonly modelingEvents: ModelingEvents;
private readonly methodsUsagePanel: MethodsUsagePanel;
private readonly methodModelingPanel: MethodModelingPanel;
private readonly modelConfig: ModelConfigListener;
private constructor(
private readonly app: App,
private readonly databaseManager: DatabaseManager,
private readonly databaseFetcher: DatabaseFetcher,
private readonly variantAnalysisManager: VariantAnalysisManager,
private readonly cliServer: CodeQLCliServer,
private readonly queryRunner: QueryRunner,
@@ -53,10 +53,10 @@ export class ModelEditorModule extends DisposableObject {
this.queryStorageDir = join(baseQueryStorageDir, "model-editor-results");
this.modelingEvents = new ModelingEvents(app);
this.modelingStore = new ModelingStore(this.modelingEvents);
this.methodsUsagePanel = this.push(
this.push(
new MethodsUsagePanel(this.modelingStore, this.modelingEvents, cliServer),
);
this.methodModelingPanel = this.push(
this.push(
new MethodModelingPanel(app, this.modelingStore, this.modelingEvents),
);
this.modelConfig = this.push(new ModelConfigListener());
@@ -67,6 +67,7 @@ export class ModelEditorModule extends DisposableObject {
public static async initialize(
app: App,
databaseManager: DatabaseManager,
databaseFetcher: DatabaseFetcher,
variantAnalysisManager: VariantAnalysisManager,
cliServer: CodeQLCliServer,
queryRunner: QueryRunner,
@@ -75,6 +76,7 @@ export class ModelEditorModule extends DisposableObject {
const modelEditorModule = new ModelEditorModule(
app,
databaseManager,
databaseFetcher,
variantAnalysisManager,
cliServer,
queryRunner,
@@ -107,7 +109,11 @@ export class ModelEditorModule extends DisposableObject {
private registerToModelingEvents(): void {
this.push(
this.modelingEvents.onSelectedMethodChanged(async (event) => {
await this.showMethod(event.databaseItem, event.method, event.usage);
await showResolvableLocation(
event.usage.url,
event.databaseItem,
this.app.logger,
);
}),
);
@@ -126,16 +132,6 @@ export class ModelEditorModule extends DisposableObject {
);
}
private async showMethod(
databaseItem: DatabaseItem,
method: Method,
usage: Usage,
): Promise<void> {
await this.methodsUsagePanel.revealItem(method.signature, usage);
await this.methodModelingPanel.setMethod(databaseItem, method);
await showResolvableLocation(usage.url, databaseItem, this.app.logger);
}
private async openModelEditor(): Promise<void> {
{
const db = this.databaseManager.currentDatabaseItem;
@@ -244,6 +240,7 @@ export class ModelEditorModule extends DisposableObject {
this.modelingEvents,
this.modelConfig,
this.databaseManager,
this.databaseFetcher,
this.variantAnalysisManager,
this.cliServer,
this.queryRunner,

View File

@@ -29,14 +29,14 @@ import type {
} from "../databases/local-databases";
import type { CodeQLCliServer } from "../codeql-cli/cli";
import { asError, assertNever, getErrorMessage } from "../common/helpers-pure";
import { promptImportGithubDatabase } from "../databases/database-fetcher";
import type { DatabaseFetcher } from "../databases/database-fetcher";
import type { App } from "../common/app";
import { redactableError } from "../common/errors";
import {
externalApiQueriesProgressMaxStep,
runModelEditorQueries,
} from "./model-editor-queries";
import type { Method } from "./method";
import type { MethodSignature } from "./method";
import type { ModeledMethod } from "./modeled-method";
import type { ExtensionPack } from "./shared/extension-pack";
import type { ModelConfigListener } from "../config";
@@ -54,7 +54,11 @@ import { telemetryListener } from "../common/vscode/telemetry";
import type { ModelingStore } from "./modeling-store";
import type { ModelingEvents } from "./modeling-events";
import type { ModelsAsDataLanguage } from "./languages";
import { createModelConfig, getModelsAsDataLanguage } from "./languages";
import {
AutoModelGenerationType,
createModelConfig,
getModelsAsDataLanguage,
} from "./languages";
import { runGenerateQueries } from "./generate";
import { ResponseError } from "vscode-jsonrpc";
import { LSPErrorCodes } from "vscode-languageclient";
@@ -86,6 +90,7 @@ export class ModelEditorView extends AbstractWebview<
private readonly modelingEvents: ModelingEvents,
private readonly modelConfig: ModelConfigListener,
private readonly databaseManager: DatabaseManager,
private readonly databaseFetcher: DatabaseFetcher,
private readonly variantAnalysisManager: VariantAnalysisManager,
private readonly cliServer: CodeQLCliServer,
private readonly queryRunner: QueryRunner,
@@ -125,13 +130,14 @@ export class ModelEditorView extends AbstractWebview<
this.languageDefinition = getModelsAsDataLanguage(language);
this.modelEvaluator = new ModelEvaluator(
this.app.logger,
this.app,
this.cliServer,
modelingStore,
modelingEvents,
this.variantAnalysisManager,
databaseItem,
language,
this.extensionPack,
this.updateModelEvaluationRun.bind(this),
);
this.push(this.modelEvaluator);
@@ -272,7 +278,6 @@ export class ModelEditorView extends AbstractWebview<
modeledMethods,
mode,
this.cliServer,
this.modelConfig,
this.app.logger,
);
@@ -346,17 +351,7 @@ export class ModelEditorView extends AbstractWebview<
withProgress((progress) => this.loadMethods(progress), {
cancellable: false,
}),
// Only load access path suggestions if the feature is enabled
this.modelConfig.enableAccessPathSuggestions
? withProgress(
(progress) => this.loadAccessPathSuggestions(progress),
{
cancellable: false,
location: ProgressLocation.Window,
title: "Loading access path suggestions",
},
)
: undefined,
this.loadAccessPathSuggestions(),
]);
void telemetryListener?.sendUIInteraction("model-editor-switch-modes");
@@ -380,6 +375,12 @@ export class ModelEditorView extends AbstractWebview<
case "stopModelEvaluation":
await this.modelEvaluator.stopEvaluation();
break;
case "openModelAlertsView":
await this.modelEvaluator.openModelAlertsView();
break;
case "revealInModelAlertsView":
await this.modelEvaluator.revealInModelAlertsView(msg.modeledMethod);
break;
case "telemetry":
telemetryListener?.sendUIInteraction(msg.action);
break;
@@ -408,14 +409,7 @@ export class ModelEditorView extends AbstractWebview<
await this.generateModeledMethodsOnStartup();
}),
this.loadExistingModeledMethods(),
// Only load access path suggestions if the feature is enabled
this.modelConfig.enableAccessPathSuggestions
? withProgress((progress) => this.loadAccessPathSuggestions(progress), {
cancellable: false,
location: ProgressLocation.Window,
title: "Loading access path suggestions",
})
: undefined,
this.loadAccessPathSuggestions(),
]);
}
@@ -427,7 +421,7 @@ export class ModelEditorView extends AbstractWebview<
this.panel?.reveal();
}
public async revealMethod(method: Method): Promise<void> {
public async revealMethod(method: MethodSignature): Promise<void> {
this.panel?.reveal();
await this.postMessage({
@@ -492,7 +486,6 @@ export class ModelEditorView extends AbstractWebview<
this.extensionPack,
this.language,
this.cliServer,
this.modelConfig,
this.app.logger,
);
this.modelingStore.setModeledMethods(this.databaseItem, modeledMethods);
@@ -560,9 +553,7 @@ export class ModelEditorView extends AbstractWebview<
}
}
protected async loadAccessPathSuggestions(
progress: ProgressCallback,
): Promise<void> {
protected async loadAccessPathSuggestions(): Promise<void> {
const mode = this.modelingStore.getMode(this.databaseItem);
const modelsAsDataLanguage = getModelsAsDataLanguage(this.language);
@@ -571,46 +562,55 @@ export class ModelEditorView extends AbstractWebview<
return;
}
try {
const suggestions = await runSuggestionsQuery(mode, {
parseResults: (results) =>
accessPathSuggestions.parseResults(
results,
modelsAsDataLanguage,
await withProgress(
async (progress) => {
try {
const suggestions = await runSuggestionsQuery(mode, {
parseResults: (results) =>
accessPathSuggestions.parseResults(
results,
modelsAsDataLanguage,
this.app.logger,
),
queryConstraints: accessPathSuggestions.queryConstraints(mode),
cliServer: this.cliServer,
queryRunner: this.queryRunner,
queryStorageDir: this.queryStorageDir,
databaseItem: this.databaseItem,
progress,
token: this.cancellationTokenSource.token,
logger: this.app.logger,
});
if (!suggestions) {
return;
}
const options: AccessPathSuggestionOptions = {
input: parseAccessPathSuggestionRowsToOptions(suggestions.input),
output: parseAccessPathSuggestionRowsToOptions(suggestions.output),
};
await this.postMessage({
t: "setAccessPathSuggestions",
accessPathSuggestions: options,
});
} catch (e: unknown) {
void showAndLogExceptionWithTelemetry(
this.app.logger,
),
queryConstraints: accessPathSuggestions.queryConstraints(mode),
cliServer: this.cliServer,
queryRunner: this.queryRunner,
queryStorageDir: this.queryStorageDir,
databaseItem: this.databaseItem,
progress,
token: this.cancellationTokenSource.token,
logger: this.app.logger,
});
if (!suggestions) {
return;
}
const options: AccessPathSuggestionOptions = {
input: parseAccessPathSuggestionRowsToOptions(suggestions.input),
output: parseAccessPathSuggestionRowsToOptions(suggestions.output),
};
await this.postMessage({
t: "setAccessPathSuggestions",
accessPathSuggestions: options,
});
} catch (e: unknown) {
void showAndLogExceptionWithTelemetry(
this.app.logger,
this.app.telemetry,
redactableError(
asError(e),
)`Failed to fetch access path suggestions: ${getErrorMessage(e)}`,
);
}
this.app.telemetry,
redactableError(
asError(e),
)`Failed to fetch access path suggestions: ${getErrorMessage(e)}`,
);
}
},
{
cancellable: false,
location: ProgressLocation.Window,
title: "Loading access path suggestions",
},
);
}
protected async generateModeledMethods(): Promise<void> {
@@ -702,10 +702,12 @@ export class ModelEditorView extends AbstractWebview<
return;
}
if (
autoModelGeneration.enabled &&
!autoModelGeneration.enabled({ mode, config: this.modelConfig })
) {
const autoModelType = autoModelGeneration.type({
mode,
config: this.modelConfig,
});
if (autoModelType === AutoModelGenerationType.Disabled) {
return;
}
@@ -726,14 +728,37 @@ export class ModelEditorView extends AbstractWebview<
queryConstraints: autoModelGeneration.queryConstraints(mode),
filterQueries: autoModelGeneration.filterQueries,
onResults: (queryPath, results) => {
const extensions = autoModelGeneration.parseResultsToYaml(
queryPath,
results,
modelsAsDataLanguage,
this.app.logger,
);
switch (autoModelType) {
case AutoModelGenerationType.SeparateFile: {
const extensions = autoModelGeneration.parseResultsToYaml(
queryPath,
results,
modelsAsDataLanguage,
this.app.logger,
);
extensionFile.extensions.push(...extensions);
extensionFile.extensions.push(...extensions);
break;
}
case AutoModelGenerationType.Models: {
const modeledMethods = autoModelGeneration.parseResults(
queryPath,
results,
modelsAsDataLanguage,
this.app.logger,
{
mode,
config: this.modelConfig,
},
);
this.addModeledMethodsFromArray(modeledMethods);
break;
}
default: {
assertNever(autoModelType);
}
}
},
cliServer: this.cliServer,
queryRunner: this.queryRunner,
@@ -753,22 +778,24 @@ export class ModelEditorView extends AbstractWebview<
return;
}
progress({
step: 4000,
maxStep: 4000,
message: "Saving generated models",
});
if (autoModelType === AutoModelGenerationType.SeparateFile) {
progress({
step: 4000,
maxStep: 4000,
message: "Saving generated models",
});
const fileContents = `# This file was automatically generated from ${this.databaseItem.name}. Manual changes will not persist.\n\n${modelExtensionFileToYaml(extensionFile)}`;
const filePath = join(
this.extensionPack.path,
"models",
`${this.language}${GENERATED_MODELS_SUFFIX}`,
);
const fileContents = `# This file was automatically generated from ${this.databaseItem.name}. Manual changes will not persist.\n\n${modelExtensionFileToYaml(extensionFile)}`;
const filePath = join(
this.extensionPack.path,
"models",
`${this.language}${GENERATED_MODELS_SUFFIX}`,
);
await outputFile(filePath, fileContents);
await outputFile(filePath, fileContents);
void this.app.logger.log(`Saved generated model file to ${filePath}`);
void this.app.logger.log(`Saved generated model file to ${filePath}`);
}
},
{
cancellable: false,
@@ -806,57 +833,61 @@ export class ModelEditorView extends AbstractWebview<
}
private async modelDependency(): Promise<void> {
return withProgress(async (progress, token) => {
const addedDatabase =
await this.promptChooseNewOrExistingDatabase(progress);
if (!addedDatabase || token.isCancellationRequested) {
return;
}
return withProgress(
async (progress, token) => {
const addedDatabase =
await this.promptChooseNewOrExistingDatabase(progress);
if (!addedDatabase || token.isCancellationRequested) {
return;
}
const addedDbUri = addedDatabase.databaseUri.toString();
if (this.modelingStore.isDbOpen(addedDbUri)) {
this.modelingEvents.fireFocusModelEditorEvent(addedDbUri);
return;
}
const addedDbUri = addedDatabase.databaseUri.toString();
if (this.modelingStore.isDbOpen(addedDbUri)) {
this.modelingEvents.fireFocusModelEditorEvent(addedDbUri);
return;
}
const modelFile = await pickExtensionPack(
this.cliServer,
addedDatabase,
this.modelConfig,
this.app.logger,
progress,
token,
3,
);
if (!modelFile) {
return;
}
const modelFile = await pickExtensionPack(
this.cliServer,
addedDatabase,
this.modelConfig,
this.app.logger,
progress,
token,
3,
);
if (!modelFile) {
return;
}
// Check again just before opening the editor to ensure no model editor has been opened between
// our first check and now.
if (this.modelingStore.isDbOpen(addedDbUri)) {
this.modelingEvents.fireFocusModelEditorEvent(addedDbUri);
return;
}
// Check again just before opening the editor to ensure no model editor has been opened between
// our first check and now.
if (this.modelingStore.isDbOpen(addedDbUri)) {
this.modelingEvents.fireFocusModelEditorEvent(addedDbUri);
return;
}
const view = new ModelEditorView(
this.app,
this.modelingStore,
this.modelingEvents,
this.modelConfig,
this.databaseManager,
this.variantAnalysisManager,
this.cliServer,
this.queryRunner,
this.queryStorageDir,
this.queryDir,
addedDatabase,
modelFile,
this.language,
Mode.Framework,
);
await view.openView();
});
const view = new ModelEditorView(
this.app,
this.modelingStore,
this.modelingEvents,
this.modelConfig,
this.databaseManager,
this.databaseFetcher,
this.variantAnalysisManager,
this.cliServer,
this.queryRunner,
this.queryStorageDir,
this.queryDir,
addedDatabase,
modelFile,
this.language,
Mode.Framework,
);
await view.openView();
},
{ cancellable: true },
);
}
private async promptChooseNewOrExistingDatabase(
@@ -913,14 +944,10 @@ export class ModelEditorView extends AbstractWebview<
// the user to import the library database. We need to have the database
// imported to the query server, so we need to register it to our workspace.
const makeSelected = false;
const addedDatabase = await promptImportGithubDatabase(
this.app.commands,
this.databaseManager,
this.app.workspaceStoragePath ?? this.app.globalStoragePath,
this.app.credentials,
const addedDatabase = await this.databaseFetcher.promptImportGithubDatabase(
progress,
this.cliServer,
this.databaseItem.language,
undefined,
makeSelected,
false,
);

View File

@@ -4,30 +4,51 @@ import type { DatabaseItem } from "../databases/local-databases";
import type { ModelEvaluationRun } from "./model-evaluation-run";
import { DisposableObject } from "../common/disposable-object";
import type { ModelEvaluationRunState } from "./shared/model-evaluation-run-state";
import type { BaseLogger } from "../common/logging";
import type { CodeQLCliServer } from "../codeql-cli/cli";
import type { VariantAnalysisManager } from "../variant-analysis/variant-analysis-manager";
import type { QueryLanguage } from "../common/query-language";
import { resolveCodeScanningQueryPack } from "../variant-analysis/code-scanning-pack";
import { withProgress } from "../common/vscode/progress";
import type { ProgressCallback } from "../common/vscode/progress";
import {
UserCancellationException,
withProgress,
} from "../common/vscode/progress";
import { VariantAnalysisScannedRepositoryDownloadStatus } from "../variant-analysis/shared/variant-analysis";
import type { VariantAnalysis } from "../variant-analysis/shared/variant-analysis";
import type { CancellationToken } from "vscode";
import { CancellationTokenSource } from "vscode";
import type { QlPackDetails } from "../variant-analysis/ql-pack-details";
import type { App } from "../common/app";
import { ModelAlertsView } from "./model-alerts/model-alerts-view";
import type { ExtensionPack } from "./shared/extension-pack";
import type { ModeledMethod } from "./modeled-method";
export class ModelEvaluator extends DisposableObject {
// Cancellation token source to allow cancelling of the current run
// before a variant analysis has been submitted. Once it has been
// submitted, we use the variant analysis manager's cancellation support.
private cancellationSource: CancellationTokenSource;
private modelAlertsView: ModelAlertsView | undefined;
public constructor(
private readonly logger: BaseLogger,
private readonly app: App,
private readonly cliServer: CodeQLCliServer,
private readonly modelingStore: ModelingStore,
private readonly modelingEvents: ModelingEvents,
private readonly variantAnalysisManager: VariantAnalysisManager,
private readonly dbItem: DatabaseItem,
private readonly language: QueryLanguage,
private readonly updateView: (
private readonly extensionPack: ExtensionPack,
private readonly updateModelEditorView: (
run: ModelEvaluationRunState,
) => Promise<void>,
) {
super();
this.registerToModelingEvents();
this.cancellationSource = new CancellationTokenSource();
}
public async startEvaluation() {
@@ -40,9 +61,10 @@ export class ModelEvaluator extends DisposableObject {
// Build pack
const qlPack = await resolveCodeScanningQueryPack(
this.logger,
this.app.logger,
this.cliServer,
this.language,
this.cancellationSource.token,
);
if (!qlPack) {
@@ -52,44 +74,99 @@ export class ModelEvaluator extends DisposableObject {
// Submit variant analysis and monitor progress
return withProgress(
async (progress, token) => {
let variantAnalysisId: number | undefined = undefined;
try {
variantAnalysisId =
await this.variantAnalysisManager.runVariantAnalysis(
qlPack,
progress,
token,
);
} catch (e) {
this.modelingStore.updateModelEvaluationRun(this.dbItem, undefined);
throw e;
}
if (variantAnalysisId) {
this.monitorVariantAnalysis(variantAnalysisId);
} else {
this.modelingStore.updateModelEvaluationRun(this.dbItem, undefined);
throw new Error(
"Unable to trigger variant analysis for evaluation run",
);
}
},
(progress) =>
this.runVariantAnalysis(
qlPack,
progress,
this.cancellationSource.token,
),
{
title: "Run Variant Analysis",
cancellable: true,
title: "Run model evaluation",
cancellable: false,
},
);
}
public async stopEvaluation() {
// For now just update the store.
// This will be fleshed out in the near future.
const evaluationRun: ModelEvaluationRun = {
isPreparing: false,
variantAnalysisId: undefined,
};
this.modelingStore.updateModelEvaluationRun(this.dbItem, evaluationRun);
const evaluationRun = this.modelingStore.getModelEvaluationRun(this.dbItem);
if (!evaluationRun) {
void this.app.logger.log("No active evaluation run to stop");
return;
}
this.cancellationSource.cancel();
if (evaluationRun.variantAnalysisId === undefined) {
// If the variant analysis has not been submitted yet, we can just
// update the store.
this.modelingStore.updateModelEvaluationRun(this.dbItem, {
...evaluationRun,
isPreparing: false,
});
} else {
// If the variant analysis has been submitted, we need to cancel it. We
// don't need to update the store here, as the event handler for
// onVariantAnalysisStatusUpdated will do that for us.
await this.variantAnalysisManager.cancelVariantAnalysis(
evaluationRun.variantAnalysisId,
);
}
}
public async openModelAlertsView() {
if (this.modelingStore.isModelAlertsViewOpen(this.dbItem)) {
this.modelingEvents.fireFocusModelAlertsViewEvent(
this.dbItem.databaseUri.toString(),
);
return;
} else {
this.modelingStore.updateIsModelAlertsViewOpen(this.dbItem, true);
this.modelAlertsView = new ModelAlertsView(
this.app,
this.modelingEvents,
this.modelingStore,
this.dbItem,
this.extensionPack,
);
this.modelAlertsView.onEvaluationRunStopClicked(async () => {
await this.stopEvaluation();
});
// There should be a variant analysis available at this point, as the
// view can only opened when the variant analysis is submitted.
const evaluationRun = this.modelingStore.getModelEvaluationRun(
this.dbItem,
);
if (!evaluationRun) {
throw new Error("No evaluation run available");
}
const variantAnalysis =
await this.getVariantAnalysisForRun(evaluationRun);
if (!variantAnalysis) {
throw new Error("No variant analysis available");
}
const reposResults =
this.variantAnalysisManager.getLoadedResultsForVariantAnalysis(
variantAnalysis.id,
);
await this.modelAlertsView.showView(reposResults);
await this.modelAlertsView.setVariantAnalysis(variantAnalysis);
}
}
public async revealInModelAlertsView(modeledMethod: ModeledMethod) {
if (!this.modelingStore.isModelAlertsViewOpen(this.dbItem)) {
await this.openModelAlertsView();
}
this.modelingEvents.fireRevealInModelAlertsViewEvent(
this.dbItem.databaseUri.toString(),
modeledMethod,
);
}
private registerToModelingEvents() {
@@ -97,7 +174,7 @@ export class ModelEvaluator extends DisposableObject {
this.modelingEvents.onModelEvaluationRunChanged(async (event) => {
if (event.dbUri === this.dbItem.databaseUri.toString()) {
if (!event.evaluationRun) {
await this.updateView({
await this.updateModelEditorView({
isPreparing: false,
variantAnalysis: undefined,
});
@@ -109,7 +186,7 @@ export class ModelEvaluator extends DisposableObject {
isPreparing: event.evaluationRun.isPreparing,
variantAnalysis,
};
await this.updateView(run);
await this.updateModelEditorView(run);
}
}
}),
@@ -127,19 +204,135 @@ export class ModelEvaluator extends DisposableObject {
return undefined;
}
private async runVariantAnalysis(
qlPack: QlPackDetails,
progress: ProgressCallback,
token: CancellationToken,
): Promise<number | void> {
let result: number | void = undefined;
try {
// Use Promise.race to make sure to stop the variant analysis processing when the
// user has stopped the evaluation run. We can't simply rely on the cancellation token
// because we haven't fully implemented cancellation support for variant analysis.
// Using this approach we make sure that the process is stopped from a user's point
// of view (the notification goes away too). It won't necessarily stop any tasks
// that are not aware of the cancellation token.
result = await Promise.race([
this.variantAnalysisManager.runVariantAnalysis(
qlPack,
progress,
token,
false,
),
new Promise<void>((_, reject) => {
token.onCancellationRequested(() =>
reject(new UserCancellationException(undefined, true)),
);
}),
]);
} catch (e) {
this.modelingStore.updateModelEvaluationRun(this.dbItem, undefined);
if (!(e instanceof UserCancellationException)) {
throw e;
} else {
return;
}
} finally {
// Renew the cancellation token source for the new evaluation run.
// This is necessary because we don't want the next evaluation run
// to start as cancelled.
this.cancellationSource = new CancellationTokenSource();
}
// If the result is a number, it means the variant analysis was successfully submitted,
// so we need to update the store and start up the monitor.
if (typeof result === "number") {
this.modelingStore.updateModelEvaluationRun(this.dbItem, {
isPreparing: true,
variantAnalysisId: result,
});
this.monitorVariantAnalysis(result);
} else {
this.modelingStore.updateModelEvaluationRun(this.dbItem, undefined);
throw new Error("Unable to trigger variant analysis for evaluation run");
}
}
private monitorVariantAnalysis(variantAnalysisId: number) {
this.push(
this.variantAnalysisManager.onVariantAnalysisStatusUpdated(
async (variantAnalysis) => {
// Make sure it's the variant analysis we're interested in
if (variantAnalysisId === variantAnalysis.id) {
await this.updateView({
if (variantAnalysis.id === variantAnalysisId) {
// Update model editor view
await this.updateModelEditorView({
isPreparing: false,
variantAnalysis,
});
// Update model alerts view
await this.modelAlertsView?.setVariantAnalysis(variantAnalysis);
}
},
),
);
this.push(
this.variantAnalysisManager.onRepoStatesUpdated(async (e) => {
if (
e.variantAnalysisId === variantAnalysisId &&
e.repoState.downloadStatus ===
VariantAnalysisScannedRepositoryDownloadStatus.Succeeded
) {
await this.readAnalysisResults(
variantAnalysisId,
e.repoState.repositoryId,
);
}
}),
);
this.push(
this.variantAnalysisManager.onRepoResultsLoaded(async (e) => {
if (e.variantAnalysisId === variantAnalysisId) {
await this.modelAlertsView?.setReposResults([e]);
}
}),
);
}
private async readAnalysisResults(
variantAnalysisId: number,
repositoryId: number,
) {
const variantAnalysis =
this.variantAnalysisManager.tryGetVariantAnalysis(variantAnalysisId);
if (!variantAnalysis) {
void this.app.logger.log(
`Could not find variant analysis with id ${variantAnalysisId}`,
);
throw new Error(
"There was an error when trying to retrieve variant analysis information",
);
}
const repository = variantAnalysis.scannedRepos?.find(
(r) => r.repository.id === repositoryId,
);
if (!repository) {
void this.app.logger.log(
`Could not find repository with id ${repositoryId} in scanned repos`,
);
throw new Error(
"There was an error when trying to retrieve repository information",
);
}
// Trigger loading the results for the repository. This will trigger a
// onRepoResultsLoaded event that we'll process.
await this.variantAnalysisManager.loadResults(
variantAnalysisId,
repository.repository.fullName,
);
}
}

View File

@@ -12,7 +12,6 @@ import { load as loadYaml } from "js-yaml";
import type { CodeQLCliServer } from "../codeql-cli/cli";
import { pathsEqual } from "../common/files";
import type { QueryLanguage } from "../common/query-language";
import type { ModelConfig } from "./languages";
export const GENERATED_MODELS_SUFFIX = ".model.generated.yml";
@@ -23,14 +22,12 @@ export async function saveModeledMethods(
modeledMethods: Readonly<Record<string, readonly ModeledMethod[]>>,
mode: Mode,
cliServer: CodeQLCliServer,
modelConfig: ModelConfig,
logger: NotificationLogger,
): Promise<void> {
const existingModeledMethods = await loadModeledMethodFiles(
extensionPack,
language,
cliServer,
modelConfig,
logger,
);
@@ -53,14 +50,9 @@ async function loadModeledMethodFiles(
extensionPack: ExtensionPack,
language: QueryLanguage,
cliServer: CodeQLCliServer,
modelConfig: ModelConfig,
logger: NotificationLogger,
): Promise<Record<string, Record<string, ModeledMethod[]>>> {
const modelFiles = await listModelFiles(
extensionPack.path,
cliServer,
modelConfig,
);
const modelFiles = await listModelFiles(extensionPack.path, cliServer);
const modeledMethodsByFile: Record<
string,
@@ -92,7 +84,6 @@ export async function loadModeledMethods(
extensionPack: ExtensionPack,
language: QueryLanguage,
cliServer: CodeQLCliServer,
modelConfig: ModelConfig,
logger: NotificationLogger,
): Promise<Record<string, ModeledMethod[]>> {
const existingModeledMethods: Record<string, ModeledMethod[]> = {};
@@ -101,7 +92,6 @@ export async function loadModeledMethods(
extensionPack,
language,
cliServer,
modelConfig,
logger,
);
for (const modeledMethods of Object.values(modeledMethodsByFile)) {
@@ -120,7 +110,6 @@ export async function loadModeledMethods(
export async function listModelFiles(
extensionPackPath: string,
cliServer: CodeQLCliServer,
modelConfig: ModelConfig,
): Promise<Set<string>> {
const result = await cliServer.resolveExtensions(
extensionPackPath,
@@ -131,11 +120,8 @@ export async function listModelFiles(
for (const [path, extensions] of Object.entries(result.data)) {
if (pathsEqual(path, extensionPackPath)) {
for (const extension of extensions) {
// We only load generated models when type models are shown
if (
!modelConfig.showTypeModels &&
extension.file.endsWith(GENERATED_MODELS_SUFFIX)
) {
// We never load generated models
if (extension.file.endsWith(GENERATED_MODELS_SUFFIX)) {
continue;
}

View File

@@ -1,3 +1,4 @@
import { assertNever } from "../common/helpers-pure";
import type { MethodSignature } from "./method";
import type { ModelingStatus } from "./shared/modeling-status";
@@ -169,3 +170,86 @@ export function calculateNewProvenance(
return "manual";
}
}
export function createModeledMethodKey(modeledMethod: ModeledMethod): string {
const canonicalModeledMethod = canonicalizeModeledMethod(modeledMethod);
return JSON.stringify(
canonicalModeledMethod,
// This ensures the keys are always in the same order
Object.keys(canonicalModeledMethod).sort(),
);
}
/**
* This method will reset any properties which are not used for the specific type of modeled method.
*
* It will also set the `provenance` to `manual` since multiple modelings of the same method with a
* different provenance are not actually different.
*
* The returned canonical modeled method should only be used for comparisons. It should not be used
* for display purposes, saving the model, or any other purpose which requires the original modeled
* method to be preserved.
*
* @param modeledMethod The modeled method to canonicalize
*/
function canonicalizeModeledMethod(
modeledMethod: ModeledMethod,
): ModeledMethod {
const methodSignature: MethodSignature = {
endpointType: modeledMethod.endpointType,
signature: modeledMethod.signature,
packageName: modeledMethod.packageName,
typeName: modeledMethod.typeName,
methodName: modeledMethod.methodName,
methodParameters: modeledMethod.methodParameters,
};
switch (modeledMethod.type) {
case "none":
return {
...methodSignature,
type: "none",
};
case "source":
return {
...methodSignature,
type: "source",
output: modeledMethod.output,
kind: modeledMethod.kind,
provenance: "manual",
};
case "sink":
return {
...methodSignature,
type: "sink",
input: modeledMethod.input,
kind: modeledMethod.kind,
provenance: "manual",
};
case "summary":
return {
...methodSignature,
type: "summary",
input: modeledMethod.input,
output: modeledMethod.output,
kind: modeledMethod.kind,
provenance: "manual",
};
case "neutral":
return {
...methodSignature,
type: "neutral",
kind: modeledMethod.kind,
provenance: "manual",
};
case "type":
return {
...methodSignature,
type: "type",
relatedTypeName: modeledMethod.relatedTypeName,
path: modeledMethod.path,
};
default:
assertNever(modeledMethod);
}
}

View File

@@ -2,7 +2,7 @@ import type { App } from "../common/app";
import { DisposableObject } from "../common/disposable-object";
import type { AppEvent, AppEventEmitter } from "../common/events";
import type { DatabaseItem } from "../databases/local-databases";
import type { Method, Usage } from "./method";
import type { Method, MethodSignature, Usage } from "./method";
import type { ModelEvaluationRun } from "./model-evaluation-run";
import type { ModeledMethod } from "./modeled-method";
import type { Mode } from "./shared/mode";
@@ -58,13 +58,22 @@ interface ModelEvaluationRunChangedEvent {
interface RevealInModelEditorEvent {
dbUri: string;
method: Method;
method: MethodSignature;
}
interface FocusModelEditorEvent {
dbUri: string;
}
interface FocusModelAlertsViewEvent {
dbUri: string;
}
interface RevealInModelAlertsViewEvent {
dbUri: string;
modeledMethod: ModeledMethod;
}
export class ModelingEvents extends DisposableObject {
public readonly onActiveDbChanged: AppEvent<void>;
public readonly onDbOpened: AppEvent<DatabaseItem>;
@@ -79,6 +88,8 @@ export class ModelingEvents extends DisposableObject {
public readonly onModelEvaluationRunChanged: AppEvent<ModelEvaluationRunChangedEvent>;
public readonly onRevealInModelEditor: AppEvent<RevealInModelEditorEvent>;
public readonly onFocusModelEditor: AppEvent<FocusModelEditorEvent>;
public readonly onFocusModelAlertsView: AppEvent<FocusModelAlertsViewEvent>;
public readonly onRevealInModelAlertsView: AppEvent<RevealInModelAlertsViewEvent>;
private readonly onActiveDbChangedEventEmitter: AppEventEmitter<void>;
private readonly onDbOpenedEventEmitter: AppEventEmitter<DatabaseItem>;
@@ -93,6 +104,8 @@ export class ModelingEvents extends DisposableObject {
private readonly onModelEvaluationRunChangedEventEmitter: AppEventEmitter<ModelEvaluationRunChangedEvent>;
private readonly onRevealInModelEditorEventEmitter: AppEventEmitter<RevealInModelEditorEvent>;
private readonly onFocusModelEditorEventEmitter: AppEventEmitter<FocusModelEditorEvent>;
private readonly onFocusModelAlertsViewEventEmitter: AppEventEmitter<FocusModelAlertsViewEvent>;
private readonly onRevealInModelAlertsViewEventEmitter: AppEventEmitter<RevealInModelAlertsViewEvent>;
constructor(app: App) {
super();
@@ -165,6 +178,17 @@ export class ModelingEvents extends DisposableObject {
app.createEventEmitter<FocusModelEditorEvent>(),
);
this.onFocusModelEditor = this.onFocusModelEditorEventEmitter.event;
this.onFocusModelAlertsViewEventEmitter = this.push(
app.createEventEmitter<FocusModelAlertsViewEvent>(),
);
this.onFocusModelAlertsView = this.onFocusModelAlertsViewEventEmitter.event;
this.onRevealInModelAlertsViewEventEmitter = this.push(
app.createEventEmitter<RevealInModelAlertsViewEvent>(),
);
this.onRevealInModelAlertsView =
this.onRevealInModelAlertsViewEventEmitter.event;
}
public fireActiveDbChangedEvent() {
@@ -274,7 +298,7 @@ export class ModelingEvents extends DisposableObject {
});
}
public fireRevealInModelEditorEvent(dbUri: string, method: Method) {
public fireRevealInModelEditorEvent(dbUri: string, method: MethodSignature) {
this.onRevealInModelEditorEventEmitter.fire({
dbUri,
method,
@@ -286,4 +310,15 @@ export class ModelingEvents extends DisposableObject {
dbUri,
});
}
public fireFocusModelAlertsViewEvent(dbUri: string) {
this.onFocusModelAlertsViewEventEmitter.fire({ dbUri });
}
public fireRevealInModelAlertsViewEvent(
dbUri: string,
modeledMethod: ModeledMethod,
) {
this.onRevealInModelAlertsViewEventEmitter.fire({ dbUri, modeledMethod });
}
}

View File

@@ -20,9 +20,10 @@ interface InternalDbModelingState {
selectedMethod: Method | undefined;
selectedUsage: Usage | undefined;
modelEvaluationRun: ModelEvaluationRun | undefined;
isModelAlertsViewOpen: boolean;
}
interface DbModelingState {
export interface DbModelingState {
readonly databaseItem: DatabaseItem;
readonly methods: readonly Method[];
readonly hideModeledMethods: boolean;
@@ -34,9 +35,10 @@ interface DbModelingState {
readonly selectedMethod: Method | undefined;
readonly selectedUsage: Usage | undefined;
readonly modelEvaluationRun: ModelEvaluationRun | undefined;
readonly isModelAlertsViewOpen: boolean;
}
interface SelectedMethodDetails {
export interface SelectedMethodDetails {
readonly databaseItem: DatabaseItem;
readonly method: Method;
readonly usage: Usage | undefined;
@@ -71,6 +73,7 @@ export class ModelingStore extends DisposableObject {
selectedUsage: undefined,
inProgressMethods: new Set(),
modelEvaluationRun: undefined,
isModelAlertsViewOpen: false,
});
this.modelingEvents.fireDbOpenedEvent(databaseItem);
@@ -113,10 +116,6 @@ export class ModelingStore extends DisposableObject {
return this.state.get(this.activeDb);
}
public hasStateForActiveDb(): boolean {
return !!this.getStateForActiveDb();
}
public anyDbsBeingModeled(): boolean {
return this.state.size > 0;
}
@@ -423,6 +422,12 @@ export class ModelingStore extends DisposableObject {
return this.state.get(databaseItem.databaseUri.toString())!;
}
public getModelEvaluationRun(
dbItem: DatabaseItem,
): ModelEvaluationRun | undefined {
return this.getState(dbItem).modelEvaluationRun;
}
private changeMethods(
dbItem: DatabaseItem,
updateState: (state: InternalDbModelingState) => void,
@@ -496,4 +501,23 @@ export class ModelingStore extends DisposableObject {
state.modelEvaluationRun,
);
}
public isModelAlertsViewOpen(dbItem: DatabaseItem): boolean {
return this.getState(dbItem).isModelAlertsViewOpen ?? false;
}
private changeIsModelAlertsViewOpen(
dbItem: DatabaseItem,
updateState: (state: InternalDbModelingState) => void,
) {
const state = this.getState(dbItem);
updateState(state);
}
public updateIsModelAlertsViewOpen(dbItem: DatabaseItem, isOpen: boolean) {
this.changeIsModelAlertsViewOpen(dbItem, (state) => {
state.isModelAlertsViewOpen = isOpen;
});
}
}

View File

@@ -0,0 +1,75 @@
import type { ModelAlerts } from "../model-alerts/model-alerts";
export enum SortKey {
Alphabetically = "alphabetically",
NumberOfResults = "numberOfResults",
}
export type ModelAlertsFilterSortState = {
modelSearchValue: string;
repositorySearchValue: string;
sortKey: SortKey;
};
export const defaultFilterSortState: ModelAlertsFilterSortState = {
modelSearchValue: "",
repositorySearchValue: "",
sortKey: SortKey.NumberOfResults,
};
export function filterAndSort(
modelAlerts: ModelAlerts[],
filterSortState: ModelAlertsFilterSortState,
): ModelAlerts[] {
if (!modelAlerts || modelAlerts.length === 0) {
return [];
}
return modelAlerts
.filter((item) => matchesFilter(item, filterSortState))
.sort((a, b) => {
switch (filterSortState.sortKey) {
case SortKey.Alphabetically:
return a.model.signature.localeCompare(b.model.signature);
case SortKey.NumberOfResults:
return (b.alerts.length || 0) - (a.alerts.length || 0);
default:
return 0;
}
});
}
function matchesFilter(
item: ModelAlerts,
filterSortState: ModelAlertsFilterSortState | undefined,
): boolean {
if (!filterSortState) {
return true;
}
return (
matchesRepository(item, filterSortState.repositorySearchValue) &&
matchesModel(item, filterSortState.modelSearchValue)
);
}
function matchesRepository(
item: ModelAlerts,
repositorySearchValue: string,
): boolean {
// We may want to only return alerts that have a repository match
// but for now just return true if the model has any alerts
// with a matching repo.
return item.alerts.some((alert) =>
alert.repository.fullName
.toLowerCase()
.includes(repositorySearchValue.toLowerCase()),
);
}
function matchesModel(item: ModelAlerts, modelSearchValue: string): boolean {
return item.model.signature
.toLowerCase()
.includes(modelSearchValue.toLowerCase());
}

Some files were not shown because too many files have changed in this diff Show More