LGTM Enterprise 1.22

Using upload analysis

Upload analysis mode is for codebases that you can't build, or don't want to build, using the LGTM worker hosts.

Overview

When you add a project in upload analysis mode, LGTM contacts the repository only for the project name and permissions. It doesn't look for commits to analyze, instead it waits for you to upload externally built snapshots and analyzes them. The analysis mode applies to all languages in the project.

As with sparse analysis mode, the resulting project has no project history, so users won't see some of the views that are available for projects in the default, full analysis mode.

Enabling upload analysis

You can convert existing projects to upload analysis mode using the Analysis settings tab for the project. However, it's more usual to create a project in upload analysis mode as follows:

  1. Generate a QL snapshot for each language you want to analyze by building the codebase using the QL command-line tools on your existing infrastructure. For details, see Preparing snapshots to upload to LGTM.
  2. Create an upload analysis mode project for the codebase using the API. For details, see Adding a project in upload analysis mode.
  3. Upload the QL snapshot(s) to LGTM using the API. For details, see Adding externally-built snapshots to LGTM.
This workflow uses API methods that require access tokens with administrator-only scopes.

Maintaining a project in upload analysis mode

LGTM automatically updates results for projects in full and sparse analysis mode. However, you must upload new snapshots for projects in upload analysis mode when you want fresh results. You can do this as often, or as infrequently, as you wish. For more information, see Adding externally-built snapshots to LGTM.

When you upgrade LGTM Enterprise, you may find that externally-built snapshots created using older versions of the QL command-line tools are no longer compatible with your version of LGTM. If you upload an incompatible snapshot, you'll see an error on the Logs page when LGTM tries to import the snapshot.

You should install the version of the QL command-line tools that matches your LGTM Enterprise installation, upgrade or regenerate your old snapshots, and repeat the upload process. For more information, see Upgrading snapshots to a new database schema in the QL help.

More information

For details, see: