Skip to content

Commit a5f2b55

Browse files
gituliscahmakholmmchammer01heiskr
authored
Add article on creating a CodeQL CLI database bundle (#54323)
Co-authored-by: Henning Makholm <hmakholm@github.com> Co-authored-by: mc <42146119+mchammer01@users.noreply.github.com> Co-authored-by: Kevin Heis <heiskr@users.noreply.github.com>
1 parent 1846647 commit a5f2b55

File tree

3 files changed

+48
-1
lines changed

3 files changed

+48
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
title: Creating CodeQL CLI database bundles
3+
intro: 'You can create a database bundle with {% data variables.product.prodname_codeql %} troubleshooting information.'
4+
allowTitleToDifferFromFilename: true
5+
product: '{% data reusables.gated-features.codeql %}'
6+
versions:
7+
fpt: '*'
8+
ghes: '*'
9+
ghec: '*'
10+
topics:
11+
- Advanced Security
12+
- Code scanning
13+
- CodeQL
14+
---
15+
16+
> [!WARNING]
17+
> {% data variables.product.prodname_codeql_cli %} database bundles contain a copy of the source code being analyzed by {% data variables.product.prodname_codeql %}, therefore we suggest sharing these bundles only with people who are authorized to access that source code.
18+
19+
## About creating {% data variables.product.prodname_codeql_cli %} database bundles
20+
21+
{% data reusables.code-scanning.codeql-cli-version-ghes %}
22+
23+
The {% data variables.product.prodname_codeql_cli %} database bundle command can be used to create a relocatable archive of a {% data variables.product.prodname_codeql %} database.
24+
25+
A copy of a database bundle can be used to share troubleshooting information with your team members or with {% data variables.contact.github_support %}.
26+
27+
The following {% data variables.product.prodname_codeql_cli %} command syntax is suggested when creating a database bundle for troubleshooting purposes:
28+
29+
> [!NOTE]
30+
> This sample `database bundle` command requires {% data variables.product.prodname_codeql_cli %} version {% data variables.product.codeql_cli_version_min_version_create_bundle %} or higher.
31+
32+
```shell
33+
codeql database bundle --output=codeql-debug-artifacts.zip --include-diagnostics --include-logs --include-results -- <dir>
34+
```
35+
36+
For this command, `<dir>` must be the path to the directory where the {% data variables.product.prodname_codeql %} database was created.
37+
38+
The successful command execution creates a zip file called `codeql-debug-artifacts.zip` which contains {% data variables.product.prodname_codeql %} troubleshooting information. That file is the database bundle.
39+
40+
This command assumes that the `--log-dir` command line argument was not used for the `database create` and `database analyze` commands. When that command line argument is used, the log files created by those commands will not be included with the database bundle.
41+
42+
## Increasing the verbosity for `database create` and `database analyze`
43+
44+
If the `database create` and `database analyze` commands are not detailed enough for troubleshooting purposes, you can increase their verbosity.
45+
46+
Both commands support the `--verbosity` command line argument which can be set to `progress++` prior to creating a database bundle.

Diff for: content/code-security/codeql-cli/using-the-advanced-functionality-of-the-codeql-cli/index.md

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ children:
2626
- /csv-output
2727
- /extractor-options
2828
- /exit-codes
29+
- /creating-database-bundle-for-troubleshooting
2930
redirect_from:
3031
- /code-security/codeql-cli/codeql-cli-reference
3132
---

Diff for: data/variables/product.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ prodname_codeql_cli: 'CodeQL CLI'
9595
# Update this whenever a new enterprise version of CodeQL is being prepared.
9696
codeql_cli_ghes_recommended_version: >-
9797
{% ifversion ghes < 3.12 %}2.14.6{% elsif ghes < 3.17 %}2.20.3{% endif %}
98-
98+
codeql_cli_version_min_version_create_bundle: '2.17.6'
9999
# Projects v2
100100
prodname_projects_v2: 'Projects'
101101
prodname_projects_v1: >-

0 commit comments

Comments
 (0)