summaryrefslogtreecommitdiff
path: root/spec
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'dz-improve-mr-compar' into 'master' Douwe Maan2016-10-122-15/+52
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Improve merge request versions compare logic ## What does this MR do? Changes the way how we compare between for merge request versions ## Are there points in the code the reviewer needs to double check? no ## Why was this MR needed? So when I squash+rebase my commit I can get more accurate diff on what changed between versions ## Screenshots (if relevant) in discussion (below) ## Does this MR meet the acceptance criteria? - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - [ ] ~~[Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)~~ - [ ] ~~API support added~~ - Tests - [x] Added for this feature/bug - [x] All builds are passing - [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html) - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] Branch has no merge conflicts with `master` (if you do - rebase it please) - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) ## What are the relevant issue numbers? https://gitlab.com/gitlab-org/gitlab-ce/issues/22368, https://gitlab.com/gitlab-org/gitlab-ce/issues/22721 See merge request !6589
| * Refactor straight compare diff codeDmitriy Zaporozhets2016-10-121-2/+2
| | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
| * Better tests for MergeRequestDiff#compare_with methodDmitriy Zaporozhets2016-10-121-2/+8
| | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
| * Improve tests for merge request diff modelDmitriy Zaporozhets2016-10-121-15/+25
| | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
| * Add spec for compare serviceDmitriy Zaporozhets2016-10-121-0/+21
| | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* | Merge branch 'api-version' into 'master' Robert Speicher2016-10-121-0/+27
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | API: Version information ## What does this MR do? Adds a new endpoint to retrieve the version information. ## Why was this MR needed? Clients can now use this information to enable/disable certain API features depending on the version. ## What are the relevant issue numbers? Closes #22608, https://gitlab.com/gitlab-org/gitlab-ce/issues/23148 See merge request !6822
| * | API: Version informationapi-versionRobert Schilling2016-10-121-0/+27
| |/
* | Merge branch '17541-move-licenses-api-endpoint-to-templates-licenses' into ↵Rémy Coutable2016-10-122-164/+176
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'master' Resolve "Move `/licenses` api endpoint to `/templates/licenses`" ## What does this MR do? It moves the `/licenses`, `/gitignores` and `/gitlab_ci_ymls` API endpoints under the `/templates` namespace ## Why was this MR needed? In EE we now have somewhat ambiguous API endpoints. `/license` refers to the EE license while `/licenses` (plural) refers to license templates. @DouweM mentioned that we're adding .gitignore templates in #14106 so it may make sense to add a /templates namespace. Then, move the /license templates endpoint to be underneath, along with .gitignore endpoints. Closes #17541 See merge request !5717
| * | Create a new /templates API namespaceThomas Balthazar2016-10-122-164/+176
| | | | | | | | | | | | | | | | | | The /licenses, /gitignores and /gitlab_ci_ymls endpoints are now also available under a new /templates namespace. Old endpoints will be deprecated when GitLab 9.0.0 is released.
* | | Revert "Merge branch 'tests-use-tmpfs' into 'master'"Yorick Peterse2016-10-121-5/+0
| |/ |/| | | This reverts merge request !6730
* | Merge branch 'user-events-api' into 'master' Robert Speicher2016-10-121-0/+54
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | API: New /users/:id/events endpoint ## What does this MR do? If add a new `/users/:id/events` endpoint to retrieve a user's contribution events. The events returned are filtered so that only the events for projects that the current user can see are returned (similarly to what we do at the controller level). ## Why was this MR needed? Because it's a nice feature to calculate leaderboards, for instance for #17815. ## What are the relevant issue numbers? Closes #20866. See merge request !6771
| * | Make spec deterministicuser-events-apiRémy Coutable2016-10-111-11/+9
| | | | | | | | | | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
| * | Addresses Robert's feedbackRémy Coutable2016-10-111-2/+3
| | | | | | | | | | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
| * | API: New /users/:id/events endpointRémy Coutable2016-10-101-0/+55
| | | | | | | | | | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* | | Merge branch 'speed-up-api-projects-spec' into 'master' Robert Speicher2016-10-121-13/+15
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Speed up specs for GET /projects/:id/events ## What does this MR do? Just groups some expectations into a single `it` block. Reduce this particular tests block time by half. See merge request !6778
| * | | Speed up specs for GET /projects/:id/eventsspeed-up-api-projects-specRémy Coutable2016-10-101-13/+15
| | | | | | | | | | | | | | | | | | | | | | | | From 8.15s to 4.55s by grouping expectations Signed-off-by: Rémy Coutable <remy@rymai.me>
* | | | Merge branch '20708-new-branch-is-immediatelly-tagged-as-merged' into 'master' Douwe Maan2016-10-1215-44/+75
|\ \ \ \ | |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removes inconsistency regarding tagging immediately as merged once you create a … - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - [x] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) - [x] API support added - Tests - [x] Added for this feature/bug - [x] All builds are passing - [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html) - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] Branch has no merge conflicts with `master` (if you do - rebase it please) - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) ## What are the relevant issue numbers? Closes #20708 See merge request !6408
| * | | refactors tests because of gitlab-test repository changes20708-new-branch-is-immediatelly-tagged-as-mergedtiagonbotelho2016-10-1114-39/+62
| | | |
| * | | writes tests to verify the issue is solved and fixes breaking issues.tiagonbotelho2016-10-092-6/+14
| | | |
* | | | Merge branch 'api-fix-project-group-sharing' into 'security'Rémy Coutable2016-10-112-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | API: Share projects only with groups current_user can access Aims to address the issues here: https://gitlab.com/gitlab-org/gitlab-ce/issues/23004 * Projects can be shared with non-existent groups * Projects can be shared with groups that the current user does not have access to read Concerns: The new implementation of the API endpoint allows projects to be shared with a larger range of groups than can be done via the web UI. The form for sharing a project with a group uses the following API endpoint to index the available groups: https://gitlab.com/gitlab-org/gitlab-ce/blob/494269fc92f61098ee6bd635a0426129ce2c5456/lib/api/groups.rb#L17. The groups indexed in the web form will only be those groups that the user is currently a member of. The new implementation allows projects to be shared with any group that the authenticated user has access to view. This widens the range of groups to those that are public and internal. See merge request !2005 Signed-off-by: Rémy Coutable <remy@rymai.me>
* | | | Merge branch 'allow_multiple_labels_commands' into 'master' Rémy Coutable2016-10-111-0/+43
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | allow multiple labels commands ### What does this MR do? This MR should add multiple command support for all label related commands. ### What are the relevant issue numbers? Closes #22965 See merge request !6780
| * | | | allow multiple labels commandsbarthc2016-10-111-0/+43
| | | | |
* | | | | Merge branch '22211-500-instead-of-404' into 'master' Sean McGivern2016-10-111-0/+14
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Respond with 404 Not Found for non-existent tags ## What does this MR do? Handles the case when a non-existent tag is being viewed, and responds with 404 Not Found instead of 500 Internal Server Error. ## Are there points in the code the reviewer needs to double check? The small changes should be clear from a simple diff. ## Why was this MR needed? To resolve the issue #22211. ## Screenshots (if relevant) ## Does this MR meet the acceptance criteria? - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) - [ ] API support added - Tests - [x] Added for this feature/bug - [x] All builds are passing - [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html) - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] Branch has no merge conflicts with `master` (if you do - rebase it please) - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) ## What are the relevant issue numbers? Closes #22211 See merge request !6699
| * \ \ \ \ Merge branch 'master' into 22211-500-instead-of-404Linus G Thiel2016-10-1176-345/+2422
| |\ \ \ \ \
| * | | | | | Respond with 404 Not Found for non-existent tagsLinus G Thiel2016-10-051-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Non-existent tags should be handled with 404 Not Found.
* | | | | | | Merge branch 'assign-issues-for-merge-request-18876' into 'master' Douwe Maan2016-10-113-0/+148
|\ \ \ \ \ \ \ | |_|_|/ / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ability to bulk assign issues to author of merge request ## What does this MR do? Provides a link to auto-assign issues to the author of a merge request, when they are mentioned as being closed by the MR. ## Are there points in the code the reviewer needs to double check? ## Why was this MR needed? To help avoid working on a MR without having assigned related issues to self ## What are the relevant issue numbers? Fixes #18876 ## Screenshots (if relevant) ![ScreenShot-P216](/uploads/1af5e71a0a0ff0a60c5d7b54c0e09d9c/ScreenShot-P216.png) ## Tasks - [x] Refactor or move away from using `BulkUpdateService` - [x] ~~Consider alternate link message when only a subset of issues will be assigned~~ - [x] Minimize repeated calls to expensive `closes_issues` method - [x] Move away from using inflector for pluralization and fix flash message - [x] Change auth `before_action` and fallback to error flash message - [x] Shouldn't overwrite current assignee if one exists ## Does this MR meet the acceptance criteria? - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - [x] ~~[Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)~~ - [x] ~~API support added~~ - Tests - [x] Added for this feature/bug - [x] All builds are passing - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] Branch has no merge conflicts with `master` (if you do - rebase it please) - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) See merge request !5725
| * | | | | | fixup! Added link to bulk assign issues to MR author. (Issue #18876)James Edwards-Jones2016-10-101-1/+1
| | | | | | |
| * | | | | | fixup! Added link to bulk assign issues to MR author. (Issue #18876)James Edwards-Jones2016-10-071-0/+17
| | | | | | |
| * | | | | | Added link to bulk assign issues to MR author. (Issue #18876)James2016-10-063-0/+131
| | | | | | |
* | | | | | | Merge branch 'guests_cant_see_mrs' into 'master' Sean McGivern2016-10-117-6/+125
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make guests unable to view MRs ## What does this MR do? Make guests unable to view MRs. This also fixes a bug when a non-member user could get notification if mentioned (in private project, it's OK for public project). Now if you are a guest and you will be mentioned in one of the MRs you won't get a notification. ## What are the relevant issue numbers? Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/1410 See merge request !6673
| * | | | | | | Make guests unable to view MRsguests_cant_see_mrsValery Sizov2016-10-117-6/+125
| | | | | | | |
* | | | | | | | Merge branch 'build-instead-create-in-label-link-spec' into 'master' Dmitriy Zaporozhets2016-10-111-2/+1
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Build instead create in label_link model spec ## What does this MR do? This MR improves spec for label link model. ## Are there points in the code the reviewer needs to double check? No ## Why was this MR needed? Because for check validations, we can use build instead create a record in the database. ## Screenshots (if relevant) No ## Does this MR meet the acceptance criteria? - n/a [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - n/a [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) - n/a API support added - Tests - n/a Added for this feature/bug - [x] All builds are passing - [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html) - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] Branch has no merge conflicts with `master` (if it does - rebase it please) - n/a [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) ## What are the relevant issue numbers? See merge request !6792
| * | | | | | | | Build instead create in label_link model specSemyon Pupkov2016-10-111-2/+1
| | | | | | | | |
* | | | | | | | | Merge branch 'remove-empty-describe' into 'master' Dmitriy Zaporozhets2016-10-111-3/+0
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove empty describe block on key spec model ## What does this MR do? Removes unnecessary describe in test ## Are there points in the code the reviewer needs to double check? No ## Why was this MR needed? It describe block not needed. ## Screenshots (if relevant) No ## Does this MR meet the acceptance criteria? - n/a [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - n/a [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) - n/a API support added - Tests - n/a Added for this feature/bug - [x] All builds are passing - [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html) - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] Branch has no merge conflicts with `master` (if it does - rebase it please) - [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) ## What are the relevant issue numbers? No See merge request !6793
| * | | | | | | | | Remove empty describe block on key spec modelSemyon Pupkov2016-10-111-3/+0
| |/ / / / / / / /
* | | | | | | | | Merge branch 'atom-routes' into 'master' Robert Speicher2016-10-113-11/+119
|\ \ \ \ \ \ \ \ \ | |_|/ / / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow browsing branches that end with '.atom' ## What does this MR do? 1. Simplify the regex capture in the routing for the CommitsController to not exclude the '.atom' suffix. That's a perfectly valid git branch name, so we shouldn't blow up if we get it. 2. Because Rails now can't automatically detect the request format, add some code to do so in `ExtractPath` when there is no path. This means that, given branches 'foo' and 'foo.atom', the Atom feed for the former is unroutable. To fix this: don't do that! Give the branches different names! ## Why was this MR needed? Creating a branch or tag name ending in '.atom' would cause some 500s on that repo. ## What are the relevant issue numbers? Closes #21955. Related to !5994. See merge request !6750
| * | | | | | | | Allow browsing branches that end with '.atom'Sean McGivern2016-10-113-11/+119
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need to do two things to support this: 1. Simplify the regex capture in the routing for the CommitsController to not exclude the '.atom' suffix. That's a perfectly valid git branch name, so we shouldn't blow up if we get it. 2. Because Rails now can't automatically detect the request format, add some code to do so in `ExtractPath` when there is no path. This means that, given branches 'foo' and 'foo.atom', the Atom feed for the former is unroutable. To fix this: don't do that! Give the branches different names!
* | | | | | | | | Merge branch 'sh-fix-issue-20776' into 'master' Robert Speicher2016-10-111-0/+10
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix Error 500 when viewing old merge requests with bad diff data Customers running old versions of GitLab may have MergeRequestDiffs with the text ["--broken diff"] due to text generated by gitlab_git 1.0.3. To avoid the Error 500, verify that each element is a type that gitlab_git will accept before attempting to create a DiffCollection. Closes #20776 See merge request !6754
| * | | | | | | | | Fix Error 500 when viewing old merge requests with bad diff datash-fix-issue-20776Stan Hu2016-10-101-0/+10
| | |/ / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Customers running old versions of GitLab may have MergeRequestDiffs with the text ["--broken diff"] due to text generated by gitlab_git 1.0.3. To avoid the Error 500, verify that each element is a type that gitlab_git will accept before attempting to create a DiffCollection. Closes #20776
* | | | | | | | | Merge branch 'new-gitlab-users-clear_all_authentication_tokens-task' into ↵Robert Speicher2016-10-111-0/+38
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'master' Add a new gitlab:users:clear_all_authentication_tokens task ## What are the relevant issue numbers? Part of #22537. See merge request !6745
| * | | | | | | | | Add a new gitlab:users:clear_all_authentication_tokens taskRémy Coutable2016-10-111-0/+38
| | |_|_|_|/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* | | | | | | | | Merge branch 'precalculate-trending-projects' into 'master' Robert Speicher2016-10-114-70/+71
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Precalculate trending projects ## What does this MR do? This MR changes the trending projects code so that data is precalculated, removing the need for any complex caching mechanisms. ## Why was this MR needed? Caching of trending data didn't work properly, still leading to queries. Using caching in general would be very hard due to users being able to apply custom filters to the list of trending projects. See merge request !6749
| * | | | | | | | | Precalculate trending projectsprecalculate-trending-projectsYorick Peterse2016-10-104-70/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit introduces a Sidekiq worker that precalculates the list of trending projects on a daily basis. The resulting set is stored in a database table that is then queried by Project.trending. This setup means that Unicorn workers no longer _may_ have to calculate the list of trending projects. Furthermore it supports filtering without any complex caching mechanisms. The data in the "trending_projects" table is inserted in the same order as the project ranking. This means that getting the projects in the correct order is simply a matter of: SELECT projects.* FROM projects INNER JOIN trending_projects ON trending_projects.project_id = projects.id ORDER BY trending_projects.id ASC; Such a query will only take a few milliseconds at most (as measured on GitLab.com), opposed to a few seconds for the query used for calculating the project ranks. The migration in this commit does not require downtime and takes care of populating an initial list of trending projects.
* | | | | | | | | | Merge branch 'empty-mrs' into 'master' Rémy Coutable2016-10-111-2/+18
|\ \ \ \ \ \ \ \ \ \ | |_|/ / / / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allows empty merge requests for a workflow described in gitlab-org/gitlab-ce#14606 Closes gitlab-org/gitlab-ce#14606 See merge request !6384
| * | | | | | | | | Allow empty merge requestsArtem Sidorenko2016-10-111-2/+18
| | | | | | | | | |
* | | | | | | | | | Merge branch 'dz-cleanup-routing' into 'master' Dmitriy Zaporozhets2016-10-115-140/+42
|\ \ \ \ \ \ \ \ \ \ | |_|_|/ / / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove NamespacesController * removes unnecessary NamespacesController. The main purpose of this controller was redirect to group or user page when URL like https://gitlab.com/gitlab-org was used. Now this functionality is handled by constrainers (like this https://gitlab.com/gitlab-org/gitlab-ce/blob/master/config/routes/user.rb#L17-21) and take user to correct controller right from the start. * serve non existing API routes like `/api/v3/whatever` with Grape instead of Rails. Before this change wrong API url was served by rails with not obvious 404, 405 & 500 errors See merge request !6733
| * | | | | | | | | Fix api users spec for post request with invalid idDmitriy Zaporozhets2016-10-101-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
| * | | | | | | | | Replace undefined Grape routing code from 400 to 404Dmitriy Zaporozhets2016-10-102-26/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
| * | | | | | | | | Fix API specs behaviour for invalid routingDmitriy Zaporozhets2016-10-102-20/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
| * | | | | | | | | Catch any undefined API routing and return 400 Bad RequestDmitriy Zaporozhets2016-10-102-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>