summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Memoize Gitlab::Database.versionmemoize-database-versionYorick Peterse2018-05-171-1/+1
| | | | | This removes the need for running a database query every time we want to check the database version.
* Fix: Use case in-sensitive ordering by name for groupsHarish Ved2018-05-171-0/+2
|
* Preload pipeline data for project pipelinesYorick Peterse2018-05-171-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When displaying the pipelines of a project we now preload the following data: 1. Authors of the commits that belong to these pipelines 2. The number of warnings per pipeline, which is used by Ci::Pipeline#has_warnings? == Commit Authors Previously this data was queried for every Commit separately, leading to 20 SQL queries being executed in the worst case. With an average of 3 to 5 milliseconds per SQL query this could result in 100 milliseconds being spent in _just_ getting Commit authors. To preload this data Commit#author now uses BatchLoader (through Commit#lazy_author), and a separate module Gitlab::Ci::Pipeline::Preloader is used to ensure all authors are loaded before they are used. == Number of warnings This changes Ci::Pipeline#has_warnings? so it supports preloading of the number of warnings per pipeline. This removes the need for executing a COUNT(*) query for every pipeline just to see if it has any warnings or not.
* Merge branch 'zj-workhorse-commit-patch-diff' into 'master'Grzegorz Bizon2018-05-171-25/+0
|\ | | | | | | | | | | | | Workhorse to send raw diff and patch for commits Closes gitaly#1196 See merge request gitlab-org/gitlab-ce!18974
| * Workhorse to send raw diff and patch for commitsZeger-Jan van de Weg2018-05-161-25/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | Prior to this change, this was done through unicorn. In theory this could time out. Workhorse has been sending these raw patches and diffs for a long time and is stable in doing so. Added bonus is the fact that `Commit#to_patch` can be removed. `Commit#to_diff` too, which closes https://gitlab.com/gitlab-org/gitaly/issues/324 Closes https://gitlab.com/gitlab-org/gitaly/issues/1196
* | Merge branch 'jprovazn-remote-upload-destroy' into 'master'Kamil Trzciński2018-05-162-0/+2
|\ \ | | | | | | | | | | | | | | | | | | Delete remote uploads Closes #45425 See merge request gitlab-org/gitlab-ce!18698
| * | Whitelisted query limits for group destroy APIjprovazn-remote-upload-destroyJan Provaznik2018-05-162-0/+2
| | |
* | | Merge branch '46010-allow-managing-group-runners-via-api' into 'master'Kamil Trzciński2018-05-162-15/+10
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | API support + Improved policies for group runners Closes #45894 and #38979 See merge request gitlab-org/gitlab-ce!18851
| * | | Remove unnecessary runner.is_shared? checks in api because they are handled ↵Dylan Griffith2018-05-161-2/+0
| | | | | | | | | | | | | | | | by policy
| * | | Allow admin to assign shared runner to project through APIDylan Griffith2018-05-161-2/+2
| | | |
| * | | Change policy list_runner_jobs -> read_runnerDylan Griffith2018-05-161-1/+1
| | | |
| * | | Rename User#ci_authorized_runners -> ci_owned_runnersDylan Griffith2018-05-162-2/+2
| | | |
| * | | Use can? policies for lib/api/runners.rbDylan Griffith2018-05-161-9/+5
| | | |
| * | | Allow group runners to be viewed/edited in APIDylan Griffith2018-05-161-0/+1
| |/ /
* | | Merge branch 'sh-fast-admin-counts' into 'master'Yorick Peterse2018-05-161-0/+48
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Fix Error 500 viewing admin page due to statement timeouts Closes #46255 See merge request gitlab-org/gitlab-ce!18982
| * | | Fix Error 500 viewing admin page due to statement timeoutsStan Hu2018-05-161-0/+48
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | Uses PostgreSQL tuple estimates to provide a much faster yet approximate count. See https://wiki.postgresql.org/wiki/Slow_Counting for more details. We only use this fast method if the table has been analyzed or vacuumed within the last hour. Closes #46255
* | | Merge branch 'fix-metrics-doorkeeper' into 'master'Nick Thomas2018-05-161-1/+5
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Fix GitLab Performance Monitoring content types for Doorkeeper Closes #46412 See merge request gitlab-org/gitlab-ce!18984
| * | | Fix GPM content types for DoorkeeperYorick Peterse2018-05-161-1/+5
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | Certain controllers (e.g. Doorkeeper::TokensController) don't expose the method "request_format". This commit changes Gitlab::Metrics::WebTransaction so we don't rely on this method, instead using the underlying code this method uses. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/46412
* | | Merge branch 'zj-add-branch-mandatory' into 'master'Douwe Maan2018-05-161-23/+3
|\ \ \ | |/ / |/| | | | | | | | | | | | | | Move Gitlab::Git::Repository#add_branch to mandatory Closes gitaly#540 See merge request gitlab-org/gitlab-ce!18939
| * | Move Gitlab::Git::Repository#add_branch to mandatoryZeger-Jan van de Weg2018-05-141-23/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prior to this change, a feature flag could be used to disable this feature. Now all requests go through Gitaly's OperationService. Closes https://gitlab.com/gitlab-org/gitaly/issues/540 When vendoring `Gitlab::Git` again in Gitaly, this implemenation will be gone, but this is readded there through: https://gitlab.com/gitlab-org/gitaly/merge_requests/717
* | | Merge branch 'zj-ref-contains-sha-mandatory' into 'master'Robert Speicher2018-05-161-37/+2
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Ref contains oid check done by Gitaly Closes gitaly#884 See merge request gitlab-org/gitlab-ce!18944
| * | | Ref contains oid check done by GitalyZeger-Jan van de Weg2018-05-141-37/+2
| |/ / | | | | | | | | | | | | | | | | | | These two endpoints are in opt-out, and no one noticed. Has been running on .com for 4 months now and considered stable. Closes https://gitlab.com/gitlab-org/gitaly/issues/884
* | | Merge branch 'fix-metrics-content-types' into 'master'Stan Hu2018-05-151-13/+1
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Fix setting Gitlab metrics content types Closes gitlab-com/infrastructure#3499 See merge request gitlab-org/gitlab-ce!18975
| * | | Fix setting Gitlab metrics content typesYorick Peterse2018-05-151-13/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The method "content_type" on a controller does not always return the correct content type. On the other hand, the method "request_format" does _and_ immediately returns a Symbol (e.g. :json) instead of a mime-type name (e.g. application/json). With these changes metrics should again report their action names correctly. Fixes https://gitlab.com/gitlab-com/infrastructure/issues/3499
* | | | Merge branch 'sh-enforce-unique-and-not-null-project-ids-project-features' ↵Yorick Peterse2018-05-151-1/+1
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into 'master' Add a unique and not null constraint on the project_features.project_id column Closes #37882 See merge request gitlab-org/gitlab-ce!18925
| * | | | Add a unique and not null constraint on the project_features.project_id columnStan Hu2018-05-151-1/+1
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit has two migrations: 1. The first prunes duplicate rows in the project_features table and leaves the row with the highest ID. Since the behavior was indeterministic before and depended on which row the database decided to use, this change at least makes the permissions consistent. For example, in some cases, the Wiki may have been disabled but enabled in another entry. 2. The second adds a non-null constraint on the project_features.project_id column. Closes #37882 Fixes a significant part of gitlab-com/migration#408. We found that we were overcounting Wikis because of these duplicates. On GitLab.com, there are 56 rows with duplicate entries by project_id, and 16,661 rows with NULL project_id values.
* | | | Remove authentication for readonly endpoints in issues APIhaseeb2018-05-151-1/+2
|/ / /
* | | Disable greedy mode when matching filenameJan Provaznik2018-05-151-1/+1
| | |
* | | Merge branch 'blackst0ne-remove-spinach' into 'master'Rémy Coutable2018-05-152-61/+0
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | Remove Spinach Closes #23036 See merge request gitlab-org/gitlab-ce!18869
| * | Clean up test.rakeblackst0ne2018-05-141-1/+0
| | |
| * | Remove spinach.rakeblackst0ne2018-05-141-60/+0
| |/
* | Merge branch 'backstage/gb/backport-untrusted-regexp-ee-code' into 'master'Rémy Coutable2018-05-141-1/+18
|\ \ | | | | | | | | | | | | Backport EE-specific untrusted regexp implementation See merge request gitlab-org/gitlab-ce!18938
| * | Backport EE-specific untrusted regexp implementationGrzegorz Bizon2018-05-141-1/+18
| | |
* | | Fix system hook not firing for blocked users when LDAP sign-in is usedStan Hu2018-05-121-1/+3
| |/ |/| | | | | | | | | | | | | | | An LDAP sign-in request results in a different request parameter than a standard GitLab sign-in. Since Warden doesn't pass us the user that was blocked, we first search for a `username` in the request parameters and then look for `user.login`. Closes #46307
* | Merge branch 'rd-remove-duplicate-method' into 'master'Robert Speicher2018-05-111-5/+0
|\ \ | | | | | | | | | | | | Remove duplicate method See merge request gitlab-org/gitlab-ce!18886
| * | Remove duplicate methodRubén Dávila2018-05-101-5/+0
| | |
* | | Merge branch 'bvl-restrict-api-git-for-terms' into 'master'Douwe Maan2018-05-114-6/+63
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Block access to API & git when terms are enforced Closes #45849 See merge request gitlab-org/gitlab-ce!18816
| * | | Allow triggered builds git accessBob Van Landuyt2018-05-112-1/+17
| | | | | | | | | | | | | | | | | | | | Allow builds that have been triggered by a user before terms were enforced access to git. That way the builds can complete as usual.
| * | | Block access to API & git when terms are enforcedBob Van Landuyt2018-05-103-5/+46
| |/ / | | | | | | | | | | | | | | | When terms are enforced, but the user has not accepted the terms access to the API & git is rejected with a message directing the user to the web app to accept the terms.
* | | Merge branch 'zj-remove-repo-path-strip-storage-path' into 'master'Douwe Maan2018-05-111-17/+2
|\ \ \ | | | | | | | | | | | | | | | | Remove Gitlab::RepoPath.strip_storage_path See merge request gitlab-org/gitlab-ce!18904
| * | | Remove Gitlab::RepoPath.strip_storage_pathZeger-Jan van de Weg2018-05-111-17/+2
| | |/ | |/| | | | | | | | | | | | | This used to be executed because of the post receive worker, but this uses Gitlab::GlRepository.parse now. So this removes dead code and reduces the number of calls on `#legacy_storage_path`.
* | | Merge branch 'zj-wiki-find-file-opt-out' into 'master'Douwe Maan2018-05-111-1/+2
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Wiki Find Page to opt_out Closes gitaly#894 See merge request gitlab-org/gitlab-ce!18895
| * | | Wiki Find Page to opt_outZeger-Jan van de Weg2018-05-111-1/+2
| | |/ | |/| | | | | | | Closes https://gitlab.com/gitlab-org/gitaly/issues/894
* | | Merge branch '46233-rails5-fix-nomethoderror-undefined-method-for-3-string' ↵Douwe Maan2018-05-111-1/+1
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | | | | | | | into 'master' Resolve "[Rails5] Fix `NoMethodError: undefined method `-' for "3":String`" Closes #46233 See merge request gitlab-org/gitlab-ce!18892
| * | [Rails5] Fix `per_page` in lib/gitlab/multi_collection_paginator.rb46233-rails5-fix-nomethoderror-undefined-method-for-3-stringblackst0ne2018-05-111-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Rails 5 the `per_page` argument came from `params` is String but an Integer is expected. This commit explicitly converts `per_page` to an Integer. It fixes the errors like: ``` 1) Groups::ChildrenController GET #index for subgroups filtering children succeeds if multiple pages contain matching subgroups Failure/Error: hash[page] = second_collection.page(second_collection_page) .per(per_page - paginated_first_collection(page).size) .padding(offset) NoMethodError: undefined method `-' for "3":String Did you mean? -@ # ./lib/gitlab/multi_collection_paginator.rb:42:in `block in paginated_second_collection' # ./lib/gitlab/multi_collection_paginator.rb:46:in `paginated_second_collection' # ./lib/gitlab/multi_collection_paginator.rb:14:in `paginate' # ./app/finders/group_descendants_finder.rb:52:in `children' # ./app/finders/group_descendants_finder.rb:34:in `execute' # ./app/controllers/groups/children_controller.rb:36:in `setup_children' # ./app/controllers/groups/children_controller.rb:18:in `index' # ./lib/gitlab/i18n.rb:50:in `with_locale' # ./lib/gitlab/i18n.rb:56:in `with_user_locale' # ./app/controllers/application_controller.rb:351:in `set_locale' # ./spec/controllers/groups/children_controller_spec.rb:182:in `block (5 levels) in <top (required)>' # ./spec/spec_helper.rb:198:in `block (2 levels) in <top (required)>' ```
* | Merge branch 'zj-validation-initializer' into 'master'Kamil Trzciński2018-05-111-1/+10
|\ \ | |/ |/| | | | | Remove method call to deprecated method See merge request gitlab-org/gitlab-ce!18815
| * Remove method call to deprecated methodZeger-Jan van de Weg2018-05-111-1/+10
| | | | | | | | | | Given the settings initializer creates Gitaly Storage Settings objects already, the calls to path can be moved to that initializer.
* | Merge branch 'sh-reset-prometheus-metrics-tests' into 'master'Nick Thomas2018-05-101-0/+8
|\ \ | | | | | | | | | | | | | | | | | | Support resetting of Prometheus metrics between test runs Closes #39968 See merge request gitlab-org/gitlab-ce!18836
| * | Support resetting of Prometheus metrics between test runsStan Hu2018-05-091-0/+8
| |/ | | | | | | | | | | | | Adding the :prometheus tag to an rspec test will clear out memory-mapped files and reset the registry. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/39968
* | Merge branch ↵Douwe Maan2018-05-103-16/+34
|\ \ | | | | | | | | | | | | | | | | | | 'backport-rd-5566-improve-performance-of-repository-size-limit-check' into 'master' Backport some changes from gitlab-ee!5476 See merge request gitlab-org/gitlab-ce!18760