summaryrefslogtreecommitdiff
path: root/app/controllers/dashboard/projects_controller.rb
Commit message (Collapse)AuthorAgeFilesLines
* Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc42GitLab Bot2020-10-211-0/+2
|
* Add latest changes from gitlab-org/gitlab@13-4-stable-eeGitLab Bot2020-09-191-3/+4
|
* Add latest changes from gitlab-org/gitlab@13-3-stable-eeGitLab Bot2020-08-201-1/+1
|
* Add latest changes from gitlab-org/gitlab@13-2-stable-eeGitLab Bot2020-07-201-1/+2
|
* Add latest changes from gitlab-org/gitlab@13-0-stable-eeGitLab Bot2020-05-201-2/+4
|
* Add latest changes from gitlab-org/gitlab@12-10-stable-eeGitLab Bot2020-04-201-7/+9
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2020-03-111-2/+3
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2020-03-101-3/+2
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2020-02-051-1/+6
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2020-01-271-0/+2
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2019-09-181-1/+1
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2019-09-131-0/+2
|
* Remove N+1 SQL query loading project feature in dashboardsh-project-feature-nplus-oneStan Hu2019-08-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Projects that have a pipeline may need to check whether the user has permission to read the build (`can?(current_user, :read_build, project)`), which requires checking the `project_features` table. This would cause an N+1 SQL query for each project. This change also has a beneficial side effect that may avoid a race condition. When a user deletes a project, the project is queued for deletion and the user is redirected back to the dashboard page. However, the following may happen: 1. The dashboard page may load this deleted project in the list of 20 projects. 2. The view will load the project pipeline status from the cache and attempt to show each project. 3. When the view encounters the deleted project, it calls `can?(current_user, :read_build, project)` to determine whether to display the pipeline status. 4. Sidekiq deletes the project from the database. 5. However, since the deleted project is still loaded in memory, it will attempt to call `project.project_feature.access_level`. 6. Since `project_feature` was not eager loaded, a lazy `SELECT` call is made to the database. 7. This `SELECT` call returns nothing, and the user sees a 500 error. By eager loading `project_feature`, we can ensure that we have a consistent view and avoid records from being deleted later. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/66482
* Add SortingPreference concernGeorge Koltsov2019-08-211-6/+16
| | | | | | | Sorting preference functionality has been extracted from `IssuableCollections` to a new `SortingPreference` concern in order to reuse this functionality in projects (and groups in the future).
* Set default project sort method prior to initial sort on page loadingDavid Palubin2019-07-041-1/+1
|
* Add A/B testing support to onboarding82-add-new-onboarding-to-flipper-a-b-testingAsh McKenzie2019-06-281-0/+1
| | | | | Check if we're gitlab.com and the :user_onboarding feature flag is enabled.
* Add render_projects method to controllerMartin Wortschack2019-06-051-6/+13
| | | | - Render EE specific partial if exists
* Update comments about N + 1 Gitaly callsZeger-Jan van de Weg2019-04-091-2/+1
| | | | | To make sure all known issues are linked to the correct epic, I've gone through the code base, and updated the comments where required.
* Fix undefined variable error on json project viewsAlejandro Rodríguez2019-03-181-2/+2
| | | | | | This mistake seems to have always been there, but it only resulted in errors on the `/explore*.json` since they were the one that _actually_ relied on the local variables.
* Allow Gitaly N+1 calls for RootController#indexThong Kuah2019-02-281-1/+7
| | | | | | Allow developers to load GitLab root page locally without errors. Since we know this issue for a while now, no point letting the exception be triggered constantly.
* Move ProjectsFinder into the controllerGeorge Tsiolis2019-01-151-0/+3
|
* Eager-load relations for Dashboard::ProjectsControllerGabriel Mazetto2018-12-101-1/+1
| | | | This removes remaining N+1 queries
* Merge branch 'security-fix-pat-web-access' into 'master'Cindy Pallares2018-11-281-0/+1
| | | | | [master] Resolve "Personal access token with only `read_user` scope can be used to authenticate any web request" See merge request gitlab/gitlabhq!2583
* Enable more frozen string in app/controllers/gfyoung2018-09-231-0/+2
| | | | | | | | | | | | | | | | Enables frozen string for the following: * app/controllers/dashboard/**/*.rb * app/controllers/explore/**/*.rb * app/controllers/google_api/**/*.rb * app/controllers/groups/**/*.rb * app/controllers/import/**/*.rb * app/controllers/instance_statistics/**/*.rb * app/controllers/ldap/**/*.rb * app/controllers/oauth/**/*.rb * app/controllers/profiles/**/*.rb Partially addresses #47424.
* Disable existing offenses for the CodeReuse copsYorick Peterse2018-09-111-0/+4
| | | | | This whitelists all existing offenses for the various CodeReuse cops, of which most are triggered by the CodeReuse/ActiveRecord cop.
* Fix User role displayed on projects dashboardFrancisco Javier López2018-07-061-2/+3
|
* Port `read_cross_project` ability from EEBob Van Landuyt2018-02-221-0/+1
|
* Resolve "Display member role per project"Mike Greiling2017-12-071-4/+7
|
* Resolve "DashboardController#activity.json is slow due to SQL"Francisco Javier López2017-11-061-0/+2
|
* Eager load namespace owners for project dashboardsdashboards-projects-controllerYorick Peterse2017-09-111-1/+1
| | | | | This solves an N+1 query problem where we'd run multiple queries when getting the namespace owners of the displayed projects.
* Use a specialized class for querying eventsYorick Peterse2017-08-101-3/+5
| | | | | | | | | | | | | | | This changes various controllers to use the new EventCollection class for retrieving events. This class uses a JOIN LATERAL query on PostgreSQL to retrieve queries in a more efficient way, while falling back to a simpler / less efficient query for MySQL. The EventCollection class also includes a limit on the number of events to display to prevent malicious users from cycling through all events, as doing so could put a lot of pressure on the database. JOIN LATERAL is only supported on PostgreSQL starting with version 9.3.0 and as such this optimisation is only used when using PostgreSQL 9.3 or newer.
* Eager load project creators for project dashboardsdashboard-projects-controller-query-performanceYorick Peterse2017-08-071-2/+4
| | | | | This solves an N+1 query problem where for every project we'd query the creator separately just to figure out what avatar to display.
* Enable Style/DotPosition Rubocop :cop:Grzegorz Bizon2017-06-211-4/+4
|
* Refactor atom builder by using xml.atom layoutTieu-Philippe KHIM2017-06-121-1/+1
|
* Consistently display last push event widgetDouwe Maan2017-05-251-2/+1
|
* ProjectsFinder should handle more optionsJacopo2017-04-061-12/+15
| | | | | | | | | | | | | | | | | | | 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.
* Eager load route for project & namespaceBob Van Landuyt2017-03-161-1/+1
|
* Use preload for Event#target since it's a polymorphic association27395-reduce-group-activity-sql-queriesRémy Coutable2017-02-131-12/+11
| | | | | | Also, don't use limit in subquery, MySQL don't like that. Signed-off-by: Rémy Coutable <remy@rymai.me>
* Remove unnecessary queries for .atom and .json in ↵Oswaldo Ferreira2017-02-031-3/+1
| | | | Dashboard::ProjectsController#index
* Restrict starred projects to viewable onesSean McGivern2016-05-101-1/+1
| | | | | | | | | | | | | | | `User#starred_projects` doesn't perform any visibility checks. This has a couple of problems: 1. It assumes a user can always view all of their starred projects in perpetuity (project not changed to private, access revoked, etc.). 2. It assumes that we'll only ever allow a user to star a project they can view. This is currently the case, but bugs happen. Add `User#viewable_starred_projects` to filter the starred projects by those the user either has explicit access to, or are public or internal. Then use that in all places where we list the user's starred projects.
* Use the configured Kaminari "per page" defaultrs-use-kaminari-defaultRobert Speicher2016-03-191-2/+2
|
* Allow filtered dashboard/explore results to be paged. Fixes #14104fix-filtered-paginationJosh Frye2016-03-091-2/+2
|
* Add option to show archived projects on dahsboardDmitriy Zaporozhets2016-03-041-16/+8
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Revert "Revert "Sort starred projects on dashboard based on last activity by ↵sort-starred-projectsDmitriy Zaporozhets2016-03-031-1/+1
| | | | | | default"" This reverts commit 617bb1096deb1fb5dea66d04b9bbd7da0dfb57ba.
* Revert "Sort starred projects on dashboard based on last activity by default"Dmitriy Zaporozhets2016-03-031-1/+1
| | | | This reverts commit 70d6455284717f938016b1e1b569e0d0dadb11fc.
* Sort starred projects on dashboard based on last activity by defaultDmitriy Zaporozhets2016-03-031-1/+1
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Don't show "Welcome to GitLab" when the search didn't return any projectsRémy Coutable2016-03-021-2/+2
|
* MR feedbackJosh Frye2016-02-091-2/+2
|
* Extract events rendering to own action.Josh Frye2016-02-091-2/+2
|
* Fix double pagingJosh Frye2016-02-051-1/+1
|