summaryrefslogtreecommitdiff
path: root/spec/lib
Commit message (Collapse)AuthorAgeFilesLines
* Restore Enterprise support in the GH importerYorick Peterse2017-11-081-11/+90
| | | | | This was removed by accident as the old GitHub importer handled this deep down the codebase, making it easy to miss.
* Fix Error 500 when pushing LFS objects with a write deploy keyStan Hu2017-11-081-2/+26
|
* Merge branch 'github-importer-refactor' into 'master'Douwe Maan2017-11-0855-152/+4557
|\ | | | | | | | | | | | | 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-074-53/+1
| |
| * Rewrite the GitHub importer from scratchYorick Peterse2017-11-0750-99/+4495
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-071-0/+41
| | | | | | | | | | | | | | | | 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-071-0/+20
| | | | | | | | | | | | | | 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-7/+0
|\ \ | | | | | | | | | | | | | | | | | | 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-7/+0
| | | | | | | | | | | | - Also remove sign_out DELETE route from read-only whitelist routes
* | | Merge branch 'bvl-free-paths' into 'master'Douwe Maan2017-11-081-37/+9
|\ \ \ | | | | | | | | | | | | | | | | Free some reserved group routes See merge request gitlab-org/gitlab-ce!15052
| * | | Remove EE-specific group pathsbvl-free-pathsBob Van Landuyt2017-11-071-12/+3
| | | |
| * | | Update failure message when finding new routes in `PathRegex`Bob Van Landuyt2017-11-071-9/+4
| | | |
| * | | Free up some group reserved wordsBob Van Landuyt2017-11-071-4/+4
| | | |
| * | | Free up `avatar`, `group_members` and `milestones` as pathsBob Van Landuyt2017-11-071-14/+0
| | | |
* | | | Merge branch 'pawel/fix_backend_transaction_protected_labels_method' into ↵Stan Hu2017-11-081-0/+6
|\ \ \ \ | |_|_|/ |/| | | | | | | | | | | | | | | | | | | 'master' Make BackgroundTransaction#labels public See merge request gitlab-org/gitlab-ce!15257
| * | | Make BackgroundTransaction#labels publicPawel Chojnacki2017-11-071-0/+6
| | | | | | | | | | | | | | | | as are all other Transaction implementations
* | | | Improve GitLab Import rake task to work with Hashed Storage and SubgroupsJames Lopez2017-11-073-100/+219
| |/ / |/| |
* | | Merge branch 'master' into 38464-k8s-appsShinya Maeda2017-11-085-21/+19
|\ \ \ | |/ /
| * | Merge branch 'fix/import-export-arguments' into 'master'Douwe Maan2017-11-071-1/+11
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | 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-3/+3
| | | |
| | * | Fix arguments error on Import/Export fetch_ref methodJames Lopez2017-11-071-1/+11
| | | | | | | | | | | | | | | | 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-072-2/+2
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | '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-062-2/+2
| | | | |
| * | | | Merge branch 'fix-mysql-grant-check' into 'master'Rémy Coutable2017-11-071-17/+5
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-17/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | | | Merge branch '39649-change-default-size-for-gke-cluster-creation' into 'master'Kamil Trzciński2017-11-071-1/+1
| |\ \ \ \ \ | | |_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | Resolve "Change default size for GKE cluster creation" Closes #39649 See merge request gitlab-org/gitlab-ce!15220
| | * | | | Resolve conflictsbikebilly2017-11-0726-263/+466
| | |\ \ \ \ | | | |/ / /
| | * | | | Change default cluster size to n1-standard-2bikebilly2017-11-061-1/+1
| | | |/ / | | |/| |
* | | | | Add Helm InstallCommandAlessio Caiazza2017-11-071-0/+100
| | | | |
* | | | | Add k8s namespace implementation and testsAlessio Caiazza2017-11-071-0/+66
| | | | |
* | | | | Merge branch '38464-k8s-apps' of https://gitlab.com/gitlab-org/gitlab-ce ↵Shinya Maeda2017-11-071-16/+0
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | into 38464-k8s-apps
| * | | | | Remove Project#clusters exportAlessio Caiazza2017-11-071-16/+0
| | | | | |
* | | | | | Merge branch 'master' into 38464-k8s-appsShinya Maeda2017-11-076-6/+69
|\ \ \ \ \ \ | |/ / / / / |/| / / / / | |/ / / /
| * | | | Merge branch 'feature/custom-attributes-on-projects-and-groups' into 'master'Rémy Coutable2017-11-075-2/+39
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Support custom attributes on groups and projects See merge request gitlab-org/gitlab-ce!14593
| | * | | | Support custom attributes on projectsMarkus Koller2017-11-065-2/+39
| | | | | |
| * | | | | Fix GFM reference links for closed milestonesbugfix_banzai_closed_milestonesVitaliy @blackst0ne Klachkov2017-11-071-4/+30
| | |_|/ / | |/| | |
* | | | | Merge branch 'master' into 38464-k8s-appsEric Eastwood2017-11-0627-266/+502
|\ \ \ \ \ | |/ / / / | | | | | | | | | | | | | | | Conflicts: db/schema.rb
| * | | | Merge branch 'refactor-clusters' into 'master'Grzegorz Bizon2017-11-063-19/+46
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Refactor Clusters to be consisted from GcpProvider and KubernetesPlatform See merge request gitlab-org/gitlab-ce!14879
| * \ \ \ \ Merge branch 'pawel/metrics-to-prometheus-33643' into 'master'Grzegorz Bizon2017-11-0614-193/+291
| |\ \ \ \ \ | | |_|_|_|/ | |/| | | | | | | | | | | | | | | | Add all InfluxDB metrics to prometheus See merge request gitlab-org/gitlab-ce!13891
| | * | | | Only enable unicorn metrics when not in sidekiq mode.Pawel Chojnacki2017-11-021-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | + remove rebased test case
| | * | | | Make subscriber tests pass, after refactoring metricsPawel Chojnacki2017-11-024-7/+7
| | | | | |
| | * | | | rename BackgroundMigration to SidekiqMigrationPawel Chojnacki2017-11-023-2/+15
| | | | | |
| | * | | | Fix sidekiq middleware testsPawel Chojnacki2017-11-022-21/+9
| | | | | |
| | * | | | Tests for Web transaction and remove simple transactonPawel Chojnacki2017-11-026-8/+8
| | | | | |
| | * | | | Cleanup metrics names and removing unnecessary cache read totalPawel Chojnacki2017-11-021-15/+3
| | | | | |
| | * | | | Adjust test to changed metrics methods.Pawel Chojnacki2017-11-022-17/+3
| | | | | | | | | | | | | | | | | | | | | | | | + remove deprecated test suite
| | * | | | Convert rails_queue_duration to metric_rails_queue_duration_secondsPawel Chojnacki2017-11-021-1/+11
| | | | | |
| | * | | | Move labels tests from Metrics rack spec to Transaction specPawel Chojnacki2017-11-023-71/+58
| | | | | |
| | * | | | Metric spec adjustment for transaction signature changePawel Chojnacki2017-11-021-6/+6
| | | | | |
| | * | | | Fix Rubocop warningsPawel Chojnacki2017-11-023-4/+1
| | | | | |