summaryrefslogtreecommitdiff
path: root/lib/gitlab
Commit message (Collapse)AuthorAgeFilesLines
* Prefer polymorphism over specific type checks in Import servicedm-import-service-polymorphismDouwe Maan2017-11-152-0/+8
|
* Merge branch 'zj-move-repo-exists-opt-out' into 'master'Sean McGivern2017-11-131-1/+1
|\ | | | | | | | | Repository Exists check is OPT_OUT for Gitaly See merge request gitlab-org/gitlab-ce!15287
| * Repository Exists check is OPT_OUT for GitalyZeger-Jan van de Weg2017-11-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | Moving more git operations to be executed by Gitaly, now the check if a repository exists is an opt out endpoint. Can be disabled, for the time being, by performing in the rails console: > Feature.get('gitaly_repository_exists').disable => true Part of gitlab-org/gitaly#314
* | Prepare Repository#fetch_source_branch for migrationJacob Vosmaer (GitLab)2017-11-103-29/+97
| |
* | Merge branch 'cleanup-issues-schema' into 'master'Sean McGivern2017-11-101-1/+0
|\ \ | | | | | | | | | | | | | | | | | | Clean up the schema of the table "issues" Closes #31811 See merge request gitlab-org/gitlab-ce!15225
| * | Clean up schema of the "issues" tablecleanup-issues-schemaYorick Peterse2017-11-091-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | This adds various foreign key constraints, indexes, missing NOT NULL constraints, and changes some column types from timestamp to timestamptz. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/31811
* | | Merge branch 'tz-no-cdn-for-svg-sprites' into 'master'Douwe Maan2017-11-101-1/+1
|\ \ \ | | | | | | | | | | | | | | | | Icon Sprite URL needs to be local even if asset_host is set See merge request gitlab-org/gitlab-ce!15289
| * | | Icon Sprite URL is also local even if asset_host is setTim Zallmann2017-11-091-1/+1
| | |/ | |/|
* | | Merge branch '39958-updatemergerequestsworker-are-failing-on-metric-tagging' ↵Sean McGivern2017-11-091-2/+0
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | | | | | | | into 'master' Revert "add metrics tagging to the sidekiq middleware" Closes #39958 See merge request gitlab-org/gitlab-ce!15285
| * | Revert "add metrics tagging to the sidekiq middleware"39958-updatemergerequestsworker-are-failing-on-metric-taggingmicael.bergeron2017-11-081-2/+0
| | | | | | | | | | | | | | | | | | This reverts commit d5859bb9d59b3750ac6e9b8c4c17d69c4c3ed077. This reverts commit 2b7e03cf699f9d266af585a1a9399c3e219fe063. This reverts commit 7799a9bc442738935104d3b047c257e5c5884d95.
* | | Merge branch 'github-rake-task-rate-limiting' into 'master'Douwe Maan2017-11-091-0/+6
|\ \ \ | |_|/ |/| | | | | | | | Add GitHub enterprise support to the GitHub Rake task and better handle rate limiting being disabled See merge request gitlab-org/gitlab-ce!15284
| * | Support importing GH projects without rate limitsgithub-rake-task-rate-limitingYorick Peterse2017-11-081-0/+6
| |/ | | | | | | | | | | | | GitHub Enterprise disables rate limiting for the API, resulting in HTTP 404 errors when requesting rate limiting details. This changes Gitlab::GithubImport::Client so it can deal with rate limiting being disabled.
* | Merge branch 'ssrf-protections-round-2' into 'security-10-1'Douwe Maan2017-11-081-1/+3
|/ | | | | | | | | Replace SSRF resolver with Addrinfo.getaddrinfo to include alternative localhost versions See merge request gitlab/gitlabhq!2219 (cherry picked from commit 4a1e73783d5480aa514db7b53e10c075f95580b5) 1bffa0c3 Replace SSRF resolver with Addrinfo.getaddrinfo to include alternative localhost versions
* Merge branch 'fix-issues-api-list-performance' into 'master'Stan Hu2017-11-081-0/+8
|\ | | | | | | | | | | | | Fail when issuable_meta_data is called on an unlimited collection Closes #39845 See merge request gitlab-org/gitlab-ce!15249
| * Fail when issuable_meta_data is called on an unlimited collectionfix-issues-api-list-performanceSean McGivern2017-11-071-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This method can be called with an array, or a relation: 1. Arrays always have a limited amount of values, so that's fine. 2. If the relation does not have a limit value applied, then we will load every single object in that collection, and prevent N+1 queries for the metadata for that. But that's wrong, because we should never call this without an explicit limit set. So we raise in that case, and this commit will see which specs fail. The only failing specs here were the issues API specs, and the specs for IssuableMetadata itself, and both have been addressed.
* | Merge branch 'github-enterprise-support-importer' into 'master'Douwe Maan2017-11-081-3/+29
|\ \ | | | | | | | | | | | | | | | | | | Github enterprise support importer Closes #39931 See merge request gitlab-org/gitlab-ce!15281
| * | Restore Enterprise support in the GH importerYorick Peterse2017-11-081-3/+29
| | | | | | | | | | | | | | | This was removed by accident as the old GitHub importer handled this deep down the codebase, making it easy to miss.
* | | Merge branch 'gitaly-700-wiki-update-page' into 'master'Douwe Maan2017-11-082-5/+45
|\ \ \ | |/ / |/| | | | | | | | | | | | | | Migrate GitLab::Git::Wiki.update_page to Gitaly Closes gitaly#700 See merge request gitlab-org/gitlab-ce!15268
| * | Migrate GitLab::Git::Wiki.update_page to GitalyKim "BKC" Carlbäcker2017-11-082-5/+45
| | |
* | | Fix Error 500 when pushing LFS objects with a write deploy keyStan Hu2017-11-082-4/+15
| | |
* | | Merge branch 'github-importer-refactor' into 'master'Douwe Maan2017-11-0854-121/+2469
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Rewrite the GitHub importer to perform work in parallel and greatly improve performance Closes #33135, #38621, and #39361 See merge request gitlab-org/gitlab-ce!14731
| * | | Replace old GH importer with the parallel importergithub-importer-refactorYorick Peterse2017-11-071-1/+1
| | | |
| * | | Rewrite the GitHub importer from scratchYorick Peterse2017-11-0753-118/+2445
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | Add returning IDs to Gitlab::Database.bulk_insertYorick Peterse2017-11-071-2/+23
| |/ / | | | | | | | | | | | | | | | | | | 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.
* | | Merge branch 'feature-change-signout-route' into 'master'Douwe Maan2017-11-081-5/+1
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Change Sign Out route from a DELETE to a GET Closes #39708 See merge request gitlab-org/gitlab-ce!15231
| * | | Updates tests to reflect sign_out route changeJoe Marty2017-11-071-5/+1
| | | | | | | | | | | | | | | | - Also remove sign_out DELETE route from read-only whitelist routes
* | | | Merge branch 'bvl-free-paths' into 'master'Douwe Maan2017-11-082-16/+19
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | Free some reserved group routes See merge request gitlab-org/gitlab-ce!15052
| * | | | Remove EE-specific group pathsbvl-free-pathsBob Van Landuyt2017-11-071-7/+0
| | | | |
| * | | | Check redirecting with a querystringBob Van Landuyt2017-11-071-2/+4
| | | | |
| * | | | Free up some group reserved wordsBob Van Landuyt2017-11-072-6/+9
| | | | |
| * | | | Free up `avatar`, `group_members` and `milestones` as pathsBob Van Landuyt2017-11-071-3/+0
| | | | |
| * | | | Free up `labels` as a group nameBob Van Landuyt2017-11-071-1/+0
| | | | |
| * | | | Add helper methods to redirect legacy pathsBob Van Landuyt2017-11-071-0/+9
| | | | |
* | | | | Merge branch 'pawel/fix_backend_transaction_protected_labels_method' into ↵Stan Hu2017-11-081-2/+0
|\ \ \ \ \ | |_|_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | 'master' Make BackgroundTransaction#labels public See merge request gitlab-org/gitlab-ce!15257
| * | | | Make BackgroundTransaction#labels publicPawel Chojnacki2017-11-071-2/+0
| | | | | | | | | | | | | | | | | | | | as are all other Transaction implementations
* | | | | Improve GitLab Import rake task to work with Hashed Storage and SubgroupsJames Lopez2017-11-073-97/+143
| |/ / / |/| | |
* | | | Merge branch '38464-k8s-apps' of https://gitlab.com/gitlab-org/gitlab-ce ↵Shinya Maeda2017-11-081-1/+1
|\ \ \ \ | | | | | | | | | | | | | | | into 38464-k8s-apps
| * | | | Review Gitlab::Kubernetes::NamespaceAlessio Caiazza2017-11-071-1/+1
| | | | |
* | | | | Merge branch 'master' into 38464-k8s-appsShinya Maeda2017-11-083-13/+21
|\ \ \ \ \ | |/ / / / |/| / / / | |/ / /
| * | | Merge branch 'fix/import-export-arguments' into 'master'Douwe Maan2017-11-071-1/+1
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix arguments error on Import/Export fetch_ref method Closes #39541 See merge request gitlab-org/gitlab-ce!15241
| | * | | fix specsfix/import-export-argumentsJames Lopez2017-11-071-1/+1
| | | | |
| | * | | Fix arguments error on Import/Export fetch_ref methodJames Lopez2017-11-071-1/+1
| | | |/ | | |/| | | | | | | | | Added unit test and updated integration spec to test for this as well.
| * | | Merge branch '39831-warning-icon-in-jobs-dropdown-has-incorrect-style' into ↵Clement Ho2017-11-071-1/+1
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'master' Resolve "Warning icon in jobs dropdown has incorrect style" Closes #39831 See merge request gitlab-org/gitlab-ce!15221
| | * | | Fixed Status Warning Icon39831-warning-icon-in-jobs-dropdown-has-incorrect-styleTim Zallmann2017-11-061-1/+1
| | | | |
| * | | | Merge branch 'fix-mysql-grant-check' into 'master'Rémy Coutable2017-11-071-11/+19
| |\ \ \ \ | | |_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | Fix TRIGGER checks for MySQL Closes #38372 See merge request gitlab-org/gitlab-ce!15226
| | * | | Fix TRIGGER checks for MySQLfix-mysql-grant-checkYorick Peterse2017-11-061-11/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This ensures we can check if the user has TRIGGER permissions without querying restricted tables. Thanks to Steve Norman (https://gitlab.com/stevenorman) for helping out with this merge request. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/38372
* | | | | Add Helm InstallCommandAlessio Caiazza2017-11-071-35/+42
| | | | |
* | | | | Add k8s namespace implementation and testsAlessio Caiazza2017-11-072-25/+35
| | | | |
* | | | | Merge branch '38464-k8s-apps' of https://gitlab.com/gitlab-org/gitlab-ce ↵Shinya Maeda2017-11-072-4/+0
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | into 38464-k8s-apps
| * | | | | Remove Project#clusters exportAlessio Caiazza2017-11-072-4/+0
| | | | | |