summaryrefslogtreecommitdiff
path: root/spec/models
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | Refactor getting user groups/projects/contributionsYorick Peterse2015-11-181-4/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This new setup no longer loads any IDs into memory using "pluck", instead using SQL UNIONs to merge the various datasets together. This results in greatly improved query performance as well as a reduction of memory usage. The old setup was in particular problematic when requesting the authorized projects _including_ public/internal projects as this would result in roughly 65000 project IDs being loaded into memory. These IDs would in turn be passed to other queries.
* | | | | Faster way of obtaining latest event update timeYorick Peterse2015-11-181-0/+21
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of using MAX(events.updated_at) we can simply sort the events in descending order by the "id" column and grab the first row. In other words, instead of this: SELECT max(events.updated_at) AS max_id FROM events LEFT OUTER JOIN projects ON projects.id = events.project_id LEFT OUTER JOIN namespaces ON namespaces.id = projects.namespace_id WHERE events.author_id IS NOT NULL AND events.project_id IN (13083); we can use this: SELECT events.updated_at AS max_id FROM events LEFT OUTER JOIN projects ON projects.id = events.project_id LEFT OUTER JOIN namespaces ON namespaces.id = projects.namespace_id WHERE events.author_id IS NOT NULL AND events.project_id IN (13083) ORDER BY events.id DESC LIMIT 1; This has the benefit that on PostgreSQL a backwards index scan can be used, which due to the "LIMIT 1" will at most process only a single row. This in turn greatly speeds up the process of grabbing the latest update time. This can be confirmed by looking at the query plans. The first query produces the following plan: Aggregate (cost=43779.84..43779.85 rows=1 width=12) (actual time=2142.462..2142.462 rows=1 loops=1) -> Index Scan using index_events_on_project_id on events (cost=0.43..43704.69 rows=30060 width=12) (actual time=0.033..2138.086 rows=32769 loops=1) Index Cond: (project_id = 13083) Filter: (author_id IS NOT NULL) Planning time: 1.248 ms Execution time: 2142.548 ms The second query in turn produces the following plan: Limit (cost=0.43..41.65 rows=1 width=16) (actual time=1.394..1.394 rows=1 loops=1) -> Index Scan Backward using events_pkey on events (cost=0.43..1238907.96 rows=30060 width=16) (actual time=1.394..1.394 rows=1 loops=1) Filter: ((author_id IS NOT NULL) AND (project_id = 13083)) Rows Removed by Filter: 2104 Planning time: 0.166 ms Execution time: 1.408 ms According to the above plans the 2nd query is around 1500 times faster. However, re-running the first query produces timings of around 80 ms, making the 2nd query "only" around 55 times faster.
* | | | Merge branch 'rs-wiki-touches-project' into 'master' Douwe Maan2015-11-171-0/+18
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make ProjectWiki touch Project#last_activity_at after wiki actions Closes #3026 See merge request !1803
| * | | | Make ProjectWiki touch Project#last_activity_at after wiki actionsrs-wiki-touches-projectRobert Speicher2015-11-161-0/+18
| | | | | | | | | | | | | | | | | | | | Closes #3026
* | | | | Move global milestone specsDmitriy Zaporozhets2015-11-161-0/+65
|/ / / / | | | | | | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* | | | Merge branch 'annotate-models' into 'master' Dmitriy Zaporozhets2015-11-1417-19/+120
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Annotate models Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> See merge request !1799
| * | | | Annotate modelsDmitriy Zaporozhets2015-11-1317-19/+120
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* | | | | Fix broken testsKamil Trzcinski2015-11-131-14/+2
| | | | |
* | | | | Expose CI enable option in project featuresKamil Trzcinski2015-11-131-3/+6
|/ / / / | | | | | | | | | | | | - Enable CI by default for all new projects
* | | | Implement Build ArtifactsKamil Trzcinski2015-11-101-0/+15
| |_|/ |/| | | | | | | | | | | | | | | | | - Offloads uploading to GitLab Workhorse - Use /authorize request for fast uploading - Added backup recipes for artifacts - Support download acceleration using X-Sendfile
* | | Merge remote-tracking branch 'origin/release-notes'Dmitriy Zaporozhets2015-11-101-0/+16
|\ \ \ | | | | | | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
| * | | Add tests to release notes featureDmitriy Zaporozhets2015-11-061-1/+12
| | | | | | | | | | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
| * | | Add release modelDmitriy Zaporozhets2015-11-051-0/+5
| | | | | | | | | | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* | | | Fix testsshared_runnersKamil Trzcinski2015-11-081-3/+25
| | | |
* | | | CI details cleanupKamil Trzcinski2015-11-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Add page titles to CI settings. - Fix CI admin navigation. - Remove duplicated scope. - Use monospace font for commit sha. - Add page title and header title to build page. - Proper authorization for cancel/retry builds. - Use gitlab pagination theme for builds and group members. - Don't paginate builds widget on build page. - Add badges to commit page Changes/Builds tabs. - Add "Builds" to commit Builds tab page title. - Add and use Ci::Build#retryable? method. - Add CI::Build#retried? method. - Allow all failed commit builds to be retried. - Proper authorization for cancel/retry all builds. - Remove unused param. - Use time_ago_with_tooltip where appropriate. - Tweak builds index text - Remove duplication between builds/build and commit_statuses/commit_status. - Use POST rather than GET for canceling and retrying builds. - Remove redundant URL helpers. - Add build ID to build page. - Link branch name on build page. - Move commit/:sha/ci to commit/:sha/builds.
* | | | Allow groups to appear in the search results if the group owner allows itValery Sizov2015-11-051-0/+19
|/ / /
* | | Merge branch 'rs-git-bin-path' into 'master' Douwe Maan2015-11-041-1/+1
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Replace all usages of `git` command with configurable binary path Closes #3311 See merge request !1742
| * | | Replace all usages of `git` command with configurable binary pathrs-git-bin-pathRobert Speicher2015-11-031-1/+1
| | | | | | | | | | | | | | | | Closes #3311
* | | | Merge branch 'remove-duplicate-orders' into 'master' Yorick Peterse2015-11-041-6/+6
|\ \ \ \ | |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | Remove duplicate orders This changes the default order from `created_at DESC, id DESC` to just `id DESC` as this achieves the same results without the overhead of having to sort data twice (we've seen queries go from 200ms to just a few ms by removing the double sort). cc @jacobvosmaer @dzaporozhets @rspeicher @DouweM See merge request !1735
| * | | Fixed User sorting specsremove-duplicate-ordersYorick Peterse2015-11-031-6/+6
| |/ / | | | | | | | | | | | | The descriptions were not accurate and one particular spec seemingly expected the wrong User row to be returned.
* | | Refactor search by commits messageolhado/gitlab-ce-commit-searchDmitriy Zaporozhets2015-11-021-2/+2
| | | | | | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* | | Actually converted code to following suggestions.Michael Chmielewski2015-10-281-1/+1
| | |
* | | Fixed method to use git log via Popen as recommended, and made output match ↵Michael Chmielewski2015-10-281-1/+1
| | | | | | | | | | | | test (and thus system) expectations.
* | | Trying to incorporate suggestions from comments on Merge Request 1661Michael Chmielewski2015-10-281-2/+2
| | |
* | | Trailing new lines at ends of files are important.Michael Chmielewski2015-10-281-1/+1
| | |
* | | Make subject of spec line up on one line to satisfy rubocop requirementsMike Chmielewski2015-10-281-4/+2
| | |
* | | Add support for searching commit log messagesJonathan Schoeffling2015-10-281-0/+11
|/ / | | | | | | | | | | | | | | Include the log messages of recent commits in project-level search results, providing functionality similar to 'git log --grep'. Update repository model rspec tests to validate the output of Repository#commits_with_log_matching.
* | Fix: Inability to reply to code comments in the MR view, if the MR comes ↵comments_fixValery Sizov2015-10-221-0/+6
| | | | | | | | from a fork
* | Improve performance of sorting milestone issuesYorick Peterse2015-10-191-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This cuts down the time it takes to sort issues of a milestone by about 10x. In the previous setup the code would run a SQL query for every issue that had to be sorted. The new setup instead runs a single SQL query to update all the given issues at once. The attached benchmark used to run at around 60 iterations per second, using the new setup this hovers around 600 iterations per second. Timing wise a request to update a milestone with 40-something issues would take about 760 ms, in the new setup this only takes about 130 ms. Fixes #3066
* | Only accept open issues and merge requestsZeger-Jan van de Weg2015-10-162-1/+37
| |
* | Correct spec description typoRobert Speicher2015-10-151-1/+1
| | | | | | | | [ci skip]
* | Fix specsKamil Trzcinski2015-10-151-2/+2
| |
* | Implement when syntax in .gitlab-ci.ymlKamil Trzcinski2015-10-151-80/+144
| |
* | Merge branch 'fix/improve_reset_service_password_v2' into 'master' Valery Sizov2015-10-153-42/+215
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Improve invalidation of stored service password if the endpoint URL is changed (V2) New version of !1583, using the same failproof logic but this time mirroring the name and behaviour of the change-tracking methods of ActiveModel::Dirty in order to make it clearer and more natural. Added more tests to clarify the expected behaviour. This is an alternative to !1594 /cc @vsizov @rspeicher See merge request !1600
| * | Improve invalidation of stored service password if the endpoint URL is changedimprove_reset_service_password_v2Alex Lossent2015-10-153-42/+215
| | | | | | | | | | | | | | | Password can now be specified at the same time as the new URL, and the service template admin pages now work.
* | | Merge branch 'builds-view' into 'master' Kamil Trzciński2015-10-153-19/+19
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | | | | Added builds view ![Screen_Shot_2015-10-13_at_19.02.48](https://gitlab.com/gitlab-org/gitlab-ce/uploads/95bb3a7d9d603678fdd077558637045d/Screen_Shot_2015-10-13_at_19.02.48.png) /cc @dzaporozhets @vsizov See merge request !1593
| * | Fix specsKamil Trzcinski2015-10-141-1/+1
| | |
| * | Remove ordering from :ci_commits relationKamil Trzcinski2015-10-142-18/+18
| |/
* | Merge branch 'simplify-cross-references' into 'master' Robert Speicher2015-10-144-7/+6
|\ \ | | | | | | | | | | | | Simplify code around (cross)-references See merge request !1568
| * | Fix mentionable specsDouwe Maan2015-10-123-6/+5
| | |
| * | Simplify code around (cross)-referencesDouwe Maan2015-10-121-1/+1
| | |
* | | Merge branch 'show_pending_warning' into 'master' Kamil Trzciński2015-10-143-0/+179
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Show warning when build is pending and there are not runners This change is based on: !1530. This resolves #2967. See merge request !1573
| * | | Show warning if build doesn't have runners with specified tags or runners ↵Kamil Trzcinski2015-10-143-0/+179
| | |/ | |/| | | | | | | | | | | | | | | | | | | didn't connect recently Slightly refactor runner status detection: moving it to Runner class Signed-off-by: Kamil Trzcinski <ayufan@ayufan.eu>
* | | Added CI_BUILD_TAG, _STAGE, _NAME and _TRIGGERED to CI buildsKamil Trzcinski2015-10-141-4/+30
|/ /
* | Merge branch 'add-wip-to-mr-hook-attrs' into 'master' Stan Hu2015-10-131-0/+11
|\ \ | | | | | | | | | | | | | | | | | | merge_request: add work_in_progress to MR hooks See merge request !1443
| * | merge_request: add work_in_progress to MR hooksBen Boeckel2015-10-081-0/+11
| | |
* | | Merge branch 'commit_status' into 'master' Kamil Trzciński2015-10-135-133/+257
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement Commit Status API This is preliminary implementation of Commit Status API, pretty much compatible with GitHub. 1. The Commit Statuses are stored in separate table: ci_commit_status. 2. The POST inserts a new row. 3. To POST execute GitLab API `post :id/repository/commits/:sha/status`. This accepts dual authorization: - Using authorized user - Using ci-token to allow easy posting from CI Services 4. This adds predefined variable to GitLab CI build environment: CI_BUILD_STATUS_URL, allowing to easy post status from within build (ex. with code coverage or other metrics). 5. This adds statuses to commit's builds view. 6. The commit's status is calculated taking into account status of all builds and all posted statuses. 7. The commit statuses doesn't trigger notifications. 8. The commit status API introduces two new privileges: `read_commit_statuses` and `create_commit_status`. 9. We still miss a few tests and documentation updates for API and CI. @dzaporozhets @sytses What do you think? See merge request !1530
| * | | Fix broken testsKamil Trzcinski2015-10-121-4/+5
| | | |
| * | | Fix some changesKamil Trzcinski2015-10-121-1/+1
| | | |
| * | | Fix commit skippingKamil Trzcinski2015-10-121-2/+2
| | | |