Skip to content

Commit 47a543e

Browse files
committed
Add reviewer feedback
1 parent fb22931 commit 47a543e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,7 @@ commands that you can specify for compiled languages.
231231
Using indirect build tracing
232232
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
233233

234-
If the CodeQL CLI autobuilders for compiled languages do not work with your CI workflow and you cannot specify
235-
build commands, you can use indirect build tracing to create a CodeQL database. To use indirect build tracing, your CI system must be able to set custom environment variables for each build action.
234+
If the CodeQL CLI autobuilders for compiled languages do not work with your CI workflow and you cannot wrap invocations of build commands with ``codeql database trace-command``, you can use indirect build tracing to create a CodeQL database. To use indirect build tracing, your CI system must be able to set custom environment variables for each build action.
236235

237236
CodeQL databases are created with indirect build tracing when you run the following command from the checkout root of your project:
238237

@@ -251,27 +250,26 @@ You may specify other options for the ``codeql database init`` command as normal
251250

252251
.. pull-quote:: Note
253252

254-
If you are on Windows, set either ``--trace-process-level <number>`` or ``--trace-process-name <parent process name>`` so that the option points to the parent CI process.
253+
If you are on Windows, set either ``--trace-process-level <number>`` or ``--trace-process-name <parent process name>`` so that the option points to a parent CI process that will observe all build steps for the code being analyzed.
255254

256255

257-
The ``codeql database init`` command will output a message:
258-
```
256+
The ``codeql database init`` command will output a message::
257+
259258
Created skeleton <database>. This in-progress database is ready to be populated by an extractor.
260259
In order to initialise tracing, some environment variables need to be set in the shell your build will run in.
261260
A number of scripts to do this have been created in <database>/temp/tracingEnvironment.
262261
Please run one of these scripts before invoking your build command.
263262

264263
Based on your operating system, we recommend you run: ...
265-
```
266264

267265
The ``codeql database init`` command will produce files in ``<database>/temp/tracingEnvironment`` containing environment variables and their values for CodeQL to trace subsequent build steps. These files are named ``start-tracing.{json,sh,bat,ps1}``. Use one of these files with your CI system's mechanism for setting environment variables for future steps. You can:
268266

269267
* Read the JSON file, process it, and print out environment variables in the format expected by your CI system. For example, Azure DevOps expects ``echo "##vso[task.setvariable variable=NAME]VALUE"``.
270268
* Or source the ``sh/bat/ps1`` script so that its variables go into your shell environment.
271269

272-
Build your code and then run the command ``codeql database finalize <database>``.
270+
Build your code, end build tracing, and then run the command ``codeql database finalize <database>``.
273271

274-
You can optionally clean up the environment variables by following the same process as with the ``--begin-tracing`` scripts, except now with ``--end-tracing`` scripts in the same directory.
272+
You can optionally clean up the environment variables by following the same process as with the ``--begin-tracing`` scripts, except now with ``end-tracing.{json,sh,bat,ps1}`` scripts in the same directory.
275273

276274
Once you have created a CodeQL database using indirect build tracing, you can work with it like any other CodeQL database. For example, analyze the database, and upload the results if using Code Scanning.
277275

@@ -326,6 +324,8 @@ The following example shows how you could use indirect build tracing in an Azure
326324
clean: True
327325
displayName: Visual Studio Build
328326

327+
# End build tracing.
328+
329329
- task: CmdLine@2
330330
displayName: Finalize CodeQL database
331331
inputs:

0 commit comments

Comments
 (0)