summaryrefslogtreecommitdiff
path: root/app/services
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'remove-use-key-worker' into 'master'Rémy Coutable2017-09-211-0/+33
|\ | | | | | | | | | | | | Stop using Sidekiq for updating Key#last_used_at Closes #36663 See merge request gitlab-org/gitlab-ce!14391
| * Stop using Sidekiq for updating Key#last_used_atremove-use-key-workerYorick Peterse2017-09-201-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes things simpler as no scheduling is involved. Further we remove the need for running a SELECT + UPDATE just to get the key and update it, whereas we only need an UPDATE when setting last_used_at directly in a request. The added service class takes care of updating Key#last_used_at without using Sidekiq. Further it makes sure we only try to obtain a Redis lease if we're confident that we actually need to do so, instead of always obtaining it. We also make sure to _only_ update last_used_at instead of also updating updated_at. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/36663
* | Merge branch 'fix-counts-caching' into 'master'Douwe Maan2017-09-204-5/+15
|\ \ | |/ |/| | | | | | | | | Fix refreshing of issues/MR count caches Closes #38061 See merge request gitlab-org/gitlab-ce!14363
| * Fix refreshing of issues/MR count cachesfix-counts-cachingYorick Peterse2017-09-194-5/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This ensures the open issues/MR count caches are refreshed properly when creating new issues or MRs. This MR also includes a change to the cache keys to ensure all caches are rebuilt on the fly. This particular problem was not caught in the test suite due to a null cache being used, resulting in all calls that would use a cache using the underlying data directly. In production the code would fail because a newly saved record returns an empty hash in #changes meaning checks such as `state_changed? || confidential_changed?` would return false for new rows, thus never updating the counters. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/38061
* | Prepare cherry-pick and revert for migration to GitalyJacob Vosmaer (GitLab)2017-09-191-1/+5
|/
* Detect n+1 issues involving GitalyAndrew Newdigate2017-09-193-10/+22
|
* Merge branch 'operation-service-merge' into 'master'Rémy Coutable2017-09-181-8/+2
|\ | | | | | | | | | | | | Prepare Repository#merge for migration to Gitaly Closes gitaly#559 See merge request gitlab-org/gitlab-ce!14154
| * Prepare Repository#merge for migration to Gitalyoperation-service-mergeJacob Vosmaer2017-09-151-8/+2
| |
* | Merge branch 'master' into 'issue_37640'issue_37640Felipe Artur2017-09-155-1/+39
|\ \ | | | | | | | | | # Conflicts: # db/schema.rb
| * | created services for keyshaseeb2017-09-154-0/+38
| |/
| * Fix PipelineTriggerService to associate trigger_request with buildsShinya Maeda2017-09-131-1/+1
| |
* | Fix project feature being deleted when updating project with invalid ↵Felipe Artur2017-09-121-1/+4
|/ | | | visibility level
* Rework how recent push events are retrieveduser-recent-pushYorick Peterse2017-09-082-3/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Whenever you push to a branch GitLab will show a button to create a merge request (should one not exist already). The underlying code to display this data was quite inefficient. For example, it involved multiple slow queries just to figure out what the most recent push event was. This commit changes the way this data is retrieved so it's much faster. This is achieved by caching the ID of the last push event on every push, which is then retrieved when loading certain pages. Database queries are only executed if necessary and the cached data is removed automatically once a merge request has been created, or 2 hours after being stored. A trade-off of this approach is that we _only_ track the last event. Previously if you were to push to branch A and B then create a merge request for branch B we'd still show the widget for branch A. As of this commit this is no longer the case, instead we will only show the widget for the branch you pushed to most recently. Once a merge request exists the widget is no longer displayed. Alternative solutions are either too complex and/or too slow, hence the decision was made to settle for this trade-off. Performance Impact ------------------ In the best case scenario (= a user didn't push anything for more than 2 hours) we perform a single Redis GET per page. Should there be cached data we will run a single (and lightweight) SQL query to get the event data from the database. If a merge request already exists we will run an additional DEL to remove the cache key. The difference in response timings can vary a bit per project. On GitLab.com the 99th percentile of time spent in User#recent_push hovers between 100 milliseconds and 1 second, while the mean hovers around 50 milliseconds. With the changes in this MR the expected time spent in User#recent_push is expected to be reduced down to just a few milliseconds. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/35990
* Make Members with Owner and Master roles always able to create subgroups30473-allow-creation-of-subgroups-with-gitlab_default_can_create_group-set-to-falseRuben Davila2017-09-071-9/+29
|
* Merge branch 'improve-share-locking-feature-for-subgroups' into 'master'Douwe Maan2017-09-073-26/+36
|\ | | | | | | | | | | | | Improve "Share with group lock" feature for subgroups Closes #30550 See merge request !13944
| * Refer to “Share with group lock” consistentlyimprove-share-locking-feature-for-subgroupsMichael Kozono2017-09-061-1/+1
| |
| * Make UpdateService error message translatableWinnie Hellmann2017-09-061-1/+1
| |
| * Refactor based on code reviewMichael Kozono2017-09-063-3/+3
| |
| * Dry up method for code climateMichael Kozono2017-09-063-27/+21
| |
| * Enforce share_with_group_lock rulesMichael Kozono2017-09-061-1/+17
| | | | | | | | …in Groups::UpdateService instead of only in the browser.
* | Merge branch '37288-fix-wrong-header-when-testing-webhook' into 'master'Douwe Maan2017-09-072-5/+4
|\ \ | | | | | | | | | | | | | | | | | | Fix a wrong `X-Gitlab-Event` header when testing webhooks Closes #37288 See merge request !14108
| * | Fix a wrong `X-Gitlab-Event` header when testing webhooks37288-fix-wrong-header-when-testing-webhookRémy Coutable2017-09-072-5/+4
| |/ | | | | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* | Merge branch '31362_decrease_cyclomatic_complexity_threshold_step3' into ↵Rémy Coutable2017-09-071-19/+21
|\ \ | | | | | | | | | | | | | | | | | | 'master' Decrease Cyclomatic Complexity threshold to 14 See merge request !13972
| * | refactor Ci::CreatePipelineService#allowed_to_create?Maxim Rydkin2017-09-071-9/+9
| | |
| * | refactor app/services/ci/create_pipeline_service.rb:50:5Maxim Rydkin2017-09-071-12/+14
| |/
* | Merge branch '23079-remove-default-scope-in-sortable' into 'master'Douwe Maan2017-09-071-1/+1
|\ \ | | | | | | | | | | | | | | | | | | Removes default scope from sortable Closes #23079 See merge request !13558
| * | Removes default scope from sortable23079-remove-default-scope-in-sortableTiago Botelho2017-09-071-1/+1
| | |
* | | Merge branch 'ee_issue_928_backport' into 'master'Sean McGivern2017-09-0712-43/+60
|\ \ \ | |_|/ |/| | | | | | | | Group boards CE backport See merge request !13883
| * | Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into ↵Simon Knox2017-09-0628-233/+101
| |\ \ | | |/ | | | | | | ee_issue_928_backport
| * | Small fixesFelipe Artur2017-08-312-2/+2
| | |
| * | Continue BE backportFelipe Artur2017-08-315-5/+5
| | |
| * | Group boards CE backportFelipe Artur2017-08-289-36/+53
| | |
* | | Profile updates from providersAlexander Keramidas2017-09-061-0/+4
| | |
* | | Resolve outdated diff discussions on pushSean McGivern2017-09-061-0/+4
| |/ |/|
* | Merge branch ↵Kamil Trzciński2017-09-051-19/+0
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | 'fix/sm/35650-remove-createtriggerrequestservice-and-forbid-to-persist-variables-on-ci-triggerrequest' into 'master' Removes `CreateTriggerRequestService` and add a blocker to prevent saving variables on `Ci::TriggerRequest` Closes #35650 See merge request !13792
| * | Remove CreateTriggerRequestService and forbit to save variables on ↵Shinya Maeda2017-09-041-19/+0
| | | | | | | | | | | | Ci::TriggerRequest
* | | Use script_failure. Add runner_system_failure. Improve spec.feature/sm/37239-implement-failure_reason-on-ci_buildsShinya Maeda2017-09-051-1/+1
| | |
* | | Fix enum listsShinya Maeda2017-09-051-1/+1
| | |
* | | Fix enum wordingShinya Maeda2017-09-051-1/+1
| | |
* | | Implement `failure_reason` on `ci_builds`Shinya Maeda2017-09-051-1/+1
|/ /
* | Merge branch 'move-git-operation-service' into 'master'Sean McGivern2017-09-042-165/+1
|\ \ | | | | | | | | | | | | Move GitOperationService to Gitlab::Git See merge request !13984
| * | Move GitOperationService to Gitlab::Gitmove-git-operation-serviceJacob Vosmaer2017-09-012-165/+1
| | |
* | | Merge branch 'git-operation-service-to-git' into 'master'Sean McGivern2017-09-042-31/+18
|\ \ \ | |/ / | | | | | | | | | Prepare GitOperationService for moving to Gitlab::Git See merge request !13773
| * | Prepare GitOperationService for move to Gitlab::GitJacob Vosmaer2017-08-312-31/+18
| | |
* | | Add validation for protected attributesShinya Maeda2017-09-031-1/+1
| | |
* | | Remove access_level index from runner. Add protected on ci_pipelines. Add ↵Shinya Maeda2017-09-031-1/+2
| | | | | | | | | | | | protected index on ci_builds.
* | | Refactor access_level to not_protected and ref_protectedShinya Maeda2017-09-031-1/+1
| | |
* | | Update application code by the db schema changeShinya Maeda2017-09-032-7/+2
| | |
* | | Tweak only new_builds. Revert the rest.Shinya Maeda2017-09-031-10/+8
| | |
* | | Solution 1. Persists protected(ref) flag on ci_pipelines table. ↵Shinya Maeda2017-09-032-6/+15
| | | | | | | | | | | | builds_for_shared_runner and builds_for_specific_runner read the flag instead of executing protected_for? one by one.