summaryrefslogtreecommitdiff
path: root/spec/controllers/import
Commit message (Collapse)AuthorAgeFilesLines
* Make all uses of `fixture_file_upload` use relative pathsRobert Speicher2018-06-072-2/+2
|
* Resolve "Namespace factory is problematic"Lin Jen-Shin2018-04-232-4/+6
|
* Merge branch 'fix/gh-namespace-issue' into 'security-10-4'James Lopez2018-02-092-6/+14
| | | | [10.4] Fix GH namespace security issue
* Replace $.post in importer status with axiosClement Ho2018-02-092-55/+118
|
* Merge branch 'sh-validate-path-project-import-10-3' into 'security-10-3'Stan Hu2018-01-161-0/+38
| | | | | | | | | | Validate project path in Gitlab import - 10.3 port See merge request gitlab/gitlabhq!2268 (cherry picked from commit 94c82376d66fc80d46dd2d5eeb5bade408ec6a7e) 2b94a7c2 Validate project path in Gitlab import
* Rewrite the GitHub importer from scratchYorick Peterse2017-11-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Change all `:empty_project` to `:project`rs-empty_project-defaultRobert Speicher2017-08-024-8/+8
|
* Enable Style/DotPosition Rubocop :cop:Grzegorz Bizon2017-06-213-86/+86
|
* Revert "Remove changes that are not absolutely necessary"Douwe Maan2017-05-242-18/+24
| | | This reverts commit b0498c176fa134761d899c9b369be12f1ca789c5
* Remove changes that are not absolutely necessarydm-fix-routesDouwe Maan2017-05-232-24/+18
|
* Fix specsDouwe Maan2017-05-232-19/+25
|
* Create subgroups if they don't exist while importing projectsJames Lopez2017-04-052-0/+133
|
* Fix Error 500 when Bitbucket importer does not have authorizationStan Hu2017-03-201-0/+11
| | | | Closes #29739
* Use `empty_project` where possible in controller specsrs-empty_project-controllersRobert Speicher2017-01-254-8/+8
|
* Namespace access token session key in `Import::GithubController`Rémy Coutable2016-12-192-2/+2
| | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* Modify GithubImport to support GiteaRémy Coutable2016-12-191-1/+1
| | | | | | | | The reason is that Gitea plan to be GitHub-compatible so it makes sense to just modify GitHubImport a bit for now, and hopefully we can change it to GitHubishImport once Gitea is 100%-compatible. Signed-off-by: Rémy Coutable <remy@rymai.me>
* Rename Gogs to Gitea, DRY the controller and improve viewsRémy Coutable2016-12-192-208/+53
| | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* Fix remaining Bitbucket controller specsStan Hu2016-11-211-14/+11
|
* Fix Bitbucket status controller specStan Hu2016-11-211-4/+3
|
* Fix Bitbucket callback specStan Hu2016-11-211-6/+14
|
* modify github import JS and controller so we can now specify a namespace ↵James Lopez2016-09-201-12/+34
| | | | | | | | and/or name for a project. - Fixed and added specs. - Added different namespace options depending on user privilages - Updated docs.
* Don't create groups for unallowed users when importing projectsDouglas Barbosa Alexandre2016-08-313-30/+93
|
* Remove gitoriouszj-remove-gitoriousZ.J. van de Weg2016-08-251-69/+0
|
* Import from Github using Personal Access Tokens.Eric K Idema2016-06-301-0/+43
| | | | | | | | | | | | | This stands as an alternative to using OAuth to access a user's Github repositories. This is setup in such a way that it can be used without OAuth configuration. From a UI perspective, the how to import modal has been replaced by a full page, which includes a form for posting a personal access token back to the Import::GithubController. If the user has logged in via GitHub, skip the Personal Access Token and go directly to Github for an access token via OAuth.
* Remove require_relative 'import_spec_helper'make-omniauth-tests-to-not-modify-global-stateKamil Trzcinski2016-06-086-6/+0
|
* Move ImportSpecHelper to spec/support/Kamil Trzcinski2016-06-081-33/+0
|
* Make Omniauth providers specs to not modify global configurationKamil Trzcinski2016-06-081-1/+1
|
* Backport GitHub Enterprise import support from EEStan Hu2016-04-261-0/+2
| | | | | | | | | | These changes were pulled from GitLab EE to support configuring an alternative API URL than the default https://api.github.com. In addition, the `verify_ssl` flag allows users to disable SSL cert checking. One modification: add a default `args` option if it does not exist to avoid breaking existing configurations.
* Fix duplicate repositories in GitHub import pageStan Hu2015-10-191-1/+1
| | | | | | | | | | | | | By default, all the current user's repositories are accessible via the /users endpoint. There's no need to traverse all the organization repositories as well. See: * http://www.rubydoc.info/github/pengwynn/octokit/Octokit/Client/Repositories#repositories-instance_method * https://developer.github.com/v3/repos/#list-your-repositories Closes #2523
* FogBugz project importJared Szechy2015-09-081-0/+39
|
* Remove user OAuth tokens stored in database for Bitbucket, GitHub, and GitLabStan Hu2015-08-233-23/+48
| | | | | | | | | | | | | | | | | | | | | | | and request them each session. Pass these tokens to the project import data. This prevents the need to encrypt these tokens and clear them in case they expire or get revoked. For example, if you deleted and re-created OAuth2 keys for Bitbucket, you would get an Error 500 with no way to recover: ``` Started GET "/import/bitbucket/status" for x.x.x.x at 2015-08-07 05:24:10 +0000 Processing by Import::BitbucketController#status as HTML Completed 500 Internal Server Error in 607ms (ActiveRecord: 2.3ms) NameError (uninitialized constant Import::BitbucketController::Unauthorized): app/controllers/import/bitbucket_controller.rb:77:in `rescue in go_to_bitbucket_for_permissions' app/controllers/import/bitbucket_controller.rb:74:in `go_to_bitbucket_for_permissions' app/controllers/import/bitbucket_controller.rb:86:in `bitbucket_unauthorized' ``` Closes #1871
* Show incompatible projects in Bitbucket import statusStan Hu2015-08-071-1/+3
| | | | See #1871
* Merge branch 'master' into rubocop-for-testsDmitriy Zaporozhets2015-06-236-35/+74
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> Conflicts: spec/features/issues_spec.rb spec/models/forked_project_link_spec.rb spec/models/hooks/service_hook_spec.rb spec/models/hooks/web_hook_spec.rb spec/models/project_services/hipchat_service_spec.rb spec/requests/api/project_members_spec.rb spec/requests/api/projects_spec.rb spec/requests/api/system_hooks_spec.rb spec/services/archive_repository_service_spec.rb spec/support/matchers.rb spec/tasks/gitlab/backup_rake_spec.rb
| * Update and simplify Import controller specsRobert Speicher2015-06-226-36/+75
| |
* | Fix Style/Blocks cop violationsRobert Speicher2015-06-223-32/+21
|/
* Show incompatible projects in Google Code import statusStan Hu2015-04-301-0/+13
| | | | | | | | Importing a JSON file with only one Subversion project lead to confusion over whether the system was working. Provide status why these projects could not be imported directly. Closes #1531
* Allow projects to be imported from Google Code.Douwe Maan2015-04-031-0/+47
|
* Add tests.import-current-userDouwe Maan2015-04-013-34/+281
|
* Fix missing GitHub organisation repositories on import page.Douwe Maan2015-03-121-2/+5
|
* Fix specs.Douwe Maan2015-02-243-0/+3
|
* Add Bitbucket importer.Douwe Maan2015-02-241-0/+77
|
* Add gitorious.org importerMarcin Kulik2015-02-201-0/+67
|
* Even more hound fixesJeroen van Baarsen2015-02-121-3/+3
| | | | Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
* Fixed hound warningsJeroen van Baarsen2015-02-122-8/+13
| | | | Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
* Updated rspec to rspec 3.x syntaxJeroen van Baarsen2015-02-122-7/+7
| | | | Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
* GitHub importer refactoringValery Sizov2015-02-051-6/+6
|
* gitlab.com importer: fix specs after refactoringValery Sizov2015-02-051-2/+2
|
* GitLab.com integration: refactoringValery Sizov2015-02-052-0/+133