Troubleshooting
Migrating from deprecated classes and selectors
Section titled “Migrating from deprecated classes and selectors”Older scripts, including some blog posts, use names that are now deprecated or removed. Use the current name instead.
| Old name | Status | Use instead |
|---|---|---|
GLHModelImporter | deprecated | GitlabModelImporter |
GLPHModelImporter | deprecated | GitlabModelImporter |
GitlabWithMergeRequestModelImporter | deprecated | GitlabModelImporter |
GHModelImporter | deprecated | GithubModelImporter |
GHApi | deprecated | GithubApi (created by GithubModelImporter) |
GLPHApi | removed | GitlabApi |
GLPHEMergeRequest | removed | GLHMergeRequest |
baseAPIUrl: (GitLab API) | removed | hostUrl: |
makeGlobal: (importer) | removed | — (store the importer in a variable) |
importMergeRequests: | removed | importMergeRequestsOfProject: |
importMergeRequests:since:until: | removed | importMergeRequestsOfProject:since:until: |
toScope: | deprecated (Moose) | containedEntitiesOfType: |
allToScope: | deprecated (Moose) | allContainedEntitiesOfType: |
allProjectstoScope | uses toScope: | containedEntitiesOfType: GLHProject |
GitMetricExporter>>exportFor:, exportFor:over: | deprecated | generateAnalysesOver: then exportInCSV |
GitMetricExporter>>addEntitiesFromUserNames: | deprecated | setupAnalysisForUsersWithNames: |
Frequent problems
Section titled “Frequent problems”The import is very slow
Section titled “The import is very slow”API imports send one or more HTTP requests per entity. To speed them up:
- reduce the period:
withCommitsSince: 7 days; - disable what you do not need:
withCommitDiffs: false,withFiles: false; - import merge requests for a period (
importMergeRequestsOfProject:since:until:) rather than all of them; - use the local importer for the history, or the mixed importer if you also need merge requests.
GitHub stops answering (rate limit)
Section titled “GitHub stops answering (rate limit)”The GitHub REST API allows 5,000 requests per hour with a token (60 without). Large organizations can exceed this limit: import fewer repositories at once, reduce the period, or wait for the limit to reset.
Local GLHRepository without importer reference
Section titled “Local GLHRepository without importer reference”The local importer cannot find the clone. Set the path on the repository before importing:
repository cacheAt: #localImporterReference put: '/path/to/clone' asFileReference.If the repository belongs to a project with a web_url, the importer tries to clone it into ./msr/<project name>: check that your Iceberg credentials give access to it.
Some branches are missing with the local importer
Section titled “Some branches are missing with the local importer”The local importer reads local branches only. Create local tracking branches for the remote ones (see Clone the repository).
Only 20 merge requests are imported
Section titled “Only 20 merge requests are imported”importLatestMergeRequestsOfProject: imports the 20 latest merge requests only. Use importMergeRequestsOfProject:since:until: to import a period.
Bitbucket api cannot import directly a project
Section titled “Bitbucket api cannot import directly a project”On Bitbucket, import the Bitbucket project with importGroup: 'KEY': its repositories are imported as GLHProjects.
The GitLab URL is not accepted
Section titled “The GitLab URL is not accepted”The GitLab host URL must point to the API, including /api/v4, for instance https://gitlab.mycompany.com/api/v4.
The image uses too much memory
Section titled “The image uses too much memory”The local importer keeps caches on the imported entities. Clear them after the import:
model flush.model entities do: #flush.Avoid withDiffRanges: true and withFiles: true unless you need them.
Where are the logs?
Section titled “Where are the logs?”Importers log their progress with MoreLogger (recordInfo). See its documentation to choose where the logs are written.
Getting help
Section titled “Getting help”- Ask on the Moose Discord.
- Report bugs on GitProjectHealth issues.