Skip to content

Commit b78faa4

Browse files
committed
Remove upgrade database docs
Database upgrades happens implicitly now as part of analysis. There is no need to call this out in separate steps.
1 parent 5fe06ab commit b78faa4

File tree

5 files changed

+33
-111
lines changed

5 files changed

+33
-111
lines changed

docs/codeql/codeql-cli/analyzing-databases-with-the-codeql-cli.rst

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,6 @@ You can also specify:
8080
- .. include:: ../reusables/threads-query-execution.rst
8181

8282

83-
.. pull-quote::
84-
85-
Upgrading databases
86-
87-
If the CodeQL queries you want to use are newer than the
88-
extractor used to create the database, then you may see a message telling you
89-
that your database needs to be upgraded when you run ``database analyze``.
90-
You can quickly upgrade a database by running the ``database upgrade``
91-
command. For more information, see ":doc:`Upgrading CodeQL databases
92-
<upgrading-codeql-databases>`."
93-
9483
For full details of all the options you can use when analyzing databases, see
9584
the `database analyze reference documentation <../manual/database-analyze>`__.
9685

docs/codeql/codeql-cli/creating-codeql-databases.rst

Lines changed: 26 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ Before you analyze your code using CodeQL, you need to create a CodeQL
77
database containing all the data required to run queries on your code.
88

99
CodeQL analysis relies on extracting relational data from your code, and
10-
using it to build a :ref:`CodeQL database <codeql-database>`. CodeQL
11-
databases contain all of the important information about a codebase, which can
10+
using it to build a :ref:`CodeQL database <codeql-database>`. CodeQL
11+
databases contain all of the important information about a codebase, which can
1212
be analyzed by executing CodeQL queries against it.
1313
Before you generate a CodeQL database, you need to:
1414

@@ -18,9 +18,9 @@ Before you generate a CodeQL database, you need to:
1818
should be ready to build, with all dependencies already installed.
1919

2020
For information about using the CodeQL CLI in a third-party CI system to create results
21-
to display in GitHub as code scanning alerts, see `Configuring CodeQL CLI in your CI system <https://docs.github.com/en/code-security/secure-coding/using-codeql-code-scanning-with-your-existing-ci-system/configuring-codeql-cli-in-your-ci-system>`__
21+
to display in GitHub as code scanning alerts, see `Configuring CodeQL CLI in your CI system <https://docs.github.com/en/code-security/secure-coding/using-codeql-code-scanning-with-your-existing-ci-system/configuring-codeql-cli-in-your-ci-system>`__
2222
in the GitHub documentation. For information about enabling CodeQL code scanning using GitHub Actions,
23-
see `Setting up code scanning for a repository <https://docs.github.com/en/code-security/secure-coding/automatically-scanning-your-code-for-vulnerabilities-and-errors/setting-up-code-scanning-for-a-repository>`__
23+
see `Setting up code scanning for a repository <https://docs.github.com/en/code-security/secure-coding/automatically-scanning-your-code-for-vulnerabilities-and-errors/setting-up-code-scanning-for-a-repository>`__
2424
in the GitHub documentation.
2525

2626
Running ``codeql database create``
@@ -37,38 +37,38 @@ You must specify:
3737

3838
- ``<database>``: a path to the new database to be created. This directory will
3939
be created when you execute the command---you cannot specify an existing
40-
directory.
40+
directory.
4141
- ``--language``: the identifier for the language to create a database for.
42-
When used with ``--db-cluster``, the option accepts a comma-separated list,
42+
When used with ``--db-cluster``, the option accepts a comma-separated list,
4343
or can be specified more than once.
4444
CodeQL supports creating databases for the following languages:
4545

4646
.. include:: ../reusables/extractors.rst
4747

48-
You can specify additional options depending on the location of your source file,
49-
if the code needs to be compiled, and if you want to create CodeQL databases for
48+
You can specify additional options depending on the location of your source file,
49+
if the code needs to be compiled, and if you want to create CodeQL databases for
5050
more than one language:
5151

5252
- ``--source-root``: the root folder for the primary source files used in
5353
database creation. By default, the command assumes that the current
5454
directory is the source root---use this option to specify a different location.
5555
- ``--db-cluster``: use for multi-language codebases when you want to create
56-
databases for more than one language.
56+
databases for more than one language.
5757
- ``--command``: used when you create a database for one or more compiled languages,
58-
omit if the only languages requested are Python and JavaScript.
59-
This specifies the build commands needed to invoke the compiler.
58+
omit if the only languages requested are Python and JavaScript.
59+
This specifies the build commands needed to invoke the compiler.
6060
Commands are run from the current folder, or ``--source-root``
6161
if specified. If you don't include a ``--command``, CodeQL will attempt to
62-
detect the build system automatically, using a built-in autobuilder.
63-
- ``--no-run-unnecessary-builds``: used with ``--db-cluster`` to suppress the build
64-
command for languages where the CodeQL CLI does not need to monitor the build
62+
detect the build system automatically, using a built-in autobuilder.
63+
- ``--no-run-unnecessary-builds``: used with ``--db-cluster`` to suppress the build
64+
command for languages where the CodeQL CLI does not need to monitor the build
6565
(for example, Python and JavaScript/TypeScript).
6666

6767
You can specify extractor options to customize the behavior of extractors that create CodeQL databases. For more information, see
6868
":doc:`Extractor options <extractor-options>`."
6969

7070
For full details of all the options you can use when creating databases,
71-
see the `database create reference documentation <../manual/database-create>`__.
71+
see the `database create reference documentation <../manual/database-create>`__.
7272

7373
Progress and results
7474
--------------------
@@ -117,7 +117,7 @@ extract both JavaScript and TypeScript files::
117117

118118
Here, we have specified a ``--source-root`` path, which is the location where
119119
database creation is executed, but is not necessarily the checkout root of the
120-
codebase.
120+
codebase.
121121

122122
By default, files in ``node_modules`` and ``bower_components`` directories are not extracted.
123123

@@ -127,7 +127,7 @@ Python
127127
When creating databases for Python you must ensure:
128128

129129
- You have the all of the required versions of Python installed.
130-
- You have access to the `pip <https://pypi.org/project/pip/>`__
130+
- You have access to the `pip <https://pypi.org/project/pip/>`__
131131
packaging management system and can install any
132132
packages that the codebase depends on.
133133
- You have installed the `virtualenv <https://pypi.org/project/virtualenv/>`__ pip module.
@@ -143,14 +143,14 @@ generating a new Python database at ``<output-folder>/python-database``.
143143
Ruby
144144
~~~~
145145

146-
Creating databases for Ruby requires no additional dependencies.
146+
Creating databases for Ruby requires no additional dependencies.
147147
In the command line you must specify ``--language=ruby``. For example::
148148

149149
codeql database create --language=ruby --source-root <folder-to-extract> <output-folder>/ruby-database
150150

151151
Here, we have specified a ``--source-root`` path, which is the location where
152152
database creation is executed, but is not necessarily the checkout root of the
153-
codebase.
153+
codebase.
154154

155155
Creating databases for compiled languages
156156
-----------------------------------------
@@ -179,11 +179,11 @@ build steps, you may need to explicitly define each step in the command line.
179179

180180

181181
.. pull-quote:: Creating databases for Go
182-
182+
183183
For Go, install the Go toolchain (version 1.11 or later) and, if there
184184
are dependencies, the appropriate dependency manager (such as `dep
185185
<https://golang.github.io/dep/>`__).
186-
186+
187187
The Go autobuilder attempts to automatically detect code written in Go in a repository,
188188
and only runs build scripts in an attempt to fetch dependencies. To force
189189
CodeQL to limit extraction to the files compiled by your build script, set the environment variable
@@ -194,7 +194,7 @@ Specifying build commands
194194
~~~~~~~~~~~~~~~~~~~~~~~~~
195195

196196
The following examples are designed to give you an idea of some of the build
197-
commands that you can specify for compiled languages.
197+
commands that you can specify for compiled languages.
198198

199199
.. pull-quote:: Important
200200

@@ -214,7 +214,7 @@ commands that you can specify for compiled languages.
214214
in the build command. It is also a good idea to add `/t:rebuild` to ensure that all code will be built (code
215215
that is not built will not be included in the CodeQL database):
216216

217-
codeql database create csharp-database --language=csharp --command='dotnet build /p:UseSharedCompilation=false /t:rebuild'
217+
codeql database create csharp-database --language=csharp --command='dotnet build /p:UseSharedCompilation=false /t:rebuild'
218218

219219
- Go project built using the ``CODEQL_EXTRACTOR_GO_BUILD_TRACING=on`` environment variable::
220220

@@ -260,7 +260,7 @@ commands that you can specify for compiled languages.
260260
- Project built using a custom build script::
261261

262262
codeql database create new-database --language=<language> --command='./scripts/build.sh'
263-
263+
264264
This command runs a custom script that contains all of the commands required
265265
to build the project.
266266

@@ -279,7 +279,7 @@ You must specify:
279279

280280
- ``<database>``: a path to the new database to be created. This directory will
281281
be created when you execute the command---you cannot specify an existing
282-
directory.
282+
directory.
283283
- ``--begin-tracing``: creates scripts that can be used to set up an environment in which build commands will be traced.
284284

285285
You may specify other options for the ``codeql database init`` command as normal.
@@ -388,14 +388,10 @@ Obtaining databases from LGTM.com
388388
CodeQL. For each project on LGTM.com, you can download an archived CodeQL
389389
database corresponding to the most recently analyzed revision of the code. These
390390
databases can also be analyzed using the CodeQL CLI or used with the CodeQL
391-
extension for Visual Studio Code.
391+
extension for Visual Studio Code.
392392

393393
.. include:: ../reusables/download-lgtm-database.rst
394394

395-
Before running an analysis, unzip the databases and try :doc:`upgrading <upgrading-codeql-databases>` the
396-
unzipped databases to ensure they are compatible with your local copy of the
397-
CodeQL queries and libraries.
398-
399395
.. pull-quote::
400396

401397
Note

docs/codeql/codeql-cli/getting-started-with-the-codeql-cli.rst

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -230,10 +230,7 @@ see ":doc:`About CodeQL packs <about-codeql-packs>`."
230230
may need to be upgraded before you can analyze them.
231231

232232
- For the most up to date CodeQL queries, check out the ``main`` branch.
233-
This branch represents the very latest version of CodeQL's analysis. Even
234-
databases created using the most recent version of the CLI may have to be
235-
upgraded before you can analyze them. For more information, see
236-
":doc:`Upgrading CodeQL databases <upgrading-codeql-databases>`."
233+
This branch represents the very latest version of CodeQL's analysis.
237234

238235
- For the queries used in a particular LGTM Enterprise release, check out the
239236
branch tagged with the relevant release number. For example, the branch
@@ -243,7 +240,7 @@ see ":doc:`About CodeQL packs <about-codeql-packs>`."
243240
<https://help.semmle.com/lgtm-enterprise/admin/help/prepare-database-upload.html>`__
244241
in the LGTM admin help.
245242

246-
4. Extract the zip archive
243+
1. Extract the zip archive
247244
~~~~~~~~~~~~~~~~~~~~~~~~~~
248245

249246
For Linux, Windows, and macOS users (version 10.14 "Mojave", and earlier)

docs/codeql/codeql-cli/upgrading-codeql-databases.rst

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

docs/codeql/codeql-cli/using-the-codeql-cli.rst

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Using the CodeQL CLI
77

88
See the following links to learn how to get set up and run CodeQL commands:
99

10-
- :doc:`About the CodeQL CLI <about-the-codeql-cli>`: Software
10+
- :doc:`About the CodeQL CLI <about-the-codeql-cli>`: Software
1111
developers and security researchers can secure their code using the CodeQL CLI.
1212

1313
- :doc:`Getting started with the CodeQL CLI
@@ -17,19 +17,15 @@ See the following links to learn how to get set up and run CodeQL commands:
1717
- :doc:`Creating CodeQL databases
1818
<creating-codeql-databases>`: Create relational
1919
representations of source code that can be queried like any other database.
20-
20+
2121
- :doc:`Extractor options
22-
<extractor-options>`: Set options for the
22+
<extractor-options>`: Set options for the
2323
behavior of extractors that create CodeQL databases.
2424

2525
- :doc:`Analyzing CodeQL databases with the CodeQL CLI
2626
<analyzing-databases-with-the-codeql-cli>`: Analyze your code using queries
2727
written in a specially-designed, object-oriented query language.
2828

29-
- :doc:`Upgrading CodeQL databases
30-
<upgrading-codeql-databases>`: Upgrade your databases so
31-
that they can be analyzed using the most up to date CodeQL products.
32-
3329
- :doc:`Using custom queries with the CodeQL CLI
3430
<using-custom-queries-with-the-codeql-cli>`: Use custom queries to extend your
3531
analysis or highlight errors that are specific to a particular codebase.
@@ -42,7 +38,7 @@ See the following links to learn how to get set up and run CodeQL commands:
4238
your analysis.
4339

4440
- :doc:`Testing query help files <testing-query-help-files>`:
45-
Test query help files by rendering them as markdown to ensure they are valid
41+
Test query help files by rendering them as markdown to ensure they are valid
4642
before adding them to the CodeQL repository or using them in code scanning.
4743

4844
- :doc:`Creating and working with CodeQL packs <creating-and-working-with-codeql-packs>`:
@@ -51,7 +47,7 @@ See the following links to learn how to get set up and run CodeQL commands:
5147
- :doc:`Publishing and using CodeQL packs <publishing-and-using-codeql-packs>`:
5248
Publish your own or use others CodeQL packs for code scanning.
5349

54-
- :doc:`Specifying command options in a CodeQL configuration file <specifying-command-options-in-a-codeql-configuration-file>`:
50+
- :doc:`Specifying command options in a CodeQL configuration file <specifying-command-options-in-a-codeql-configuration-file>`:
5551
You can save default or frequently used options for your commands in a per-user configuration file.
5652

5753
.. toctree::
@@ -63,7 +59,6 @@ See the following links to learn how to get set up and run CodeQL commands:
6359
creating-codeql-databases
6460
extractor-options
6561
analyzing-databases-with-the-codeql-cli
66-
upgrading-codeql-databases
6762
using-custom-queries-with-the-codeql-cli
6863
creating-codeql-query-suites
6964
testing-custom-queries

0 commit comments

Comments
 (0)