Skip to content

Commit 84fe272

Browse files
committed
Further changes from the technical review
1 parent 6c82c2c commit 84fe272

File tree

3 files changed

+18
-14
lines changed

3 files changed

+18
-14
lines changed

docs/codeql/codeql-cli/about-codeql-packs.rst

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ You can use the CodeQL package manger in the CodeQL CLI to create CodeQL packs,
2121
CodeQL pack structure
2222
---------------------
2323

24-
A CodeQL pack must contain a file called ``qlpack.yml`` in its root directory. In the ``qlpack.yml`` file, the ``name:`` field must have a value that follows the format of ``<scope>/<pack>``, where ``<scope>`` is the GitHub organization that the pack is published to and ``<pack>`` is the name of the pack. The other
24+
A CodeQL pack must contain a file called ``qlpack.yml`` in its root directory. In the ``qlpack.yml`` file, the ``name:`` field must have a value that follows the format of ``<scope>/<pack>``, where ``<scope>`` is the GitHub organization or user account that the pack will be published to and ``<pack>`` is the name of the pack. The other
2525
files and directories within the pack should be logically organized. For example, typically:
2626

2727
- Queries are organized into directories for specific categories.
@@ -31,7 +31,11 @@ files and directories within the pack should be logically organized. For example
3131
About ``qlpack.yml`` files
3232
--------------------------
3333

34-
When executing query-related commands, CodeQL first looks in the package cache for CodeQL packs which have already been downloaded. If a suitable pack cannot be found, then CodeQL scans siblings of the installation directory (and their subdirectories) for ``qlpack.yml`` files. The metadata in each `qlpack.yml`` file tells
34+
When executing query-related commands, CodeQL first looks in siblings of the installation directory (and their subdirectories) for ``qlpack.yml`` files.
35+
Then it checks the package cache for CodeQL packs which have been downloaded. This means that when you are developing queries locally, the local packages
36+
in the installation directory override packages of the same name in the package cache, so that you can test your local changes.
37+
38+
The metadata in each `qlpack.yml`` file tells
3539
CodeQL how to compile any queries in the pack, what libraries the pack depends on, and where to
3640
find query suite definitions.
3741

@@ -65,11 +69,11 @@ The following properties are supported in ``qlpack.yml`` files.
6569
* - ``version``
6670
- ``0.0.0``
6771
- All packs
68-
- A version number for this CodeQL pack. This must be a valid semantic version that meets the `SemVer v2.0.0 specification <https://semver.org/spec/v2.0.0.html>`__.
72+
- A version range for this CodeQL pack. This must be a valid semantic version that meets the `SemVer v2.0.0 specification <https://semver.org/spec/v2.0.0.html>`__.
6973
* - ``dependencies``
7074
- ``codeql/javascript-all: ^1.2.3``
7175
- Optional
72-
- The names of any CodeQL packs that this pack depends on, as a sequence. This gives the pack access to any libraries, database schema, and query suites defined in the dependency. Optionally a version for the dependency is specified.
76+
- The names and version ranges of any CodeQL packs that this pack depends on, as a mapping. This gives the pack access to any libraries, database schema, and query suites defined in the dependency. For more information, see `SemVer ranges <https://docs.npmjs.com/cli/v6/using-npm/semver#ranges>`__ in the NPM documentation.
7377
* - ``suites``
7478
- ``octo-org-query-suites``
7579
- Optional
@@ -93,12 +97,12 @@ The following properties are supported in ``qlpack.yml`` files.
9397
* - ``authors``
9498
9599
- All packs
96-
- Metadata that will be displayed on the packaging search page in the packages section of the organization that a CodeQL pack is published to.
100+
- Metadata that will be displayed on the packaging search page in the packages section of the account that the CodeQL pack is published to.
97101
* - ``licenses``
98102
- ``(LGPL-2.1 AND MIT)``
99103
- All packs
100-
- Metadata that will be displayed on the packaging search page in the packages section of the organization that a CodeQL pack is published to.
104+
- Metadata that will be displayed on the packaging search page in the packages section of the account that the CodeQL pack is published to. For a list of allowed licenses, see `SPDX License List <https://spdx.org/licenses/>`__ in the SPDX Specification.
101105
* - ``description``
102106
- ``Human-readable description of the software packaged in the image.``
103107
- All packs
104-
- Metadata that will be displayed on the packaging search page in the packages section of the organization that a CodeQL pack is published to.
108+
- Metadata that will be displayed on the packaging search page in the packages section of the account that the CodeQL pack is published to.

docs/codeql/codeql-cli/creating-and-working-with-codeql-packs.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ You can create a CodeQL pack by running the following command from the checkout
3333

3434
You must specify:
3535

36-
- ``<scope>``: the name of the GitHub organization that you will publish to.
36+
- ``<scope>``: the name of the GitHub organization or user account that you will publish to.
3737
- ``<pack>``: the name for the pack that you are creating.
3838

3939
The ``codeql pack init`` command creates the directory structure and configuration files for a CodeQL pack. By default, the command creates a query pack. If you want to create a library pack, you must edit the ``qlpack.yml`` file to explicitly declare the file as a library pack by including the ``library:true`` property.
@@ -49,7 +49,7 @@ For more information about the properties, see ":ref:`About CodeQL packs <about-
4949

5050
Adding and installing dependencies to a CodeQL pack
5151
---------------------------------------------------
52-
You can add dependencies on CodeQL packs using the command ``codeql pack add``. You can specify the scope, name, and version.
52+
You can add dependencies on CodeQL packs using the command ``codeql pack add``. You must specify the scope, name, and version range.
5353

5454
::
5555

docs/codeql/codeql-cli/publishing-and-using-codeql-packs.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ You can check and modify the configuration details of your CodeQL pack prior to
2222
name: <scope>/<pack>
2323
version: <x.x.x>
2424
description: <Description to publish with the package>
25-
default-suite: # a query-suite file that has been inlined
26-
- query:
27-
default-suite-file: default-queries.qls # a pointer to a query-suite in this pack
25+
default-suite: # optional, one or more queries in the pack to run by default
26+
- query: <relative-path>/query-file>.ql
27+
default-suite-file: default-queries.qls # optional, a pointer to a query-suite in this pack
2828
license: # optional, the license under which the pack is published
2929
dependencies: # map from CodeQL pack name to version range
3030
3131
- ``name:`` must follow the <scope>/<pack> format, where <scope> is the GitHub organization that you will publish to and <pack> is the name for the pack.
32-
- Only one of ``default-suite`` or ``default-suite-file`` is allowed. Both options define a default query suite to be run, the first by specifying queries directly in the `qlpack.yml` file and the second by specifying a query suite in the pack.
32+
- A maximum of one of ``default-suite`` or ``default-suite-file`` is allowed. These are two different ways to define a default query suite to be run, the first by specifying queries directly in the `qlpack.yml` file and the second by specifying a query suite in the pack.
3333

3434
Running ``codeql pack publish``
3535
-------------------------------
@@ -55,7 +55,7 @@ To run a pack that someone else has created, you must first download it by runni
5555
- ``<pack>``: the name for the pack that you are creating.
5656
- ``@x.x.x``: an optional version number. If omitted, the latest version will be downloaded.
5757

58-
This command accepts arguments for multiple packs, as well as query suites.
58+
This command accepts arguments for multiple packs.
5959

6060
Using a CodeQL pack to analyze a CodeQL database
6161
------------------------------------------------

0 commit comments

Comments
 (0)