Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-02-06Add latest changes from gitlab-org/gitlab@masterGitLab Bot
2020-01-28Add latest changes from gitlab-org/gitlab@masterGitLab Bot
2019-11-25Add latest changes from gitlab-org/gitlab@masterGitLab Bot
2019-11-15Add latest changes from gitlab-org/gitlab@masterGitLab Bot
2019-09-13Add latest changes from gitlab-org/gitlab@masterGitLab Bot
2019-05-07Add improvements to the global search processFrancisco Javier López
Removed the conditions added to Project.with_feature_available_for_user, and moved to the IssuableFinder. Now, we ensure that, in the projects retrieved in the Finder, the user has enough access for the feature.
2019-04-10Revert "Merge branch 'sh-optimize-projects-api' into 'master'"Stan Hu
This reverts merge request !26481
2019-03-27Optimize /api/v4/projects endpoint for visibility levelStan Hu
Previously when a user requested a list of projects, `Project#public_or_visible_to_user` would search all authorized projects and public/internal projects as well. However, when a user requests a specific `visibility_level` (e.g. private), that should reduce the search space, and we shouldn't need to load public/internal projects. Improves https://gitlab.com/gitlab-org/gitlab-ce/issues/59329
2018-10-31Whitelist none method from ActiveRecord::QueryingDouglas Barbosa Alexandre
2018-10-12Backport CE changes for Ops Dashboard in EEPeter Leitzen
2018-09-13Merge branch 'frozen-string-app-finders-graphql' into 'master'Stan Hu
Enable frozen string in app/graphql + app/finders See merge request gitlab-org/gitlab-ce!21681
2018-09-13Merge branch 'rubocop-code-reuse' into 'master'Robert Speicher
Add RuboCop cops to enforce code reusing rules See merge request gitlab-org/gitlab-ce!21391
2018-09-12Resolve "500 Internal Server Error: Deleting branch of deleted project"🙈 jacopo beschi 🙉
2018-09-11Enable frozen string in app/graphql + app/findersgfyoung
Partially addresses #47424.
2018-09-11Disable existing offenses for the CodeReuse copsYorick Peterse
This whitelists all existing offenses for the various CodeReuse cops, of which most are triggered by the CodeReuse/ActiveRecord cop.
2018-07-23Add min_access_level filter to projects APIMarko, Peter
Signed-off-by: Marko, Peter <peter.marko@siemens.com>
2018-07-16Fix archived parameter for projects APIMarko, Peter
2018-04-04[Rails5] Rename `sort` methods to `sort_by_attribute`blackst0ne
2017-11-06Support custom attributes on projectsMarkus Koller
2017-09-07Removes default scope from sortableTiago Botelho
2017-08-24Add an option to list only archived projectsMehdi Lahmam
Closes #35994
2017-07-06Add user projects APIvanadium23
2017-06-19Refactor GroupProjectsFinder#init_collectionYorick Peterse
This optimises how GroupProjectsFinder builds it collection, producing simpler and faster queries in the process. It also cleans up the code a bit to make it easier to understand.
2017-06-16Refactor ProjectsFinder#init_collectionYorick Peterse
This changes ProjectsFinder#init_collection so it no longer relies on a UNION. For example, to get starred projects of a user we used to run: SELECT projects.* FROM projects WHERE projects.pending_delete = 'f' AND ( projects.id IN ( SELECT projects.id FROM projects INNER JOIN users_star_projects ON users_star_projects.project_id = projects.id INNER JOIN project_authorizations ON projects.id = project_authorizations.project_id WHERE projects.pending_delete = 'f' AND project_authorizations.user_id = 1 AND users_star_projects.user_id = 1 UNION SELECT projects.id FROM projects INNER JOIN users_star_projects ON users_star_projects.project_id = projects.id WHERE projects.visibility_level IN (20, 10) AND users_star_projects.user_id = 1 ) ) ORDER BY projects.id DESC; With these changes the above query is turned into the following instead: SELECT projects.* FROM projects INNER JOIN users_star_projects ON users_star_projects.project_id = projects.id WHERE projects.pending_delete = 'f' AND ( EXISTS ( SELECT 1 FROM project_authorizations WHERE project_authorizations.user_id = 1 AND (project_id = projects.id) ) OR projects.visibility_level IN (20,10) ) AND users_star_projects.user_id = 1 ORDER BY projects.id DESC; This query in turn produces a better execution plan and takes less time, though the difference is only a few milliseconds (this however depends on the amount of data involved and additional conditions that may be added).
2017-05-30Add :owned param to ProjectFinderToon Claes
And use it in the API.
2017-05-30Make it possible to combine :trending with other paramsToon Claes
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.
2017-05-30UNION of SELECT/WHERE is faster than WHERE on UNIONToon Claes
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"]] ```
2017-05-30Change ProjectFinder so starred can be combined with other filtersToon Claes
The `starred` parameter couldn't be used in combination with `trending` or `non_public`. But this is changed now.
2017-04-06ProjectsFinder should handle more optionsJacopo
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.
2017-02-08Store group and project full name and full path in routes tableDmitriy Zaporozhets
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-08-15Pass project IDs relation to ProjectsFinder instead of using a blockAhmad Sherif
2016-08-15Speed up todos queries by limiting the projects set we join withAhmad Sherif
Closes #20828
2016-03-20Tweaks, refactoring, and specsDouwe Maan
2016-03-15Improve external users featureZeger-Jan van de Weg
2016-03-14Merge branch 'master' into 4009-external-usersZeger-Jan van de Weg
2016-03-14Merge branch 'share-project-ce' into 'master' Dmitriy Zaporozhets
Bring from EE: Share Project with Group - [x] Models and migrations - [x] Logic, UI - [x] Tests - [x] Documentation - [x] Share with group lock - [x] Api feature - [x] Api docs - [x] Api tests Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> For #12831 cc @DouweM @rspeicher @vsizov See merge request !3186
2016-03-13Create an external users tab on Admin user listZeger-Jan van de Weg
Also incorporates the review into this, mainly spec changes.
2016-03-13External UsersZeger-Jan van de Weg
The user has the rights of a public user execpt it can never create a project, group, or team. Also it cant view internal projects.
2016-03-12Removed User#project_relationsYorick Peterse
GitLab EE adds an extra relation that selects a "project_id" column instead of an "id" column, making it very hard for this method to be re-used in EE. Since using User#authorized_groups in ProjectsFinder#all_groups apparently has no performance impact we can just use it and keep everything compatible with EE.
2016-03-11Clean up ProjectsFinder for getting user projectsYorick Peterse
We don't need the extra layer of nesting of UNION queries here (as User#authorized_projects already returns a UNION'd query).
2016-03-11Add finders logic and tests for shared projects featureDmitriy Zaporozhets
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-11-20Port GitLab EE ProjectsFinder changesYorick Peterse
These changes were added in GitLab EE commit d39de0ea91b26b8840195e5674b92c353cc16661. The tests were a bit bugged (they used a non existing group, thus not testing a crucial part) which I only noticed when porting CE changes to EE.
2015-11-18Refactor ProjectsFinder to not pluck IDsYorick Peterse
This class now uses a UNION (when needed) instead of plucking tens of thousands of project IDs into memory. The tests have also been re-written to ensure all different use cases are tested properly (assuming I didn't forget any cases). The finder has also been broken up into 3 different finder classes: * ContributedProjectsFinder: class for getting the projects a user contributed to. * PersonalProjectsFinder: class for getting the personal projects of a user. * ProjectsFinder: class for getting generic projects visible to a given user. Previously a lot of the logic of these finders was handled directly in the users controller.
2014-09-15Fix finder and tests for new membership modelsDmitriy Zaporozhets
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-09-14Huge replace of old users_project and users_group referencesDmitriy Zaporozhets
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-06-05Refactor some search scopes to prevent wierd behaviour and PG::Error issuesDmitriy Zaporozhets
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-02-25Move services for collecting items to FindersDmitriy Zaporozhets
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>