Skip to content

Commit e14b803

Browse files
committed
Add paragraph about lock files in library packs with tests
1 parent f737e07 commit e14b803

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ The following properties are supported in ``qlpack.yml`` files.
176176
About ``codeql-pack.lock.yml`` files
177177
------------------------------------
178178

179-
``codeql-pack.lock.yml`` files store the versions of the resolved transitive dependencies of a CodeQL pack. This file is created by the ``codeql pack install`` command if it does not already exist and should be added to your version control system. The ``dependencies`` section of the ``qlpack.yml`` file contains version ranges that are compatible with the pack. The ``codeql-pack.lock.yml`` file locks the versions to precise dependencies. This ensures that anyone running ``codeql pack install`` on this the pack will always retrieve the same versions of dependencies even if newer compatible versions exist.
179+
``codeql-pack.lock.yml`` files store the versions of the resolved transitive dependencies of a CodeQL pack. This file is created by the ``codeql pack install`` command if it does not already exist and should be added to your version control system. The ``dependencies`` section of the ``qlpack.yml`` file contains version ranges that are compatible with the pack. The ``codeql-pack.lock.yml`` file locks the versions to precise dependencies. This ensures that running ``codeql pack install`` on this the pack will always retrieve the same versions of dependencies even if newer compatible versions exist.
180180

181181
For example, if a ``qlpack.yml`` file contains the following dependencies:
182182

@@ -199,11 +199,14 @@ The ``codeql-pack.lock.yml`` file will contain something like the following:
199199
my-user/transitive-dependency:
200200
version: 1.2.4
201201
202+
202203
..
203204
TODO: Add a link to the CodeQL CLI documentation for query resolution, specifically in regards to resolving from source
204205
205206
The ``codeql/cpp-all`` dependency is locked to version 0.1.4. The ``my-user/my-lib`` dependency is locked to version 0.2.4. The ``my-user/transitive-dependency``, which is a transitive dependency and is not specified in the ``qlpack.yml`` file, is locked to version 1.2.4. The ``other-dependency/from-source`` is absent from the lock file since it is resolved from source. This dependency must be available in the same CodeQL workspace as the pack.
206207

208+
In most cases, the ``codeql-pack.lock.yml`` file is only relevant for query packs since library packs are non-executable and usually do not need their transitive dependencies to be fixed. The exception to this is for library packs that contain tests. In this case, the ``codeql-pack.lock.yml`` file is used to ensure that the tests are always run with the same versions of dependencies to avoid spurious failures when there are mismatched dependencies.
209+
207210
.. _custom-codeql-packs:
208211

209212
Examples of custom CodeQL packs

0 commit comments

Comments
 (0)