summaryrefslogtreecommitdiff
path: root/spec/controllers/import
Commit message (Collapse)AuthorAgeFilesLines
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2020-02-066-23/+23
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2020-01-249-0/+22
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2019-11-141-2/+3
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2019-10-231-1/+1
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2019-10-022-3/+3
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2019-09-261-0/+15
|
* Add BitbucketServerController filtering specGeorge Koltsov2019-08-121-1/+13
|
* Remove code related to object hierarchy in MySQLremove-nested-groups-checksHeinrich Lee Yu2019-07-252-6/+6
| | | | | These are not required because MySQL is not supported anymore
* Do not authorize with OAuth for CICD only projectsmc/feature/use-only-pat-cicd-projectsMatija Čupić2019-07-231-0/+10
|
* Fix Fogbugz Importer not workingsh-fix-fogbugz-importStan Hu2019-06-091-0/+38
| | | | | | | | | | | | | | | | This stopped working in GitLab 11.11 when we upgraded to Rails 5.1. Rails 5 changed ActionController::Parameters to return an Object instead of a Hash. The old behavior was deprecated in Rails 5 but finally removed in Rails 5.1 Since the controller wasn't updated properly, the callback endpoint quietly failed with the message, "Could not connect to FogBugz, check your url". To fix this, we need to call `to_h` on the `import_params` to access the Hash. We also need to do this for the user map and permit specific keys. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/33530
* Setup Phabricator importBob Van Landuyt2019-05-311-0/+92
| | | | | | | | | | | | | | | | | | | | | | 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.
* Add some frozen string to spec/**/*.rbgfyoung2019-04-158-0/+16
| | | | | | | | | | Adds frozen string to the following: * spec/bin/**/*.rb * spec/config/**/*.rb * spec/controllers/**/*.rb xref https://gitlab.com/gitlab-org/gitlab-ce/issues/59758
* Improve the GitHub and Gitea import feature table interfaceLuke Bennett2019-02-132-0/+12
| | | | | | | | | | | These are backend changes. Use Vue for the import feature UI for "githubish" providers (GitHub and Gitea). Add "Go to project" button after a successful import. Use CI-style status icons and improve spacing of the table and its component. Adds ETag polling to the github and gitea import jobs endpoint.
* Alias GitHub and BitBucket OAuth2 callback URLsStan Hu2019-01-312-3/+16
| | | | | | | | | | | | | | | | | | | | To prevent an OAuth2 covert redirect vulnerability, this commit adds and uses an alias for the GitHub and BitBucket OAuth2 callback URLs to the following paths: GitHub: /users/auth/-/import/github Bitbucket: /users/auth/-/import/bitbucket This allows admins to put a more restrictive callback URL in the OAuth2 configuration settings. Instead of https://example.com, admins can now use: https://example.com/users/auth It's possible but not trivial to change Devise and OmniAuth to use a different prefix for callback URLs instead of /users/auth. For now, aliasing the import URLs under the /users/auth namespace should suffice. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/56663
* Fix Bitbucket Server import not allowing personal projectsStan Hu2019-01-281-3/+19
| | | | | | | | Bitbucket Server places personal projects in a namespace called `~username`. This change allows those projects and also strips them from the GitLab namespace. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/53419
* Fix Bitbucket Server importer error handlingStan Hu2019-01-121-1/+1
| | | | | | | | | | | The importer would display a 500 error page if you attempted to import using a non-existent DNS entry. This commit rescues known network issues and consolidates them into BitbucketServer::Connection::ConnectionError`. The previous error handling in the paginator doesn't work because it returns a lazy collection. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/56154
* Update specs to rails5 formatblackst0ne-convert-specs-rails5-styleblackst0ne2018-12-195-25/+25
| | | | | | | | | | Updates specs to use new rails5 format. The old format: `get :show, { some: params }, { some: headers }` The new format: `get :show, params: { some: params }, headers: { some: headers }`
* Allow GitHub imports via token even if OAuth2 provider not configuredStan Hu2018-12-101-0/+9
| | | | | | | | | | Previously, the GitHub importer would only work if the site configured an OAuth2 provider were configured. Users attempting to import via a GitHub personal access token would see an Error 500 due to a failed redirection. We fix this by only doing the redirection if the provider has been configured and allowing users to see the new import page. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/38524
* Removes all the irrelevant import related code and columnsTiago Botelho2018-11-271-1/+1
| | | | | Clears the import related columns and code from the Project model over to the ProjectImportState model
* Paginate Bitbucket Server importer projectsStan Hu2018-11-071-2/+9
| | | | | | | To prevent delays in loading the page and reduce memory usage, limit the number of projects shown at 25 per page. Part of https://gitlab.com/gitlab-org/gitlab-ce/issues/50021
* Resolve "Unable to import repository: undefined method `import_file' for ↵James Lopez2018-09-171-1/+1
| | | | nil:NilClass"
* Consolidate server errors and add specsStan Hu2018-07-261-1/+1
|
* Fix failing specsStan Hu2018-07-261-2/+2
|
* Add missing stubbed parameterStan Hu2018-07-171-1/+1
|
* Finish specs for spec/controllers/import/bitbucket_server_controller_spec.rbStan Hu2018-07-091-2/+53
|
* Test server connection errorStan Hu2018-07-081-0/+5
|
* Add spec when project can't be savedStan Hu2018-07-081-7/+12
|
* Add spec for project not foundStan Hu2018-07-081-0/+10
|
* Add more specs and fix some typosStan Hu2018-07-081-0/+6
|
* Add initial specs for app/controllers/import/bitbucket_server_controller.rbStan Hu2018-07-081-0/+77
|
* 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
|