summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Replace old GH importer with the parallel importergithub-importer-refactorYorick Peterse2017-11-0731-1042/+23
|
* Rewrite the GitHub importer from scratchYorick Peterse2017-11-07154-244/+9004
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Cache feature names in RequestStoreYorick Peterse2017-11-072-1/+54
| | | | | | | | The GitHub importer (and probably other parts of our code) ends up calling Feature.persisted? many times (via Gitaly). By storing this data in RequestStore we can save ourselves _a lot_ of database queries. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/39361
* Add returning IDs to Gitlab::Database.bulk_insertYorick Peterse2017-11-072-2/+43
| | | | | | | This adds the keyword argument "return_ids" to Gitlab::Database.bulk_insert. When set to `true` (and PostgreSQL is used) this method will return an Array of the IDs of the inserted rows, otherwise it will return an empty Array.
* Refactor User.find_by_any_emailYorick Peterse2017-11-072-9/+22
| | | | | | By using SQL::Union we can return a proper ActiveRecord::Relation, making it possible to select the columns we're interested in (instead of all of them).
* Merge branch 'add-ingress-to-cluster-applications' into 'master'Kamil Trzciński2017-11-0714-23/+325
|\ | | | | | | | | Add Ingress to cluster applications section See merge request gitlab-org/gitlab-ce!15185
| * Merge remote-tracking branch 'origin/master' into ↵Kamil Trzcinski2017-11-077-26/+12
| |\ | | | | | | | | | add-ingress-to-cluster-applications
| * | Fix db/schema.rbKamil Trzcinski2017-11-071-2/+1
| | |
| * | Add feature spec for IngressEric Eastwood2017-11-071-16/+60
| | |
| * | Merge branch '38464-k8s-apps' of https://gitlab.com/gitlab-org/gitlab-ce ↵Kamil Trzcinski2017-11-0768-442/+766
| |\ \ | | | | | | | | | | | | into add-ingress-to-cluster-applications
| * \ \ Merge branch '38464-k8s-apps' of https://gitlab.com/gitlab-org/gitlab-ce ↵Kamil Trzcinski2017-11-071-3/+2
| |\ \ \ | | | | | | | | | | | | | | | into add-ingress-to-cluster-applications
| * | | | Make ingress to use install_commandKamil Trzcinski2017-11-072-2/+22
| | | | |
| * | | | Merge remote-tracking branch 'origin/38464-k8s-apps' into ↵Kamil Trzcinski2017-11-0712-45/+208
| |\ \ \ \ | | | | | | | | | | | | | | | | | | add-ingress-to-cluster-applications
| * | | | | Fix ingress rubocop failureKamil Trzcinski2017-11-071-1/+1
| | | | | |
| * | | | | Add specs for ingressKamil Trzcinski2017-11-073-0/+148
| | | | | |
| * | | | | Fix ingress.rbKamil Trzcinski2017-11-071-0/+2
| | | | | |
| * | | | | Merge branch '38464-k8s-apps' into add-ingress-to-cluster-applicationsKamil Trzcinski2017-11-0795-221/+815
| |\ \ \ \ \
| * | | | | | Fix initial status againKamil Trzcinski2017-11-073-13/+9
| | | | | | |
| * | | | | | Fix initial_statusKamil Trzcinski2017-11-071-4/+6
| | | | | | |
| * | | | | | Merge branch '38464-k8s-apps' into add-ingress-to-cluster-applicationsKamil Trzcinski2017-11-0729-209/+157
| |\ \ \ \ \ \
| * \ \ \ \ \ \ Merge branch '38464-k8s-apps' into add-ingress-to-cluster-applicationsEric Eastwood2017-11-06237-2946/+8139
| |\ \ \ \ \ \ \
| * \ \ \ \ \ \ \ Merge branch '38464-k8s-apps' into add-ingress-to-cluster-applicationsEric Eastwood2017-11-062-1/+1
| |\ \ \ \ \ \ \ \
| * | | | | | | | | Add changelog for Ingress in Cluster applicationsEric Eastwood2017-11-061-0/+5
| | | | | | | | | |
| * | | | | | | | | Merge branch 'add-ingress-to-cluster-applications' of ↵Eric Eastwood2017-11-061-1/+10
| |\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gitlab.com:gitlab-org/gitlab-ce into add-ingress-to-cluster-applications
| | * | | | | | | | | Fix db/schema.rbKamil Trzcinski2017-11-061-1/+10
| | | | | | | | | | |
| * | | | | | | | | | Remove misspelled duplicate endpointEric Eastwood2017-11-061-1/+0
| |/ / / / / / / / /
| * | | | | | | | | Merge branch '38464-k8s-apps' into add-ingress-to-cluster-applicationsEric Eastwood2017-11-0656-374/+668
| |\ \ \ \ \ \ \ \ \
| * \ \ \ \ \ \ \ \ \ Merge branch '36629-35958-add-cluster-application-section' into ↵add-ingress-to-cluster-applicationsEric Eastwood2017-11-062-10/+20
| |\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | add-ingress-to-cluster-applications
| * \ \ \ \ \ \ \ \ \ \ Merge branch '36629-35958-add-cluster-application-section' into ↵Eric Eastwood2017-11-067-34/+115
| |\ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | add-ingress-to-cluster-applications Conflicts: app/assets/javascripts/clusters/clusters_bundle.js app/assets/javascripts/clusters/components/application_row.vue app/assets/javascripts/clusters/services/clusters_service.js
| * | | | | | | | | | | | Add active? to Platforms::KubernetesKamil Trzcinski2017-11-061-0/+4
| | | | | | | | | | | | |
| * | | | | | | | | | | | Add support for not_installable/scheduled and to not show created bannerKamil Trzcinski2017-11-067-5/+27
| | | | | | | | | | | | |
| * | | | | | | | | | | | Merge branch '36629-35958-add-cluster-application-section' into ↵Kamil Trzcinski2017-11-061-0/+2
| |\ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | add-ingress-to-cluster-applications
| * | | | | | | | | | | | | Fix ingress endpointKamil Trzcinski2017-11-061-1/+1
| | | | | | | | | | | | | |
| * | | | | | | | | | | | | Merge branch '36629-35958-add-cluster-application-section' into ↵Kamil Trzcinski2017-11-062-3/+0
| |\ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | add-ingress-to-cluster-applications
| * | | | | | | | | | | | | | Set installation pathsKamil Trzcinski2017-11-061-3/+2
| | | | | | | | | | | | | | |
| * | | | | | | | | | | | | | Add ingress applicationKamil Trzcinski2017-11-064-13/+72
| | | | | | | | | | | | | | |
| * | | | | | | | | | | | | | Merge branch '36629-35958-add-cluster-application-section' into ↵Kamil Trzcinski2017-11-06255-1435/+2340
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | add-ingress-to-cluster-applications
| * | | | | | | | | | | | | | | Add Ingress to cluster applications sectionEric Eastwood2017-11-033-3/+12
| | | | | | | | | | | | | | | |
* | | | | | | | | | | | | | | | Merge branch '10.2-templates-vendoring' into 'master'Kamil Trzciński2017-11-078-20/+107
|\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Upgrade vendored templates for 10.2 See merge request gitlab-org/gitlab-ce!15259
| * | | | | | | | | | | | | | | | Upgrade vendored templatesAlessio Caiazza2017-11-078-20/+107
| | | | | | | | | | | | | | | | |
* | | | | | | | | | | | | | | | | Merge branch 'feature/hashed-storage-repo-import' into 'master'Nick Thomas2017-11-079-227/+398
|\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / / / / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Improve GitLab Import rake task to work with Hashed Storage and Subgroups Closes #36509 See merge request gitlab-org/gitlab-ce!15157
| * | | | | | | | | | | | | | | | Improve GitLab Import rake task to work with Hashed Storage and SubgroupsJames Lopez2017-11-079-227/+398
|/ / / / / / / / / / / / / / / /
* | | | | | | | | | | | | | | | Merge branch 'fix-comments-spec' into 'master'Rémy Coutable2017-11-071-1/+1
|\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | |_|_|_|_|_|_|_|_|_|_|_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix merge_request_spec See merge request gitlab-org/gitlab-ce!15250
| * | | | | | | | | | | | | | | Fix merge_request_specAnnabel Dunstone Gray2017-11-071-1/+1
| | | | | | | | | | | | | | | |
* | | | | | | | | | | | | | | | Merge branch '38464-k8s-apps' into 'master'Kamil Trzciński2017-11-0763-237/+2546
|\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | |_|_|_|_|_|_|_|_|_|_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for k8s cluster applications - Helm tiller installation See merge request gitlab-org/gitlab-ce!14908
| * | | | | | | | | | | | | | | Merge branch '38464-k8s-apps' of https://gitlab.com/gitlab-org/gitlab-ce ↵Shinya Maeda2017-11-082-4/+3
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into 38464-k8s-apps
| | * | | | | | | | | | | | | | | Review Gitlab::Kubernetes::NamespaceAlessio Caiazza2017-11-071-1/+1
| | | |_|_|_|_|_|_|_|_|_|_|_|_|/ | | |/| | | | | | | | | | | | |
| | * | | | | | | | | | | | | | Fix Projects::Clusters::ApplicationsController failuresAlessio Caiazza2017-11-071-3/+2
| | | |_|_|_|_|_|_|_|_|_|_|_|/ | | |/| | | | | | | | | | | |
| * | | | | | | | | | | | | | Fix schema versionShinya Maeda2017-11-081-1/+1
| | | | | | | | | | | | | | |
| * | | | | | | | | | | | | | Merge branch 'master' into 38464-k8s-appsShinya Maeda2017-11-0866-440/+764
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ | | |/ / / / / / / / / / / / / | |/| | | | | | | | | | | | |