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.
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
You can configure LGTM Enterprise to prevent users adding projects from their My projects page.
On the Add tab, enter the URLs or host names for the project repositories you want to add, one per line.More about repository URLs
You can add projects hosted by any supported repository type using the repository's web URL (HTTP or HTTPS). Alternatively, for projects hosted on Bitbucket.org or GitHub.com, you can use the repository's clone URL. For repositories in Subversion or simple Git, the web URL must match a repository root URL specified in one of the repository providers (to find out more about the repository root URL, see Adding Git or Subversion as a repository provider).
Typically a project's repository URL is the one that displays the home page for the project in the repository management system. For example, a URL for a project in GitHub Enterprise might be something like:
If you're adding a project under TFVC control (either in TFS or Azure DevOps) you can do so using a variety of URLs. The team name in the URL is optional, as is
_versionControlat the end of the URL.
DefaultCollectionis an optional part of the URL for Azure DevOps, but is mandatory for TFS.
For example, the following URLs for the same TFVC project repository, in Azure DevOps, are all valid:
URLs can use URL encoding or not.
The final example shown above does not specify a branch path at the end of the URL. This URL would add the whole repository rather than a specific branch. If you add the whole repository you should be aware that you will get duplicate alerts if the same coding issue appears on multiple branches.
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.
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.
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.Examples
If you want the project(s) you are adding to be processed only on a host machine that is running Linux, add the label
unix. To mandate that Windows is used, add the label
If you add a label
tiger-team, then the project(s) you are adding will only be processed on machines that have also been assigned this label (plus any label that might have been assigned to specific languages). For example, if Python has been assigned the label
python-environment, then any Python code in the project(s) you are adding will only be processed on machines that have the labels
For information about labeling, see Defining which workers can build and analyze a project.
Click Add to process the URLs.
What happens next?
Each URL is processed as follows:
- 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.
- 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
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.