summaryrefslogtreecommitdiff
path: root/spec/workers
Commit message (Collapse)AuthorAgeFilesLines
* Run background migrations with a minimum intervaldelay-background-migrationsYorick Peterse2018-01-051-2/+21
| | | | | | | | | | | | | | | This adds a minimum interval to BackgroundMigrationWorker, ensuring background migrations of the same class only run once every 5 minutes. This prevents a thundering herd problem where scheduled migrations all run at once due to their delays having been expired (e.g. as the result of a queue being paused for a long time). If a job was recently executed it's rescheduled with a delay that equals the remaining time of the job's lease. This means that if the lease expires in two minutes we only need to wait two minutes, instead of five. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/41624
* Replace '.team << [user, role]' with 'add_role(user)' in specs36782-replace-team-user-role-with-add_role-user-in-specsblackst0ne2017-12-221-1/+1
|
* Merge branch ↵Douwe Maan2017-12-203-31/+61
|\ | | | | | | | | | | | | | | | | '39246-fork-and-import-jobs-should-only-be-marked-as-failed-when-the-number-of-retries-was-exhausted' into 'master' Fork and Import jobs only get marked as failed when the number of Sidekiq retries were exhausted Closes #39246 See merge request gitlab-org/gitlab-ce!15844
| * Fork and Import jobs only get marked as failed when the number of Sidekiq ↵39246-fork-and-import-jobs-should-only-be-marked-as-failed-when-the-number-of-retries-was-exhaustedTiago Botelho2017-12-153-31/+61
| | | | | | | | retries were exhausted
* | Merge branch 'sh-add-schedule-pipeline-run-now' into 'master'Kamil Trzciński2017-12-181-0/+39
|\ \ | | | | | | | | | | | | | | | | | | Add button to run scheduled pipeline immediately Closes #38741 See merge request gitlab-org/gitlab-ce!15700
| * | Address some comments with running a pipeline scheduleStan Hu2017-12-121-6/+9
| | |
| * | Add button to run scheduled pipeline immediatelyStan Hu2017-12-121-0/+36
| |/ | | | | | | Closes #38741
* | Merge branch 'dm-dedicated-sidekiq-queues' into 'master'Sean McGivern2017-12-147-22/+36
|\ \ | | | | | | | | | | | | Use a dedicated queue for each Sidekiq worker See merge request gitlab-org/gitlab-ce!15882
| * | Add rubocops to ensure Sidekiq workers include ApplicationWorker and don't ↵Douwe Maan2017-12-131-4/+0
| | | | | | | | | | | | manually set their queue
| * | Use a dedicated queue for each workerDouwe Maan2017-12-127-18/+36
| |/
* | Prevent worker that updates merge requests head pipeline from failing jobsFelipe Artur2017-12-132-3/+5
|/
* Ensure pippeline corresponds with the sha of an MRJarka Kadlecova2017-12-051-0/+38
|
* Merge branch 'zj-multiple-artifacts' into 'master'Grzegorz Bizon2017-12-051-13/+9
|\ | | | | | | | | Multiple artifacts See merge request gitlab-org/gitlab-ce!14367
| * Use `job_artifacts_archive|metadata`Kamil Trzcinski2017-12-031-3/+3
| |
| * Revert "Rename `job_archive|metadata` to `artifacts_archive|metadata`"Kamil Trzcinski2017-12-031-3/+3
| | | | | | | | This reverts commit 714082e65304ae2ec5c5400c59a68ab63e724aa9.
| * Rename `job_archive|metadata` to `artifacts_archive|metadata`Kamil Trzcinski2017-12-031-3/+3
| |
| * Rename Artifact to JobArtifact, split metadata outZeger-Jan van de Weg2017-12-031-13/+9
| | | | | | | | | | | | | | | | | | Two things at ones, as there was no clean way to seperate the commit and give me feedback from the tests. But the model Artifact is now JobArtifact, and the table does not have a type anymore, but the metadata is now its own model: Ci::JobArtifactMetadata.
* | Consistently schedule Sidekiq jobsdm-application-workerDouwe Maan2017-12-053-32/+31
| |
* | Add ApplicationWorker and make every worker include itDouwe Maan2017-12-059-54/+62
| |
* | Fix the fork project functionality for projects with hashed storageNick Thomas2017-12-041-49/+28
|/ | | | Note the dependency on gitlab-shell v5.10.0
* Merge branch 'master' into backstage/gb/build-pipeline-in-a-separate-classGrzegorz Bizon2017-11-3029-91/+1138
|\ | | | | | | * master: (1794 commits)
| * Merge branch '38668-revert-copied-kubernetesservice-logic' into 'master'Grzegorz Bizon2017-11-301-6/+19
| |\ | | | | | | | | | | | | Copy `KubernetesService` logic in `Clusters::Platforms::Kubernetes` to make it interchangeable. And implement a selector. See merge request gitlab-org/gitlab-ce!15515
| | * Fix unit testsShinya Maeda2017-11-281-10/+9
| | |
| | * Aling shared_exmaples to "same behavior between KubernetesService and ↵Shinya Maeda2017-11-281-3/+3
| | | | | | | | | | | | Platform::Kubernetes"
| | * Replce kubernetes_service and deployment_service to deployment_platformShinya Maeda2017-11-281-1/+1
| | |
| | * Duplicate spec for Platform::Kubernetes with kubernetes_projectShinya Maeda2017-11-281-4/+18
| | |
| * | Merge branch ↵Kamil Trzciński2017-11-281-0/+36
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | '38962-automatically-run-a-pipeline-when-auto-devops-is-turned-on-in-project-settings' into 'master' Add checkbox to automatically run a pipeline when Auto DevOps is turned on in project settings Closes #38962 See merge request gitlab-org/gitlab-ce!15380
| | * | BE for automatic pipeline when enabling Auto DevOpsMatija Čupić2017-11-281-0/+36
| | |/ | | | | | | | | | Fix https://gitlab.com/gitlab-org/gitlab-ce/issues/38962
| * | Merge branch 'hashed-storage-attachments-migration-path' into 'master'Nick Thomas2017-11-281-14/+38
| |\ \ | | |/ | |/| | | | | | | Hashed storage attachments migration path See merge request gitlab-org/gitlab-ce!15352
| | * fix exclusive lease specs fro hashed storage migrationGabriel Mazetto2017-11-231-3/+9
| | |
| | * Codestyle changes and Added Exclusive Lease to hashed storage migrationGabriel Mazetto2017-11-231-13/+31
| | |
| * | Fix stuck jobs testsoptimise-stuck-ci-jobs-workerKamil Trzcinski2017-11-271-4/+4
| | |
| * | Allow to drop jobs for deleted projectsKamil Trzcinski2017-11-271-2/+2
| | |
| * | Fix testing orderShinya Maeda2017-11-231-1/+1
| | |
| * | Add a testShinya Maeda2017-11-231-12/+19
| |/
| * rework the logging to be simpler and add a thresholdmicael.bergeron2017-11-141-3/+9
| |
| * add simple logging to UpdateMergeRequestsWorker#performmicael.bergeron2017-11-131-0/+6
| | | | | | | | this is to try to debug #35914
| * Rewrite the GitHub importer from scratchYorick Peterse2017-11-0718-0/+933
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * Remove 10.3 comments (Tracked by a tech debts issue). Refactor spec factory ↵refactor-clustersShinya Maeda2017-11-062-2/+2
| | | | | | | | name. Use ArgumentError
| * Merge branch 'master' into refactor-clustersShinya Maeda2017-11-011-2/+7
| |\
| | * Make merge_jid handling less stateful in MergeServiceOswaldo Ferreira2017-10-271-2/+7
| | |
| * | specs for workers.Shinya Maeda2017-10-312-51/+29
| |/
| * Backports EE 38771 changes to CE.Tiago Botelho2017-10-102-0/+39
| |
| * Replaces `tag: true` into `:tag` in the specsJacopo2017-10-071-1/+1
| | | | | | | | | | | | Replaces all the explicit include metadata syntax in the specs (tag: true) into the implicit one (:tag). Added a cop to prevent future errors and handle autocorrection.
* | Improve post_receive spec by not stubbing private methodsGrzegorz Bizon2017-10-101-5/+7
|/
* Add a project forks spec helperBob Van Landuyt2017-10-071-3/+7
| | | | | The helper creates a fork of a project with all provided attributes, but skipping the creation of the repository on disk.
* Merge branch 'master' into '37970-ci-sections-tracking'Kamil Trzciński2017-10-073-0/+105
|\ | | | | | | # Conflicts: # db/schema.rb
| * Use utc for time comparisionShinya Maeda2017-10-061-1/+1
| |
| * Add some empty spacesKamil Trzcinski2017-10-051-0/+2
| |
| * Fix failing specKamil Trzcinski2017-10-051-2/+2
| |