summaryrefslogtreecommitdiff
path: root/spec/features/groups
Commit message (Collapse)AuthorAgeFilesLines
* Correct RSpec/SingleLineHook cop offensesRobert Speicher2017-06-141-3/+8
|
* Merge branch 'rework-authorizations-performance' into 'master'Douwe Maan2017-05-292-4/+4
|\ | | | | | | | | Rework project authorizations and nested groups for better performance See merge request !10885
| * Use CTEs for nested groups and authorizationsYorick Peterse2017-05-172-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit introduces the usage of Common Table Expressions (CTEs) to efficiently retrieve nested group hierarchies, without having to rely on the "routes" table (which is an _incredibly_ inefficient way of getting the data). This requires a patch to ActiveRecord (found in the added initializer) to work properly as ActiveRecord doesn't support WITH statements properly out of the box. Unfortunately MySQL provides no efficient way of getting nested groups. For example, the old routes setup could easily take 5-10 seconds depending on the amount of "routes" in a database. Providing vastly different logic for both MySQL and PostgreSQL will negatively impact the development process. Because of this the various nested groups related methods return empty relations when used in combination with MySQL. For project authorizations the logic is split up into two classes: * Gitlab::ProjectAuthorizations::WithNestedGroups * Gitlab::ProjectAuthorizations::WithoutNestedGroups Both classes get the fresh project authorizations (= as they should be in the "project_authorizations" table), including nested groups if PostgreSQL is used. The logic of these two classes is quite different apart from their public interface. This complicates development a bit, but unfortunately there is no way around this. This commit also introduces Gitlab::GroupHierarchy. This class can be used to get the ancestors and descendants of a base relation, or both by using a UNION. This in turn is used by methods such as: * Namespace#ancestors * Namespace#descendants * User#all_expanded_groups Again this class relies on CTEs and thus only works on PostgreSQL. The Namespace methods will return an empty relation when MySQL is used, while User#all_expanded_groups will return only the groups a user is a direct member of. Performance wise the impact is quite large. For example, on GitLab.com Namespace#descendants used to take around 580 ms to retrieve data for a particular user. Using CTEs we are able to reduce this down to roughly 1 millisecond, returning the exact same data. == On The Fly Refreshing Refreshing of authorizations on the fly (= when users.authorized_projects_populated was not set) is removed with this commit. This simplifies the code, and ensures any queries used for authorizations are not mutated because they are executed in a Rails scope (e.g. Project.visible_to_user). This commit includes a migration to schedule refreshing authorizations for all users, ensuring all of them have their authorizations in place. Said migration schedules users in batches of 5000, with 5 minutes between every batch to smear the load around a bit. == Spec Changes This commit also introduces some changes to various specs. For example, some specs for ProjectTeam assumed that creating a personal project would _not_ lead to the owner having access, which is incorrect. Because we also no longer refresh authorizations on the fly for new users some code had to be added to the "empty_project" factory. This chunk of code ensures that the owner's permissions are refreshed after creating the project, something that is normally done in Projects::CreateService.
* | use full caps RSS instead of rssAlexis Reigel2017-05-243-10/+10
| |
* | atom links with rss token instead of private tokenAlexis Reigel2017-05-243-10/+10
| |
* | Use wait_for_requests to wait all JS requestwait-for-ajax-handling-all-js-requestsOswaldo Ferreira2017-05-221-1/+1
|/
* Devise can assign trackable fields, but only allow writes once/hourtc-cache-trackable-attributesToon Claes2017-05-081-2/+2
| | | | Not assigning the trackable fields seems to cause strange side-effects.
* Redirect from redirect routes to canonical routesMichael Kozono2017-05-051-0/+3
|
* Add happy path feature tests for redirect behaviorMichael Kozono2017-05-051-0/+77
|
* Assignee filter on group issues/merge requests only loads group usersgroup-assignee-dropdown-send-group-idPhil Hughes2017-04-241-0/+16
| | | | Closes #29490
* Merge branch 'dz-refactor-create-members' into 'master' Douwe Maan2017-04-201-2/+52
|\ | | | | | | | | Refactor code that creates and destroys project/group members See merge request !10735
| * Move some project/group members spinach tests to rspecdz-refactor-create-membersDmitriy Zaporozhets2017-04-171-2/+52
| | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* | Fixed group milestones date pickers not workinggroup-milestone-date-fields-fixPhil Hughes2017-04-191-0/+36
|/ | | | Closes #31095
* MR empty stateLuke "Jared" Bennett2017-04-051-0/+70
|
* Activate group name toggle based on horizontal spaceSam Rose2017-03-251-20/+27
|
* Append _spec to group_name_toggle spec fileSam Rose2017-03-171-1/+1
|
* Toggle project name if too long28187-project-name-cut-off-with-nested-groupsSam Rose2017-03-131-0/+44
|
* Show public RSS feeds to anonymous usersMichael Kozono2017-02-283-0/+68
|
* Added ability to change user permissions in group to ownergroup-memebrs-owner-levelPhil Hughes2017-02-161-0/+15
| | | | Closes #28233
* Show parent group members for nested groupdz-nested-groups-members-pageDmitriy Zaporozhets2017-02-101-0/+40
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Add traits for ProjectFeatures to Project factorySemyon Pupkov2017-02-051-1/+1
| | | | https://gitlab.com/gitlab-org/gitlab-ce/issues/24007
* Use archived trait for project in specs instead model columnSemyon Pupkov2017-01-221-1/+1
|
* Improve test for sort dropdown on members pageNur Rony2016-12-161-0/+9
|
* Use factories to create project/group membership on specsDouglas Barbosa Alexandre2016-12-161-2/+2
|
* Sort group/project members alphabetically by defaultDouglas Barbosa Alexandre2016-12-161-0/+7
|
* Add feature spec for sort functionality on group/project members listDouglas Barbosa Alexandre2016-12-161-0/+82
|
* Merge branch '23305-leave-project-and-leave-group-should-be-buttons' into ↵Jacob Schatz2016-12-093-4/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'master' Remove 'Leave Project' and 'Leave Group' from settings dropdowns ## What does this MR do? Removes `Leave Project` and `Leave Group` from the settings dropdown. Adds it to the `views/shared/members/access_request_buttons.html.haml`. ## Are there points in the code the reviewer needs to double check? ## Why was this MR needed? ## Screenshots (if relevant) ![Screen_Shot_2016-11-19_at_15.34.26](/uploads/5c66a025513b4780a9e881f0036381e4/Screen_Shot_2016-11-19_at_15.34.26.png) ![Screen_Shot_2016-11-19_at_15.35.29](/uploads/ed74a5dfe982cf65bb49c0c4fb307061/Screen_Shot_2016-11-19_at_15.35.29.png) ## Does this MR meet the acceptance criteria? - [x] [Changelog entry](https://docs.gitlab.com/ce/development/changelog.html) added - [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) - [ ] API support added - Tests - [ ] 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) - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) ## What are the relevant issue numbers? Closes #23305 See merge request !7600
| * Removed leave buttons from settings dropdowns23305-leave-project-and-leave-group-should-be-buttonsLuke "Jared" Bennett2016-11-263-4/+4
| | | | | | | | Updated specs
* | Fix 404 error when visit group label edit pagedz-fix-group-label-404Dmitriy Zaporozhets2016-12-061-0/+21
| | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* | Fix Archived project merge requests add to group's Merge RequestsJacopo2016-12-051-1/+29
|/ | | | | | | | | | counter This is done by: - Extending the IssuableFinder adding the non_archived option to the params - Overriding the #filter_params in the MergeRequestsAction - Passing the non_archived param in the nav/_group.html.haml navbar partial from the groups/merge_requests.html.haml
* Make access request specs explicitly enable or disable access requests as ↵Nick Thomas2016-11-112-2/+2
| | | | required
* Merge branch '22481-honour-issue-visibility-for-groups' into 'security' Douwe Maan2016-11-092-0/+16
| | | | | | | | | Honour issue and merge request visibility in their respective finders This MR fixes a security issue with the IssuesFinder and MergeRequestFinder where they would return items the user did not have permission to see. This was most visible on the issue and merge requests page for a group containing projects that had set their issues or merge requests to "private". Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/22481 See merge request !2000
* Tests updatePhil Hughes2016-09-131-1/+1
|
* Fix a few nitpicksRémy Coutable2016-07-201-10/+1
| | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* Allow to disable user request access to groups/projectsFelipe Artur2016-07-201-0/+16
|
* New :request_access ability to replace a ugly helperRémy Coutable2016-07-051-0/+16
| | | | | | | | | | | - Group / project members cannot request access - Group members cannot request access to a group's project This addresses an issue where project owners could request access to their own project, leading to UI inconsistency where their requester status would replace their owner status. Signed-off-by: Rémy Coutable <remy@rymai.me>
* Merge branch 'explicit-requesters-scope' into 'master' Douwe Maan2016-07-012-5/+5
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Exclude requesters from Project#members, Group#members and User#members ## What does this MR do? It excludes requesters from the `Project#members`, `Group#members` and `User#members` associations, and adds new `Project#requesters` and `Group#requesters` associations. ## Are there points in the code the reviewer needs to double check? No. ## Why was this MR needed? Without this, if you call `project.members`, requesters are included in the results! This is at best misleading, and at worst can lead to security issues. By excluding requesters from the `#members` associations, we avoid introducing security inadvertently since you have to call the `#requesters` association explicitly to get requesters. ## What are the relevant issue numbers? This is something I realized while fixing the security issue #19102. ## Does this MR meet the acceptance criteria? - [x] I don't think this needs a CHANGELOG since this is an internal change - Tests - [x] Added for this feature/bug - [ ] 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 !4946
| * Exclude requesters from Project#members, Group#members and User#membersexplicit-requesters-scopeRémy Coutable2016-07-012-5/+5
| | | | | | | | | | | | And create new Project#requesters, Group#requesters scopes. Signed-off-by: Rémy Coutable <remy@rymai.me>
* | Enable Style/EmptyLines cop, remove redundant onesrubocop/enable-cops-for-empty-linesGrzegorz Bizon2016-07-011-1/+0
|/
* Fix an information disclosure when requesting access to a group containing ↵Rémy Coutable2016-06-241-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | private projects The issue was with the `User#groups` and `User#projects` associations which goes through the `User#group_members` and `User#project_members`. Initially I chose to use a secure approach by storing the requester's user ID in `Member#created_by_id` instead of `Member#user_id` because I was aware that there was a security risk since I didn't know the codebase well enough. Then during the review, we decided to change that and directly store the requester's user ID into `Member#user_id` (for the sake of simplifying the code I believe), meaning that every `group_members` / `project_members` association would include the requesters by default... My bad for not checking that all the `group_members` / `project_members` associations and the ones that go through them (e.g. `Group#users` and `Project#users`) were made safe with the `where(requested_at: nil)` / `where(members: { requested_at: nil })` scopes. Now they are all secure. Signed-off-by: Rémy Coutable <remy@rymai.me>
* Merge branch ↵Douwe Maan2016-06-221-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | '18871-check-improve-how-we-display-access-requesters-in-admin-area' into 'master' Display group/project access requesters separately in admin ## What does this MR do? It displays the access requesters in a separate list in group & project members pages. It also harmonize the members counter UI to use `%span.badge` everywhere (in the admin & non-admin members views). ## Are there points in the code the reviewer needs to double check? No. ## Why was this MR needed? To not confuse access requesters with actual members. ## What are the relevant issue numbers? Closes #18871. ## Screenshots ### Group members | Before | After | | --------- | ---- | | ![group-members-before](/uploads/2f15137e073fd3a63bc2cb7b2217cb6c/group-members-before.png) | ![group-members-after](/uploads/5b643974505cfa57783fa0320d3bf8b2/group-members-after.png) | ### Project members | Before | After | | --------- | ---- | | ![project-members-before](/uploads/9c48dcd3736e42de84061b1201ee0b06/project-members-before.png) | ![project-members-after](/uploads/8e04c92ef0bba3de7e2405618632b27d/project-members-after.png) | ### Admin group members | Before | After | | --------- | ---- | | ![admin-group-members-before](/uploads/7fda8c2c94b697bea6655ba892ba45e7/admin-group-members-before.png) | ![admin-group-members-after](/uploads/ea25717001794f75939c679b80308c3a/admin-group-members-after.png) | ### Admin project members | Before | After | | --------- | ---- | | ![admin-project-members-before](/uploads/ba9d3ec52adbda6bb3d45ad9ac5243d3/admin-project-members-before.png) | ![admin-project-members-after](/uploads/3b889a029a9756e9ed2781b45c4dd9cb/admin-project-members-after.png) | ## Does this MR meet the acceptance criteria? - [x] No CHANGELOG since this is related to the original "request access" MR. - [ ] 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 !4798
| * Fix specsRémy Coutable2016-06-201-1/+1
| | | | | | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* | Fix and remove duplicate specs18755-fix-destroy-project-causes-post_decline_request-to-be-executedRémy Coutable2016-06-201-1/+0
| | | | | | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* | Add 'Leave Group' linkRémy Coutable2016-06-183-0/+39
|/ | | | | | The link was removed in !3798, probably by mistake. Signed-off-by: Rémy Coutable <remy@rymai.me>
* UI and copywriting improvements13948-access-request-to-projects-and-groupsRémy Coutable2016-06-142-26/+16
| | | | | | | | | + Move 'Edit Project/Group' out of membership-related partial + Show the access request buttons only to logged-in users + Put the request access buttons out of in a more visible button + Improve the copy in the #remove_member_message helper Signed-off-by: Rémy Coutable <remy@rymai.me>
* Add request access for groupsRémy Coutable2016-06-142-0/+106
Signed-off-by: Rémy Coutable <remy@rymai.me>