summaryrefslogtreecommitdiff
path: root/lib/gitlab/import_sources.rb
Commit message (Collapse)AuthorAgeFilesLines
* Add latest changes from gitlab-org/gitlab@13-7-stable-eev13.7.0-rc42GitLab Bot2020-12-171-1/+1
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2019-09-131-0/+2
|
* Setup Phabricator importBob Van Landuyt2019-05-311-1/+2
| | | | | | | | | | | | | | | | | | | | | | This sets up all the basics for importing Phabricator tasks into GitLab issues. To import all tasks from a Phabricator instance into GitLab, we'll import all of them into a new project that will have its repository disabled. The import is hooked into a regular ProjectImport setup, but similar to the GitHub parallel importer takes care of all the imports itself. In this iteration, we're importing each page of tasks in a separate sidekiq job. The first thing we do when requesting a new page of tasks is schedule the next page to be imported. But to avoid deadlocks, we only allow a single job per worker type to run at the same time. For now we're only importing basic Issue information, this should be extended to richer information.
* Fix ConstantName rubocop offenseSemyon Pupkov2018-12-091-2/+2
|
* Enable frozen string for lib/gitlab/*.rbgfyoung2018-10-221-0/+2
|
* Merge branch 'sh-support-bitbucket-server-import' into 'master'Tim Zallmann2018-08-061-9/+10
|\ | | | | | | | | | | | | Add support for Bitbucket Server imports Closes #25393 See merge request gitlab-org/gitlab-ce!20164
| * Keep alignment in lib/gitlab/import_sources.rbStan Hu2018-08-021-9/+9
| |
| * Merge branch 'master' into sh-support-bitbucket-server-importStan Hu2018-07-121-1/+2
| |\
| * | WIP: Add support for Bitbucket Server importsStan Hu2018-06-251-1/+2
| | |
* | | EE PortFrancisco Javier López2018-07-201-4/+8
| |/ |/|
* | Add feature specs for manifest importDmitriy Zaporozhets2018-07-111-1/+1
| | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* | Fix tests in import_sources_spec.rbDmitriy Zaporozhets2018-07-111-1/+1
| | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* | Add manifest import featureDmitriy Zaporozhets2018-07-111-1/+2
|/ | | | | | | | | It allows user to automatically import multiple repositories with nested structure by uploading a manifest xml file. AOSP project was used as an example during development of this feature. Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* add note to import sourcesJames Lopez2018-01-031-0/+1
|
* Replace old GH importer with the parallel importergithub-importer-refactorYorick Peterse2017-11-071-1/+1
|
* Rewrite the GitHub importer from scratchYorick Peterse2017-11-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prior to this MR there were two GitHub related importers: * Github::Import: the main importer used for GitHub projects * Gitlab::GithubImport: importer that's somewhat confusingly used for importing Gitea projects (apparently they have a compatible API) This MR renames the Gitea importer to Gitlab::LegacyGithubImport and introduces a new GitHub importer in the Gitlab::GithubImport namespace. This new GitHub importer uses Sidekiq for importing multiple resources in parallel, though it also has the ability to import data sequentially should this be necessary. The new code is spread across the following directories: * lib/gitlab/github_import: this directory contains most of the importer code such as the classes used for importing resources. * app/workers/gitlab/github_import: this directory contains the Sidekiq workers, most of which simply use the code from the directory above. * app/workers/concerns/gitlab/github_import: this directory provides a few modules that are included in every GitHub importer worker. == Stages The import work is divided into separate stages, with each stage importing a specific set of data. Stages will schedule the work that needs to be performed, followed by scheduling a job for the "AdvanceStageWorker" worker. This worker will periodically check if all work is completed and schedule the next stage if this is the case. If work is not yet completed this worker will reschedule itself. Using this approach we don't have to block threads by calling `sleep()`, as doing so for large projects could block the thread from doing any work for many hours. == Retrying Work Workers will reschedule themselves whenever necessary. For example, hitting the GitHub API's rate limit will result in jobs rescheduling themselves. These jobs are not processed until the rate limit has been reset. == User Lookups Part of the importing process involves looking up user details in the GitHub API so we can map them to GitLab users. The old importer used an in-memory cache, but this obviously doesn't work when the work is spread across different threads. The new importer uses a Redis cache and makes sure we only perform API/database calls if absolutely necessary. Frequently used keys are refreshed, and lookup misses are also cached; removing the need for performing API/database calls if we know we don't have the data we're looking for. == Performance & Models The new importer in various places uses raw INSERT statements (as generated by `Gitlab::Database.bulk_insert`) instead of using Rails models. This allows us to bypass any validations and callbacks, drastically reducing the number of SQL queries and Gitaly RPC calls necessary to import projects. To ensure the code produces valid data the corresponding tests check if the produced rows are valid according to the model validation rules.
* Set the new GitHub import as import sourceDouglas Barbosa Alexandre2017-08-071-1/+1
|
* Rescue from ActiveRecord::UnknownAttributeError and fallback to fake settingsdont-persist-application-settings-in-test-env-bisRémy Coutable2017-01-231-2/+0
| | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* Improve Gitlab::ImportSourcesRémy Coutable2016-12-191-12/+28
| | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* Rename Gogs to Gitea, DRY the controller and improve viewsRémy Coutable2016-12-191-2/+2
| | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* Gogs ImporterKim "BKC" Carlbäcker2016-12-191-0/+1
|
* Remove gitoriouszj-remove-gitoriousZ.J. van de Weg2016-08-251-7/+6
|
* Enable Style/EmptyLines cop, remove redundant onesrubocop/enable-cops-for-empty-linesGrzegorz Bizon2016-07-011-2/+0
|
* fix specsJames Lopez2016-06-161-1/+1
|
* lots of refactoring again based on feedback. Changed the UI slightly and ↵James Lopez2016-06-151-1/+1
| | | | also fixed a small bug
* fix import feature v2James Lopez2016-05-051-1/+1
|
* gitlab import UI - icon, file selector, etc... Also updated font-awesome and ↵James Lopez2016-04-221-0/+1
| | | | modified import source settings.
* FogBugz project importJared Szechy2015-09-081-0/+1
|
* Import sources: settings in the admin interfaceArtem Sidorenko2015-08-201-0/+29