summaryrefslogtreecommitdiff
path: root/app/finders
Commit message (Collapse)AuthorAgeFilesLines
* Add :owned param to ProjectFinderToon Claes2017-05-301-2/+7
| | | | And use it in the API.
* Make it possible to combine :trending with other paramsToon Claes2017-05-301-6/+7
| | | | | Now it is possible to combine the :non_public parameter. This might be useful when a user wants to know the trending projects they are member of.
* UNION of SELECT/WHERE is faster than WHERE on UNIONToon Claes2017-05-301-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of applying WHERE on a UNION, apply the WHERE on each of the seperate SELECT statements, and do UNION on that. Local tests with about 2_000_000 projects: - 1_500_000 private projects - 40_000 internal projects - 400_000 public projects For the API endpoint `/api/v4/projects?visibility=private` the slowest query was: ```sql SELECT "projects".* FROM "projects" WHERE ... ``` The original query took 1073.8ms. The query refactored to UNION of SELECT/WHERE took 2.3ms. The original query was: ```sql SELECT "projects".* FROM "projects" WHERE "projects"."pending_delete" = $1 AND (projects.id IN (SELECT "projects"."id" FROM "projects" INNER JOIN "project_authorizations" ON "projects"."id" = "project_authorizations"."project_id" WHERE "projects"."pending_delete" = 'f' AND "project_authorizations"."user_id" = 23 UNION SELECT "projects"."id" FROM "projects" WHERE "projects"."visibility_level" IN (20, 10))) AND "projects"."visibility_level" = $2 AND "projects"."archived" = $3 ORDER BY "projects"."created_at" DESC LIMIT 20 OFFSET 0 [["pending_delete", "f"], ["visibility_level", 0], ["archived", "f"]] ``` The refactored query: ```sql SELECT "projects".* FROM "projects" WHERE "projects"."pending_delete" = $1 AND (projects.id IN (SELECT "projects"."id" FROM "projects" INNER JOIN "project_authorizations" ON "projects"."id" = "project_authorizations"."project_id" WHERE "projects"."pending_delete" = 'f' AND "project_authorizations"."user_id" = 23 AND "projects"."visibility_level" = 0 AND "projects"."archived" = 'f' UNION SELECT "projects"."id" FROM "projects" WHERE "projects"."visibility_level" IN (20, 10) AND "projects"."visibility_level" = 0 AND "projects"."archived" = 'f')) ORDER BY "projects"."created_at" DESC LIMIT 20 OFFSET 0 [["pending_delete", "f"]] ```
* Change ProjectFinder so starred can be combined with other filtersToon Claes2017-05-301-2/+5
| | | | | The `starred` parameter couldn't be used in combination with `trending` or `non_public`. But this is changed now.
* Create a Users FinderGeorge Andrinopoulos2017-05-151-0/+74
|
* Merge branch 'tc-fix-private-subgroups-shown' into 'security' Douwe Maan2017-05-101-4/+16
| | | | | Use GroupsFinder to find subgroups the user has access to See merge request !2096
* Merge branch 'snippets-finder-visibility' into 'security'Douwe Maan2017-05-102-48/+56
| | | | | | Refactor snippets finder & dont return internal snippets for external users See merge request !2094
* Add Pipeline Schedules that supersedes experimental Trigger ScheduleZeger-Jan van de Weg2017-05-071-0/+22
|
* Backport of multiple_assignees_feature [ci skip]Valery Sizov2017-05-042-5/+16
|
* Add constant as ALLOWED_INDEXED_COLUMNSShinya Maeda2017-05-031-1/+3
|
* Use HasStatus::AVAILABLE_STATUSES instead of hard codingShinya Maeda2017-05-031-16/+3
|
* Add a blank line between blocksShinya Maeda2017-05-031-0/+2
|
* Revert "Use JSON type for sorting parameter (halfway)"Shinya Maeda2017-05-031-15/+11
| | | | This reverts commit 34127cb13ad72f65a24bdc8fc051363d3edd77cb.
* Use JSON type for sorting parameter (halfway)Shinya Maeda2017-05-031-11/+15
|
* Use order instead of reorder. Improve tests.Shinya Maeda2017-05-031-1/+1
|
* Fix improper method name and spec descriptionShinya Maeda2017-05-031-2/+2
|
* Allow only indexed columns in #order_and_sort. Remove present (Because ↵Shinya Maeda2017-05-031-2/+2
| | | | unnecessary) from condition. Added spec just in case.
* Avoid hardcode table nameShinya Maeda2017-05-031-2/+2
|
* Add name. Improve order_and_sort.Shinya Maeda2017-05-031-7/+12
|
* Add name(User)Shinya Maeda2017-05-031-0/+8
|
* Change name to usernameShinya Maeda2017-05-031-1/+1
|
* Fix inappropriate regexShinya Maeda2017-05-031-1/+1
|
* Use 'case/when/end'Shinya Maeda2017-05-031-7/+5
|
* Improved CI. Fix yaml_errors boolean evaluation.Shinya Maeda2017-05-031-1/+1
|
* Fixed the following.Shinya Maeda2017-05-031-3/+4
| | | | | | - Fix inappropriate evaluation(casecmp) to regex - Fix missed boolean conversion - Improve spec
* Fixed SQL injectionShinya Maeda2017-05-031-2/+2
|
* Fix rubocop offences and rspec failuresShinya Maeda2017-05-031-2/+2
|
* Add specs. Plus, minor fixes.Shinya Maeda2017-05-031-2/+6
|
* Fixed those points.Shinya Maeda2017-05-031-17/+10
| | | | | | | | - username to user_id - Drop duration - Resolve comments - Add Changelog - Edit docs
* Remove unnecessary commentShinya Maeda2017-05-031-1/+1
|
* - Add new parameters for Pipeline APIShinya Maeda2017-05-031-20/+88
| | | | - Expand PipelinesFinder functions
* Display comments for personal snippets12910-personal-snippets-notes-showJarka Kadlecova2017-05-021-0/+2
|
* Ability to filter merge requests by labels and milestonesRobert Schilling2017-04-251-1/+1
|
* Merge branch 'update-droplab-to-webpack-version' into new-resolvable-discussionLuke "Jared" Bennett2017-04-065-34/+125
|\
| * ProjectsFinder should handle more optionsJacopo2017-04-065-34/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extended ProjectFinder in order to handle the following options: - current_user - which user use - project_ids_relation: int[] - project ids to use - params: - trending: boolean - non_public: boolean - starred: boolean - sort: string - visibility_level: int - tags: string[] - personal: boolean - search: string - non_archived: boolean GroupProjectsFinder now inherits from ProjectsFinder. Changed the code in order to use the new available options.
* | Fix specsDouwe Maan2017-04-051-2/+2
| |
* | Address review commentsDouwe Maan2017-04-051-8/+13
| |
* | Add option to start a new discussion on an MRDouwe Maan2017-04-051-22/+32
|/
* Fixes milestone/merge_request API endpoint to really scope the resultsJoren De Groof2017-04-032-2/+2
| | | | | The MergeRequestsFinder uses the milestone_title instead of the milestone_id
* Merge branch 'jej-group-name-disclosure' into 'security'Sean McGivern2017-03-291-0/+17
| | | | | | Prevent private group disclosure via parent_id See merge request !2077
* Optimize labels finder querymhasbini2017-03-271-2/+11
| | | | Optimize labels finder query when searching for a project with a group
* Revert "Merge branch '29534-todos-performance' into 'master'"Sean McGivern2017-03-211-12/+0
| | | This reverts merge request !10076
* Todos performance: Include associations in FinderJarka Kadlecova2017-03-201-0/+12
|
* Allow filtering by all started milestonesbetter-priority-sortingSean McGivern2017-03-151-0/+6
|
* Show members of parent groups on project members pagedz-nested-groups-membersDmitriy Zaporozhets2017-03-092-10/+32
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Merge remote-tracking branch ↵Douwe Maan2017-03-071-0/+45
|\ | | | | | | 'origin/personal_access_token_api_and_impersonation_token'
| * apply codestyle and implementation changes to the respective feature codepersonal_access_token_api_and_impersonation_tokenTiago Botelho2017-03-061-16/+14
| |
| * refactors finder and correlated codeTiago Botelho2017-03-011-25/+31
| |
| * applies relevant changes to the code and code structureTiago Botelho2017-02-281-0/+41
| |
* | Improve issues filtering performanceJarka Kadlecova2017-03-063-14/+31
|/