Skip to content

Commit aa6c60a

Browse files
authored
Merge pull request github#12342 from github/codeql-cli-2.12.3-mergeback
Mergeback: codeql-cli-2.12.3 into main
2 parents f3f5f6e + 6224d6c commit aa6c60a

18 files changed

+282
-15
lines changed

docs/codeql/codeql-for-visual-studio-code/about-codeql-for-visual-studio-code.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ CodeQL for Visual Studio Code provides an easy way to run queries from the large
1414
With these queries, or your own custom queries, you can analyze databases generated from source code to find errors and security vulnerabilities.
1515
The Results view shows the flow of data through the results of path queries, which is essential for triaging security results.
1616

17-
The CodeQL extension also adds a **CodeQL** sidebar view to VS Code. This contains a list of databases, and an overview of the queries that you have run in the current session.
17+
The CodeQL extension also adds a **CodeQL** sidebar view to VS Code. This contains a list of local CodeQL databases, an overview of the queries that you have run in the current session, and a variant analysis view for large scale analysis.
1818

1919
The extension provides standard `IntelliSense <https://code.visualstudio.com/docs/editor/intellisense>`__
2020
features for query files (extension ``.ql``) and library files (extension ``.qll``) that you open in the Visual Studio Code editor.
@@ -36,4 +36,5 @@ Further reading
3636
-------------------
3737

3838
- ":doc:`Setting up CodeQL in Visual Studio Code <setting-up-codeql-in-visual-studio-code>`"
39-
- ":doc:`Analyzing your projects <analyzing-your-projects>`"
39+
- ":doc:`Analyzing your projects <analyzing-your-projects>`"
40+
- ":doc:`Running CodeQL queries at scale with multi-repository variant analysis <running-codeql-queries-at-scale-with-mrva>`"

docs/codeql/codeql-for-visual-studio-code/analyzing-your-projects.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Analyzing your projects
66
=================================================
77

8-
You can run queries on CodeQL databases and view the results in Visual Studio Code.
8+
You can run queries on CodeQL databases and view the results in Visual Studio Code. This article explains how to get a CodeQL database and analyze it on your local machine. For information on running analysis at scale across many CodeQL databases, see ":ref:`Running CodeQL queries at scale with multi-repository variant analysis <running-codeql-queries-at-scale-with-mrva>`."
99

1010
Choosing a database
1111
------------------------
@@ -24,8 +24,8 @@ To analyze a project, you need to add a :ref:`CodeQL database <codeql-database>`
2424

2525
#. Once you've chosen a database, it is displayed in the Databases view. To see the menu options for interacting with a database, right-click an entry in the list. You can select multiple databases using **Ctrl/Cmd+click**.
2626

27-
Obtaining a local database
28-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
27+
Importing a local database
28+
~~~~~~~~~~~~~~~~~~~~~~~~~~
2929

3030
If you have a CodeQL database saved locally, as an unarchived folder or as a ZIP file, you can add it to Visual Studio Code. There are several ways to obtain a local CodeQL database.
3131

@@ -37,6 +37,9 @@ If you have a CodeQL database saved locally, as an unarchived folder or as a ZIP
3737

3838
For more information about running query tests, see "`Testing custom queries <https://docs.github.com/en/code-security/codeql-cli/using-the-codeql-cli/testing-custom-queries>`__" in the CodeQL CLI help.
3939

40+
Downloading a database from GitHub
41+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
42+
4043
.. include:: ../reusables/download-github-database.rst
4144

4245
Running a query

docs/codeql/codeql-for-visual-studio-code/customizing-settings.rst

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ Editing settings
2525

2626
3. Edit a setting. The new settings are saved automatically.
2727

28+
Alternatively, you can edit the settings in JSON format by opening the command palette and selecting **Preferences: Open User Settings (JSON)**.
29+
2830
Choosing a version of the CodeQL CLI
2931
--------------------------------------
3032

@@ -55,17 +57,58 @@ By default, items in the query history view are retained for 30 days. You can se
5557

5658
.. _configuring-settings-for-running-queries:
5759

58-
Configuring settings for running queries
59-
-----------------------------------------
60+
Configuring settings for running queries locally
61+
------------------------------------------------
6062

6163
There are a number of settings for **Running Queries**. If your queries run too slowly and time out frequently, you may want to increase the memory.
6264

6365
.. include:: ../reusables/running-queries-debug.rst
6466

6567
To save query server logs in a custom location, edit the **Running Queries: Custom Log Directory** setting. If you use a custom log directory, the extension saves the logs permanently, instead of deleting them automatically after each workspace session. This is useful if you want to investigate these logs to improve the performance of your queries.
6668

67-
Configuring settings for testing queries
68-
-----------------------------------------
69+
Configuring settings for variant analysis
70+
------------------------------------------
71+
72+
You can define or edit lists of GitHub repositories for variant analysis, and change to a different controller repository using the **Variant analysis** settings.
73+
74+
For information on the purpose and requirements for a controller repository, see ":ref:`Setting up a controller repository for variant analysis <controller-repository>`."
75+
76+
You can also edit the items shown in the Variant Analysis Repositories panel by editing a file in your Visual Studio Code workspace called ``databases.json``. This file contains a JSON representation of all the items displayed in the panel. To open your ``databases.json`` file in an editor window, click the **{ }** icon in the top right of the Variant Analysis Repositories panel. You can then see a structured representation of the repos, orgs and lists in your panel. For example:
77+
78+
.. code-block:: json
79+
80+
{
81+
"version": 1,
82+
"databases": {
83+
"variantAnalysis": {
84+
"repositoryLists": [
85+
{
86+
"name": "My favorite JavaScript repos",
87+
"repositories": [
88+
"facebook/react",
89+
"babel/babel",
90+
"angular/angular"
91+
]
92+
}
93+
],
94+
"owners": [
95+
"microsoft"
96+
],
97+
"repositories": [
98+
"apache/hadoop"
99+
]
100+
}
101+
},
102+
"selected": {
103+
"kind": "variantAnalysisSystemDefinedList",
104+
"listName": "top_10"
105+
}
106+
}
107+
108+
You can change the items shown in the panel or add new items by directly editing this file.
109+
110+
Configuring settings for testing queries locally
111+
------------------------------------------------
69112

70113
To increase the number of threads used for testing queries, you can update the **Running Tests > Number Of Threads** setting.
71114

docs/codeql/codeql-for-visual-studio-code/exploring-data-flow-with-path-queries.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
.. _exploring-data-flow-with-path-queries:
44

55
Exploring data flow with path queries
6-
=================================================
6+
=====================================
77

88
You can run CodeQL queries in VS Code to help you track the flow of data through a program, highlighting areas that are potential security vulnerabilities.
99

@@ -20,8 +20,8 @@ You can also modify the existing queries to model data flow more precisely for t
2020
To ensure that your path query uses the correct format and metadata, follow the instructions in ":ref:`Creating path queries <creating-path-queries>`."
2121
This topic also contains detailed information about how to define new sources and sinks, as well as templates and examples of how to extend the CodeQL libraries to suit your analysis.
2222

23-
Running path queries in VS Code
24-
-----------------------------------
23+
Running path queries in VS Code locally
24+
---------------------------------------
2525

2626
#. Open a path query in the editor.
2727
#. Right-click in the query window and select **CodeQL: Run Query on Selected Database**. (Alternatively, run the command from the Command Palette.)
@@ -30,6 +30,8 @@ Running path queries in VS Code
3030
#. Click each step to jump to it in the source code and investigate the problem further.
3131
#. To navigate the results from your keyboard, you can bind shortcuts to the **CodeQL: Navigate Up/Down/Left/Right in Result Viewer** commands.
3232

33+
When you are ready to run a path query at scale, you can use the Variant Analysis Repositories panel to run the query against up to 1,000 repositories on GitHub.com. For information on running analysis at scale across many CodeQL databases, see ":ref:`Running CodeQL queries at scale with multi-repository variant analysis <running-codeql-queries-at-scale-with-mrva>`."
34+
3335
Further reading
3436
-----------------
3537

docs/codeql/codeql-for-visual-studio-code/index.rst

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ The CodeQL extension for Visual Studio Code adds rich language support for CodeQ
2727
VS Code to help you track the flow of data through a program, highlighting
2828
areas that are potential security vulnerabilities.
2929

30+
- :doc:`Running CodeQL queries at scale with multi-repository variant analysis
31+
<running-codeql-queries-at-scale-with-mrva>`: You can run queries against groups
32+
of repositories on GitHub.com and view results in Visual Studio Code as each analysis
33+
finishes.
34+
3035
- :doc:`Testing CodeQL queries in Visual Studio Code
3136
<testing-codeql-queries-in-visual-studio-code>`: You can run unit tests for
3237
CodeQL queries using the Visual Studio Code extension.
@@ -40,7 +45,13 @@ The CodeQL extension for Visual Studio Code adds rich language support for CodeQ
4045

4146
- :doc:`Troubleshooting CodeQL for Visual Studio Code
4247
<troubleshooting-codeql-for-visual-studio-code>`: You can use the detailed
43-
information written to the extension's log files if you need to troubleshoot problems.
48+
information written to the extension's log files if you need to troubleshoot problems with
49+
analysis of local CodeQL databases.
50+
51+
- :doc:`Troubleshooting variant analysis
52+
<troubleshooting-variant-analysis>`: You can use the detailed
53+
information written to workflow log files in your controller repository if you need to
54+
troubleshoot problems with analysis of CodeQL databases stored on GitHub.com.
4455

4556
- :doc:`About telemetry in CodeQL for Visual Studio Code <about-telemetry-in-codeql-for-visual-studio-code>`: If you specifically opt in to permit GitHub to do so, GitHub will collect usage data and metrics for the purposes of helping the core developers to improve the CodeQL extension for VS Code.
4657

@@ -53,8 +64,10 @@ The CodeQL extension for Visual Studio Code adds rich language support for CodeQ
5364
analyzing-your-projects
5465
exploring-the-structure-of-your-source-code
5566
exploring-data-flow-with-path-queries
67+
running-codeql-queries-at-scale-with-mrva
5668
testing-codeql-queries-in-visual-studio-code
5769
working-with-codeql-packs-in-visual-studio-code
5870
customizing-settings
5971
troubleshooting-codeql-for-visual-studio-code
72+
troubleshooting-variant-analysis
6073
about-telemetry-in-codeql-for-visual-studio-code

0 commit comments

Comments
 (0)