summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Fix e2e create merge request testml-fix-create-merge-spec-qaMark Lapierre2018-11-071-1/+1
| | | | Add QA selector to 'New label' button on empty labels page
* Merge branch 'refactor-snippets-finder' into 'master'Douwe Maan2018-11-0710-138/+481
|\ | | | | | | | | | | | | Rewrite SnippetsFinder to improve performance Closes #52639 See merge request gitlab-org/gitlab-ce!22606
| * Merge branch 'master' into 'refactor-snippets-finder'refactor-snippets-finderDouwe Maan2018-11-06535-3760/+7738
| |\ | | | | | | | | | # Conflicts: # spec/models/project_spec.rb
| * | Rewrite SnippetsFinder to improve performanceYorick Peterse2018-11-058-137/+438
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This completely rewrites the SnippetsFinder class from the ground up in order to improve its performance. The old code was beyond salvaging. It was complex, included various Rails 5 workarounds, comments that shouldn't be necessary, and most important of all: it produced a really poorly performing database query. As a result, I opted for rewriting the finder from scratch, instead of trying to patch the existing code. Instead of trying to reuse as many existing methods as possible, I opted for defining new methods specifically meant for the SnippetsFinder. This requires some extra code here and there, but allows us to have much more control over the resulting SQL queries. It is these changes that then allow us to produce a _much_ more efficient query. To illustrate how bad the old query was, we will use my own snippets as an example. Currently I have 52 snippets, most of which are global ones. To retrieve these, you would run the following Ruby code: user = User.find_by(username: 'yorickpeterse') SnippetsFinder.new(user, author: user).execute On GitLab.com the resulting query will take between 10 and 15 seconds to run, producing the query plan found at https://explain.depesz.com/s/Y5IX. Apart from the long execution time, the total number of buffers (the sum of all shared hits) is around 185 GB, though the real number is probably (hopefully) much lower as I doubt simply summing these numbers produces the true total number of buffers used. The new query's plan can be found at https://explain.depesz.com/s/wHdN, and this query takes between 10 and 100-ish milliseconds to run. The total number of buffers used is only about 30 MB. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/52639
| * | Enforce a default snippet access level in the DBYorick Peterse2018-11-012-1/+43
| | | | | | | | | | | | | | | | | | | | | | | | This adds a database migration that ensures that project_features.snippets_access_level defaults to a value of 20 (= ProjectFeature::ENABLED), instead of NULL. This allows us to simplify some of the queries used for obtaining snippets, as we no longer need to handle cases where this column is NULL.
* | | Merge branch 'fj-bump-gitaly-0-129-0' into 'master'Douwe Maan2018-11-072-1/+6
|\ \ \ | | | | | | | | | | | | | | | | Bump Gitaly to 0.129.0 See merge request gitlab-org/gitlab-ce!22868
| * | | Bump Gitaly to 0.129.0Francisco Javier López2018-11-072-1/+6
|/ / /
* | | Merge branch 'tc-index-uploads-file-store' into 'master'Andreas Brandl2018-11-079-21/+162
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Enhance performance of counting local Uploads Closes gitlab-ee#6070 See merge request gitlab-org/gitlab-ce!22522
| * | | Add migration to steal FillStoreUploadToon Claes2018-11-072-0/+71
| | | |
| * | | Backport changes from EEToon Claes2018-11-073-4/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Now the files are identical again compared to EE. These are backported from https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/5050
| * | | Enhance performance of counting local UploadsToon Claes2018-11-076-18/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add an index to the `store` column on `uploads`. This makes counting local uploads faster. Also, there is no longer need to check for objects with `store = NULL`. See https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/18557 --- ### Query plans Query: ```sql SELECT COUNT(*) FROM "uploads" WHERE ("uploads"."store" = ? OR "uploads"."store" IS NULL) ``` #### Without index ``` gitlabhq_production=# EXPLAIN ANALYZE SELECT uploads.* FROM uploads WHERE (uploads.store = 1 OR uploads.store IS NULL); QUERY PLAN --------------------------------------------------------------------------------------------------------------- Seq Scan on uploads (cost=0.00..601729.54 rows=578 width=272) (actual time=6.170..2308.256 rows=545 loops=1) Filter: ((store = 1) OR (store IS NULL)) Rows Removed by Filter: 4411957 Planning time: 38.652 ms Execution time: 2308.454 ms (5 rows) ``` #### Add index ``` gitlabhq_production=# create index uploads_tmp1 on uploads (store); CREATE INDEX ``` #### With index ``` gitlabhq_production=# EXPLAIN ANALYZE SELECT uploads.* FROM uploads WHERE (uploads.store = 1 OR uploads.store IS NULL); QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------- Bitmap Heap Scan on uploads (cost=11.46..1238.88 rows=574 width=272) (actual time=0.155..0.577 rows=545 loops=1) Recheck Cond: ((store = 1) OR (store IS NULL)) Heap Blocks: exact=217 -> BitmapOr (cost=11.46..11.46 rows=574 width=0) (actual time=0.116..0.116 rows=0 loops=1) -> Bitmap Index Scan on uploads_tmp1 (cost=0.00..8.74 rows=574 width=0) (actual time=0.095..0.095 rows=545 loops=1) Index Cond: (store = 1) -> Bitmap Index Scan on uploads_tmp1 (cost=0.00..2.44 rows=1 width=0) (actual time=0.020..0.020 rows=0 loops=1) Index Cond: (store IS NULL) Planning time: 0.274 ms Execution time: 0.637 ms (10 rows) ``` Closes https://gitlab.com/gitlab-org/gitlab-ee/issues/6070
* | | | Merge branch 'osw-comment-on-any-line-on-diffs' into 'master'Douwe Maan2018-11-0726-89/+1234
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | Comment on any expanded diff line on MRs See merge request gitlab-org/gitlab-ce!22398
| * | | | Update changelogosw-comment-on-any-line-on-diffsOswaldo Ferreira2018-11-061-1/+1
| | | | |
| * | | | Apply additional guard-clauses for unfold_required?Oswaldo Ferreira2018-11-061-1/+2
| | | | |
| * | | | Comment on any expanded diff line on MRsOswaldo Ferreira2018-11-0626-89/+1233
| | | | |
* | | | | Merge branch 'copy-changes-for-abuse-clarity' into 'master'Phil Hughes2018-11-077-16/+39
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Copy changes for abuse clarity Closes #51589 See merge request gitlab-org/gitlab-ce!22148
| * | | | | Copy changes for abuse clarityJeremy Watson2018-11-077-16/+39
|/ / / / /
* | | | | Merge branch 'ee-1012-assign-code-owner-as-approver' into 'master'Grzegorz Bizon2018-11-0716-13/+186
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | (EE Port) Assign approvers based on code owners See merge request gitlab-org/gitlab-ce!22513
| * | | | | Set @push early for EEee-1012-assign-code-owner-as-approverMark Chao2018-11-071-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In EE, there is need to call `merge_requests_for_source_branch` before calling CE's `refresh_merge_requests, in order to obtain the old diffs. However that requires `@push`, initialized inside CE's refresh_merge_requests. However it can't be set early in EE, or static analysis would fail because use of instance variables in module is discouraged. So @push is set in execute instead.
| * | | | | Fix spec in EE which now trigger access to repositoryMark Chao2018-11-076-7/+7
| | | | | |
| * | | | | Allow getting all paths (old & new) involved in MRMark Chao2018-11-076-0/+110
| | | | | | | | | | | | | | | | | | | | | | | | Fetch database columns directly if available
| * | | | | Add factory for MergeRequestDiff and MergeRequestDiffFileMark Chao2018-11-072-0/+60
| | | | | |
| * | | | | Add reference for branch for simple file operationMark Chao2018-11-071-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | Suitable for testing old and new paths involved for each file in diff
* | | | | | Merge branch 'docs/fix-openshift-links' into 'master'Achilleas Pipinellis2018-11-071-1/+1
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix broken link to Vagrant box See merge request gitlab-org/gitlab-ce!22859
| * | | | | | Fix broken link to Vagrant boxdocs/fix-openshift-linksEvan Read2018-11-071-1/+1
| |/ / / / /
* | | | | | Merge branch '21480-parallel-job-keyword-mvc' into 'master'Grzegorz Bizon2018-11-0711-10/+247
|\ \ \ \ \ \ | |_|_|/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Resolve "`parallel` job keyword MVC" Closes #21480 See merge request gitlab-org/gitlab-ce!22631
| * | | | | Add additional specs for Normalizer21480-parallel-job-keyword-mvcMatija Čupić2018-11-061-0/+14
| | | | | |
| * | | | | Avoid creating intersection if there's no arrayMatija Čupić2018-11-061-2/+2
| | | | | |
| * | | | | Use instance based approach for NormalizerMatija Čupić2018-11-063-39/+41
| | | | | |
| * | | | | Refactor Normalizer specsMatija Čupić2018-11-062-11/+3
| | | | | |
| * | | | | Refactor Gitlab::Ci::Config::NormalizerMatija Čupić2018-11-053-44/+56
| | | | | | | | | | | | | | | | | | | | | | | | Use Hash#each_with_object to manipulate job hashes.
| * | | | | Use instance based approach for NormalizerMatija Čupić2018-11-053-52/+48
| | | | | |
| * | | | | Refactor Gitlab::Ci::Config::NormalizerMatija Čupić2018-11-021-17/+27
| | | | | |
| * | | | | Make Rubocop and Danger happyMatija Čupić2018-11-023-1/+5
| | | | | |
| * | | | | Move parallelized node index to job optionsMatija Čupić2018-11-016-38/+23
| | | | | |
| * | | | | Add Normalizer specsMatija Čupić2018-11-011-0/+36
| | | | | |
| * | | | | Parallelize jobs in Gitlab::Ci::YamlProcessorMatija Čupić2018-11-014-22/+7
| | | | | |
| * | | | | Move parallelization to Ci::Config::NormalizerMatija Čupić2018-10-312-9/+52
| | | | | |
| * | | | | Implement POC config based parallelizationMatija Čupić2018-10-314-0/+65
| | | | | |
| * | | | | Revert Seed based parallelization implementationMatija Čupić2018-10-305-122/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Revert "Add Build seed specs" This reverts commit 03bc722ea1797a6b2b09f2897215477f5b269632. Revert "Add build specs" This reverts commit c2d49565cf787c592c4f8bd9f24843babd2a6c9a. Revert "Refactor parallelization implementation" This reverts commit 72430483ded51e9a7d01ef70c3dce3dda174fac1. Revert "Implement POC for job parallelization" This reverts commit 44b740f99dfe6a4344c918fd4c94972aa6f9237e.
| * | | | | Copyedit documentation updatesMatija Čupić2018-10-292-11/+8
| | | | | |
| * | | | | Add documentation entriesMatija Čupić2018-10-272-1/+27
| | | | | |
| * | | | | Change minimum parallel value to 2Matija Čupić2018-10-273-6/+6
| | | | | |
| * | | | | Add CHANGELOG entryMatija Čupić2018-10-271-0/+5
| | | | | |
| * | | | | Add Build seed specsMatija Čupić2018-10-271-3/+56
| | | | | |
| * | | | | Add YamlProcessor specsMatija Čupić2018-10-271-0/+32
| | | | | |
| * | | | | Add build specsMatija Čupić2018-10-272-2/+50
| | | | | |
| * | | | | Refactor parallelization implementationMatija Čupić2018-10-272-17/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Move the variables to ::Ci::Build#predefined_variables * Tweak pipeline build seed implementation
| * | | | | Implement POC for job parallelizationMatija Čupić2018-10-262-1/+24
| | | | | |
| * | | | | Add parallel keyword to CI configMatija Čupić2018-10-262-7/+40
| | | | | |