LGTM Enterprise 1.25

Exploring query pack logs

The Logs tab of the Queries page shows query pack upload information for custom queries stored in the currently selected project. If an upload fails, you can use the logs on this page to debug problems with the per-project custom queries in your repository.

The Logs tab is hidden if there are no custom queries stored in the repository of the currently selected project.

To access the Logs tab of the Queries page:

  1. Select a project on LGTM. The project Alerts page is displayed.
  2. Click the Queries page on the purple navigation banner.
  3. In the query pack drop-down list, select a per-project custom query pack.
  4. Click Logs.

LGTM uploads per-project custom queries stored in the repository, makes them into query packs, and runs them alongside the built-in queries. For more information about adding these queries to LGTM, refer to About queries.

Uploading a query pack consists of building the queries in the pack (that is, getting all the .ql and the .qll files, and compiling them), and publishing them (which means adding relevant entries to the datastore so that the queries are run against the project). The task of uploading query packs to LGTM is referred to as an "upload job".

LGTM runs a new upload job every time a new commit is added to the repository and this page shows the results of the upload, and logs, where appropriate.

Note that a new log is generated even when the latest revision is unchanged.

The name of the currently selected query pack is displayed at the top of the page ( below). If there is more than one query pack for the current project, use the ( below) on the query pack selector control to select a different query pack.

In particular, for each query pack, this page highlights the Current status ( below) of the job that is most relevant to the current pack state. This is usually the same as the most recent upload job (which is the top item in the list of upload jobs), but will differ in cases such as when there's a success in the past, followed by a run of one or more failures.

The possible statuses are:

  • <language> queries published in <revision-reference> - <revision-date>, where <language> is one of the languages supported in LGTM
  • <language> query pack never published
  • Deleted <language> query pack

Query pack logs tab

There's a line for each upload job. On each row, you can see the revision that was analyzed, as well as the job status.

Clicking ( above) on a job opens a log showing more detailed information. If a query pack built unsuccessfully, the extra information may give a better idea as to why. There is no log available when a query pack is deleted.

An example of log is shown in the screenshot above (see ): the lgtm/javascript-queries/query.ql query file is missing a query identifier (@id). See Writing custom queries to include in LGTM analysis for guidance on query syntax.

Related topicsRelated topics