Skip to content

Commit 3cae3cc

Browse files
Merge branch 'main' into robertbrignull/database-prompting
2 parents ff889b7 + 7a41d9c commit 3cae3cc

File tree

106 files changed

+5360
-7085
lines changed

Some content is hidden

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

106 files changed

+5360
-7085
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import javascript
2+
3+
class WithProgressCall extends CallExpr {
4+
WithProgressCall() { this.getCalleeName() = "withProgress" }
5+
6+
predicate usesToken() { exists(this.getTokenParameter()) }
7+
8+
Parameter getTokenParameter() { result = this.getArgument(0).(Function).getParameter(1) }
9+
10+
Property getCancellableProperty() { result = this.getArgument(1).(ObjectExpr).getPropertyByName("cancellable") }
11+
12+
predicate isCancellable() {
13+
this.getCancellableProperty().getInit().(BooleanLiteral).getBoolValue() =
14+
true
15+
}
16+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
* @name Using token for non-cancellable progress bar
3+
* @kind problem
4+
* @problem.severity warning
5+
* @id vscode-codeql/progress-not-cancellable
6+
* @description If we call `withProgress` without `cancellable: true` then the
7+
* token that is given to us should be ignored because it won't ever be cancelled.
8+
* This makes the code more confusing as it tries to account for cases that can't
9+
* happen. The fix is to either not use the token or make the progress bar cancellable.
10+
*/
11+
12+
import javascript
13+
import ProgressBar
14+
15+
from WithProgressCall t
16+
where not t.isCancellable() and t.usesToken()
17+
select t,
18+
"The $@ should not be used when the progress bar is not cancellable. Either stop using the $@ or mark the progress bar as cancellable.",
19+
t.getTokenParameter(), t.getTokenParameter().getName(), t.getTokenParameter(),
20+
t.getTokenParameter().getName()
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* @name Don't ignore the token for a cancellable progress bar
3+
* @kind problem
4+
* @problem.severity warning
5+
* @id vscode-codeql/token-not-used
6+
* @description If we call `withProgress` with `cancellable: true` but then
7+
* ignore the token that is given to us, it will lead to a poor user experience
8+
* because the progress bar will appear to be canceled but it will not actually
9+
* affect the background process. Either check the token and respect when it
10+
* has been cancelled, or mark the progress bar as not cancellable.
11+
*/
12+
13+
import javascript
14+
import ProgressBar
15+
16+
from WithProgressCall t
17+
where t.isCancellable() and not t.usesToken()
18+
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"

.github/dependabot.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,20 @@ updates:
1313
# are unrelated to the Node version, so we allow those.
1414
- dependency-name: "@types/node"
1515
update-types: ["version-update:semver-major", "version-update:semver-minor"]
16+
groups:
17+
octokit:
18+
patterns:
19+
- "@octokit/*"
20+
storybook:
21+
patterns:
22+
- "@storybook/*"
23+
- "storybook"
24+
testing-library:
25+
patterns:
26+
- "@testing-library/*"
27+
typescript-eslint:
28+
patterns:
29+
- "@typescript-eslint/*"
1630
- package-ecosystem: "github-actions"
1731
directory: "/"
1832
schedule:

extensions/ql-vscode/.babelrc.json

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

extensions/ql-vscode/.storybook/main.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import type { StorybookConfig } from "@storybook/react-webpack5";
1+
import type { StorybookConfig } from "@storybook/react-vite";
22

33
const config: StorybookConfig = {
4-
stories: ["../src/**/*.stories.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
4+
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
55
addons: [
66
"@storybook/addon-links",
77
"@storybook/addon-essentials",
@@ -10,7 +10,7 @@ const config: StorybookConfig = {
1010
"./vscode-theme-addon/preset.ts",
1111
],
1212
framework: {
13-
name: "@storybook/react-webpack5",
13+
name: "@storybook/react-vite",
1414
options: {},
1515
},
1616
docs: {

extensions/ql-vscode/.storybook/vscode-theme-addon/ThemeSelector.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import { useCallback } from "react";
55
import { useGlobals } from "@storybook/manager-api";
66
import {
77
IconButton,
8-
Icons,
98
TooltipLinkList,
109
WithTooltip,
1110
} from "@storybook/components";
11+
import { DashboardIcon } from "@storybook/icons";
1212

1313
import { themeNames, VSCodeTheme } from "./theme";
1414

@@ -53,7 +53,7 @@ export const ThemeSelector: FunctionComponent = () => {
5353
title="Change the theme of the preview"
5454
active={vscodeTheme !== VSCodeTheme.Dark}
5555
>
56-
<Icons icon="dashboard" />
56+
<DashboardIcon />
5757
</IconButton>
5858
</WithTooltip>
5959
);

extensions/ql-vscode/.storybook/vscode-theme-addon/withTheme.ts

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/// <reference types="vite/client" />
2+
13
import { useEffect } from "react";
24
import type {
35
PartialStoryFn as StoryFunction,
@@ -6,31 +8,20 @@ import type {
68

79
import { VSCodeTheme } from "./theme";
810

11+
import darkThemeStyle from "../../src/stories/vscode-theme-dark.css?url";
12+
import lightThemeStyle from "../../src/stories/vscode-theme-light.css?url";
13+
import lightHighContrastThemeStyle from "../../src/stories/vscode-theme-light-high-contrast.css?url";
14+
import darkHighContrastThemeStyle from "../../src/stories/vscode-theme-dark-high-contrast.css?url";
15+
import githubLightDefaultThemeStyle from "../../src/stories/vscode-theme-github-light-default.css?url";
16+
import githubDarkDefaultThemeStyle from "../../src/stories/vscode-theme-github-dark-default.css?url";
17+
918
const themeFiles: { [key in VSCodeTheme]: string } = {
10-
[VSCodeTheme.Dark]:
11-
// eslint-disable-next-line @typescript-eslint/no-var-requires,import/no-commonjs,import/no-webpack-loader-syntax
12-
require("!file-loader?modules!../../src/stories/vscode-theme-dark.css")
13-
.default,
14-
[VSCodeTheme.Light]:
15-
// eslint-disable-next-line @typescript-eslint/no-var-requires,import/no-commonjs,import/no-webpack-loader-syntax
16-
require("!file-loader?modules!../../src/stories/vscode-theme-light.css")
17-
.default,
18-
[VSCodeTheme.LightHighContrast]:
19-
// eslint-disable-next-line @typescript-eslint/no-var-requires,import/no-commonjs,import/no-webpack-loader-syntax
20-
require("!file-loader?modules!../../src/stories/vscode-theme-light-high-contrast.css")
21-
.default,
22-
[VSCodeTheme.DarkHighContrast]:
23-
// eslint-disable-next-line @typescript-eslint/no-var-requires,import/no-commonjs,import/no-webpack-loader-syntax
24-
require("!file-loader?modules!../../src/stories/vscode-theme-dark-high-contrast.css")
25-
.default,
26-
[VSCodeTheme.GitHubLightDefault]:
27-
// eslint-disable-next-line @typescript-eslint/no-var-requires,import/no-commonjs,import/no-webpack-loader-syntax
28-
require("!file-loader?modules!../../src/stories/vscode-theme-github-light-default.css")
29-
.default,
30-
[VSCodeTheme.GitHubDarkDefault]:
31-
// eslint-disable-next-line @typescript-eslint/no-var-requires,import/no-commonjs,import/no-webpack-loader-syntax
32-
require("!file-loader?modules!../../src/stories/vscode-theme-github-dark-default.css")
33-
.default,
19+
[VSCodeTheme.Dark]: darkThemeStyle,
20+
[VSCodeTheme.Light]: lightThemeStyle,
21+
[VSCodeTheme.LightHighContrast]: lightHighContrastThemeStyle,
22+
[VSCodeTheme.DarkHighContrast]: darkHighContrastThemeStyle,
23+
[VSCodeTheme.GitHubLightDefault]: githubLightDefaultThemeStyle,
24+
[VSCodeTheme.GitHubDarkDefault]: githubDarkDefaultThemeStyle,
3425
};
3526

3627
export const withTheme = (StoryFn: StoryFunction, context: StoryContext) => {

extensions/ql-vscode/CHANGELOG.md

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

33
## [UNRELEASED]
44

5+
- Add new supported source and sink kinds in the CodeQL Model Editor [#3511](https://github.com/github/vscode-codeql/pull/3511)
6+
7+
## 1.12.4 - 20 March 2024
8+
9+
- Don't show notification after local query cancellation. [#3489](https://github.com/github/vscode-codeql/pull/3489)
10+
- 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)
11+
512
## 1.12.3 - 29 February 2024
613

714
- Update variant analysis view to show when cancelation is in progress. [#3405](https://github.com/github/vscode-codeql/pull/3405)

0 commit comments

Comments
 (0)