Commit Graph

90 Commits

Author SHA1 Message Date
GitLab Bot fc4faf47ac Add latest changes from gitlab-org/gitlab@master 2023-05-25 12:07:22 +00:00
GitLab Bot e52198c836 Add latest changes from gitlab-org/gitlab@master 2023-04-04 00:08:36 +00:00
GitLab Bot 99f4b14cb0 Add latest changes from gitlab-org/gitlab@master 2023-02-17 15:09:22 +00:00
GitLab Bot 1caab68312 Add latest changes from gitlab-org/gitlab@master 2023-01-12 12:07:17 +00:00
GitLab Bot 12b995e0e7 Add latest changes from gitlab-org/gitlab@master 2022-12-05 12:08:19 +00:00
GitLab Bot 8fc2555ccc Add latest changes from gitlab-org/gitlab@master 2022-11-04 21:09:59 +00:00
GitLab Bot 0d8bcdf77d Add latest changes from gitlab-org/gitlab@master 2022-10-04 09:09:18 +00:00
GitLab Bot a6533d71f5 Add latest changes from gitlab-org/gitlab@master 2022-06-16 15:09:00 +00:00
GitLab Bot 9613d93025 Add latest changes from gitlab-org/gitlab@master 2022-05-17 21:08:51 +00:00
GitLab Bot ebc589e90c Add latest changes from gitlab-org/gitlab@master 2021-06-10 03:10:01 +00:00
GitLab Bot 0ae8428c8e Add latest changes from gitlab-org/gitlab@master 2021-05-11 21:10:21 +00:00
GitLab Bot 9bc5f183df Add latest changes from gitlab-org/gitlab@master 2021-04-07 21:09:01 +00:00
GitLab Bot 5b2abea8db Add latest changes from gitlab-org/gitlab@master 2021-03-29 18:09:37 +00:00
GitLab Bot ff06f859cd Add latest changes from gitlab-org/gitlab@master 2020-11-10 15:09:14 +00:00
GitLab Bot 3ef453aa1c Add latest changes from gitlab-org/gitlab@master 2020-10-05 21:08:47 +00:00
GitLab Bot c596046be9 Add latest changes from gitlab-org/gitlab@master 2020-09-10 18:08:54 +00:00
GitLab Bot c282dba898 Add latest changes from gitlab-org/gitlab@master 2020-01-24 15:09:00 +00:00
GitLab Bot 190e204dec Add latest changes from gitlab-org/gitlab@master 2019-11-17 12:06:19 +00:00
GitLab Bot b7dfe2ae40 Add latest changes from gitlab-org/gitlab@master 2019-09-13 13:26:31 +00:00
Andreas Brandl 53801b1206
Preload routes information
This fixes a high frequency N+1 issue:

`RoutableActions#find_routable!` is used across many controllers to
retrieve e.g. the Project or Namespace by path. The `#find_routable!`
method calls `#ensure_canonical_path` which in turn retrieves
`#full_path` from the given Routable.

This in turn triggers a lookup on `routes`, leading to a high frequency
of these queries:

```sql
SELECT  "routes".* FROM "routes" WHERE "routes"."source_id" = $1 AND
"routes"."source_type" = $2 LIMIT $3
```

This is unnecessary as we already join `routes` in
`Routable#find_by_full_path` anyways.
2019-09-03 12:16:03 +02:00
Fabio Papa d279cc5a7a Add subgroup_creation_level to the list of allowed group params
For both groups_controller and admin/groups_controller
2019-07-19 11:55:46 -07:00
Gosia Ksionek 64858317ad Add part of needed code
Add columns to store project creation settings

Add project creation level column in groups
 and default project creation column in application settings

Remove obsolete line from schema

Update migration with project_creation_level column existence check

Rename migrations to avoid conflicts

Update migration methods

Update migration method
2019-04-05 18:49:46 +00:00
Martin Wortschack 8ce09a1d42 Externalize strings in admin controllers
- Update PO file
2019-03-21 14:31:34 +01:00
gfyoung 73322a0e55 Enable frozen string in app/controllers/**/*.rb
Enables frozen string for the following:

* app/controllers/*.rb
* app/controllers/admin/**/*.rb
* app/controllers/boards/**/*.rb
* app/controllers/ci/**/*.rb
* app/controllers/concerns/**/*.rb

Partially addresses #47424.
2018-09-18 21:22:45 -07:00
Yorick Peterse 2039c8280d
Disable existing offenses for the CodeReuse cops
This whitelists all existing offenses for the various CodeReuse cops, of
which most are triggered by the CodeReuse/ActiveRecord cop.
2018-09-11 17:32:00 +02:00
Lin Jen-Shin 4ee08b77bc Updates from `rubocop -a` 2018-07-09 21:13:08 +08:00
Lin Jen-Shin b23428d664 Bring changes from EE 2018-06-25 21:11:00 +08:00
blackst0ne 3d3b46f344 [Rails5] Rename `sort` methods to `sort_by_attribute` 2018-04-04 09:19:47 +00:00
Rémy Coutable 1c88d92b3f Improve Member services
Signed-off-by: Rémy Coutable <remy@rymai.me>
2018-02-27 16:02:22 +01:00
Rémy Coutable 50d7c356c2
Present member collection at the controller level
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-12-12 18:14:58 +01:00
blackst0ne a544e46bb0 Add a rubocop rule to check if a method 'redirect_to' is used without explicitly set 'status' in 'destroy' actions of controllers 2017-06-07 09:45:16 +11:00
Nick Thomas 5c602e306c Limit non-administrators to adding 100 members at a time to groups and projects 2017-06-06 16:04:26 +01:00
Kushal Pandya 848204ba74 Show group name on flash container when group is created from Admin area 2017-04-25 12:43:21 +00:00
Dmitriy Zaporozhets bae1644015
Refactor Admin::GroupsController#members_update method and add some specs
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2017-04-20 19:25:02 +03:00
Markus Koller a3430f011f Support 2FA requirement per-group 2017-04-06 10:01:13 +02:00
Dmitriy Zaporozhets 8820f3cdd2 Merge branch 'dz-refactor-full-path' into 'master'
Store group and project full name and full path in routes table

See merge request !8979
2017-02-08 18:45:19 +00:00
Dmitriy Zaporozhets 2989192d1a
Store group and project full name and full path in routes table
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2017-02-08 19:14:29 +02:00
dixpac 0dacf3c169 Fix inconsistent naming for services that delete things
* Changed name of delete_user_service and worker to destroy
* Move and change delete_group_service to Groups::DestroyService
* Rename Notes::DeleteService to Notes::DestroyService
2017-02-08 09:16:43 +01:00
Rémy Coutable 83c1395af2 Refactor authorized params in Admin::GroupsController
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-01-11 16:52:30 -05:00
Valery Sizov 684536321c Fix: Admin group show page does not work 2016-12-28 15:34:12 +02:00
Markus Koller 3ef4f74b1a
Add more storage statistics
This adds counters for build artifacts and LFS objects, and moves
the preexisting repository_size and commit_count from the projects
table into a new project_statistics table.

The counters are displayed in the administration area for projects
and groups, and also available through the API for admins (on */all)
and normal users (on */owned)

The statistics are updated through ProjectCacheWorker, which can now
do more granular updates with the new :statistics argument.
2016-12-21 16:39:49 +01:00
Dmitriy Zaporozhets 83232be0e1
Add nested groups support on data level
* add parent_id field to namespaces table to store relation with nested groups
* create routes table to keep information about full path of every group and project
* project/group lookup by full path from routes table

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-12-08 11:47:16 +02:00
Rémy Coutable 924a6b7d33 New AccessRequestsFinder
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-09-28 08:46:59 +02:00
Patricio Cano 02ddb9dff4 Syntax fixes and better tests for helper methods. Updated docs. 2016-09-15 14:10:49 -05:00
Patricio Cano fd62142950 Added group-specific setting for LFS.
Groups can enable/disable LFS, but this setting can be overridden at the project level. Admin only
2016-09-15 12:27:32 -05:00
Sean McGivern 64d45a87cd Fix adding a user to a group in admin section 2016-08-18 23:33:50 +01:00
Stan Hu cb8a425ba4 Fix bug where destroying a namespace would not always destroy projects
There is a race condition in DestroyGroupService now that projects are deleted asynchronously:

1. User attempts to delete group
2. DestroyGroupService iterates through all projects and schedules a Sidekiq job to delete each Project
3. DestroyGroupService destroys the Group, leaving all its projects without a namespace
4. Projects::DestroyService runs later but the can?(current_user,
   :remove_project) is `false` because the user no longer has permission to
   destroy projects with no namespace.
5. This leaves the project in pending_delete state with no namespace/group.

Projects without a namespace or group also adds another problem: it's not possible to destroy the container
registry tags, since container_registry_path_with_namespace is the wrong value.

The fix is to destroy the group asynchronously and to run execute directly on Projects::DestroyService.

Closes #17893
2016-08-11 15:36:35 -07:00
Felipe Artur 4d69cb9d94 Allow to disable user request access to groups/projects 2016-07-20 14:38:21 +02:00
Rémy Coutable bd78f5733c Exclude requesters from Project#members, Group#members and User#members
And create new Project#requesters, Group#requesters scopes.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-07-01 17:44:46 +02:00
Douwe Maan ae7b2ef62c Merge branch 'master' into issue_12658
# Conflicts:
#	app/models/issue.rb
#	app/views/projects/_home_panel.html.haml
#	app/views/shared/projects/_project.html.haml
#	db/schema.rb
#	spec/models/project_spec.rb
2016-03-21 23:22:21 +01:00