LGTM Enterprise 1.20.1

Adding projects

When you have defined one or more integrations with repository providers, you can add projects to LGTM using either the main interface or the administration interface.

Prerequisites

To add a project to LGTM Enterprise, your LGTM account must have at least read access to the repository in which that project is stored. So, if you want to add projects from repositories that require you to log in, you must either:

  • Connect your repository host account (for example, your GitHub Enterprise or Azure DevOps account) to your existing LGTM account—for details, see Managing external accounts in the user help.

  • Use your repository host account to log in to LGTM Enterprise—see Logging in to LGTM Enterprise in the user help.

Adding a few projects

Typically, any user of LGTM can add projects directly from their My projects page. If a user attempts to add a project that's already analyzed by LGTM, they "follow" the project and LGTM does not attempt to add the project again. For details, see Adding projects to LGTM in the user help.

You can configure LGTM Enterprise to prevent users adding projects from their My projects page.

Adding many projects

The Add tab of the Projects administration page is designed to make it easy to add up to 1000 projects in one action. LGTM attempts to build every project, even those that are already on LGTM.

  1. On the Add tab, enter the URLs or host names for the project repositories you want to add, one per line.

  2. If you want to use sparse analysis for these projects—where not every commit is analyzed—click Advanced options and select the Add projects in sparse analysis mode check box.

    When you enable sparse analysis for a project, instead of building and analyzing all commits for the project, LGTM only builds and analyzes those commits that are, or were, the HEAD of the repository. This applies to the analysis for all languages in a project.

    Enabling this mode reduces the computational burden of projects, but has some drawbacks. For more information, see Using sparse analysis.

  3. If you do not want LGTM Enterprise to attempt to analyze all languages for the projects you're adding, clear the appropriate language check box(es) in the Advanced options section.

  4. If you want to ensure the added projects are only processed by worker daemons running on particular worker host servers, enter appropriate, space-separated, labels in the Worker labels box.

    For information about labeling, see Defining which workers can build and analyze a project.

  5. Click Add to process the URLs.

What happens next?

Each URL is processed as follows:

  1. Each URL is tested against the repository provider URLs:
    • If a match is found, a series of "attempt-build" jobs are queued for the repository, one per language.
    • If no match is found, an error is reported on the Add project page.
  2. Each attempt-build job runs and tries to analyze the code base:
    • If at least one language is analyzed successfully, the repository is registered as an LGTM project.
    • If the analysis fails for all languages, an error is reported.

You can monitor the progress of the attempt-build jobs by returning to the Add tab periodically, scrolling to the History section, then clicking the link for the appropriate batch of projects added (this is likely to be the one at the top of the list).

A table is displayed, listing each of the projects you added and showing the status of the attempt-build jobs for each language supported by LGTM Enterprise. After each language is processed for each project, a green check mark or a red cross is displayed, depending on whether the job succeeded or failed. Click the check mark or cross to display the log for that job.

Initial view of project data

Initially only some of the parts of LGTM that are visible to standard users are populated with analysis data for a newly added project. You will be able to see details for the initially analyzed commit in the Alerts, Files, and Dependencies tabs. Parts of the interface that display data calculated by comparing analysis between a commit and its predecessor commit will not be populated until at least one historic commit (that is, a commit made prior to the initially processed commit) is analyzed.

The new project can be examined using the query console as soon as the initial analysis data is added. This is because queries run from the query console are always run against the data for the most recent version of the code to have been analyzed by LGTM.

Related topicsRelated topics