LGTM Enterprise 1.23.1

Adding projects

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

By default, LGTM analyzes all commits to the default branch of each project you add. This is known as full analysis mode. You can, however, tell LGTM to use sparse analysis or upload analysis for specific projects, if required.

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 projects using the API

Administrators can also add projects to LGTM by posting a request to the /projects endpoint of the rest API. By default, LGTM builds and analyzes the project in the same way as for projects added through the user interface. For more information, see Add a project to LGTM in the user help.

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 to the default branch of a project, LGTM only builds and analyzes the HEAD commit at the time the repository is polled for changes. 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 host URLs specified by integrations (and, if simple Git or Subversion are configured, also the repository root 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 codebase:
    • 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.

For projects added using the Administration interface, 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 tab and the Files tab. 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