Compare commits

...

633 Commits

Author SHA1 Message Date
Anders Starcke Henriksen
53df2bcd87 Merge pull request #2956 from github/v1.9.2
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
Release v1.9.2
2023-10-12 10:18:15 +02:00
Koen Vlaswinkel
0835b140e7 Merge pull request #2948 from github/koesie10/sort-usages-panel
Sort methods in usages panel according to model editor sort order
2023-10-12 09:55:00 +02:00
Anders Starcke Henriksen
0e62d2635c v1.9.2 2023-10-12 09:50:13 +02:00
Koen Vlaswinkel
78284cbc7a Merge remote-tracking branch 'origin/main' into koesie10/sort-usages-panel 2023-10-12 09:39:11 +02:00
Koen Vlaswinkel
0d7002273a Merge pull request #2949 from github/koesie10/single-model-editor-per-db
Only allow a single model editor per database
2023-10-12 09:37:56 +02:00
Charis Kyriakou
7041dd7698 Rename 'open database' button and only show if source available (#2945) 2023-10-12 08:09:05 +01:00
Koen Vlaswinkel
a3d41a2afe Merge pull request #2924 from github/koesie10/modeling-panel-multiple-models-add-remove
Add ability to add/remove modelings to method modeling panel
2023-10-11 16:20:39 +02:00
Koen Vlaswinkel
0cbdadb271 Add newline for readability
Co-authored-by: Robert <robertbrignull@github.com>
2023-10-11 15:59:56 +02:00
Henry Mercer
5105187dbd Merge pull request #2951 from github/github-action/bump-cli
Bump CLI Version to v2.15.0 for integration tests
2023-10-11 14:03:49 +01:00
Koen Vlaswinkel
918362f39e Merge pull request #2950 from github/koesie10/variant-analysis-save-before-start
Use `saveBeforeStart` setting when running a variant analysis
2023-10-11 14:34:08 +02:00
github-actions[bot]
0b5d2d86cf Bump CLI version from v2.14.6 to v2.15.0 for integration tests 2023-10-11 12:30:29 +00:00
Koen Vlaswinkel
3a035708c5 Merge pull request #2947 from github/koesie10/update-set-selected-method-message
Convert `SetSelectedMethodMessage` to include multiple modeled methods
2023-10-11 13:59:48 +02:00
Koen Vlaswinkel
84211c63bb Merge remote-tracking branch 'origin/main' into koesie10/update-set-selected-method-message 2023-10-11 13:40:27 +02:00
Koen Vlaswinkel
11218522e7 Update CHANGELOG 2023-10-11 13:35:11 +02:00
Koen Vlaswinkel
0bdd441767 Use saveBeforeStart setting when running a variant analysis
This will respect the user's `saveBeforeStart` setting when running a
variant analysis. This re-uses the existing `saveBeforeStart` function
that is used when running local queries. The default behavior if the
setting is not set is to save all open named files.
2023-10-11 13:33:24 +02:00
Koen Vlaswinkel
667bf19f46 Add methodSignature to SetMultipleModeledMethodsMessage 2023-10-11 13:07:18 +02:00
Robert
c459d0ff65 Merge pull request #2942 from github/robertbrignull/SetModeledMethodsMessage
Convert SetModeledMethodsMessage to include multiple modeled methods
2023-10-11 11:45:57 +01:00
Koen Vlaswinkel
039b28235d Only allow 1 view in the view tracker
This will change the model editor view tracker to only store 1 view per
database item instead of an array of views per database item.
2023-10-11 11:54:47 +02:00
Koen Vlaswinkel
76db520ce7 Only allow a single model editor per database
This will add checks in the appropriate places to ensure that only a
single model editor is opened per database.
2023-10-11 11:51:05 +02:00
Koen Vlaswinkel
0e1afcee64 Sort methods in usages panel according to model editor sort order
This sorts the methods in the methods usages panel the same as in the
model editor. Since this is dependent on the mode, we need to keep track
of the mode in the modeling store, so this also adds a mode field to the
db state.
2023-10-11 11:42:10 +02:00
Robert
62c9e51c25 Avoid unnnecessarily renaming field read from props 2023-10-11 10:41:48 +01:00
Charis Kyriakou
2b47d3d192 Ensure modeled methods are not undefined in usages panel (#2946) 2023-10-11 08:29:39 +00:00
Koen Vlaswinkel
4a62d05af6 Convert SetSelectedMethodMessage to include multiple modeled methods 2023-10-11 10:14:58 +02:00
Koen Vlaswinkel
e77cf28192 Merge pull request #2944 from github/dependabot/npm_and_yarn/extensions/ql-vscode/postcss-8.4.31
Bump postcss from 8.4.24 to 8.4.31 in /extensions/ql-vscode
2023-10-11 09:51:41 +02:00
Koen Vlaswinkel
59e23f35e2 Merge pull request #2943 from github/koesie10/state-confusion
Fix confusion between modeling store and view states
2023-10-11 09:45:58 +02:00
dependabot[bot]
33d55b1f0a Bump postcss from 8.4.24 to 8.4.31 in /extensions/ql-vscode
Bumps [postcss](https://github.com/postcss/postcss) from 8.4.24 to 8.4.31.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/8.4.24...8.4.31)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-10 15:03:37 +00:00
Koen Vlaswinkel
e7ddb4406a Merge pull request #2937 from github/koesie10/remove-gulp-sourcemaps
Remove `gulp-sourcemaps` dependency
2023-10-10 17:02:00 +02:00
Koen Vlaswinkel
9a12a12065 Unexport DbModelingState 2023-10-10 16:57:19 +02:00
Koen Vlaswinkel
073440914d Set instance variables on webview load 2023-10-10 16:55:55 +02:00
Robert
c6a9f23e7e Delete convertToLegacyModeledMethods 2023-10-10 15:50:02 +01:00
Robert
d531bc642d Convert SetModeledMethodsMessage to include multiple modeled methods 2023-10-10 15:50:02 +01:00
Robert
a6625334f0 Merge pull request #2940 from github/robertbrignull/CommonFromViewMessages
Add CommonFromViewMessages to FromModelEditorMessage
2023-10-10 15:49:04 +01:00
Koen Vlaswinkel
77bb9780ec Fix confusion between modeling store an view states
This fixes three bugs related to the modeling store and view states:
- In the model editor view, when `setModeledMethods` was called, it
would do it on the active database, instead of the database that the
view was showing. This should not result in any visible bugs since the
active database is always the one that is being shown (in theory), but
I can imagine that it could cause issues if showing multiple model
editors next to each other.
- In the method modeling panel, the "reveal in editor" button would
always show the already active model editor. Therefore, if you had
multiple open and were still viewing the method of the first one, it
would always show the second one.
- In the method modeling panel, the same bug would cause the incorrect
modeled methods to be updated.
2023-10-10 16:44:40 +02:00
Koen Vlaswinkel
bb88c148aa Merge pull request #2941 from github/koesie10/modeling-store-modeled-methods-bug
Fix bug when selecting method without modeled methods
2023-10-10 16:18:42 +02:00
Robert
6df7ea3ddc Remove unused import 2023-10-10 15:15:29 +01:00
Robert
2beaf9a88c ViewLoadedMsg is already included 2023-10-10 15:11:30 +01:00
Robert
a7dbae02e0 Use ap logger 2023-10-10 15:11:19 +01:00
Robert
28ac019929 Fix typo 2023-10-10 15:11:09 +01:00
Koen Vlaswinkel
2e2ab11e4f Merge pull request #2939 from github/koesie10/unhandled-error-stack
Add stack trace to unhandled error log message
2023-10-10 16:10:01 +02:00
Robert
edf3cad6e4 Add CommonFromViewMessages to FromModelEditorMessage 2023-10-10 15:03:23 +01:00
Robert
246c347b04 Merge pull request #2938 from github/robertbrignull/legacy-conversion
Make use of modeled-methods-legacy.ts in the webview code
2023-10-10 15:00:52 +01:00
Koen Vlaswinkel
e332b26f29 Fix bug when selecting method without modeled methods
When selecting a method that has no modeled methods, the modeling state
would not contain an entry for the method signature. This would cause
the `modeledMethods` to be `undefined`, which is not allowed according
to its type.
2023-10-10 15:51:59 +02:00
Koen Vlaswinkel
22f6ac7974 Add stack trace to unhandled error log message
This change sets the `fullMessage` of the
`showAndLogExceptionWithTelemetry` to include the stack trace. This
makes it possible to find the source of the error rather than only
knowing that a specific error occurred. If the error does not have a
stack trace (which should be rare) the message will be the same as
before.
2023-10-10 15:45:49 +02:00
Robert
e45f4bd0d9 Merge branch 'main' into robertbrignull/legacy-conversion 2023-10-10 14:37:20 +01:00
Charis Kyriakou
f4d74c7d3f Deal with already modeled methods in the modeling panel (#2933) 2023-10-10 14:35:21 +01:00
Robert
7ba58b6298 Use legacy modeled method conversions instead of custom conversions 2023-10-10 14:23:06 +01:00
Robert
2b59c041b8 Make convertFromLegacyModeledMethod handle undefined 2023-10-10 14:23:06 +01:00
Robert
a434fbffbc Move modeled-methods-legacy.ts to /shared directory 2023-10-10 14:23:06 +01:00
Koen Vlaswinkel
649f69234e Remove gulp-sourcemaps 2023-10-10 14:37:20 +02:00
Charis Kyriakou
4ee86c15ad Add some spacing in modeling method empty states (#2934) 2023-10-10 10:52:15 +00:00
Robert
fcfd4f37a6 Merge pull request #2926 from github/robertbrignull/JumpToUsageMessage
Only include method signature in JumpToUsageMessage
2023-10-10 11:12:36 +01:00
Robert
6561bb0543 Merge branch 'main' into robertbrignull/JumpToUsageMessage 2023-10-10 10:50:21 +01:00
Koen Vlaswinkel
319a54c32f Merge pull request #2906 from github/koesie10/convert-remaining-multiple-models
Convert remaining extension host code to handle multiple models
2023-10-10 11:43:09 +02:00
Koen Vlaswinkel
385b0e8d1a Merge remote-tracking branch 'origin/main' into koesie10/convert-remaining-multiple-models 2023-10-10 11:22:08 +02:00
Robert
4dcfa8b679 Merge pull request #2927 from github/robertbrignull/generateMethodsFromLlm
Only include method signatures in generateMethodsFromLlm message
2023-10-10 10:19:20 +01:00
Robert
47509a922a Rename jumpToUsage => jumpToMethod throughout 2023-10-10 10:14:27 +01:00
Charis Kyriakou
7eab7e4e48 Set modeling mode when initialising method modeling panel (#2932) 2023-10-10 10:12:01 +01:00
Charis Kyriakou
f794a19d96 Track db related to modeled method and react when it closes (#2930) 2023-10-10 09:51:50 +01:00
Charis Kyriakou
e98611fd21 Ensure modified methods updated after changing a method from the modeling panel (#2929) 2023-10-10 08:57:36 +01:00
Koen Vlaswinkel
461cf15a47 Merge remote-tracking branch 'origin/main' into koesie10/convert-remaining-multiple-models 2023-10-10 09:30:29 +02:00
Koen Vlaswinkel
54e1b29940 Add explicit return type to convertToLegacyModeledMethod 2023-10-10 09:26:27 +02:00
Dave Bartolomeo
623890adc9 Merge pull request #2922 from github/dbartol/passthru
Add `additionalArgs` option to `launch.json`
2023-10-09 15:04:13 -04:00
Dave Bartolomeo
e7f75ab928 Merge branch 'dbartol/passthru' of https://github.com/github/vscode-codeql into dbartol/passthru 2023-10-09 14:44:49 -04:00
Dave Bartolomeo
df02fecf3c Fix test expectations 2023-10-09 14:44:33 -04:00
Dave Bartolomeo
a861346b10 Merge branch 'main' into dbartol/passthru 2023-10-09 14:06:14 -04:00
Philip Ginsbach
86b2157552 Merge pull request #2792 from github/ginsbach/TextMateInstantiationSyntax
fix syntax highlighting after imports with instantiation arguments
2023-10-09 17:17:55 +01:00
Philip Ginsbach
47fa163cb9 Update compiled grammar 2023-10-09 16:58:00 +01:00
Dave Bartolomeo
c78f01758a Alternate fix for import highlighting with instantiations 2023-10-09 16:58:00 +01:00
Philip Ginsbach
353e22d6e8 link to the PR from the changelog entry 2023-10-09 16:58:00 +01:00
Philip Ginsbach
599d31e5ac add changelog entry for TextMate instantiation argument syntax 2023-10-09 16:57:25 +01:00
Philip Ginsbach
64df792eda TextMate grammar: imports can have instantiation arguments 2023-10-09 16:56:21 +01:00
Robert
feebf7c3fd Only include method signatures in generateMethodsFromLlm 2023-10-09 16:17:46 +01:00
Robert
27c4bd8349 Merge pull request #2910 from github/robertbrignull/multiple-models-method-row
Add ability for MethodRow to render multiple modelings of the same method
2023-10-09 16:17:17 +01:00
Dave Bartolomeo
d4cbfbb70e Rename to additionalRunQueryArgs 2023-10-09 11:04:22 -04:00
Robert
153424ae5a Only include method signature in JumpToUsageMessage 2023-10-09 16:03:41 +01:00
Robert
edd2aa5e8f Merge branch 'main' into robertbrignull/multiple-models-method-row 2023-10-09 15:38:00 +01:00
Robert
0265353370 Use index as react key 2023-10-09 14:44:43 +01:00
Koen Vlaswinkel
623df4c2ee Merge pull request #2919 from github/koesie10/show-multiple-models-listener
Listen to modeling setting changes in the model editor and method modeling panel
2023-10-09 15:38:30 +02:00
Robert
8b0825ab3c Use better name for variable 2023-10-09 14:32:56 +01:00
Robert
c620939895 Merge pull request #2913 from github/robertbrignull/SaveModeledMethods
Remove method and modeledMethods from SaveModeledMethods message
2023-10-09 14:16:30 +01:00
Koen Vlaswinkel
e4a290fe37 Merge pull request #2925 from github/koesie10/method-modeling-codeowner
Set SecExp as codeowner for modeling panel
2023-10-09 15:13:56 +02:00
Koen Vlaswinkel
3230cc9166 Set SecExp as codeowner for modeling panel 2023-10-09 14:56:38 +02:00
Koen Vlaswinkel
4dae9b87d4 Add ability to add/remove modelings 2023-10-09 14:54:32 +02:00
Koen Vlaswinkel
5c368cec8b Merge pull request #2921 from github/koesie10/modeling-panel-multiple-models
Add ability for method modeling panel to render multiple modelings of the same method
2023-10-09 14:27:30 +02:00
Koen Vlaswinkel
b76369330d Convert remaining extension host code to handle multiple models
This converts all remaining extension host code to handle multiple
models per method. The only place where we're using the legacy format
is in the webview and in the boundary between the webview and the
extension host.
2023-10-09 13:56:41 +02:00
Koen Vlaswinkel
323c5368ba Switch from CodiconButton to VSCodeButton 2023-10-09 13:52:55 +02:00
Robert
c3e18910fc Fix typo in comment 2023-10-09 12:26:09 +01:00
Robert
603c799717 Merge pull request #2923 from github/robertbrignull/telemetry-changelog
Update CHANGELOG.md for telemetry changes
2023-10-09 12:24:39 +01:00
Robert
aa045835fd Merge branch 'main' into robertbrignull/SaveModeledMethods 2023-10-09 11:35:47 +01:00
Robert
850c04a289 Clarify method docs 2023-10-09 11:30:35 +01:00
Robert
4d19955740 Update CHANGELOG.md for telemetry changes 2023-10-09 11:08:31 +01:00
Robert
b623f92c4a Merge pull request #2824 from github/robertbrignull/telemetry
Respect "telemetry.telemetryLevel" as well as "telemetry.enableTelemetry"
2023-10-09 10:59:26 +01:00
Koen Vlaswinkel
08342f1960 Merge pull request #2905 from github/koesie10/convert-modeled-method-fs
Convert `modeled-method-fs.ts` to handle multiple models per method
2023-10-09 11:54:31 +02:00
Robert
af334a98e3 Merge pull request #2912 from github/robertbrignull/simplify_messages/RevealMethodMessage
Convert RevealMethodMessage to only include method signature
2023-10-09 10:46:19 +01:00
Dave Bartolomeo
9e26c29ddb Fix tests for older CLIs 2023-10-06 18:35:20 -04:00
Dave Bartolomeo
705a7975c5 Add additionalArgs option to launch.json 2023-10-06 18:03:10 -04:00
Koen Vlaswinkel
6be98f3f8d Fix test 2023-10-06 16:57:31 +02:00
Koen Vlaswinkel
3b6263fb07 Remove size from CodiconButton 2023-10-06 16:48:49 +02:00
Koen Vlaswinkel
29aa4a3f29 Add tests for multiple modeled methods panel 2023-10-06 16:42:41 +02:00
Koen Vlaswinkel
3a494dff36 Add support for unmodeled methods 2023-10-06 16:26:53 +02:00
Koen Vlaswinkel
a01a76cb73 Add initial multiple modelings panel 2023-10-06 16:25:25 +02:00
Koen Vlaswinkel
a29112e045 Add multiple models to MethodModeling story 2023-10-06 15:54:02 +02:00
Koen Vlaswinkel
ee1bf8896e Change MethodModeling to accept multiple models 2023-10-06 15:50:31 +02:00
Koen Vlaswinkel
2410d2bfdd Merge pull request #2918 from github/koesie10/modeling-panel-view-state
Add view state to method modeling panel
2023-10-06 15:49:37 +02:00
Charis Kyriakou
0e5551b650 Make method modeling panel available to canary users (#2920) 2023-10-06 13:25:33 +00:00
Koen Vlaswinkel
951bd13881 Use ModelConfig for all model settings
This switches all places where we're retrieving some model configuration
to use the `ModelConfig` or `ModelConfigListener` types. This makes it
much easier to mock these settings in tests.

This also adds a listener to the `ModelEditorView` to send the new view
state when any of the settings is changed. This should make it easier
to test settings changes in the model editor without having to re-open
the model editor.
2023-10-06 14:29:07 +02:00
Koen Vlaswinkel
08944a292c Update method modeling panel after changes to config
This updates the method modeling panel's view state when the
`codeQL.model.showMultipleModels` setting changes. This will ensure that
the setting updates without needing to restart VS Code since this view
is much harder to restart than the model editor.
2023-10-06 14:15:23 +02:00
Koen Vlaswinkel
cf0057ecd9 Add view state to method modeling panel
This adds a view state to the method modeling panel similar to the
model editor. This will be used to send the state of the show multiple
models feature flag to the webview so this can be used to selectively
show/hide components in the method modeling panel.
2023-10-06 14:04:06 +02:00
Charis Kyriakou
1d691c2b7f UI polish for modeling panel (#2917)
* Don't push content down with unsaved tag

* Adjust spacing between components
2023-10-06 11:57:52 +01:00
Charis Kyriakou
20c63921f7 Wire up modeling panel empty states (#2915) 2023-10-06 11:27:16 +01:00
Koen Vlaswinkel
9c275130a5 Fix duplicate modeled methods
Co-authored-by: Robert <robertbrignull@github.com>
2023-10-06 12:09:00 +02:00
Henry Mercer
b1df4a4f0a Merge pull request #2916 from github/henrymercer/remove-ml-powered-queries
Packaging: Remove ML-powered queries pack from known list
2023-10-06 11:02:27 +01:00
Henry Mercer
08a4457e39 Packaging: Remove ML-powered queries pack from known list
ML-powered queries are [now deprecated](https://github.blog/changelog/2023-09-29-codeql-code-scanning-deprecates-ml-powered-alerts/).
2023-10-06 10:38:14 +01:00
Charis Kyriakou
db3d24236c Add empty states for modeling panel (#2914) 2023-10-06 09:34:54 +01:00
Robert
9d40d9a703 Remove method and modeledMethods from SaveModeledMethods message 2023-10-05 16:56:05 +01:00
Robert
0fabcda49b Convert RevealMethodMessage to only include method signature 2023-10-05 16:41:56 +01:00
Robert
2b0bd840e6 Place setup before initialising listener 2023-10-05 15:25:42 +01:00
Robert
d499ff3cf4 Merge branch 'main' into robertbrignull/telemetry 2023-10-05 15:19:07 +01:00
Charis Kyriakou
1806108166 Remove unnecessary TODOs (#2900) 2023-10-05 08:04:17 +00:00
Andrew Eisenberg
02af432d5f Merge pull request #2885 from github/aeisenberg/multi-token
Adds `MultiCancellationToken`
2023-10-04 13:33:46 -07:00
Andrew Eisenberg
76ec9e2e50 Make DisposableObject a concrete class 2023-10-04 20:10:42 +00:00
Robert
5ba64a1db3 Add test for when there's no modeled method 2023-10-04 18:46:17 +01:00
Robert
f87b1c46de Add some simple tests of rendering multiple models 2023-10-04 18:46:17 +01:00
Robert
8eef4eb4f2 Add story with multiple modelings 2023-10-04 18:46:17 +01:00
Robert
252c7a20c4 Convert MethodRow to display multiple modelings 2023-10-04 18:46:13 +01:00
Robert
86d7d8345c Convert ApiOrMethodCell to ApiOrMethodRow 2023-10-04 18:17:34 +01:00
Robert
a704cd7bae Convert getModelingStatus to take ModeledMethod[] 2023-10-04 18:17:34 +01:00
Robert
e75eccb416 Change MethodRow to accept ModelEditorViewState object instead of just Mode 2023-10-04 18:17:34 +01:00
Charis Kyriakou
17947fb7c2 Use base postMessage instead of webview one (#2909) 2023-10-04 17:23:49 +01:00
Charis Kyriakou
c00207cccc Move method modeling panel out of explorer (#2908) 2023-10-04 15:38:07 +01:00
Andrew Eisenberg
801df7b14a Merge branch 'main' into aeisenberg/multi-token 2023-10-04 07:09:21 -07:00
Koen Vlaswinkel
a6c7af09d4 Merge pull request #2907 from github/koesie10/eslint-memory
Increase memory limit when running ESLint
2023-10-04 15:11:26 +02:00
Koen Vlaswinkel
96668928aa Increase memory limit when running ESLint 2023-10-04 14:46:32 +02:00
Koen Vlaswinkel
a6c97077fb Merge pull request #2904 from github/koesie10/convert-yaml-modeled-methods
Convert `yaml.ts` to handle multiple models per method
2023-10-04 14:01:02 +02:00
Robert
6d7fbfc4f8 Merge pull request #2903 from github/robertbrignull/multiple-models-feature-flag
Add feature flag for showing multiple modelings
2023-10-04 12:55:42 +01:00
Koen Vlaswinkel
c5175e040e Convert modeled-method-fs.ts to handle multiple models per method
This will change the input/output types for modeled methods in the
`modeled-method-fs.ts` file to take in multiple models per method. This
removes the need for conversion functions between this file and
`yaml.ts` files. Instead, the conversion functions are done when calling
any functions defined in `modeled-method-fs.ts` files.
2023-10-04 13:47:30 +02:00
Anders Starcke Henriksen
55af9bc47c Merge pull request #2894 from github/starcke/lang-context-history
Add support for filtering history panel.
2023-10-04 13:38:38 +02:00
Koen Vlaswinkel
ada62ffd33 Convert yaml.ts to handle multiple models per method
This changes YAML parsing/creating functions for the model editor to
handle multiple models per method. The changes in the actual YAML
handling are fairly small because the format itself already supports
multiple models per method.

I've introduced a few helper functions to convert between the old and
new types. This should only be necessary while we're in the middle of
the transition to the new types and can be removed later. For now,
we'll just take the first model in the array when converting from the
new to the old type. This is a change in the behavior since currently
we always take the last model in the array but this behavior is
undocumented and unsupported, so it should be fine to change it.
2023-10-04 13:23:54 +02:00
Robert
e10e3adc14 Add feature flag for showing multiple modelings 2023-10-04 12:21:47 +01:00
Koen Vlaswinkel
16af4c49ea Merge pull request #2902 from github/koesie10/actions-nvmrc
Use .nvmrc file for setting up Node version in Actions
2023-10-04 11:36:22 +02:00
Koen Vlaswinkel
c970c3bc19 Use .nvmrc file for setting up Node version in Actions 2023-10-04 10:00:56 +02:00
Andrew Eisenberg
3699f0b3b3 Add BasicDisposableObject
Use it for `MultiCancellationToken`. And ensure that adding a
cancellation requested listener to the `MultiCancellationToken` will
forward any cancellation requests to all constituent tokens.
2023-10-03 21:42:00 +00:00
Andrew Eisenberg
ccbe4ee974 Merge branch 'main' into aeisenberg/multi-token 2023-10-03 07:52:54 -07:00
Anders Starcke Henriksen
486180d149 Fix and add tests. 2023-10-03 13:57:16 +02:00
Anders Starcke Henriksen
9362447338 Add support for filtering history panel. 2023-10-03 13:55:01 +02:00
Anders Starcke Henriksen
ff34079247 Merge pull request #2892 from github/starcke/local-query-lang-dto
Add language to local query history items
2023-10-03 13:53:32 +02:00
Koen Vlaswinkel
7cd99cb000 Merge pull request #2897 from github/dependabot/npm_and_yarn/extensions/ql-vscode/p-queue-7.4.1
Bump p-queue from 6.6.2 to 7.4.1 in /extensions/ql-vscode
2023-10-03 12:53:55 +02:00
Koen Vlaswinkel
21fd0cfd29 Transform p-queue and p-timeout modules in Jest tests 2023-10-03 11:52:51 +02:00
dependabot[bot]
db3337cc1b Bump p-queue from 6.6.2 to 7.4.1 in /extensions/ql-vscode
Bumps [p-queue](https://github.com/sindresorhus/p-queue) from 6.6.2 to 7.4.1.
- [Release notes](https://github.com/sindresorhus/p-queue/releases)
- [Commits](https://github.com/sindresorhus/p-queue/compare/v6.6.2...v7.4.1)

---
updated-dependencies:
- dependency-name: p-queue
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-03 09:29:01 +00:00
Koen Vlaswinkel
a525499c2a Merge pull request #2818 from github/dependabot/npm_and_yarn/extensions/ql-vscode/nanoid-5.0.1
Bump nanoid from 3.3.6 to 5.0.1 in /extensions/ql-vscode
2023-10-03 11:26:00 +02:00
Anders Starcke Henriksen
6d2859cee5 Fix typo. 2023-10-03 11:23:32 +02:00
Koen Vlaswinkel
ac9128735f Merge pull request #2896 from github/koesie10/reveal-in-editor
Add reveal in editor button to method modeling panel
2023-10-03 11:12:44 +02:00
Anders Starcke Henriksen
2c0838e393 Merge branch 'main' into starcke/local-query-lang-dto 2023-10-03 11:01:46 +02:00
Anders Starcke Henriksen
b294e16c44 Add to changelog. 2023-10-03 11:01:03 +02:00
Koen Vlaswinkel
f678f49bc9 Transform nanoid module in Jest tests 2023-10-03 10:48:08 +02:00
dependabot[bot]
99dabb0779 Bump nanoid from 3.3.6 to 5.0.1 in /extensions/ql-vscode
Bumps [nanoid](https://github.com/ai/nanoid) from 3.3.6 to 5.0.1.
- [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/3.3.6...5.0.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-03 08:13:33 +00:00
Koen Vlaswinkel
add7a25578 Merge pull request #2877 from github/robertbrignull/upgrade_msw
Upgrade MSW
2023-10-03 10:08:34 +02:00
Koen Vlaswinkel
487a753ede Reveal method in editor view
This will reveal a method for which "Review in editor" is clicked in the
model editor view: it will expand the group (library/package) in which
the method is located, scroll to the method, and highlight the method.

If the user clicks anywhere on the page, the highlight will be removed,
but the group will remain expanded.
2023-10-03 09:49:00 +02:00
Koen Vlaswinkel
79ea901a52 Send message to model editor view on revealing method
This will call a method on the correct model editor view when the user
clicks on "Review in editor". This does not yet do anything to the view;
this will be added in a follow-up commit.
2023-10-03 09:48:59 +02:00
Koen Vlaswinkel
2872a2dcaf Add model editor view tracker
This is used for registering which model editor views are currently
active. This will be used to determine which view to send the "reveal
method" command to. It can also be used in the future to limit the
number of instances of the model editor that can be opened for a
database.

This uses the same pattern as variant analyses with a separate interface
for the view to avoid having circular dependencies.
2023-10-03 09:48:17 +02:00
Koen Vlaswinkel
8b8bacb718 Add button for reveal method in editor 2023-10-03 09:47:52 +02:00
Koen Vlaswinkel
83e38c811f Update CHANGELOG 2023-10-03 09:36:59 +02:00
Koen Vlaswinkel
8107bf7cb1 Merge remote-tracking branch 'origin/main' into robertbrignull/upgrade_msw 2023-10-03 09:36:03 +02:00
Andrew Eisenberg
625b3a5c37 Merge branch 'main' into aeisenberg/multi-token 2023-10-02 20:07:31 -07:00
Andrew Eisenberg
0fa3cf5d8e Use EventEmitter in MultiCancellationToken 2023-10-02 10:21:17 -07:00
Charis Kyriakou
558b9329c5 Extract base functionality for WebviewViewProviders into an abstract class (#2895) 2023-10-02 16:31:52 +01:00
Koen Vlaswinkel
e15b7681db Bump @types/vscode to 1.82.0 2023-10-02 11:14:42 +02:00
Koen Vlaswinkel
6539417d2d Fix recording of binary response bodies 2023-10-02 11:13:18 +02:00
Koen Vlaswinkel
095d56ee37 Fix typo in BasicErrorResponse 2023-10-02 11:02:44 +02:00
Koen Vlaswinkel
7578697e92 Fix response bodies when recording 2023-10-02 11:02:20 +02:00
Anders Starcke Henriksen
6e06e7934b Merge pull request #2889 from github/starcke/lang-context-queries
Apply language context to queries panel
2023-10-02 10:27:00 +02:00
Charis Kyriakou
58249e3efe Dispose event subscriptions in method modeling view (#2882) 2023-10-02 08:57:33 +01:00
Andrew Eisenberg
75540b449f Merge pull request #2884 from github/aeisenberg/avoid-double-restart
Avoid double restarts of the query server
2023-09-29 11:04:37 -07:00
Andrew Eisenberg
04dfc4e647 Move location of multi-cancellation-token
This avoids a code-scanning warning.
2023-09-29 08:31:20 -07:00
Andrew Eisenberg
3ba1712be0 Update Changelog 2023-09-29 08:30:51 -07:00
Andrew Eisenberg
e8f68c1b5f Adds MultiCancellationToken
This is a cancellation token that cancels when any of its constituent
cancellation tokens are cancelled.

This token is used to fix a bug in Find Definitions. Previously, when
clicking `CTRL` (or `CMD` on macs) inside a source file in an archive
and hovering over a token, this will automatically invoke the
definitions finder (in preparation for navigating to the definition).
The only way to cancel is to move down to the message popup and click
cancel there.

However, this is a bug. What _should_ happen is that if a user moves
their mouse away from the token, the operation should cancel.

The underlying problem is that the extension was only listening to the
cancellation token from inside `getLocationsForUriString` the
cancellation token used by the Language Server protocol to cancel
operations in flight was being ignored.

This fix will ensure we are listening to _both_ cancellation tokens
and cancel the query if either are cancelled.
2023-09-29 08:28:35 -07:00
Andrew Eisenberg
a9edb36242 Merge branch 'main' into aeisenberg/avoid-double-restart 2023-09-29 08:26:53 -07:00
Koen Vlaswinkel
40b79f2e61 Improve scenario recording 2023-09-29 14:34:12 +02:00
Charis Kyriakou
3489c26ef6 Styling updates to method modeling panel (#2888) 2023-09-29 13:02:29 +01:00
Koen Vlaswinkel
6b522819fd Merge pull request #2893 from github/version/bump-to-v1.9.2
Bump version to v1.9.2
2023-09-29 13:20:59 +02:00
Koen Vlaswinkel
15b8d2bdb4 Merge pull request #2890 from github/koesie10/add-missing-feature-flag-to-test-plan
Add missing feature flag to test plan
2023-09-29 13:10:27 +02:00
github-actions[bot]
213a03555a Bump version to v1.9.2 2023-09-29 10:27:33 +00:00
Koen Vlaswinkel
0a9a9792ad Merge pull request #2891 from github/koesie10/dispose-webview
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
Dispose tracked objects when panel is disposed
2023-09-29 12:19:56 +02:00
Anders Starcke Henriksen
c4fe868826 Add a way to show language for qury history. 2023-09-29 12:15:55 +02:00
Koen Vlaswinkel
4cf67ef799 Fix disposing in ResultsView 2023-09-29 12:00:26 +02:00
Anders Starcke Henriksen
c43d0fa805 Add language to local queries. 2023-09-29 11:54:45 +02:00
Koen Vlaswinkel
0a27c0538d Dispose tracked objects when panel is disposed
This will change the `AbstractWebview` to dispose its tracked objects
(using `this.push`) when the panel is disposed rather than when the
view is disposed. This makes `this.push` actually useful in a view.
Before, the objects would only get disposed when the extension itself
was disposed.
2023-09-29 11:34:59 +02:00
Koen Vlaswinkel
e798663bbb Add missing feature flag to test plan 2023-09-29 11:12:04 +02:00
Anders Starcke Henriksen
169a425e0b Update and add tests. 2023-09-29 11:07:06 +02:00
Koen Vlaswinkel
66fdabf4c8 Merge pull request #2887 from github/v1.9.1
Release v1.9.1
2023-09-29 10:30:40 +02:00
Koen Vlaswinkel
f249b36660 v1.9.1 2023-09-29 10:05:43 +02:00
Anders Starcke Henriksen
1e6b7a6619 Add support for filtering queries panel. 2023-09-29 09:28:44 +02:00
Anders Starcke Henriksen
552a4f6eb3 Merge pull request #2873 from github/starcke/language-context-store
Add language context store.
2023-09-29 09:24:31 +02:00
Andrew Eisenberg
2b17979b6c Update changelog 2023-09-28 14:29:40 -07:00
Andrew Eisenberg
3999ae3728 Avoid double restarts of the query server
Previously, if there was an explicit restart of the query server (eg-
by changing a configuration setting), then the query server process
would be started twice: once by the `close` handler and once by the
restart command.

By adding the `removeAllListeners` to the dispose method, we ensure that
when the query server shuts down gracefully, there won't be a `close`
listener that is going to restart it a second time if there is a
different way of restarting it.
2023-09-28 14:25:35 -07:00
Shati Patel
493e8d915e Hide the language filter behind an extra flag (#2881) 2023-09-28 14:47:25 +00:00
Anders Starcke Henriksen
dc632d5c3d Change to use QueryLanguage | undefined. 2023-09-28 16:43:33 +02:00
Koen Vlaswinkel
ae2d6ce16e Upgrade Node version to 18.15.0 2023-09-28 16:38:54 +02:00
Charis Kyriakou
27a7474f2b Add modeling indicator to method usages panel (#2876) 2023-09-28 15:33:46 +01:00
Koen Vlaswinkel
8b1c52886a Fix typing error for Octokit 2023-09-28 16:09:16 +02:00
Koen Vlaswinkel
f9ddb4080c Switch to stable VS Code version for tests 2023-09-28 16:07:34 +02:00
Koen Vlaswinkel
3afa15a0ce Remove redundant query params 2023-09-28 16:07:05 +02:00
Koen Vlaswinkel
f22714777c Use AppOctokit in tests 2023-09-28 16:06:34 +02:00
Koen Vlaswinkel
469f65a392 Merge pull request #2854 from github/koesie10/bump-min-version
Bump minimum VS Code version to 1.82
2023-09-28 16:04:57 +02:00
Koen Vlaswinkel
9b10a09727 Fix MSW JSON responses 2023-09-28 14:32:33 +02:00
Koen Vlaswinkel
3c10e87529 Switch Octokit to use node-fetch
It seems like Node's native `fetch` implementation isn't quite working
right with Octokit and MSW. This switches to using `node-fetch` like
we're already doing for all other requests (e.g. downloading databases).
2023-09-28 14:32:32 +02:00
Koen Vlaswinkel
a1ea1f8135 Upgrade Octokit and MSW 2023-09-28 14:32:16 +02:00
Robert
ffc90a0c30 Remove startServer method as it now does nothing 2023-09-28 14:32:15 +02:00
Robert
e34f4ed485 Only start server when loading a scenario 2023-09-28 14:32:15 +02:00
Robert
7c1b6e2ff6 Use new types 2023-09-28 14:32:15 +02:00
Robert
e719df711a Upgrade msw to the @next tag 2023-09-28 14:32:15 +02:00
Anders Starcke Henriksen
6accba66fe Rename state to languageFilter. 2023-09-28 14:28:31 +02:00
Anders Starcke Henriksen
a657df4468 Move context manipulation into store and fix initial state. 2023-09-28 14:19:07 +02:00
Koen Vlaswinkel
6aab4b4090 Merge pull request #2875 from github/koesie10/update-csharp-query
Update model editor C# query to return method parameters with parentheses
2023-09-28 14:10:50 +02:00
Anders Starcke Henriksen
c7e5922bd5 Merge branch 'main' into starcke/language-context-store 2023-09-28 14:08:26 +02:00
Anders Starcke Henriksen
bb25874299 Remove TODO. 2023-09-28 14:05:31 +02:00
Shati Patel
d5c78fd67b Indicate which language is selected in the databases view (#2871) 2023-09-28 12:30:11 +02:00
Koen Vlaswinkel
6c5f160eee Update model editor C# query to return method parameters with parentheses 2023-09-28 12:17:06 +02:00
Nora
ecbc458106 Merge pull request #2802 from github/nora/minor-integration-test-improvement
Minor test updates for `db-panel.test`
2023-09-28 12:16:54 +02:00
Koen Vlaswinkel
93652fc75f Merge pull request #2872 from github/koesie10/resolve-queries-from-ql
Resolve model editor queries from CodeQL packs if present
2023-09-28 12:14:41 +02:00
Nora
859eca0195 Merge pull request #2812 from github/nora/remove-rate-limit-code-search
Code Search: don't show rate limit warnings to users
2023-09-28 11:57:15 +02:00
Koen Vlaswinkel
905eaf66aa Implement PR feedback 2023-09-28 11:27:42 +02:00
Nora
7af8b7a274 Use BaseLogger instead of ExtLogger 2023-09-28 08:50:35 +00:00
Nora
a6b6b5a7d6 Show rate limit messages in extension output 2023-09-28 08:24:58 +00:00
Nora
9aff9891d3 Fix comment 2023-09-28 08:18:44 +00:00
Nora
681a15ce45 Extract dbConfigFilePath 2023-09-28 08:17:38 +00:00
Nora
f82b51f7c5 Add comment 2023-09-28 08:17:38 +00:00
Nora
5b7124683a Replace void with await 2023-09-28 08:17:38 +00:00
Charis Kyriakou
031b5076db Update modeling panel when clicking 'view' on model editor (#2874) 2023-09-27 16:59:39 +01:00
Dave Bartolomeo
f1533dde2d Merge pull request #2858 from github/dbartol/long-strings
Use streaming when creating log symbols file.
2023-09-27 09:55:25 -04:00
Koen Vlaswinkel
e9b67dd90c Resolve model editor queries from ql if present 2023-09-27 15:32:01 +02:00
Anders Starcke Henriksen
7bfe0df901 Add language context store. 2023-09-27 15:28:11 +02:00
Koen Vlaswinkel
b1debee244 Merge pull request #2868 from github/koesie10/new-model-editor-queries
Update model editor queries
2023-09-27 12:03:48 +02:00
Charis Kyriakou
3b00d74f47 Hook method modeling view to modeling store (#2870) 2023-09-27 09:57:27 +00:00
Koen Vlaswinkel
4efd3f8fe8 Merge pull request #2865 from github/github-action/bump-cli
Bump CLI Version to v2.14.6 for integration tests
2023-09-27 11:23:40 +02:00
Koen Vlaswinkel
95c512e3e8 Fix compilation errors when using submodule with updated queries 2023-09-27 11:20:57 +02:00
Koen Vlaswinkel
7501f9b81e Merge pull request #2864 from github/koesie10/right-align-format-numbers
Right align and format raw result numbers
2023-09-27 11:03:12 +02:00
Charis Kyriakou
a98b998e5f Add selected method and usage state to modeling store (#2869) 2023-09-27 08:15:51 +01:00
Koen Vlaswinkel
e03d106bc2 Update model editor queries
This updates the model editor queries to the version that will be merged
into the CodeQL repository. There are some slight changes to the output
format, so we slightly need to change the BQRS decoding of those
queries.

The queries themselves were copied from the two PRs with some minor
additions at the end since these were changes in core CodeQL library
files.
2023-09-27 09:05:15 +02:00
Dave Bartolomeo
3c63df2221 Unit tests for SplitBuffer 2023-09-26 17:54:47 -04:00
Charis Kyriakou
c6996771ab Add unsaved tag on method modeling panel (#2867) 2023-09-26 20:17:16 +01:00
Koen Vlaswinkel
e475036721 Right align and format raw result numbers
This changes the formatting for both the local raw results table and the
variant analysis raw results table to right align and format numbers.
2023-09-26 16:18:42 +02:00
Charis Kyriakou
42192fa922 Move modeling status code to its own module (#2866)
* Move ModelingStatus to its own file

* Move getModelingStatus to modeling status module
2023-09-26 13:52:04 +00:00
Koen Vlaswinkel
947084d792 Merge pull request #2863 from github/koesie10/refactor-raw-results-table
Split out components in variant analysis raw results table
2023-09-26 15:41:47 +02:00
Charis Kyriakou
6c1cd71743 Move modeled and modified method state to store (#2861) 2023-09-26 14:23:12 +01:00
github-actions[bot]
c4b890597d Bump CLI version from v2.14.5 to v2.14.6 for integration tests 2023-09-26 13:19:05 +00:00
Charis Kyriakou
93251f8d57 Make MethodModelingViewProvider a disposable object (#2862) 2023-09-26 13:53:23 +01:00
Koen Vlaswinkel
452329b07a Extract RawResultRow to separate file 2023-09-26 14:46:42 +02:00
Koen Vlaswinkel
1afee02e78 Extract RawResultCell to separate file 2023-09-26 14:46:39 +02:00
Koen Vlaswinkel
cbb1de4faf Merge pull request #2847 from github/dependabot/npm_and_yarn/extensions/ql-vscode/types/js-yaml-4.0.6
Bump @types/js-yaml from 3.12.5 to 4.0.6 in /extensions/ql-vscode
2023-09-26 12:41:11 +02:00
Charis Kyriakou
9e92c6c304 Merge pull request #2857 from github/charisk/initial-modeling-store
Introduce modeling store and move some state there
2023-09-26 11:36:46 +01:00
Koen Vlaswinkel
7864844ddd Fix missing string type on dataExtensions 2023-09-26 11:58:33 +02:00
Charis Kyriakou
c77a300f24 Move methods, hideModeledMethods and active editor state to the modeling store 2023-09-26 09:52:59 +00:00
Koen Vlaswinkel
f5fbd7f4cc Switch tests to new types 2023-09-26 11:32:25 +02:00
Koen Vlaswinkel
405292ecd4 Introduce type for QlPackFile 2023-09-26 11:29:19 +02:00
Shati Patel
3be7eb9e15 Add ability to filter DB view by language (#2856) 2023-09-26 09:20:40 +00:00
Dave Bartolomeo
c972a5c0de Use streaming when creating log symbols file. 2023-09-25 14:24:10 -04:00
Koen Vlaswinkel
5ae67fecda Do not export unused types 2023-09-25 15:54:26 +02:00
Charis Kyriakou
d33c26798d Introduce modeling store 2023-09-25 13:42:57 +00:00
Koen Vlaswinkel
9392fb75c8 Format generated schema files with Prettier 2023-09-25 15:35:02 +02:00
Koen Vlaswinkel
e0509f684b Merge pull request #2845 from github/dependabot/npm_and_yarn/extensions/ql-vscode/zip-a-folder-3.1.2
Bump zip-a-folder from 2.0.0 to 3.1.2 in /extensions/ql-vscode
2023-09-25 15:26:01 +02:00
Koen Vlaswinkel
c55e87c64b Generate schema for extension pack file 2023-09-25 15:25:40 +02:00
Koen Vlaswinkel
bc01d73ba5 Fix some type errors in tests 2023-09-25 15:25:39 +02:00
Koen Vlaswinkel
db55e9cd42 Generate schema for extension pack metadata
After the upgrade to the correct types for js-yaml, the return type
of `load` is correctly typed as `unknown`. This means that we can't
use the return value directly, but need to validate it first.

This adds such validation by generating a JSON schema for a newly
created typed. The JSON schema generation is very similar to how we do
it in https://github.com/github/codeql-variant-analysis-action.
2023-09-25 15:25:37 +02:00
Charis Kyriakou
19890b8591 Merge pull request #2855 from github/charisk/tidy-castings
Don't use 'as any' when checking open view
2023-09-25 13:52:14 +01:00
Shati Patel
df1c12f2ba Rearrange DB panel UI commands (#2853) 2023-09-25 14:10:34 +02:00
Charis Kyriakou
bd67afe799 Extract logic into reusable function 2023-09-25 10:08:52 +00:00
Koen Vlaswinkel
7a2876faad Bump zip-a-folder to v3.1.3
This fixes an issue with TypeScript declarations.

See: https://redirect.github.com/maugenst/zip-a-folder/issues/48
2023-09-25 12:07:01 +02:00
Charis Kyriakou
4c9ce2d537 Don't use 'as any' when checking open view 2023-09-25 09:48:57 +00:00
Charis Kyriakou
868ffd79a5 Hide modeling panel when modeling editor is active (#2851) 2023-09-25 10:39:43 +01:00
Koen Vlaswinkel
eb3900f642 Bump minimum VS Code version for warnings 2023-09-25 11:38:39 +02:00
Charis Kyriakou
3934ba7e69 Remove redundant argument from onChange (#2852) 2023-09-25 09:41:36 +01:00
Charis Kyriakou
3e259f14c9 Add modeling inputs to method modeling panel (#2849) 2023-09-22 15:13:40 +00:00
Charis Kyriakou
4323aad254 Fix MethodRow stories to not all show as modeled (#2850) 2023-09-22 11:38:36 +00:00
Charis Kyriakou
cd7c26f2ff Merge pull request #2848 from github/dependabot/npm_and_yarn/extensions/ql-vscode/graphql-16.8.1
Bump graphql from 16.6.0 to 16.8.1 in /extensions/ql-vscode
2023-09-22 11:43:04 +01:00
dependabot[bot]
6e9280b97e Bump graphql from 16.6.0 to 16.8.1 in /extensions/ql-vscode
Bumps [graphql](https://github.com/graphql/graphql-js) from 16.6.0 to 16.8.1.
- [Release notes](https://github.com/graphql/graphql-js/releases)
- [Commits](https://github.com/graphql/graphql-js/compare/v16.6.0...v16.8.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-21 17:49:46 +00:00
dependabot[bot]
e43adb6424 Bump @types/js-yaml from 3.12.5 to 4.0.6 in /extensions/ql-vscode
Bumps [@types/js-yaml](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/js-yaml) from 3.12.5 to 4.0.6.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/js-yaml)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-21 13:06:11 +00:00
dependabot[bot]
54435d78cf Bump zip-a-folder from 2.0.0 to 3.1.2 in /extensions/ql-vscode
Bumps [zip-a-folder](https://github.com/maugenst/zip-a-folder) from 2.0.0 to 3.1.2.
- [Commits](https://github.com/maugenst/zip-a-folder/commits)

---
updated-dependencies:
- dependency-name: zip-a-folder
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-21 13:04:12 +00:00
Charis Kyriakou
3a1431ca31 Merge pull request #2843 from github/charisk/model-kind-dropdown
Update KindInput component to bring it inline with others
2023-09-21 08:24:54 +01:00
Charis Kyriakou
73f161cdac Clean up model editor onChange callback (#2844) 2023-09-21 08:16:11 +01:00
Robert
ef008a1659 Merge pull request #2840 from github/robertbrignull/node-version
Add docs about the Node.js version
2023-09-20 17:27:18 +01:00
Charis Kyriakou
dc33784dbc Update ModelKindDropdown to be more self-contained 2023-09-20 14:59:11 +00:00
Charis Kyriakou
c4396b764c Rename KindInput to ModelKindDropdown 2023-09-20 14:59:10 +00:00
Charis Kyriakou
4e096400db Extract model output dropdown to its own component (#2839) 2023-09-20 15:58:24 +01:00
Robert
f99177ac21 Merge pull request #2842 from github/robertbrignull/revert-node18
Switch back to Node.js version 16
2023-09-20 14:41:04 +01:00
Robert
f95bf6889b Revert "Disable unit tests using MockGitHubApiServer"
This reverts commit 26450e9236.
2023-09-20 13:48:21 +01:00
Robert
ed48f4ac76 Revert "Change node version to 18.15.0"
This reverts commit 8136328ad6.
2023-09-20 13:48:12 +01:00
Charis Kyriakou
d2f4f33bea Extract type for modeled method kind (#2835) 2023-09-20 13:36:41 +01:00
Robert
a68d5df13b Apply suggestions from code review 2023-09-20 12:25:30 +01:00
Robert
495f632ae2 Update node-version.md 2023-09-20 11:57:16 +01:00
Robert
929f54333b Create vscode-version.md 2023-09-20 11:55:13 +01:00
Charis Kyriakou
4f1a92d09c Extract model input dropdown to its own component (#2837) 2023-09-20 11:25:26 +01:00
Robert
91866971dd Update node-version.md 2023-09-20 11:17:14 +01:00
Robert
9b15b35274 Add files via upload 2023-09-20 11:15:55 +01:00
Robert
b3544b461a Update releasing.md 2023-09-20 11:15:35 +01:00
Robert
53fccdfb2e Create node-version.md 2023-09-20 11:14:06 +01:00
Charis Kyriakou
606bfd7f87 Remove unnecessary spread of modeled method (#2836) 2023-09-20 10:56:47 +01:00
Charis Kyriakou
7d088b749b Update import to fix build (#2838) 2023-09-20 09:53:44 +00:00
Charis Kyriakou
315021ef35 Minor redesign of method modeling title (#2832) 2023-09-20 10:10:40 +01:00
Charis Kyriakou
1dc70fe625 Extract model type dropdown to its own component (#2833) 2023-09-20 10:02:12 +01:00
Charis Kyriakou
36f6531fc4 Move method factories to factories/model-editor (#2834) 2023-09-20 08:55:02 +00:00
Robert
4227ff6338 Mock env.itTelemetryEnable 2023-09-19 17:24:53 +01:00
Robert
ca96cdf879 Mock sendTelemetryErrorEvent and check appropriately 2023-09-19 17:23:47 +01:00
Robert
aad1fee787 Stop mocking sendTelemetryException because we don't use that anywhere in the program 2023-09-19 17:18:38 +01:00
Koen Vlaswinkel
fc735cb83b Merge pull request #2829 from github/koesie10/fix-return-value
Fix incorrect `ReturnType` instead of `ReturnValue`
2023-09-19 17:52:20 +02:00
Robert
48399a9aeb Merge branch 'main' into robertbrignull/telemetry 2023-09-19 16:40:07 +01:00
Robert
c514575bc8 Merge pull request #2831 from github/version/bump-to-v1.9.1
Bump version to v1.9.1
2023-09-19 15:22:21 +01:00
Charis Kyriakou
651bc51ed6 Only download automodel query pack when relevant (#2830) 2023-09-19 15:11:15 +01:00
github-actions[bot]
dea6426c0b Bump version to v1.9.1 2023-09-19 13:49:34 +00:00
Koen Vlaswinkel
96a8bea50a Fix incorrect ReturnType instead of ReturnValue 2023-09-19 15:29:45 +02:00
Robert
297260af88 Merge pull request #2828 from github/v1.9.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
Release v1.9.0
2023-09-19 13:43:40 +01:00
Robert
26450e9236 Disable unit tests using MockGitHubApiServer 2023-09-19 11:37:25 +01:00
Robert
8d74933c70 v1.9.0 2023-09-19 10:13:20 +01:00
Robert
8136328ad6 Change node version to 18.15.0 2023-09-19 10:11:55 +01:00
Robert
d3df14f860 Merge pull request #2827 from github/robertbrignull/any/stderr
Avoid use of "as any" during error handling
2023-09-19 09:52:51 +01:00
Robert
31e233cc59 Add getChildProcessErrorMessage 2023-09-18 16:34:20 +01:00
Robert
23641a01d9 Avoid checking err.stderr when it's not necessary 2023-09-18 16:33:54 +01:00
Robert
209edf86e7 Merge pull request #2825 from github/robertbrignull/any/preview.ts
Avoid using "as any" in .storybook/preview.ts
2023-09-18 16:32:42 +01:00
Robert
3d410c9ce2 Merge pull request #2826 from github/robertbrignull/any/deploy.ts
Avoid use of "as any" in gulpfile.ts/deploy.ts
2023-09-18 16:27:28 +01:00
Robert
ef38ffaa6d Move resolution of package.json path to inside deployPackage 2023-09-18 15:49:06 +01:00
Robert
f195e93d91 Import type of package.json 2023-09-18 15:47:37 +01:00
Robert
26c301603d Include .storybook in deadcode detection 2023-09-18 15:36:56 +01:00
Robert
b9367095cf Avoid use of "as any" in gulpfile.ts/deploy.ts 2023-09-18 15:26:18 +01:00
Robert
3d415d2852 Avoid using "as any" in preview.ts 2023-09-18 15:14:28 +01:00
Robert
177c770f4d Delete config values that we on longer read directly 2023-09-18 11:15:34 +01:00
Robert
d4033615c8 Use onDidChangeTelemetryEnabled instead of listening for config value changes 2023-09-18 11:14:11 +01:00
Robert
9ec6590548 Use env.isTelemetryEnabled instead of checking configuration values ourselves 2023-09-18 11:14:11 +01:00
Robert
5fc9a73e20 Add telemtry tag to settings 2023-09-18 11:14:11 +01:00
Robert
af5547fb77 Use correct values of telemtetry level 2023-09-18 11:14:03 +01:00
Robert
1b0f0f4566 Merge pull request #2823 from github/robertbrignull/model-editor-changelog
Add changelog entry for model editor
2023-09-18 09:56:45 +01:00
Robert
1c81eb1b07 Merge pull request #2822 from github/robertbrignull/model-editor-feature-flag
Remove codeQL.model.editor feature flag
2023-09-18 09:56:32 +01:00
Robert
a506276635 Update custom telemetry setting description 2023-09-15 16:14:34 +01:00
Robert
f3e72a0ab8 Delete unused relevantSettings field 2023-09-15 16:04:58 +01:00
Robert
c7a9337ac0 Use .qualifiedName instead of writing out manually 2023-09-15 16:04:58 +01:00
Robert
c7bd343f54 Use sendTelemetryErrorEvent when sending errors 2023-09-15 16:04:58 +01:00
Robert
9c76ba35f1 Check both telemetry.telemetryLevel and telemetry.enableTelemetry 2023-09-15 16:04:13 +01:00
Robert
90093fb9f5 Rearrange settings so the telemetry settings are clearer 2023-09-15 15:01:32 +01:00
Robert
f183703b34 Add link to PR 2023-09-15 14:20:35 +01:00
Robert
49a3b534ae Add changelog entry for model editor 2023-09-15 14:19:38 +01:00
Koen Vlaswinkel
d83ca35f0c Merge pull request #2817 from github/koesie10/model-editor-row-tests
Add tests for model editor row and grid components
2023-09-15 14:04:53 +02:00
Koen Vlaswinkel
8bc8ffe1a1 Merge pull request #2820 from github/koesie10/cleanup-temp-directories
Cleanup temporary directories in model editor
2023-09-15 14:04:42 +02:00
Robert
ea2454742c Remove codeQL.model.editor feature flag 2023-09-15 12:22:22 +01:00
Koen Vlaswinkel
d970b51a7c Merge pull request #2814 from github/koesie10/test-model-editor-view
Add simple test for ModelEditorView
2023-09-15 13:19:13 +02:00
Koen Vlaswinkel
69f5d2c134 Cleanup model editor query dir after use 2023-09-15 11:59:11 +02:00
Koen Vlaswinkel
4d4a72bddb Cleanup automodel temporary pack after use 2023-09-15 11:59:11 +02:00
Koen Vlaswinkel
ac9355edd1 Rename restoreView test and add comment 2023-09-15 11:26:25 +02:00
Koen Vlaswinkel
2a9c8ef9dd Merge pull request #2816 from github/koesie10/simple-model-editor-react-tests
Add some simple model editor React unit tests
2023-09-15 11:22:37 +02:00
Koen Vlaswinkel
48f0b92d67 Merge pull request #2819 from github/github-action/bump-cli
Bump CLI Version to v2.14.5 for integration tests
2023-09-15 10:16:46 +02:00
Koen Vlaswinkel
57dcf58518 Merge pull request #2813 from github/koesie10/use-app-in-webview
Use `App` instead of `ExtensionContext` for webviews
2023-09-15 10:12:34 +02:00
github-actions[bot]
43efc9cc4c Bump CLI version from v2.14.4 to v2.14.5 for integration tests 2023-09-14 15:17:49 +00:00
Koen Vlaswinkel
17e0291bb5 Add tests for MethodRow 2023-09-14 14:41:03 +02:00
Koen Vlaswinkel
499060d549 Add tests for ModeledMethodDataGrid 2023-09-14 14:24:24 +02:00
Koen Vlaswinkel
a359fd7054 Add tests for ModeledMethodsList 2023-09-14 14:11:40 +02:00
Koen Vlaswinkel
d3a9426411 Add story and tests for LibraryRow 2023-09-14 14:06:36 +02:00
Koen Vlaswinkel
72faf86678 Add some simple model editor React unit tests 2023-09-14 13:45:45 +02:00
Koen Vlaswinkel
7f20921984 Add simple test for ModelEditorView 2023-09-14 12:20:01 +02:00
Koen Vlaswinkel
d7565fb849 Use App instead of ExtensionContext for webviews 2023-09-14 12:03:18 +02:00
Robert
9175449323 Merge pull request #2811 from github/robertbrignull/fix-jump-to-usage
Fix jumping to usage and updating method modeling panel
2023-09-13 13:07:24 +01:00
Robert
c8487c9431 Fix jumping to usage and updating method modeling panel 2023-09-13 12:41:53 +01:00
Robert
93fc90fcd0 Merge pull request #2790 from github/dependabot/github_actions/actions/checkout-4
Bump actions/checkout from 3 to 4
2023-09-12 16:53:57 +01:00
Robert
0a705a6bfa Merge pull request #2808 from github/robertbrignull/rename_hideModeledMethods_code
Rename hideModeledApis => hideModeledMethods throughout the code
2023-09-12 16:48:46 +01:00
Robert
b424157ab0 Merge pull request #2806 from github/robertbrignull/rename_externalApiUsages
Renames remaining references to "external API usage" in the code
2023-09-12 16:45:51 +01:00
github-actions[bot]
8c13124dfd Bump CLI version from v2.14.3 to v2.14.4 for integration tests (#2809)
Co-authored-by: github-actions[bot] <github-actions@github.com>
2023-09-12 15:13:34 +00:00
Robert
cbf0f279b9 Update extensions/ql-vscode/src/model-editor/model-editor-view.ts 2023-09-12 15:53:24 +01:00
Robert
a5b22fd0b9 Update extensions/ql-vscode/test/unit-tests/model-editor/bqrs.test.ts 2023-09-12 15:50:48 +01:00
Robert
c6736e8576 Merge pull request #2807 from github/robertbrignull/rename_hideModeledMethods_checkbox
Rename checkbox for hide modeled APIs => methods
2023-09-12 15:47:45 +01:00
Nick Rolfe
acf7270e39 Relax 'resolve ram' test (#2805) 2023-09-12 14:35:42 +01:00
Robert
3ae55e92b8 Rename hideModeledApis => hideModeledMethods throughout 2023-09-12 14:30:22 +01:00
Robert
c3fa83f301 Rename checkbox for hide modeled APIs => methods 2023-09-12 14:18:28 +01:00
Robert
9018cac91a Rename decodeBqrsToExternalApiUsages => decodeBqrsToMethods 2023-09-12 14:02:23 +01:00
Robert
aec742a508 Rename loadExternalApiUsages => loadMethods 2023-09-12 13:59:29 +01:00
Robert
64f6a770c3 Merge pull request #2800 from github/robertbrignull/num-hidden-methods
Add a row to the model editor tables showing how many methods have been hidden
2023-09-12 11:38:48 +01:00
Koen Vlaswinkel
7a2b61432c Merge pull request #2804 from github/koesie10/source-archive-model-editor
Do not add source archive folder for "Model dependency"
2023-09-12 12:10:58 +02:00
Robert
b04ecc959a Use pluralize 2023-09-12 10:18:26 +01:00
Robert
3ee16f88f2 Pull out props to separate variables instead of referencing props.foo 2023-09-12 10:14:10 +01:00
github-actions[bot]
ca079e085d Bump version to v1.8.13 (#2803)
Co-authored-by: github-actions[bot] <github-actions@github.com>
2023-09-11 14:52:33 +00:00
Koen Vlaswinkel
c93dd7a25b Do not add source archive folder for "Model dependency" 2023-09-11 15:45:46 +02:00
Shati Patel
9925b4e3bc v1.8.12 (#2801)
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
2023-09-11 14:02:23 +01:00
Koen Vlaswinkel
27f46062ae Merge pull request #2799 from github/koesie10/upgrade-semver
Upgrade transitive semver dependencies
2023-09-11 13:08:48 +02:00
Robert
e379320015 Add row showing how many methods are hidden 2023-09-11 11:57:18 +01:00
Robert
bbacb147d2 Hide table entirely if there aren't any non-hidden methods 2023-09-11 11:56:33 +01:00
Robert
58d38ff867 Move calculation of hidden/modelable rows into ModeledMethodDataGrid 2023-09-11 11:52:37 +01:00
Koen Vlaswinkel
90972defed Upgrade transitive semver dependencies 2023-09-11 10:51:07 +02:00
Andrew Eisenberg
3a8028cb6f Merge pull request #2786 from github/aeisenberg/extensible-predicate-metadata
Copy more files into the synthetic variant analysis pack
2023-09-08 09:38:49 -07:00
Koen Vlaswinkel
6e802b1212 Merge pull request #2798 from github/koesie10/group-framework-mode-models
Group framework mode model files by package
2023-09-08 17:17:53 +02:00
Koen Vlaswinkel
c868bdcdec Merge pull request #2797 from github/koesie10/sort-methods-alphabetically
Sort methods alphabetically
2023-09-08 16:54:52 +02:00
Koen Vlaswinkel
b1412912ec Merge pull request #2795 from github/koesie10/switch-mode-loading
Set loading state when switching between modes
2023-09-08 16:54:27 +02:00
Koen Vlaswinkel
708c5bc3ef Group framework mode model files by package 2023-09-08 16:08:13 +02:00
Koen Vlaswinkel
6f020d4b33 Sort methods alphabetically 2023-09-08 14:41:19 +02:00
Anders Starcke Henriksen
1b7a68a43e Merge pull request #2791 from github/starcke/model-editor-test-plan
Test plan for model editor.
2023-09-08 14:38:01 +02:00
Shati Patel
8f7befd031 Make "databases" the top panel in the CodeQL sidebar (#2796) 2023-09-08 12:23:01 +00:00
Koen Vlaswinkel
3157ffab88 Set empty array in ModelEditorView 2023-09-08 14:20:45 +02:00
Koen Vlaswinkel
bf024943a8 Merge pull request #2794 from github/koesie10/improve-model-editor
Improve responsiveness of model editor
2023-09-08 13:40:29 +02:00
Koen Vlaswinkel
b0eab8b9fe Set loading state when switching between modes 2023-09-08 13:34:08 +02:00
Koen Vlaswinkel
72ab83f15b Remove createLockFile argument 2023-09-08 12:56:02 +02:00
Koen Vlaswinkel
567cb10a57 Merge pull request #2793 from github/koesie10/feature-flag-flow-generation
Add feature flag for flow generation
2023-09-08 12:48:59 +02:00
Koen Vlaswinkel
13c2f5979e Add feature flag for flow generation 2023-09-08 12:07:27 +02:00
Koen Vlaswinkel
cecd8033bb Improve responsiveness of model editor 2023-09-08 12:06:26 +02:00
Anders Starcke Henriksen
35dfebd353 Fix linter. 2023-09-08 10:28:56 +02:00
Anders Starcke Henriksen
6e50d4af7b Address feedback. 2023-09-08 10:20:15 +02:00
Anders Starcke Henriksen
f8a90e5fba Update docs/test-plan.md
Co-authored-by: Koen Vlaswinkel <koesie10@users.noreply.github.com>
2023-09-08 10:01:02 +02:00
Robert
45312865b1 Merge pull request #2782 from github/robertbrignull/calculateModeledPercentage
Change calculateModeledPercentage to accept Method instead of using Pick
2023-09-07 16:51:53 +01:00
Robert
0897cdd96d Merge branch 'main' into dependabot/github_actions/actions/checkout-4 2023-09-07 16:37:03 +01:00
Robert
2e45dcd7b9 Merge pull request #2777 from github/robertbrignull/model-remove-disableAutoNameExtensionPack
Remove the disableAutoNameExtensionPack feature flag
2023-09-07 16:35:59 +01:00
Robert
4b93d341fe Merge pull request #2784 from github/robertbrignull/saving-progress
Make progress notifications more useful when calling loadExternalApiUsages
2023-09-07 16:35:28 +01:00
Robert
5922bdf0e0 Merge pull request #2785 from github/robertbrignull/in-progress-dropdown
Adjust styling of disabled dropdowns when automodeling is in progress
2023-09-07 16:31:15 +01:00
dependabot[bot]
709c49542e Bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-07 13:19:53 +00:00
Anders Starcke Henriksen
860507dfa5 Merge pull request #2789 from github/version/bump-to-v1.8.12
Bump version to v1.8.12
2023-09-07 15:16:15 +02:00
github-actions[bot]
3a07e143de Bump version to v1.8.12 2023-09-07 12:40:41 +00:00
Anders Starcke Henriksen
baf959efa9 Test plan for model editor. 2023-09-07 14:35:17 +02:00
Anders Starcke Henriksen
df5a7bce19 Merge pull request #2788 from github/v1.8.11
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
v1.8.11
2023-09-07 13:51:35 +02:00
Anders Starcke Henriksen
1b3dc7d132 v1.8.11 2023-09-07 13:31:03 +02:00
Andrew Eisenberg
d8fb227cc7 Fix failing test 2023-09-05 14:49:36 -07:00
Andrew Eisenberg
767051e43f Update changelog 2023-09-05 13:31:18 -07:00
Andrew Eisenberg
d264bca304 Copy more files into the synthetic variant analysis pack
Before this change and starting with CLI v2.14.3, if you wanted to run
a variant analysis query and the pack it is contained in has at least
one query that contains an extensible predicate, this would be an error.

The reason is that v2.14.3 introduced deep validation for data
extensions. We are not copying the query that contains an extensible
predicate to the synthetic pack we are generating. This means that deep
validation will fail because there will be extensions that target the
missing extensible predicate.

This change avoids the problem by copying any query files that contain
extensible predicates to the synthetic pack. It uses the internal
`generate extensible-predicate-metadata` command to discover which
query files contain extensible predicates and copies them.
2023-09-05 13:28:53 -07:00
Robert
a2f1710aa5 Add story for when modeling is in progress 2023-09-05 16:58:10 +01:00
Robert
fd1c7f338d Make onChange optional 2023-09-05 16:58:10 +01:00
Robert
040a91a6d7 Use custom disabled placeholder text for InProgressDropdown 2023-09-05 16:58:10 +01:00
Robert
1e2acb0acb Clarify progress message from loadExternalApiUsages 2023-09-05 16:53:01 +01:00
Robert
2171ec1a03 Include cliServer.resolveQlpacks in the progress notification so there isn't a gap with no updates 2023-09-05 16:48:25 +01:00
Robert
8407516b31 Move progress notification to cover entire saveModeledMethods message handler 2023-09-05 16:45:50 +01:00
Robert
899cfb058c Store externalApiQueriesProgressMaxStep as a constant 2023-09-05 16:43:31 +01:00
Robert
95e4b04471 Move custom progress editing from loadExternalApiUsages into runExternalApiQueries 2023-09-05 16:43:03 +01:00
Robert
816b66c57c Move withProgress out of loadExternalApiUsages 2023-09-05 16:36:01 +01:00
Robert
247ba4e8ea Merge pull request #2779 from github/robertbrignull/dropdown-disabled
Adjust styling of disabled dropdowns to make their state clearer
2023-09-05 16:20:40 +01:00
Robert
a1c6a3a642 Change calculateModeledPercentage to accept Method instead of using Pick 2023-09-05 15:23:31 +01:00
Robert
e9a2028c10 Delete askForWorkspaceFolder 2023-09-05 11:03:01 +01:00
Shati Patel
a3ce9f516a Queries Panel: Create query from welcome view (#2780) 2023-09-05 10:34:38 +01:00
Robert
f6b3f28039 Merge pull request #2781 from github/robertbrignull/model-editor-telemetry
Emit telemetry for all messages sent from model editor
2023-09-05 10:04:14 +01:00
Robert
ba423376cd Emit telemetry for all messages sent from model editor 2023-09-04 17:13:29 +01:00
Robert
e9b459adaf Merge pull request #2778 from github/robertbrignull/MethodRow_stories
Provide stories for all states of MethodRow
2023-09-04 15:42:59 +01:00
Robert
074f3fb402 Move dropdown arrow away from the right-hand edge 2023-09-04 15:23:21 +01:00
Robert
c316d52514 Set opacity to 40% when disabled 2023-09-04 15:23:03 +01:00
Robert
9af0239041 Show a dash when dropdown is disabled 2023-09-04 15:22:52 +01:00
Robert
5cf6786e9c Merge branch 'main' into robertbrignull/MethodRow_stories 2023-09-04 14:19:35 +01:00
Charis Kyriakou
09077a0e24 Rename ExternalApiUsage to Method (#2776) 2023-09-04 14:10:10 +02:00
Robert
47c897e9bd Include stories for all modeled method types 2023-09-04 11:12:07 +01:00
Robert
096e6e8ffd Wrap MethodRow in a VSCodeDataGrid during story 2023-09-04 11:00:55 +01:00
Robert
480fa517ea Remove the disableAutoNameExtensionPack feature flag 2023-09-04 10:16:08 +01:00
Charis Kyriakou
2d033bff57 Update jump to usage to include the method (#2773) 2023-09-01 13:30:54 +01:00
Robert
1861692055 Merge pull request #2768 from github/robertbrignull/mocked-treeview
Use mockedObject for TreeView
2023-09-01 12:41:27 +01:00
Charis Kyriakou
ac7a37c02e Add ability to set method for modeling in the modeling panel (#2767) 2023-09-01 11:16:10 +00:00
Robert
b5d6c4d84c Merge pull request #2771 from github/robertbrignull/normalize-feature-flag
Make methodModelingView match the naming of other flags
2023-09-01 11:05:10 +01:00
Anders Starcke Henriksen
cdd6553735 Merge pull request #2772 from github/starcke/fix-rename-comment
Fix a comment that should be renamed.
2023-09-01 11:52:00 +02:00
Anders Starcke Henriksen
6bb0854ff2 Fix a comment that should be renamed. 2023-09-01 11:26:33 +02:00
Robert
c51aaf7790 Make methodModelingView match the other flags 2023-09-01 10:19:12 +01:00
Anders Starcke Henriksen
a6745379c4 Merge pull request #2766 from github/starcke/rename-ff
Rename feature flags.
2023-09-01 10:35:28 +02:00
Robert
1178e4c3ae Merge pull request #2770 from github/robertbrignull/model-beta-label
Add beta label to model editor
2023-08-31 15:49:27 +01:00
Robert
59c567a8fa Add beta label to model editor 2023-08-31 15:25:54 +01:00
Shati Patel
4f2b46aa85 Add "create query" button to queries panel (#2764) 2023-08-31 15:02:25 +01:00
Shati Patel
66f12bfbef Make the "Create query" location workspace-specific (#2769) 2023-08-31 15:02:10 +01:00
Robert
2b5d233847 Use mockedObject for TreeView 2023-08-31 12:01:49 +01:00
Robert
11ca60f213 Merge pull request #2738 from github/robertbrignull/useScrollIntoView
Convert ScrollIntoViewHelper into a React hook
2023-08-31 10:58:50 +01:00
Robert
dea6bc257a Merge branch 'main' into robertbrignull/useScrollIntoView 2023-08-31 10:37:16 +01:00
Charis Kyriakou
26b602399a Extract external api usage name component and reuse it (#2765) 2023-08-31 10:12:19 +01:00
Anders Starcke Henriksen
0836307f29 Rename feature flags. 2023-08-31 09:46:22 +02:00
Anders Starcke Henriksen
e61f619f8f Merge pull request #2763 from github/starcke/rename-vars
Starcke/rename vars
2023-08-31 09:17:20 +02:00
Nora
fad674b1c5 Merge pull request #2760 from github/nora/add-components-to-modeling-panel
Adds container and header css to new method model sidebar
2023-08-30 17:37:34 +02:00
Nora
4d2856699b polish 2023-08-30 15:14:51 +00:00
Shati Patel
b51d027b0c Make "create query" command available when queries panel is enabled (#2762) 2023-08-30 16:09:39 +01:00
Nora
595249a9d6 Addning props and minor changes 2023-08-30 15:05:11 +00:00
Anders Starcke Henriksen
00b3ea473c Misc renames. 2023-08-30 16:36:17 +02:00
Anders Starcke Henriksen
46f80efa4c Rename in strings. 2023-08-30 16:36:17 +02:00
Anders Starcke Henriksen
05a7d933d1 Rename DataExtensionsEditor 2023-08-30 16:36:17 +02:00
Anders Starcke Henriksen
6da39ee79f Rename "DataExtensionEditor". 2023-08-30 16:36:17 +02:00
Anders Starcke Henriksen
bb4d97999e Merge pull request #2761 from github/starcke/rename-files2
Rename files.
2023-08-30 16:35:52 +02:00
Anders Starcke Henriksen
af3434b87c Remove spurious theme. 2023-08-30 16:08:42 +02:00
Nora
083b232bb3 Fix merge conflict 2023-08-30 13:35:03 +00:00
Nora
a65c91c84e Add Container and Header 2023-08-30 13:33:32 +00:00
Anders Starcke Henriksen
23f8c48b06 Rename files. 2023-08-30 15:06:45 +02:00
Anders Starcke Henriksen
7fbb1286b9 Merge pull request #2759 from github/starcke/rename-files
Starcke/rename files
2023-08-30 14:50:51 +02:00
Anders Starcke Henriksen
571e6f285f Update webview enum. 2023-08-30 13:59:51 +02:00
Anders Starcke Henriksen
e64cf4073c Rename data-extension-editor files. 2023-08-30 13:46:48 +02:00
Anders Starcke Henriksen
e3a2a11b3d Merge pull request #2754 from github/starcke/rename-directories
Starcke/rename directories
2023-08-30 09:11:00 +02:00
Anders Starcke Henriksen
9b121d56c2 Merge branch 'main' into starcke/rename-directories 2023-08-29 15:38:08 +02:00
Anders Starcke Henriksen
b548bbd43b Merge pull request #2758 from github/starcke/more-java-update
Change the java query to work for multiple java versions.
2023-08-29 15:37:28 +02:00
Anders Starcke Henriksen
ccdb46a1bb Merge branch 'main' into starcke/rename-directories 2023-08-29 15:16:33 +02:00
Anders Starcke Henriksen
d1a342beaf Merge pull request #2757 from github/starcke/automodel-pack
Use auto-model pack to run auto-model queries.
2023-08-29 15:12:03 +02:00
Anders Starcke Henriksen
eeac123ee5 Update non-build references. 2023-08-29 14:39:22 +02:00
Anders Starcke Henriksen
73c596c87a Rename other directories. 2023-08-29 14:38:18 +02:00
Anders Starcke Henriksen
c6f40b3152 Rename main directory. 2023-08-29 14:38:18 +02:00
Anders Starcke Henriksen
3a0843219e Change the java query to work for multiple java versions. 2023-08-29 13:57:16 +02:00
Anders Starcke Henriksen
b00a2cc803 Use auto-model pack to run auto-model queries. 2023-08-29 13:39:44 +02:00
Anders Starcke Henriksen
14b9f932ab Merge pull request #2731 from github/starcke/no-submodule
Make automodel and flow queries work without submodule.
2023-08-29 12:45:22 +02:00
Anders Starcke Henriksen
f3e32baec4 Update extensions/ql-vscode/src/data-extensions-editor/external-api-usage-queries.ts
Co-authored-by: Charis Kyriakou <charisk@users.noreply.github.com>
2023-08-29 11:45:32 +02:00
Anders Starcke Henriksen
20e5429af8 Merge pull request #2755 from github/starcke/fix-neutral-fetch
Fix ql code in neutral fetch.
2023-08-29 09:29:59 +02:00
Dave Bartolomeo
d23178be85 Merge pull request #2756 from github/github-action/bump-cli
Bump CLI Version to v2.14.3 for integration tests
2023-08-28 12:18:48 -04:00
Andrew Eisenberg
b09e9942b2 Add more path triggers for cli-test.yml 2023-08-28 15:25:00 +00:00
github-actions[bot]
fc5cfd0aec Bump CLI version from v2.14.2 to v2.14.3 for integration tests 2023-08-28 13:45:42 +00:00
Anders Starcke Henriksen
259159df45 Add missing pack download and fix lock file creation. 2023-08-28 13:22:03 +02:00
Anders Starcke Henriksen
bc7c97e216 Fix ql code in neutral fetch. 2023-08-28 09:42:04 +02:00
Charis Kyriakou
af22a1573b Add new method modeling panel (#2752) 2023-08-25 15:47:57 +00:00
Anders Starcke Henriksen
d2eb366e74 Make automodel and flow queries work without submodule. 2023-08-25 14:57:54 +02:00
Anders Starcke Henriksen
6a6028bf63 Merge pull request #2746 from github/starcke/update-editor-name
Update editor name in visible strings.
2023-08-25 14:13:19 +02:00
Charis Kyriakou
3c7e1fc192 Remove codeQL.dataExtensions.frameworkMode setting (#2753) 2023-08-25 11:28:21 +00:00
Anders Starcke Henriksen
0433f899fd Merge pull request #2750 from github/starcke/fetch-queries-out-of-view
Starcke/fetch queries out of view
2023-08-25 13:25:04 +02:00
Charis Kyriakou
c82f00eb45 Rename ModelDetail to MethodsUsage in types and functions (#2751) 2023-08-25 11:06:21 +01:00
Shati Patel
94edb9bf16 Merge pull request #2749 from github/shati-patel/implement-dropdown
Make "result format" dropdown determine result display
2023-08-25 10:52:23 +01:00
Shati Patel
4a87a6fddf Merge pull request #2745 from github/shati-patel/result-format-view
Display "result format" dropdown in results view for (path-)problem queries
2023-08-25 09:46:54 +01:00
Anders Starcke Henriksen
9543ab339f Update tests. 2023-08-25 09:50:01 +02:00
Anders Starcke Henriksen
398f16c4cb Change fetch queries to use shared methods. 2023-08-25 09:49:57 +02:00
Anders Starcke Henriksen
ea14767f2a Rename methods in fetch queries. 2023-08-25 09:28:46 +02:00
Anders Starcke Henriksen
b6deb8e0ea Merge pull request #2744 from github/starcke/general-setup
Move pack setup out of fetch queries.
2023-08-25 09:26:01 +02:00
Nora
7b78fc1dd9 Merge pull request #2748 from github/nora/rename-method-usages-folder
Rename methods usage folder and command
2023-08-24 20:02:28 +02:00
shati-patel
0ccd39a368 Update changelog 2023-08-24 17:37:40 +01:00
shati-patel
24b93e247c Make "result format" dropdown determine result display 2023-08-24 17:28:54 +01:00
Nora
6e3b0b245c Merge pull request #2747 from github/nora/rename-model-details-files
Rename methods usage panel files
2023-08-24 18:12:39 +02:00
Nora
6939caa6a5 Rename command and folders 2023-08-24 15:22:13 +00:00
Nora
2e8e7cae47 Rename files only 2023-08-24 15:13:01 +00:00
shati-patel
f8d542d141 Only show the "result format" dropdown for (path-)problem queries 2023-08-24 15:44:08 +01:00
shati-patel
6715669036 Add "result format" dropdown to MRVA view 2023-08-24 15:44:07 +01:00
Shati Patel
c38a01e937 Add a dropdown for choosing MRVA result format (#2743) 2023-08-24 14:42:44 +00:00
Anders Starcke Henriksen
74a12b9fed Move test to separate file. 2023-08-24 16:16:24 +02:00
Anders Starcke Henriksen
906af36337 Update editor name in visible strings. 2023-08-24 16:07:33 +02:00
Anders Starcke Henriksen
359e23fc59 Fix test. 2023-08-24 13:53:34 +02:00
Anders Starcke Henriksen
b13dd7545c Merge branch 'main' into starcke/general-setup 2023-08-24 13:45:00 +02:00
Anders Starcke Henriksen
ac0dfa5e83 Merge pull request #2742 from github/starcke/flow-queries-refactor
Starcke/flow queries refactor
2023-08-24 13:38:13 +02:00
Shati Patel
2ffb7894d4 Always read BQRS results file (#2741) 2023-08-24 12:11:51 +01:00
Nora
422f6de05e Merge pull request #2735 from github/nora/test-model-details-view
Add tests for Model Details View
2023-08-24 12:33:51 +02:00
Shati Patel
ee88ea1658 Store query @kind when running a variant analysis (#2740) 2023-08-24 10:18:20 +01:00
Nora
0daa06bc0d rename test and remove boolean type 2023-08-24 08:58:37 +00:00
Anders Starcke Henriksen
c584d02805 Merge pull request #2734 from github/starcke/automodel-queries-refactor
Starcke/automodel queries refactor
2023-08-24 09:57:32 +02:00
Nora
c56936e2f6 create and use factories 2023-08-23 16:06:30 +00:00
Anders Starcke Henriksen
1fc735639b Merge pull request #2733 from github/starcke/refactor-names
Rename query files to have consistent suffix.
2023-08-23 12:58:18 +02:00
Charis Kyriakou
0352629eb4 Rename WebviewView to WebviewKind (#2739) 2023-08-23 11:27:58 +01:00
Anders Starcke Henriksen
877fc51494 Move pack setup out of fetch queries. 2023-08-23 11:27:18 +02:00
Anders Starcke Henriksen
886f211441 Change flow queries to use shared methods. 2023-08-23 11:27:03 +02:00
Anders Starcke Henriksen
75d275c93f Rename methods in flow queries. 2023-08-23 11:27:03 +02:00
Anders Starcke Henriksen
5d1fa1d6b5 Reorder methods in flow queries. 2023-08-23 11:27:03 +02:00
Anders Starcke Henriksen
4fce448717 Address comments. 2023-08-23 11:26:23 +02:00
Robert
610c936690 Add useScrollIntoView hook 2023-08-22 17:01:25 +01:00
Robert
d777427c0a Merge pull request #2737 from github/robertbrignull/AlertTable-functional
Convert AlertTable to a function component
2023-08-22 16:59:00 +01:00
Charis Kyriakou
81924af1e4 Don't download artifacts for repos with no results in MRVA (#2736)
* Don't download artifacts for repos with no results

* Remove getVariantAnalysisRepoResult requests for repos with no results

* Run fix-scenario-file-numbering for mrva-problem-query-success scenario

* Update CHANGELOG
2023-08-22 16:23:40 +01:00
Nora
45f7d22d2a Add reveal test 2023-08-22 13:11:46 +00:00
Robert
dcef43c6d5 Convert updateSelectionCallback to use useCallback 2023-08-22 14:08:14 +01:00
Robert
160642ec73 Convert toggle to use useCallback 2023-08-22 14:07:54 +01:00
Robert
240dd51dc0 Convert handleNavigationEvent to use useCallback 2023-08-22 14:07:54 +01:00
Robert
ad42b060b7 Decompose props earlier 2023-08-22 14:07:54 +01:00
Robert
23b2327bd0 Convert AlertTable to a function component 2023-08-22 14:07:52 +01:00
Robert
450d294bab Move render to the end of the component 2023-08-22 14:04:48 +01:00
Robert
4e376063ee Move getNewSelection to before it is used 2023-08-22 14:02:56 +01:00
Anders Starcke Henriksen
39cb219e56 Fix broken reference in test. 2023-08-22 14:53:04 +02:00
Anders Starcke Henriksen
e01fb9172f Update tests. 2023-08-22 14:23:26 +02:00
Anders Starcke Henriksen
1764151bf7 Change automodel queries to use shared methods. 2023-08-22 14:20:59 +02:00
Anders Starcke Henriksen
82c40c69e6 Add generalized run query method. 2023-08-22 14:18:19 +02:00
Anders Starcke Henriksen
1a34d782e8 Reorder methods in automodel queries. 2023-08-22 14:16:18 +02:00
Anders Starcke Henriksen
08c1b57661 Rename query files to have consistent suffix. 2023-08-22 14:06:22 +02:00
Robert
5fc34248b3 Merge pull request #2732 from github/robertbrignull/AlertTable-decompose
Split AlertTable into smaller components
2023-08-22 12:24:12 +01:00
Robert
bee7d81fb4 Merge branch 'main' into robertbrignull/AlertTable-decompose 2023-08-22 11:40:45 +01:00
Charis Kyriakou
3094405f68 Split out CLI version tests to separate workflow (#2729) 2023-08-22 11:28:36 +01:00
Nora
392e76d8f2 Add getChildren tests 2023-08-22 08:56:42 +00:00
Nora
6e4e89a006 Move dataProvider creation to beforeEach 2023-08-22 08:56:07 +00:00
Nora
cb2802e2e7 Add mode details panel test 2023-08-22 08:55:25 +00:00
Robert
af1af074dc Convert updateSelectionCallback to not use double-nested methods 2023-08-21 17:17:37 +01:00
Robert
d65ce3e24a Use useCallback when calling toggleExpanded 2023-08-21 17:13:49 +01:00
Robert
13ce5f7e3c Merge pull request #2730 from github/robertbrignull/details-ship
Remove config.codeQL.dataExtensions.modelDetailsView feature flag
2023-08-21 14:53:24 +01:00
Robert
eebe11e5dd Simplify passing similar props 2023-08-21 14:52:42 +01:00
Robert
bd5d361de1 Pass around toggle instead of toggler 2023-08-21 14:26:10 +01:00
Robert
e3596db8e7 Remove rows array and render AlertTableResultRow inline 2023-08-21 14:26:10 +01:00
Robert
21b1c997c6 Move rendering of AlertTablePathRow to inside of AlertTableResultRow 2023-08-21 14:26:09 +01:00
Robert
9ecf97152a Move rendering of msg to inside AlertTableResuiltRow 2023-08-21 14:25:42 +01:00
Robert
3983087bc8 Use useMemo for callback passed to SarifLocation.onClick in AlertTableResultRow 2023-08-21 14:25:08 +01:00
Robert
636d0bf025 Move rendering of locationCells to inside AlertTableResuiltRow 2023-08-21 14:25:08 +01:00
Robert
fe4d87dae5 Teach AlertTableResultRow how to render results without codeFlows 2023-08-21 14:25:06 +01:00
Robert
1794c6b7f7 Simplify rendering in AlertTable 2023-08-21 14:24:36 +01:00
Robert
23d815ff05 Use useMemo for callback passed to AlertTableDropdownIndicatorCell.onClick in AlertTableResultRow 2023-08-21 14:24:25 +01:00
Robert
8945abcb57 Pull out AlertTableResultRow to a separate component 2023-08-21 14:23:57 +01:00
Robert
a576dace04 Do all rendering in AlertTablePathRow in one place 2023-08-21 14:23:05 +01:00
Robert
3e7577c984 Use useMemo for callback passed to AlertTableDropdownIndicatorCell.onClick in AlertTablePathRow 2023-08-21 14:21:58 +01:00
Robert
acb76a64ef Pull out AlertTablePathRow to a separate component 2023-08-21 14:20:45 +01:00
Robert
ba0cf9a22d Use useMemo for callback passed to SarifLocation.onClick in AlertTablePathNodeRow 2023-08-21 14:19:54 +01:00
Robert
443c9ac56c Inline some rendering in AlertTablePathNodeRow 2023-08-21 14:19:53 +01:00
Robert
91e69c93be Pull out AlertTablePathNodeRow to a separate component 2023-08-21 14:19:53 +01:00
Robert
7e31b6e42a Construct rows using maps instead of mutating array from multiple places 2023-08-21 14:19:52 +01:00
Robert
cff7170fdc Move AlertTableTruncatedMessage to a new component in a new file 2023-08-21 14:17:47 +01:00
Robert
ca40963238 Move AlertTableNoResults to a new component in a new file 2023-08-21 14:17:45 +01:00
Robert
b1ff75b646 Remove config.codeQL.dataExtensions.modelDetailsView feature flag 2023-08-21 12:32:45 +01:00
Robert
e5ab1118ee Merge pull request #2719 from github/koesie10/fix-button-accessibility
Fix button accessibility
2023-08-21 11:48:36 +01:00
Robert
d90fb69e39 Merge branch 'main' into koesie10/fix-button-accessibility 2023-08-21 11:11:35 +01:00
Robert
2f4eed4a4d Merge pull request #2726 from github/koesie10/fix-alert-table-accessibility
Fix accessibility of alert table
2023-08-21 11:04:41 +01:00
Nora
2cb520d603 Merge pull request #2717 from github/nora/hide-modeled-on-model-details-view
Respect the "Hide modeled APIs" checkbox in the model details view
2023-08-21 11:09:48 +02:00
Charis Kyriakou
4a752d27c4 Moves mock GitHub API to /common (#2728)
* Move mock GitHub API to /common

* Rename MRVA mock scenarios

* Update mock GitHub API docs
2023-08-21 08:49:27 +01:00
Nora
6cfd20eca4 Set hodeModeledApis variable 2023-08-21 07:29:37 +00:00
dependabot[bot]
36259b21db Bump @testing-library/jest-dom in /extensions/ql-vscode (#2723)
Bumps [@testing-library/jest-dom](https://github.com/testing-library/jest-dom) from 5.16.5 to 6.0.0.
- [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/v5.16.5...v6.0.0)

---
updated-dependencies:
- dependency-name: "@testing-library/jest-dom"
  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>
Co-authored-by: Charis Kyriakou <charisk@users.noreply.github.com>
2023-08-18 15:39:28 +01:00
dependabot[bot]
cd14a37f79 Bump lint-staged from 13.2.0 to 14.0.0 in /extensions/ql-vscode (#2722)
Bumps [lint-staged](https://github.com/okonet/lint-staged) from 13.2.0 to 14.0.0.
- [Release notes](https://github.com/okonet/lint-staged/releases)
- [Commits](https://github.com/okonet/lint-staged/compare/v13.2.0...v14.0.0)

---
updated-dependencies:
- dependency-name: lint-staged
  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>
Co-authored-by: Charis Kyriakou <charisk@users.noreply.github.com>
2023-08-18 14:55:10 +01:00
Koen Vlaswinkel
d6e0c6a4a7 Fix accessibility of alert table dropdown 2023-08-18 13:28:17 +02:00
Koen Vlaswinkel
9f589880df Split alert table dropdown indicator cell 2023-08-18 13:26:45 +02:00
Koen Vlaswinkel
b7a4419420 Add story for AlertTable 2023-08-18 13:26:19 +02:00
Koen Vlaswinkel
1d2ef805fb Merge remote-tracking branch 'origin/main' into koesie10/fix-button-accessibility 2023-08-18 10:03:54 +02:00
Koen Vlaswinkel
2888fddf61 Move all ResultTablesHeader styles to styled-components 2023-08-18 10:03:36 +02:00
Koen Vlaswinkel
a5c675b8c7 Add story for ResultTablesHeader 2023-08-18 09:58:34 +02:00
Shati Patel
d05dba4bba Fix changelog entry (#2725) 2023-08-17 16:13:40 +00:00
Shati Patel
2db0ca8ecc Group extension settings in the VS Code UI (#2706) 2023-08-17 16:48:15 +01:00
Robert
497dc31819 Merge pull request #2716 from github/robertbrignull/data-renames
Rename files in src/view/results to match their components
2023-08-17 15:23:38 +01:00
Nora
cd309aece6 Adjust badge number 2023-08-17 12:53:24 +00:00
Nora
aaaf799557 Add test 2023-08-17 12:27:16 +00:00
Nora
ece54b8f7d Make all setStage arguments mandatory 2023-08-17 12:26:13 +00:00
Nora
0824892507 Move post message and use effect 2023-08-17 11:02:20 +00:00
Nora
082268e201 Rename constant file 2023-08-17 11:00:45 +00:00
Nora
27bce4a1e9 Add tests 2023-08-17 09:19:01 +00:00
Nora
56ecd1a84c hide unmodeled apis 2023-08-17 09:19:01 +00:00
Nora
84ab602277 Send message from from view 2023-08-17 09:19:01 +00:00
Koen Vlaswinkel
a86a373e19 Merge pull request #2718 from github/koesie10/upgrade-storybook
Upgrade Storybook
2023-08-17 10:04:36 +02:00
Koen Vlaswinkel
90a39ec293 Use button instead of a for raw results link 2023-08-16 16:45:51 +02:00
Koen Vlaswinkel
3dd8583116 Use button instead of a for clickable location links 2023-08-16 16:45:47 +02:00
Koen Vlaswinkel
b0663669b0 Use button instead of a for compare table queries 2023-08-16 16:45:44 +02:00
Koen Vlaswinkel
493c9cb5fe Add story for compare table 2023-08-16 16:45:41 +02:00
Robert
99dd9166b3 Merge pull request #2709 from github/robertbrignull/details-visible
Only show the details view when a data extensions editor is open
2023-08-16 15:28:38 +01:00
Koen Vlaswinkel
10604808e0 Upgrade Storybook 2023-08-16 15:45:28 +02:00
Robert
3164c3f11f Rename results.tsx => ResultsApp.tsx 2023-08-16 13:21:07 +01:00
Robert
ed36fb725b Rename raw-results-table.tsx => RawTable.tsx 2023-08-16 13:21:07 +01:00
Robert
67b138f0c2 Rename graph.tsx => Graph.tsx 2023-08-16 13:21:04 +01:00
Robert
fed9870a0c Only show the details view when a data extensions editor is open 2023-08-16 13:06:14 +01:00
Robert
51844bb541 Merge pull request #2705 from github/robertbrignull/details-multiple-editors
Allow the details view to handle multiple open data extensions editors
2023-08-16 12:47:44 +01:00
Robert
0acd06f773 Rename alert-table.tsx => AlertTable.tsx 2023-08-16 10:35:59 +01:00
Robert
acb9669e9f Merge pull request #2714 from github/robertbrignull/EmptyQueryResultsMessage
Move EmptyQueryResultsMessage out of results-table-utils
2023-08-16 10:05:58 +01:00
Charis Kyriakou
2a71183695 Start with collapsed items in data extensions editor (#2713) 2023-08-15 17:06:12 +01:00
Robert
1c3d3428e4 Merge pull request #2712 from github/robertbrignull/AlertTableHeader-filename
Rename alert-table-header.tsx => AlertTableHeader.tsx
2023-08-15 16:58:55 +01:00
Robert
c77bb2b9c2 Rename result-table-utils.tsx => result-table-utils.ts 2023-08-15 16:44:29 +01:00
Robert
d3d96a1dbe Make EmptyQueryResultsMessage into a component 2023-08-15 16:42:10 +01:00
Robert
7c62176f59 Rename alert-table-header.tsx => AlertTableHeader.tsx 2023-08-15 16:31:55 +01:00
Robert
87754a9ec9 Move mostRecentlyActiveView variable to DataExtensionsEditorModule 2023-08-15 15:36:14 +01:00
Robert
ee78df683a Add onPanelWasDisposed 2023-08-15 15:16:37 +01:00
Robert
3764a7e567 Split isTheMostRecentlyActivePanel into two methods 2023-08-15 15:14:15 +01:00
Robert
552baa5570 Merge branch 'main' into robertbrignull/details-multiple-editors 2023-08-15 14:57:45 +01:00
Charis Kyriakou
57262446fb Merge pull request #2711 from github/version/bump-to-v1.8.11
Bump version to v1.8.11
2023-08-15 14:07:35 +01:00
Robert
5b128711e5 Merge pull request #2708 from github/robertbrignull/details-updates
Only update the details view when data has changed
2023-08-15 14:01:35 +01:00
Robert
6787deed04 Use not.toHaveBeenCalled() 2023-08-15 11:16:44 +01:00
Robert
381e8c0849 Fix test name 2023-08-15 11:15:32 +01:00
github-actions[bot]
74c6f3ce54 Bump version to v1.8.11 2023-08-15 10:08:02 +00:00
Robert
4e70c8999f Only update the details view when data has changed 2023-08-14 15:55:01 +01:00
Robert
6005e3ab70 Update details view on view state changes, and remember the most recently active panel 2023-08-14 15:02:40 +01:00
Robert
7c93c7046e Store the latest set of external API usages on the view class 2023-08-14 14:08:10 +01:00
445 changed files with 22552 additions and 17416 deletions

View File

@@ -33,7 +33,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Bump CLI

111
.github/workflows/cli-test.yml vendored Normal file
View File

@@ -0,0 +1,111 @@
name: Run CLI tests
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- .github/workflows/cli-test.yml
- extensions/ql-vscode/src/codeql-cli/**
- extensions/ql-vscode/src/language-support/**
- extensions/ql-vscode/src/query-server/**
- extensions/ql-vscode/supported_cli_versions.json
jobs:
find-nightly:
name: Find Nightly Release
runs-on: ubuntu-latest
outputs:
url: ${{ steps.get-url.outputs.nightly-url }}
steps:
- name: Get Nightly Release URL
id: get-url
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
shell: bash
# This workflow step gets an unstable testing version of the CodeQL CLI. It should not be used outside of these tests.
run: |
LATEST=`gh api repos/dsp-testing/codeql-cli-nightlies/releases --jq '.[].tag_name' --method GET --raw-field 'per_page=1'`
echo "nightly-url=https://github.com/dsp-testing/codeql-cli-nightlies/releases/download/$LATEST" >> "$GITHUB_OUTPUT"
set-matrix:
name: Set Matrix for cli-test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set the variables
id: set-variables
run: echo "cli-versions=$(cat ./extensions/ql-vscode/supported_cli_versions.json | jq -rc)" >> $GITHUB_OUTPUT
outputs:
cli-versions: ${{ steps.set-variables.outputs.cli-versions }}
cli-test:
name: CLI Test
runs-on: ${{ matrix.os }}
needs: [find-nightly, set-matrix]
timeout-minutes: 30
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
version: ${{ fromJson(needs.set-matrix.outputs.cli-versions) }}
fail-fast: false
env:
CLI_VERSION: ${{ matrix.version }}
NIGHTLY_URL: ${{ needs.find-nightly.outputs.url }}
TEST_CODEQL_PATH: '${{ github.workspace }}/codeql'
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version-file: extensions/ql-vscode/.nvmrc
cache: 'npm'
cache-dependency-path: extensions/ql-vscode/package-lock.json
- name: Install dependencies
working-directory: extensions/ql-vscode
run: |
npm ci
shell: bash
- name: Build
working-directory: extensions/ql-vscode
run: |
npm run build
shell: bash
- name: Decide on ref of CodeQL repo
id: choose-ref
shell: bash
run: |
if [[ "${{ matrix.version }}" == "nightly" ]]
then
REF="codeql-cli/latest"
else
REF="codeql-cli/${{ matrix.version }}"
fi
echo "ref=$REF" >> "$GITHUB_OUTPUT"
- name: Checkout QL
uses: actions/checkout@v4
with:
repository: github/codeql
ref: ${{ steps.choose-ref.outputs.ref }}
path: codeql
- name: Run CLI tests (Linux)
working-directory: extensions/ql-vscode
if: matrix.os == 'ubuntu-latest'
run: |
unset DBUS_SESSION_BUS_ADDRESS
/usr/bin/xvfb-run npm run test:cli-integration
- name: Run CLI tests (Windows)
working-directory: extensions/ql-vscode
if: matrix.os == 'windows-latest'
run: |
npm run test:cli-integration

View File

@@ -19,7 +19,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@main

View File

@@ -11,6 +11,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: 'Dependency Review'
uses: actions/dependency-review-action@v3

View File

@@ -16,13 +16,13 @@ jobs:
os: [ubuntu-latest, windows-latest]
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: actions/setup-node@v3
with:
node-version: '16.17.1'
node-version-file: extensions/ql-vscode/.nvmrc
cache: 'npm'
cache-dependency-path: extensions/ql-vscode/package-lock.json
@@ -53,34 +53,18 @@ jobs:
name: vscode-codeql-extension
path: artifacts
find-nightly:
name: Find Nightly Release
runs-on: ubuntu-latest
outputs:
url: ${{ steps.get-url.outputs.nightly-url }}
steps:
- name: Get Nightly Release URL
id: get-url
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
shell: bash
# This workflow step gets an unstable testing version of the CodeQL CLI. It should not be used outside of these tests.
run: |
LATEST=`gh api repos/dsp-testing/codeql-cli-nightlies/releases --jq '.[].tag_name' --method GET --raw-field 'per_page=1'`
echo "nightly-url=https://github.com/dsp-testing/codeql-cli-nightlies/releases/download/$LATEST" >> "$GITHUB_OUTPUT"
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: actions/setup-node@v3
with:
node-version: '16.17.1'
node-version-file: extensions/ql-vscode/.nvmrc
cache: 'npm'
cache-dependency-path: extensions/ql-vscode/package-lock.json
@@ -97,6 +81,8 @@ jobs:
- name: Lint
working-directory: extensions/ql-vscode
env:
NODE_OPTIONS: '--max-old-space-size=4096'
run: |
npm run lint
@@ -115,6 +101,42 @@ jobs:
run: |
npm run find-deadcode
generated:
name: Check generated code
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: actions/setup-node@v3
with:
node-version-file: extensions/ql-vscode/.nvmrc
cache: 'npm'
cache-dependency-path: extensions/ql-vscode/package-lock.json
- name: Install dependencies
working-directory: extensions/ql-vscode
run: |
npm ci
shell: bash
- name: Check that repo is clean
run: |
git diff --exit-code
git diff --exit-code --cached
- name: Generate code
working-directory: extensions/ql-vscode
run: |
npm run generate
- name: Check for changes
run: |
git diff --exit-code
git diff --exit-code --cached
unit-test:
name: Unit Test
runs-on: ${{ matrix.os }}
@@ -123,13 +145,13 @@ jobs:
os: [ubuntu-latest, windows-latest]
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: actions/setup-node@v3
with:
node-version: '16.17.1'
node-version-file: extensions/ql-vscode/.nvmrc
cache: 'npm'
cache-dependency-path: extensions/ql-vscode/package-lock.json
@@ -157,13 +179,13 @@ jobs:
os: [ubuntu-latest, windows-latest]
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: actions/setup-node@v3
with:
node-version: '16.17.1'
node-version-file: extensions/ql-vscode/.nvmrc
cache: 'npm'
cache-dependency-path: extensions/ql-vscode/package-lock.json
@@ -198,40 +220,40 @@ jobs:
run: |
npm run test:vscode-integration
set-matrix:
name: Set Matrix for cli-test
get-latest-cli-version:
name: Get latest CLI version
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set the variables
id: set-variables
run: echo "cli-versions=$(cat ./extensions/ql-vscode/supported_cli_versions.json | jq -rc)" >> $GITHUB_OUTPUT
uses: actions/checkout@v4
- name: Set the variable
id: set-variable
run: |
echo "cli-version=$(cat ./extensions/ql-vscode/supported_cli_versions.json | jq -rc '.[0]')" >> $GITHUB_OUTPUT
echo "$cli-version"
outputs:
cli-versions: ${{ steps.set-variables.outputs.cli-versions }}
cli-version: ${{ steps.set-variable.outputs.cli-version }}
cli-test:
name: CLI Test
runs-on: ${{ matrix.os }}
needs: [find-nightly, set-matrix]
needs: [get-latest-cli-version]
timeout-minutes: 30
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
version: ${{ fromJson(needs.set-matrix.outputs.cli-versions) }}
fail-fast: false
env:
CLI_VERSION: ${{ matrix.version }}
NIGHTLY_URL: ${{ needs.find-nightly.outputs.url }}
CLI_VERSION: ${{ needs.get-latest-cli-version.outputs.cli-version }}
TEST_CODEQL_PATH: '${{ github.workspace }}/codeql'
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: '16.17.1'
node-version-file: extensions/ql-vscode/.nvmrc
cache: 'npm'
cache-dependency-path: extensions/ql-vscode/package-lock.json
@@ -247,23 +269,11 @@ jobs:
npm run build
shell: bash
- name: Decide on ref of CodeQL repo
id: choose-ref
shell: bash
run: |
if [[ "${{ matrix.version }}" == "nightly" ]]
then
REF="codeql-cli/latest"
else
REF="codeql-cli/${{ matrix.version }}"
fi
echo "ref=$REF" >> "$GITHUB_OUTPUT"
- name: Checkout QL
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: github/codeql
ref: ${{ steps.choose-ref.outputs.ref }}
ref: 'codeql-cli/${{ needs.get-latest-cli-version.outputs.cli-version }}'
path: codeql
- name: Run CLI tests (Linux)

View File

@@ -18,11 +18,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: '16.17.1'
node-version-file: extensions/ql-vscode/.nvmrc
- name: Install dependencies
run: |

View File

@@ -1,5 +1,6 @@
**/* @github/codeql-vscode-reviewers
**/variant-analysis/ @github/code-scanning-secexp-reviewers
**/databases/ @github/code-scanning-secexp-reviewers
**/data-extensions-editor/ @github/code-scanning-secexp-reviewers
**/method-modeling/ @github/code-scanning-secexp-reviewers
**/model-editor/ @github/code-scanning-secexp-reviewers
**/queries-panel/ @github/code-scanning-secexp-reviewers

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

30
docs/node-version.md Normal file
View File

@@ -0,0 +1,30 @@
# Node version
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.
We should make sure the CodeQL for VS Code extension works with the Node.js version supplied by all versions of VS Code that we support.
## Checking the version of Node.js supplied by VS Code
You can find this info by seleting "About Visual Studio Code" from the top menu.
![about-vscode](images/about-vscode.png)
## Updating the Node.js version
The following files will need to be updated:
- `extensions/ql-vscode/.nvmrc` - this will enable nvm to automatically switch to the correct Node
version when you're in the project folder. It will also change the Node version the GitHub Actions
workflows use.
- `extensions/ql-vscode/package.json` - the "engines.node: '[VERSION]'" setting
- `extensions/ql-vscode/package.json` - the "@types/node: '[VERSION]'" dependency
Then run `npm install` to update the `extensions/ql-vscode/package-lock.json` file.
## Node.js version used in tests
Unit tests will use whatever version of Node.js is installed locally. In CI this will be the version specified in the workflow.
Integration tests download a copy of VS Code and then will use whatever version of Node.js is provided by VS Code. Our integration tests are currently pinned to an older version of VS Code. See [VS Code version used in tests](./vscode-version.md#vs-code-version-used-in-tests) for more information.

View File

@@ -1,5 +1,6 @@
# Releasing (write access required)
1. Run the ["Run CLI tests" workflow](https://github.com/github/vscode-codeql/actions/workflows/cli-test.yml) and make sure the tests are green. If there were no merges between the time the workflow ran (it runs daily), and the release, you can skip this step.
1. Double-check the `CHANGELOG.md` contains all desired change comments and has the version to be released with date at the top.
* Go through all recent PRs and make sure they are properly accounted for.
* Make sure all changelog entries have links back to their PR(s) if appropriate.
@@ -10,10 +11,7 @@
* New telemetry events are added.
* Deprecation or removal of commands.
* Accumulation of many changes, none of which are individually big enough to warrant a minor bump, but which together are. This does not include changes which are purely internal to the extension, such as refactoring, or which are only available behind a feature flag.
1. Double-check that the node version we're using matches the one used for VS Code. You can find this info by seleting "About Visual Studio Code" from the top menu. If it doesn't match, you will then need to update the node version in the following files:
* `.nvmrc` - this will enable `nvm` to automatically switch to the correct node version when you're in the project folder
* `.github/workflows/main.yml` - all the "node-version: '[VERSION]'" settings
* `.github/workflows/release.yml` - the "node-version: '[VERSION]'" setting
1. Double-check that the node version we're using matches the one used for VS Code. See the [Node.js version instructions](./node-version.md) for more information.
1. Double-check that the extension `package.json` and `package-lock.json` have the version you intend to release. If you are doing a patch release (as opposed to minor or major version) this should already be correct.
1. Create a PR for this release:
* This PR will contain any missing bits from steps 1, 2 and 3. Most of the time, this will just be updating `CHANGELOG.md` with today's date.

View File

@@ -60,7 +60,7 @@ choose to go through some of the Optional Test Cases.
- Check that the results table is rendered
- Check that result locations can be clicked on
#### Test case 3: Can use AST viewer
#### Test case 4: Can use AST viewer
1. Click on any code location from a previous query to open a source file from a database
2. Open the AST viewing panel and click "View AST"
@@ -143,6 +143,43 @@ Run one of the above MRVAs, but cancel it from within VS Code:
- Check that the workflow run is also canceled.
- Check that any available results are visible in VS Code.
### CodeQL Model Editor
#### Test Case 1: Opening the model editor
1. Download the `sofastack/sofa-jraft` java database from GitHub.
2. Open the Model Editor with the "CodeQL: Open CodeQL Model Editor" command from the command palette.
- Check that the editor loads and shows methods to model.
- Check that methods are grouped per library (e.g. `rocksdbjni@7.7.3` or `asm@6.0`)
- Check that the "Open database" link works.
#### Test Case 2: Model methods
1. Expand one of the libraries.
- Change the model type and check that the other dropdowns change.
2. Save the modeled methods.
3. Click "Open extension pack"
- Check that the file explorer opens a directory with a "models" directory
4. Open the ".model.yml" file corresponding to the library that was changed.
- Check that the file contrains the entries that was modeled.
#### Test Case 3: Model with AI
Note that this test requires the feature flag: `codeQL.model.llmGeneration`
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
Note that this test requires the feature flag: `codeQL.model.flowGeneration`
1. Click "Model as dependency"
- Check that grouping are now per package (e.g. `com.alipay.sofa.rraft.option` or `com.google.protobuf`)
2. Click "Generate".
- Check that rows are filled out.
### General
#### Test case 1: Change to a different colour theme

View File

@@ -133,4 +133,4 @@ Once the scenario has been recorded, it's often useful to remove some of the req
### Scenario data location
Pre-recorded scenarios are stored in `./src/variant-analysis/github-api/mocks/scenarios`. However, it's possible to configure the location, by setting the `codeQL.mockGitHubApiServer.scenariosPath` configuration property in the VS Code user settings.
Pre-recorded scenarios are stored in `./src/common/mock-gh-api/scenarios`. However, it's possible to configure the location, by setting the `codeQL.mockGitHubApiServer.scenariosPath` configuration property in the VS Code user settings.

33
docs/vscode-version.md Normal file
View File

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

View File

@@ -1 +1 @@
v16.17.1
v18.15.0

View File

@@ -5,7 +5,15 @@ import { action } from "@storybook/addon-actions";
// Allow all stories/components to use Codicons
import "@vscode/codicons/dist/codicon.css";
(window as any).acquireVsCodeApi = () => ({
import type { VsCodeApi } from "../src/view/vscode-api";
declare global {
interface Window {
acquireVsCodeApi: () => VsCodeApi;
}
}
window.acquireVsCodeApi = () => ({
postMessage: action("post-vscode-message"),
setState: action("set-vscode-state"),
});

View File

@@ -1,5 +1,37 @@
# CodeQL for Visual Studio Code: Changelog
## 1.9.2 - 12 October 2023
- Fix a bug where the query to Find Definitions in database source files would not be cancelled appropriately. [#2885](https://github.com/github/vscode-codeql/pull/2885)
- It is now possible to show the language of query history items using the `%l` specifier in the `codeQL.queryHistory.format` setting. Note that this only works for queries run after this upgrade, and older items will show `unknown` as a language. [#2892](https://github.com/github/vscode-codeql/pull/2892)
- Increase the required version of VS Code to 1.82.0. [#2877](https://github.com/github/vscode-codeql/pull/2877)
- Fix a bug where the query server was restarted twice after configuration changes. [#2884](https://github.com/github/vscode-codeql/pull/2884).
- Add support for the `telemetry.telemetryLevel` setting. For more information, see the [telemetry documentation](https://codeql.github.com/docs/codeql-for-visual-studio-code/about-telemetry-in-codeql-for-visual-studio-code). [#2824](https://github.com/github/vscode-codeql/pull/2824).
- Fix syntax highlighting directly after import statements with instantiation arguments. [#2792](https://github.com/github/vscode-codeql/pull/2792)
- The `debug.saveBeforeStart` setting is now respected when running variant analyses. [#2950](https://github.com/github/vscode-codeql/pull/2950)
- The 'open database' button of the model editor was renamed to 'open source'. Also, it's now only available if the source archive is available as a workspace folder. [#2945](https://github.com/github/vscode-codeql/pull/2945)
## 1.9.1 - 29 September 2023
- Add warning when using a VS Code version older than 1.82.0. [#2854](https://github.com/github/vscode-codeql/pull/2854)
- Fix a bug when parsing large evaluation log summaries. [#2858](https://github.com/github/vscode-codeql/pull/2858)
- Right-align and format numbers in raw result tables. [#2864](https://github.com/github/vscode-codeql/pull/2864)
- Remove rate limit warning notifications when using Code Search to add repositories to a variant analysis list. [#2812](https://github.com/github/vscode-codeql/pull/2812)
## 1.9.0 - 19 September 2023
- Release the [CodeQL model editor](https://codeql.github.com/docs/codeql/codeql-for-visual-studio-code/using-the-codeql-model-editor) to create CodeQL model packs for Java frameworks. Open the editor using the "CodeQL: Open CodeQL Model Editor (Beta)" command. [#2823](https://github.com/github/vscode-codeql/pull/2823)
## 1.8.12 - 11 September 2023
- Fix a bug where variant analysis queries would fail for queries in the `codeql/java-queries` query pack. [#2786](https://github.com/github/vscode-codeql/pull/2786)
## 1.8.11 - 7 September 2023
- Update how variant analysis results are displayed. For queries with ["path-problem" or "problem" `@kind`](https://codeql.github.com/docs/writing-codeql-queries/metadata-for-codeql-queries/#metadata-properties), you can choose to display the results as rendered alerts or as a table of raw results. For queries with any other `@kind`, the results are displayed as a table. [#2745](https://github.com/github/vscode-codeql/pull/2745) & [#2749](https://github.com/github/vscode-codeql/pull/2749)
- When running variant analyses, don't download artifacts for repositories with no results. [#2736](https://github.com/github/vscode-codeql/pull/2736)
- Group the extension settings, so that they're easier to find in the Settings UI. [#2706](https://github.com/github/vscode-codeql/pull/2706)
## 1.8.10 - 15 August 2023
- Add a code lens to make the `CodeQL: Open Referenced File` command more discoverable. Click the "Open referenced file" prompt in a `.qlref` file to jump to the referenced `.ql` file. [#2704](https://github.com/github/vscode-codeql/pull/2704)

View File

@@ -9,6 +9,7 @@ import {
} from "fs-extra";
import { resolve, join } from "path";
import { isDevBuild } from "./dev";
import type * as packageJsonType from "../package.json";
export interface DeployedPackage {
distPath: string;
@@ -46,12 +47,10 @@ async function copyPackage(
);
}
export async function deployPackage(
packageJsonPath: string,
): Promise<DeployedPackage> {
export async function deployPackage(): Promise<DeployedPackage> {
try {
const packageJson: any = JSON.parse(
await readFile(packageJsonPath, "utf8"),
const packageJson: typeof packageJsonType = JSON.parse(
await readFile(resolve(__dirname, "../package.json"), "utf8"),
);
const distDir = join(__dirname, "../../../dist");

View File

@@ -3,9 +3,7 @@ import { deployPackage } from "./deploy";
import { spawn } from "child-process-promise";
export async function packageExtension(): Promise<void> {
const deployedPackage = await deployPackage(
resolve(__dirname, "../package.json"),
);
const deployedPackage = await deployPackage();
console.log(
`Packaging extension '${deployedPackage.name}@${deployedPackage.version}'...`,
);

View File

@@ -2,7 +2,7 @@
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "../tsconfig.json",
"compilerOptions": {
"rootDir": "."
"rootDir": ".."
},
"include": ["*.ts"]
}

View File

@@ -1,17 +0,0 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" fill="none"
viewBox="0 0 432 432" style="enable-background:new 0 0 432 432;" xml:space="preserve">
<g>
<g>
<g>
<polygon points="234.24,9.067 183.893,59.413 284.587,59.413" fill="#C5C5C5"/>
<polygon points="301.44,304.32 427.947,120.853 427.947,93.973 250.88,93.973 250.88,128.107 376.32,128.107 250.027,310.72
250.027,338.24 432,338.24 432,304.32" fill="#C5C5C5"/>
<polygon points="234.24,422.933 283.947,373.227 184.533,373.227" fill="#C5C5C5"/>
<path d="M226.773,338.24L130.987,93.76H96L0,338.24h39.253l19.627-52.267h109.013l19.627,52.267H226.773z M71.893,250.987
L113.28,140.48l41.387,110.507H71.893z" fill="#C5C5C5"/>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 953 B

View File

@@ -1,3 +0,0 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M7 2L6 3V6H7V3H14V5.45306L14.2071 5.29286L15 6.08576V3L14 2H7ZM8 4H10V6H8V4ZM5 9H3V11H5V9ZM2 7L1 8V13L2 14H9L10 13V8L9 7H2ZM2 13V8H9V13H2ZM8 10H6V12H8V10ZM13 4H12V7.86388L10.818 6.68192L10.1109 7.38903L12.1465 9.42454L12.8536 9.42454L14.889 7.38908L14.1819 6.68197L13 7.86388V4Z" fill="#C5C5C5"/>
</svg>

Before

Width:  |  Height:  |  Size: 449 B

View File

@@ -1,17 +0,0 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 432 432" style="enable-background:new 0 0 432 432;" xml:space="preserve">
<g>
<g>
<g>
<polygon points="234.24,9.067 183.893,59.413 284.587,59.413 "/>
<polygon points="301.44,304.32 427.947,120.853 427.947,93.973 250.88,93.973 250.88,128.107 376.32,128.107 250.027,310.72
250.027,338.24 432,338.24 432,304.32 "/>
<polygon points="234.24,422.933 283.947,373.227 184.533,373.227 "/>
<path d="M226.773,338.24L130.987,93.76H96L0,338.24h39.253l19.627-52.267h109.013l19.627,52.267H226.773z M71.893,250.987
L113.28,140.48l41.387,110.507H71.893z"/>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 894 B

View File

@@ -1,3 +0,0 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M7 2L6 3V6H7V3H14V5.45306L14.2071 5.29286L15 6.08576V3L14 2H7ZM8 4H10V6H8V4ZM5 9H3V11H5V9ZM2 7L1 8V13L2 14H9L10 13V8L9 7H2ZM2 13V8H9V13H2ZM8 10H6V12H8V10ZM13 4H12V7.86388L10.818 6.68192L10.1109 7.38903L12.1465 9.42454L12.8536 9.42454L14.889 7.38908L14.1819 6.68197L13 7.86388V4Z" fill="#424242"/>
</svg>

Before

Width:  |  Height:  |  Size: 449 B

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -14,24 +14,26 @@
import { pathExists, readJson, writeJson } from "fs-extra";
import { resolve, relative } from "path";
import { Octokit, type RestEndpointMethodTypes } from "@octokit/rest";
import { Octokit } from "@octokit/core";
import { type RestEndpointMethodTypes } from "@octokit/rest";
import { throttling } from "@octokit/plugin-throttling";
import { getFiles } from "./util/files";
import type { GitHubApiRequest } from "../src/variant-analysis/gh-api/mocks/gh-api-request";
import { isGetVariantAnalysisRequest } from "../src/variant-analysis/gh-api/mocks/gh-api-request";
import type { GitHubApiRequest } from "../src/common/mock-gh-api/gh-api-request";
import { isGetVariantAnalysisRequest } from "../src/common/mock-gh-api/gh-api-request";
import { VariantAnalysis } from "../src/variant-analysis/gh-api/variant-analysis";
import { RepositoryWithMetadata } from "../src/variant-analysis/gh-api/repository";
import { AppOctokit } from "../src/common/octokit";
const extensionDirectory = resolve(__dirname, "..");
const scenariosDirectory = resolve(
extensionDirectory,
"src/variant-analysis/gh-api/mocks/scenarios",
"src/common/mock-gh-api/scenarios",
);
// Make sure we don't run into rate limits by automatically waiting until we can
// make another request.
const MyOctokit = Octokit.plugin(throttling);
const MyOctokit = AppOctokit.plugin(throttling);
const auth = process.env.GITHUB_TOKEN;

View File

@@ -6,6 +6,7 @@ import { exit } from "process";
function ignoreFile(file: string): boolean {
return (
containsPath("gulpfile.ts", file) ||
containsPath(".storybook", file) ||
containsPath(join("src", "stories"), file) ||
pathsEqual(
join("test", "vscode-tests", "jest-runner-installed-extensions.ts"),

View File

@@ -22,7 +22,7 @@ const scenarioName = process.argv[2];
const extensionDirectory = resolve(__dirname, "..");
const scenariosDirectory = resolve(
extensionDirectory,
"src/variant-analysis/gh-api/mocks/scenarios",
"src/common/mock-gh-api/scenarios",
);
const scenarioDirectory = resolve(scenariosDirectory, scenarioName);

View File

@@ -0,0 +1,72 @@
import { createGenerator } from "ts-json-schema-generator";
import { join, resolve } from "path";
import { outputFile } from "fs-extra";
import { format, resolveConfig } from "prettier";
const extensionDirectory = resolve(__dirname, "..");
const schemas = [
{
path: join(
extensionDirectory,
"src",
"model-editor",
"extension-pack-metadata.ts",
),
type: "ExtensionPackMetadata",
schemaPath: join(
extensionDirectory,
"src",
"model-editor",
"extension-pack-metadata.schema.json",
),
},
{
path: join(
extensionDirectory,
"src",
"model-editor",
"model-extension-file.ts",
),
type: "ModelExtensionFile",
schemaPath: join(
extensionDirectory,
"src",
"model-editor",
"model-extension-file.schema.json",
),
},
];
async function generateSchema(
schemaDefinition: (typeof schemas)[number],
): Promise<void> {
const schema = createGenerator({
path: schemaDefinition.path,
tsconfig: resolve(extensionDirectory, "tsconfig.json"),
type: schemaDefinition.type,
skipTypeCheck: true,
topRef: true,
additionalProperties: true,
}).createSchema(schemaDefinition.type);
const schemaJson = JSON.stringify(schema, null, 2);
const prettierOptions = await resolveConfig(schemaDefinition.schemaPath);
const formattedSchemaJson = await format(schemaJson, {
...prettierOptions,
filepath: schemaDefinition.schemaPath,
});
await outputFile(schemaDefinition.schemaPath, formattedSchemaJson);
}
async function generateSchemas() {
await Promise.all(schemas.map(generateSchema));
}
generateSchemas().catch((e: unknown) => {
console.error(e);
process.exit(2);
});

View File

@@ -10,7 +10,7 @@ const extensionDirectory = resolve(__dirname, "..");
const rootDirectory = resolve(extensionDirectory, "../..");
const scenariosDirectory = resolve(
extensionDirectory,
"src/variant-analysis/gh-api/mocks/scenarios",
"src/common/mock-gh-api/scenarios",
);
const debug = process.env.RUNNER_DEBUG || process.argv.includes("--debug");
@@ -19,7 +19,7 @@ async function lintScenarios() {
const schema = createGenerator({
path: resolve(
extensionDirectory,
"src/variant-analysis/gh-api/mocks/gh-api-request.ts",
"src/common/mock-gh-api/gh-api-request.ts",
),
tsconfig: resolve(extensionDirectory, "tsconfig.json"),
type: "GitHubApiRequest",

View File

@@ -6,7 +6,6 @@ import { dirname, join, delimiter } from "path";
import * as sarif from "sarif";
import { SemVer } from "semver";
import { Readable } from "stream";
import { StringDecoder } from "string_decoder";
import tk from "tree-kill";
import { promisify } from "util";
import { CancellationToken, Disposable, Uri } from "vscode";
@@ -19,6 +18,7 @@ import {
} from "./distribution";
import {
assertNever,
getChildProcessErrorMessage,
getErrorMessage,
getErrorStack,
} from "../common/helpers-pure";
@@ -30,6 +30,7 @@ import { CompilationMessage } from "../query-server/legacy-messages";
import { sarifParser } from "../common/sarif-parser";
import { App } from "../common/app";
import { QueryLanguage } from "../common/query-language";
import { LINE_ENDINGS, splitStreamAtSeparators } from "../common/split-stream";
/**
* The version of the SARIF format that we are using.
@@ -123,6 +124,15 @@ export type ResolveExtensionsResult = {
};
};
export type GenerateExtensiblePredicateMetadataResult = {
// There are other properties in this object, but they are
// not relevant for its use in the extension, so we omit them.
extensible_predicates: Array<{
// pack relative path
path: string;
}>;
};
/**
* The expected output of `codeql resolve qlref`.
*/
@@ -538,9 +548,7 @@ export class CodeQLCliServer implements Disposable {
yield JSON.parse(event) as EventType;
} catch (err) {
throw new Error(
`Parsing output of ${description} failed: ${
(err as any).stderr || getErrorMessage(err)
}`,
`Parsing output of ${description} failed: ${getErrorMessage(err)}`,
);
}
}
@@ -638,9 +646,7 @@ export class CodeQLCliServer implements Disposable {
return JSON.parse(result) as OutputType;
} catch (err) {
throw new Error(
`Parsing output of ${description} failed: ${
(err as any).stderr || getErrorMessage(err)
}`,
`Parsing output of ${description} failed: ${getErrorMessage(err)}`,
);
}
}
@@ -1458,6 +1464,17 @@ export class CodeQLCliServer implements Disposable {
);
}
async generateExtensiblePredicateMetadata(
packRoot: string,
): Promise<GenerateExtensiblePredicateMetadataResult> {
return await this.runJsonCodeQlCliCommand(
["generate", "extensible-predicate-metadata"],
[packRoot],
"Generating extensible predicate metadata",
{ addFormat: false },
);
}
public async getVersion() {
if (!this._version) {
try {
@@ -1627,125 +1644,18 @@ export async function runCodeQlCliCommand(
return result.stdout;
} catch (err) {
throw new Error(
`${description} failed: ${(err as any).stderr || getErrorMessage(err)}`,
`${description} failed: ${getChildProcessErrorMessage(err)}`,
);
}
}
/**
* Buffer to hold state used when splitting a text stream into lines.
*/
class SplitBuffer {
private readonly decoder = new StringDecoder("utf8");
private readonly maxSeparatorLength: number;
private buffer = "";
private searchIndex = 0;
constructor(private readonly separators: readonly string[]) {
this.maxSeparatorLength = separators
.map((s) => s.length)
.reduce((a, b) => Math.max(a, b), 0);
}
/**
* Append new text data to the buffer.
* @param chunk The chunk of data to append.
*/
public addChunk(chunk: Buffer): void {
this.buffer += this.decoder.write(chunk);
}
/**
* Signal that the end of the input stream has been reached.
*/
public end(): void {
this.buffer += this.decoder.end();
this.buffer += this.separators[0]; // Append a separator to the end to ensure the last line is returned.
}
/**
* A version of startsWith that isn't overriden by a broken version of ms-python.
*
* The definition comes from
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith
* which is CC0/public domain
*
* See https://github.com/github/vscode-codeql/issues/802 for more context as to why we need it.
*/
private static startsWith(
s: string,
searchString: string,
position: number,
): boolean {
const pos = position > 0 ? position | 0 : 0;
return s.substring(pos, pos + searchString.length) === searchString;
}
/**
* Extract the next full line from the buffer, if one is available.
* @returns The text of the next available full line (without the separator), or `undefined` if no
* line is available.
*/
public getNextLine(): string | undefined {
while (this.searchIndex <= this.buffer.length - this.maxSeparatorLength) {
for (const separator of this.separators) {
if (SplitBuffer.startsWith(this.buffer, separator, this.searchIndex)) {
const line = this.buffer.slice(0, this.searchIndex);
this.buffer = this.buffer.slice(this.searchIndex + separator.length);
this.searchIndex = 0;
return line;
}
}
this.searchIndex++;
}
return undefined;
}
}
/**
* Splits a text stream into lines based on a list of valid line separators.
* @param stream The text stream to split. This stream will be fully consumed.
* @param separators The list of strings that act as line separators.
* @returns A sequence of lines (not including separators).
*/
async function* splitStreamAtSeparators(
stream: Readable,
separators: string[],
): AsyncGenerator<string, void, unknown> {
const buffer = new SplitBuffer(separators);
for await (const chunk of stream) {
buffer.addChunk(chunk);
let line: string | undefined;
do {
line = buffer.getNextLine();
if (line !== undefined) {
yield line;
}
} while (line !== undefined);
}
buffer.end();
let line: string | undefined;
do {
line = buffer.getNextLine();
if (line !== undefined) {
yield line;
}
} while (line !== undefined);
}
/**
* Standard line endings for splitting human-readable text.
*/
const lineEndings = ["\r\n", "\r", "\n"];
/**
* Log a text stream to a `Logger` interface.
* @param stream The stream to log.
* @param logger The logger that will consume the stream output.
*/
async function logStream(stream: Readable, logger: BaseLogger): Promise<void> {
for await (const line of splitStreamAtSeparators(stream, lineEndings)) {
for await (const line of splitStreamAtSeparators(stream, LINE_ENDINGS)) {
// Await the result of log here in order to ensure the logs are written in the correct order.
await logger.log(line);
}
@@ -1830,6 +1740,14 @@ export class CliVersionConstraint {
*/
public static CLI_VERSION_WITH_QUICK_EVAL_COUNT = new SemVer("2.13.3");
/**
* 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.
*/
@@ -1916,4 +1834,10 @@ export class CliVersionConstraint {
CliVersionConstraint.CLI_VERSION_WITH_QUICK_EVAL_COUNT,
);
}
async supportsGenerateExtensiblePredicateMetadata() {
return this.isVersionAtLeast(
CliVersionConstraint.CLI_VERSION_WITH_EXTENSIBLE_PREDICATE_METADATA,
);
}
}

View File

@@ -12,7 +12,6 @@ import type {
} from "../variant-analysis/shared/variant-analysis";
import type { QLDebugConfiguration } from "../debugger/debug-configuration";
import type { QueryTreeViewItem } from "../queries-panel/query-tree-view-item";
import type { Usage } from "../data-extensions-editor/external-api-usage";
// A command function matching the signature that VS Code calls when
// a command is invoked from a context menu on a TreeView with
@@ -135,6 +134,7 @@ export type LocalQueryCommands = {
"codeQLQueries.runLocalQueryContextMenu": TreeViewContextSingleSelectionCommandFunction<QueryTreeViewItem>;
"codeQLQueries.runLocalQueriesContextMenu": TreeViewContextSingleSelectionCommandFunction<QueryTreeViewItem>;
"codeQLQueries.runLocalQueriesFromPanel": TreeViewContextSingleSelectionCommandFunction<QueryTreeViewItem>;
"codeQLQueries.createQuery": () => Promise<void>;
"codeQL.runLocalQueryFromFileTab": (uri: Uri) => Promise<void>;
"codeQL.runQueries": ExplorerSelectionCommandFunction<Uri>;
"codeQL.quickEval": (uri: Uri) => Promise<void>;
@@ -218,6 +218,24 @@ export type LocalDatabasesCommands = {
"codeQLDatabases.chooseDatabaseGithub": () => Promise<void>;
"codeQLDatabases.sortByName": () => Promise<void>;
"codeQLDatabases.sortByDateAdded": () => Promise<void>;
"codeQLDatabases.displayAllLanguages": () => Promise<void>;
"codeQLDatabases.displayCpp": () => Promise<void>;
"codeQLDatabases.displayCsharp": () => Promise<void>;
"codeQLDatabases.displayGo": () => Promise<void>;
"codeQLDatabases.displayJava": () => Promise<void>;
"codeQLDatabases.displayJavascript": () => Promise<void>;
"codeQLDatabases.displayPython": () => Promise<void>;
"codeQLDatabases.displayRuby": () => Promise<void>;
"codeQLDatabases.displaySwift": () => Promise<void>;
"codeQLDatabases.displayAllLanguagesSelected": () => Promise<void>;
"codeQLDatabases.displayCppSelected": () => Promise<void>;
"codeQLDatabases.displayCsharpSelected": () => Promise<void>;
"codeQLDatabases.displayGoSelected": () => Promise<void>;
"codeQLDatabases.displayJavaSelected": () => Promise<void>;
"codeQLDatabases.displayJavascriptSelected": () => Promise<void>;
"codeQLDatabases.displayPythonSelected": () => Promise<void>;
"codeQLDatabases.displayRubySelected": () => Promise<void>;
"codeQLDatabases.displaySwiftSelected": () => Promise<void>;
// Database panel context menu
"codeQLDatabases.setCurrentDatabase": (
@@ -302,10 +320,11 @@ export type PackagingCommands = {
"codeQL.downloadPacks": () => Promise<void>;
};
export type DataExtensionsEditorCommands = {
"codeQL.openDataExtensionsEditor": () => Promise<void>;
"codeQLDataExtensionsEditor.jumpToUsageLocation": (
usage: Usage,
export type ModelEditorCommands = {
"codeQL.openModelEditor": () => Promise<void>;
"codeQL.openModelEditorFromModelingPanel": () => Promise<void>;
"codeQLModelEditor.jumpToMethod": (
methodSignature: string,
databaseItem: DatabaseItem,
) => Promise<void>;
};
@@ -347,7 +366,7 @@ export type AllExtensionCommands = BaseCommands &
AstCfgCommands &
AstViewerCommands &
PackagingCommands &
DataExtensionsEditorCommands &
ModelEditorCommands &
EvalLogViewerCommands &
SummaryLanguageSupportCommands &
Partial<TestUICommands> &

View File

@@ -9,10 +9,16 @@ export type DisposeHandler = (disposable: Disposable) => void;
/**
* Base class to make it easier to implement a `Disposable` that owns other disposable object.
*/
export abstract class DisposableObject implements Disposable {
export class DisposableObject implements Disposable {
private disposables: Disposable[] = [];
private tracked?: Set<Disposable> = undefined;
constructor(...dispoables: Disposable[]) {
for (const d of dispoables) {
this.push(d);
}
}
/**
* Adds `obj` to a list of objects to dispose when `this` is disposed. Objects added by `push` are
* disposed in reverse order of being added.

View File

@@ -67,3 +67,26 @@ export function asError(e: unknown): Error {
return e instanceof Error ? e : new Error(String(e));
}
/**
* Get error message when the error may have come from a method from the `child_process` module.
*/
export function getChildProcessErrorMessage(e: unknown): string {
return isChildProcessError(e) ? e.stderr : getErrorMessage(e);
}
/**
* Error thrown from methods from the `child_process` module.
*/
interface ChildProcessError {
readonly stderr: string;
}
function isChildProcessError(e: unknown): e is ChildProcessError {
return (
typeof e === "object" &&
e !== null &&
"stderr" in e &&
typeof e.stderr === "string"
);
}

View File

@@ -17,13 +17,14 @@ import {
} from "../variant-analysis/shared/variant-analysis-filter-sort";
import { ErrorLike } from "../common/errors";
import { DataFlowPaths } from "../variant-analysis/shared/data-flow-paths";
import { Method } from "../model-editor/method";
import { ModeledMethod } from "../model-editor/modeled-method";
import {
ExternalApiUsage,
Usage,
} from "../data-extensions-editor/external-api-usage";
import { ModeledMethod } from "../data-extensions-editor/modeled-method";
import { DataExtensionEditorViewState } from "../data-extensions-editor/shared/view-state";
import { Mode } from "../data-extensions-editor/shared/mode";
MethodModelingPanelViewState,
ModelEditorViewState,
} from "../model-editor/shared/view-state";
import { Mode } from "../model-editor/shared/mode";
import { QueryLanguage } from "./query-language";
/**
* This module contains types and code that are shared between
@@ -54,6 +55,7 @@ export const RAW_RESULTS_LIMIT = 10000;
export interface DatabaseInfo {
name: string;
databaseUri: string;
language?: QueryLanguage;
}
/** Arbitrary query metadata */
@@ -494,23 +496,23 @@ export type ToDataFlowPathsMessage = SetDataFlowPathsMessage;
export type FromDataFlowPathsMessage = CommonFromViewMessages;
interface SetExtensionPackStateMessage {
t: "setDataExtensionEditorViewState";
viewState: DataExtensionEditorViewState;
t: "setModelEditorViewState";
viewState: ModelEditorViewState;
}
interface SetExternalApiUsagesMessage {
t: "setExternalApiUsages";
externalApiUsages: ExternalApiUsage[];
interface SetMethodsMessage {
t: "setMethods";
methods: Method[];
}
interface LoadModeledMethodsMessage {
t: "loadModeledMethods";
modeledMethods: Record<string, ModeledMethod>;
interface SetModeledMethodsMessage {
t: "setModeledMethods";
methods: Record<string, ModeledMethod[]>;
}
interface AddModeledMethodsMessage {
t: "addModeledMethods";
modeledMethods: Record<string, ModeledMethod>;
interface SetModifiedMethodsMessage {
t: "setModifiedMethods";
methodSignatures: string[];
}
interface SetInProgressMethodsMessage {
@@ -524,9 +526,9 @@ interface SwitchModeMessage {
mode: Mode;
}
interface JumpToUsageMessage {
t: "jumpToUsage";
usage: Usage;
interface JumpToMethodMessage {
t: "jumpToMethod";
methodSignature: string;
}
interface OpenDatabaseMessage {
@@ -537,29 +539,27 @@ interface OpenExtensionPackMessage {
t: "openExtensionPack";
}
interface RefreshExternalApiUsages {
t: "refreshExternalApiUsages";
interface RefreshMethods {
t: "refreshMethods";
}
interface SaveModeledMethods {
t: "saveModeledMethods";
externalApiUsages: ExternalApiUsage[];
modeledMethods: Record<string, ModeledMethod>;
methodSignatures?: string[];
}
interface GenerateExternalApiMessage {
t: "generateExternalApi";
interface GenerateMethodMessage {
t: "generateMethod";
}
interface GenerateExternalApiFromLlmMessage {
t: "generateExternalApiFromLlm";
interface GenerateMethodsFromLlmMessage {
t: "generateMethodsFromLlm";
packageName: string;
externalApiUsages: ExternalApiUsage[];
modeledMethods: Record<string, ModeledMethod>;
methodSignatures: string[];
}
interface StopGeneratingExternalApiFromLlmMessage {
t: "stopGeneratingExternalApiFromLlm";
interface StopGeneratingMethodsFromLlmMessage {
t: "stopGeneratingMethodsFromLlm";
packageName: string;
}
@@ -567,22 +567,96 @@ interface ModelDependencyMessage {
t: "modelDependency";
}
export type ToDataExtensionsEditorMessage =
| SetExtensionPackStateMessage
| SetExternalApiUsagesMessage
| LoadModeledMethodsMessage
| AddModeledMethodsMessage
| SetInProgressMethodsMessage;
interface HideModeledMethodsMessage {
t: "hideModeledMethods";
hideModeledMethods: boolean;
}
export type FromDataExtensionsEditorMessage =
| ViewLoadedMsg
interface SetModeledMethodMessage {
t: "setModeledMethod";
method: ModeledMethod;
}
interface SetMultipleModeledMethodsMessage {
t: "setMultipleModeledMethods";
methodSignature: string;
modeledMethods: ModeledMethod[];
}
interface SetInModelingModeMessage {
t: "setInModelingMode";
inModelingMode: boolean;
}
interface RevealMethodMessage {
t: "revealMethod";
methodSignature: string;
}
export type ToModelEditorMessage =
| SetExtensionPackStateMessage
| SetMethodsMessage
| SetModeledMethodsMessage
| SetModifiedMethodsMessage
| SetInProgressMethodsMessage
| RevealMethodMessage;
export type FromModelEditorMessage =
| CommonFromViewMessages
| SwitchModeMessage
| RefreshExternalApiUsages
| RefreshMethods
| OpenDatabaseMessage
| OpenExtensionPackMessage
| JumpToUsageMessage
| JumpToMethodMessage
| SaveModeledMethods
| GenerateExternalApiMessage
| GenerateExternalApiFromLlmMessage
| StopGeneratingExternalApiFromLlmMessage
| ModelDependencyMessage;
| GenerateMethodMessage
| GenerateMethodsFromLlmMessage
| StopGeneratingMethodsFromLlmMessage
| ModelDependencyMessage
| HideModeledMethodsMessage
| SetModeledMethodMessage;
interface RevealInEditorMessage {
t: "revealInModelEditor";
method: Method;
}
interface StartModelingMessage {
t: "startModeling";
}
export type FromMethodModelingMessage =
| CommonFromViewMessages
| SetModeledMethodMessage
| RevealInEditorMessage
| StartModelingMessage;
interface SetMethodModelingPanelViewStateMessage {
t: "setMethodModelingPanelViewState";
viewState: MethodModelingPanelViewState;
}
interface SetMethodMessage {
t: "setMethod";
method: Method | undefined;
}
interface SetMethodModifiedMessage {
t: "setMethodModified";
isModified: boolean;
}
interface SetSelectedMethodMessage {
t: "setSelectedMethod";
method: Method;
modeledMethods: ModeledMethod[];
isModified: boolean;
}
export type ToMethodModelingMessage =
| SetMethodModelingPanelViewStateMessage
| SetMethodMessage
| SetMultipleModeledMethodsMessage
| SetMethodModifiedMessage
| SetSelectedMethodMessage
| SetInModelingModeMessage;

View File

@@ -1,5 +1,8 @@
import { Repository } from "../repository";
import { VariantAnalysis, VariantAnalysisRepoTask } from "../variant-analysis";
import { Repository } from "../../variant-analysis/gh-api/repository";
import {
VariantAnalysis,
VariantAnalysisRepoTask,
} from "../../variant-analysis/gh-api/variant-analysis";
// Types that represent requests/responses from the GitHub API
// that we need to mock.
@@ -14,7 +17,7 @@ export enum RequestKind {
AutoModel = "autoModel",
}
interface BasicErorResponse {
export interface BasicErrorResponse {
message: string;
}
@@ -24,7 +27,7 @@ interface GetRepoRequest {
};
response: {
status: number;
body: Repository | BasicErorResponse | undefined;
body: Repository | BasicErrorResponse | undefined;
};
}
@@ -34,7 +37,7 @@ interface SubmitVariantAnalysisRequest {
};
response: {
status: number;
body?: VariantAnalysis | BasicErorResponse;
body?: VariantAnalysis | BasicErrorResponse;
};
}
@@ -44,7 +47,7 @@ interface GetVariantAnalysisRequest {
};
response: {
status: number;
body?: VariantAnalysis | BasicErorResponse;
body?: VariantAnalysis | BasicErrorResponse;
};
}
@@ -55,7 +58,7 @@ interface GetVariantAnalysisRepoRequest {
};
response: {
status: number;
body?: VariantAnalysisRepoTask | BasicErorResponse;
body?: VariantAnalysisRepoTask | BasicErrorResponse;
};
}
@@ -71,6 +74,13 @@ export interface GetVariantAnalysisRepoResultRequest {
};
}
export interface CodeSearchResponse {
total_count: number;
items: Array<{
repository: Repository;
}>;
}
interface CodeSearchRequest {
request: {
kind: RequestKind.CodeSearch;
@@ -78,16 +88,14 @@ interface CodeSearchRequest {
};
response: {
status: number;
body?: {
total_count?: number;
items?: Array<{
repository: Repository;
}>;
};
message?: string;
body?: CodeSearchResponse | BasicErrorResponse;
};
}
export interface AutoModelResponse {
models: string;
}
interface AutoModelRequest {
request: {
kind: RequestKind.AutoModel;
@@ -97,10 +105,7 @@ interface AutoModelRequest {
};
response: {
status: number;
body?: {
models: string;
};
message?: string;
body?: AutoModelResponse | BasicErrorResponse;
};
}

View File

@@ -2,11 +2,11 @@ import { join, resolve } from "path";
import { pathExists } from "fs-extra";
import { setupServer, SetupServer } from "msw/node";
import { DisposableObject } from "../../../common/disposable-object";
import { DisposableObject } from "../disposable-object";
import { Recorder } from "./recorder";
import { createRequestHandlers } from "./request-handlers";
import { getDirectoryNamesInsidePath } from "../../../common/files";
import { getDirectoryNamesInsidePath } from "../files";
/**
* Enables mocking of the GitHub API server via HTTP interception, using msw.
@@ -129,11 +129,11 @@ export class MockGitHubApiServer extends DisposableObject {
public async getDefaultScenariosPath(): Promise<string | undefined> {
// This should be the directory where package.json is located
const rootDirectory = resolve(__dirname, "../../../..");
const rootDirectory = resolve(__dirname, "../../..");
const scenariosPath = resolve(
rootDirectory,
"src/variant-analysis/gh-api/mocks/scenarios",
"src/common/mock-gh-api/scenarios",
);
if (await pathExists(scenariosPath)) {
return scenariosPath;

View File

@@ -1,30 +1,33 @@
import { ensureDir, writeFile } from "fs-extra";
import { join } from "path";
import { MockedRequest } from "msw";
import { SetupServer } from "msw/node";
import { IsomorphicResponse } from "@mswjs/interceptors";
import { Headers } from "headers-polyfill";
import fetch from "node-fetch";
import { SetupServer } from "msw/node";
import { DisposableObject } from "../../../common/disposable-object";
import { DisposableObject } from "../disposable-object";
import { gzipDecode } from "../zlib";
import {
AutoModelResponse,
BasicErrorResponse,
CodeSearchResponse,
GetVariantAnalysisRepoResultRequest,
GitHubApiRequest,
RequestKind,
} from "./gh-api-request";
import {
VariantAnalysis,
VariantAnalysisRepoTask,
} from "../../variant-analysis/gh-api/variant-analysis";
import { Repository } from "../../variant-analysis/gh-api/repository";
export class Recorder extends DisposableObject {
private readonly allRequests = new Map<string, MockedRequest>();
private currentRecordedScenario: GitHubApiRequest[] = [];
private _isRecording = false;
constructor(private readonly server: SetupServer) {
super();
this.onRequestStart = this.onRequestStart.bind(this);
this.onResponseBypass = this.onResponseBypass.bind(this);
}
@@ -45,7 +48,6 @@ export class Recorder extends DisposableObject {
this.clear();
this.server.events.on("request:start", this.onRequestStart);
this.server.events.on("response:bypass", this.onResponseBypass);
}
@@ -56,13 +58,11 @@ export class Recorder extends DisposableObject {
this._isRecording = false;
this.server.events.removeListener("request:start", this.onRequestStart);
this.server.events.removeListener("response:bypass", this.onResponseBypass);
}
public clear() {
this.currentRecordedScenario = [];
this.allRequests.clear();
}
public async save(scenariosPath: string, name: string): Promise<string> {
@@ -91,7 +91,7 @@ export class Recorder extends DisposableObject {
let bodyFileLink = undefined;
if (writtenRequest.response.body) {
await writeFile(bodyFilePath, writtenRequest.response.body || "");
await writeFile(bodyFilePath, writtenRequest.response.body);
bodyFileLink = `file:${bodyFileName}`;
}
@@ -112,33 +112,18 @@ export class Recorder extends DisposableObject {
return scenarioDirectory;
}
private onRequestStart(request: MockedRequest): void {
private async onResponseBypass(
response: Response,
request: Request,
_requestId: string,
): Promise<void> {
if (request.headers.has("x-vscode-codeql-msw-bypass")) {
return;
}
this.allRequests.set(request.id, request);
}
private async onResponseBypass(
response: IsomorphicResponse,
requestId: string,
): Promise<void> {
const request = this.allRequests.get(requestId);
this.allRequests.delete(requestId);
if (!request) {
return;
}
if (response.body === undefined) {
return;
}
const gitHubApiRequest = await createGitHubApiRequest(
request.url.toString(),
response.status,
response.body,
response.headers,
request.url,
response,
);
if (!gitHubApiRequest) {
return;
@@ -150,14 +135,14 @@ export class Recorder extends DisposableObject {
async function createGitHubApiRequest(
url: string,
status: number,
body: string,
headers: Headers,
response: Response,
): Promise<GitHubApiRequest | undefined> {
if (!url) {
return undefined;
}
const status = response.status;
if (url.match(/\/repos\/[a-zA-Z0-9-_.]+\/[a-zA-Z0-9-_.]+$/)) {
return {
request: {
@@ -165,7 +150,9 @@ async function createGitHubApiRequest(
},
response: {
status,
body: JSON.parse(body),
body: await jsonResponseBody<
Repository | BasicErrorResponse | undefined
>(response),
},
};
}
@@ -179,7 +166,9 @@ async function createGitHubApiRequest(
},
response: {
status,
body: JSON.parse(body),
body: await jsonResponseBody<
VariantAnalysis | BasicErrorResponse | undefined
>(response),
},
};
}
@@ -195,7 +184,9 @@ async function createGitHubApiRequest(
},
response: {
status,
body: JSON.parse(body),
body: await jsonResponseBody<
VariantAnalysis | BasicErrorResponse | undefined
>(response),
},
};
}
@@ -211,7 +202,9 @@ async function createGitHubApiRequest(
},
response: {
status,
body: JSON.parse(body),
body: await jsonResponseBody<
VariantAnalysisRepoTask | BasicErrorResponse | undefined
>(response),
},
};
}
@@ -238,9 +231,10 @@ async function createGitHubApiRequest(
repositoryId: parseInt(repoDownloadMatch.groups.repositoryId, 10),
},
response: {
status,
status: response.status,
body: responseBuffer,
contentType: headers.get("content-type") ?? "application/octet-stream",
contentType:
response.headers.get("content-type") ?? "application/octet-stream",
},
};
}
@@ -254,7 +248,9 @@ async function createGitHubApiRequest(
},
response: {
status,
body: JSON.parse(body),
body: await jsonResponseBody<
CodeSearchResponse | BasicErrorResponse | undefined
>(response),
},
};
}
@@ -269,7 +265,9 @@ async function createGitHubApiRequest(
},
response: {
status,
body: JSON.parse(body),
body: await jsonResponseBody<
BasicErrorResponse | AutoModelResponse | undefined
>(response),
},
};
}
@@ -277,6 +275,26 @@ async function createGitHubApiRequest(
return undefined;
}
async function responseBody(response: Response): Promise<Uint8Array> {
const body = await response.arrayBuffer();
const view = new Uint8Array(body);
if (view[0] === 0x1f && view[1] === 0x8b) {
// Response body is gzipped, so we need to un-gzip it.
return await gzipDecode(view);
} else {
return view;
}
}
async function jsonResponseBody<T>(response: Response): Promise<T> {
const body = await responseBody(response);
const text = new TextDecoder("utf-8").decode(body);
return JSON.parse(text);
}
function shouldWriteBodyToFile(
request: GitHubApiRequest,
): request is GetVariantAnalysisRepoResultRequest {

View File

@@ -1,6 +1,6 @@
import { join } from "path";
import { readdir, readJson, readFile } from "fs-extra";
import { DefaultBodyType, MockedRequest, rest, RestHandler } from "msw";
import { RequestHandler, rest } from "msw";
import {
GitHubApiRequest,
isAutoModelRequest,
@@ -14,7 +14,19 @@ import {
const baseUrl = "https://api.github.com";
type RequestHandler = RestHandler<MockedRequest<DefaultBodyType>>;
const jsonResponse = <T>(
body: T,
init?: ResponseInit,
contentType = "application/json",
): Response => {
return new Response(JSON.stringify(body), {
...init,
headers: {
"Content-Type": contentType,
...init?.headers,
},
});
};
export async function createRequestHandlers(
scenarioDirPath: string,
@@ -82,11 +94,10 @@ function createGetRepoRequestHandler(
const getRepoRequest = getRepoRequests[0];
return rest.get(`${baseUrl}/repos/:owner/:name`, (_req, res, ctx) => {
return res(
ctx.status(getRepoRequest.response.status),
ctx.json(getRepoRequest.response.body),
);
return rest.get(`${baseUrl}/repos/:owner/:name`, () => {
return jsonResponse(getRepoRequest.response.body, {
status: getRepoRequest.response.status,
});
});
}
@@ -105,11 +116,10 @@ function createSubmitVariantAnalysisRequestHandler(
return rest.post(
`${baseUrl}/repositories/:controllerRepoId/code-scanning/codeql/variant-analyses`,
(_req, res, ctx) => {
return res(
ctx.status(getRepoRequest.response.status),
ctx.json(getRepoRequest.response.body),
);
() => {
return jsonResponse(getRepoRequest.response.body, {
status: getRepoRequest.response.status,
});
},
);
}
@@ -127,7 +137,7 @@ function createGetVariantAnalysisRequestHandler(
// request, so keep an index of the request and return the appropriate response.
return rest.get(
`${baseUrl}/repositories/:controllerRepoId/code-scanning/codeql/variant-analyses/:variantAnalysisId`,
(_req, res, ctx) => {
() => {
const request = getVariantAnalysisRequests[requestIndex];
if (requestIndex < getVariantAnalysisRequests.length - 1) {
@@ -135,10 +145,9 @@ function createGetVariantAnalysisRequestHandler(
requestIndex++;
}
return res(
ctx.status(request.response.status),
ctx.json(request.response.body),
);
return jsonResponse(request.response.body, {
status: request.response.status,
});
},
);
}
@@ -152,18 +161,17 @@ function createGetVariantAnalysisRepoRequestHandler(
return rest.get(
`${baseUrl}/repositories/:controllerRepoId/code-scanning/codeql/variant-analyses/:variantAnalysisId/repositories/:repoId`,
(req, res, ctx) => {
({ request, params }) => {
const scenarioRequest = getVariantAnalysisRepoRequests.find(
(r) => r.request.repositoryId.toString() === req.params.repoId,
(r) => r.request.repositoryId.toString() === params.repoId,
);
if (!scenarioRequest) {
throw Error(`No scenario request found for ${req.url}`);
throw Error(`No scenario request found for ${request.url}`);
}
return res(
ctx.status(scenarioRequest.response.status),
ctx.json(scenarioRequest.response.body),
);
return jsonResponse(scenarioRequest.response.body, {
status: scenarioRequest.response.status,
});
},
);
}
@@ -177,22 +185,23 @@ function createGetVariantAnalysisRepoResultRequestHandler(
return rest.get(
"https://objects-origin.githubusercontent.com/codeql-query-console/codeql-variant-analysis-repo-tasks/:variantAnalysisId/:repoId/*",
(req, res, ctx) => {
({ request, params }) => {
const scenarioRequest = getVariantAnalysisRepoResultRequests.find(
(r) => r.request.repositoryId.toString() === req.params.repoId,
(r) => r.request.repositoryId.toString() === params.repoId,
);
if (!scenarioRequest) {
throw Error(`No scenario request found for ${req.url}`);
throw Error(`No scenario request found for ${request.url}`);
}
if (scenarioRequest.response.body) {
return res(
ctx.status(scenarioRequest.response.status),
ctx.set("Content-Type", scenarioRequest.response.contentType),
ctx.body(scenarioRequest.response.body),
);
return new Response(scenarioRequest.response.body, {
status: scenarioRequest.response.status,
headers: {
"Content-Type": scenarioRequest.response.contentType,
},
});
} else {
return res(ctx.status(scenarioRequest.response.status));
return new Response(null, { status: scenarioRequest.response.status });
}
},
);
@@ -207,7 +216,7 @@ function createCodeSearchRequestHandler(
// During a code search, there are multiple request to get pages of results. We
// need to return different responses for each request, so keep an index of the
// request and return the appropriate response.
return rest.get(`${baseUrl}/search/code?q=*`, (_req, res, ctx) => {
return rest.get(`${baseUrl}/search/code`, () => {
const request = codeSearchRequests[requestIndex];
if (requestIndex < codeSearchRequests.length - 1) {
@@ -215,10 +224,9 @@ function createCodeSearchRequestHandler(
requestIndex++;
}
return res(
ctx.status(request.response.status),
ctx.json(request.response.body),
);
return jsonResponse(request.response.body, {
status: request.response.status,
});
});
}
@@ -233,7 +241,7 @@ function createAutoModelRequestHandler(
// so keep an index of the request and return the appropriate response.
return rest.post(
`${baseUrl}/repos/github/codeql/code-scanning/codeql/auto-model`,
(_req, res, ctx) => {
() => {
const request = autoModelRequests[requestIndex];
if (requestIndex < autoModelRequests.length - 1) {
@@ -241,10 +249,9 @@ function createAutoModelRequestHandler(
requestIndex++;
}
return res(
ctx.status(request.response.status),
ctx.json(request.response.body),
);
return jsonResponse(request.response.body, {
status: request.response.status,
});
},
);
}

View File

@@ -5,7 +5,7 @@
},
"response": {
"status": 200,
"body": "file:20-getVariantAnalysisRepoResult.body.zip",
"body": "file:19-getVariantAnalysisRepoResult.body.zip",
"contentType": "application/zip"
}
}

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