Commit Graph

70 Commits

Author SHA1 Message Date
Jarka Kadlecova bd90dfab87 Fix edit milestone path from group milestones list 2017-08-16 14:06:49 +02:00
Rémy Coutable 1b413bd62f Enable Timecop safe mode
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-08-11 14:53:17 +02:00
Robert Speicher c8b802471b Enable the RSpec/HookArgument cop and auto-correct offenses 2017-08-10 19:29:42 -04:00
Bryce Johnson 0532bff6d4 Group-level new issue & MR using previously selected project 2017-08-07 20:55:50 +00:00
Robert Speicher 72a7b30c9f Change all `:empty_project` to `:project` 2017-08-02 17:47:31 -04:00
Clement Ho 974a04026d Add filtered search to group issue dashboard 2017-08-02 09:27:24 +00:00
Robert Speicher 1b3681614b Use `empty_project` where possible in spec/features/groups 2017-07-27 13:12:16 -04:00
Keifer Furzland 7e113b6824 Remove superfluous type defs in specs
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-07-27 14:31:52 +02:00
Paul Charlton cb3b4a15e6 Support multiple Redis instances based on queue type 2017-07-11 03:35:47 +00:00
Robert Speicher 7d03012f2a Merge branch 'master' into rs-sign_in 2017-07-07 11:42:00 -04:00
Felipe Artur b5f596c3ff Native group milestones 2017-07-07 15:08:49 +00:00
Robert Speicher e939bf7be1 Change gitlab_sign_in to sign_in where possible 2017-06-29 12:18:23 -04:00
Douwe Maan bf4129292d Merge branch 'dz-refactor-group-members-tests' into 'master'
Refactor group members tests

See merge request !12465
2017-06-27 16:43:36 +00:00
Douglas Barbosa Alexandre fe17b11736 Improve scenario description for the group labels subscription spec 2017-06-26 17:55:52 -03:00
Douglas Barbosa Alexandre af6c01fb6f Allow users to subscribe to group labels on group labels page 2017-06-26 17:55:52 -03:00
Dmitriy Zaporozhets 0aa5f08988
Move another group member spec from spinach
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2017-06-26 17:00:07 +02:00
Dmitriy Zaporozhets 69043814b4
Fix leave_group_spec.rb
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2017-06-26 16:51:05 +02:00
Dmitriy Zaporozhets a67ff8e883
Move "remove group member" spec from spinach to rspec
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2017-06-26 16:50:16 +02:00
Dmitriy Zaporozhets c56f787602
Rename group member specs for consistent naming
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2017-06-26 16:43:14 +02:00
Dmitriy Zaporozhets 195cf2a712
Fix wrong scenario title to owner_manages_access_requests_spec.rb
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2017-06-26 16:34:35 +02:00
Dmitriy Zaporozhets f2174f2dd0
Merge group request access specs under one file
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2017-06-26 16:33:49 +02:00
Dmitriy Zaporozhets 9f87b34f66
Combine group leave feature specs in one file
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2017-06-26 16:23:46 +02:00
Douwe Maan 3e7e08adfc Show group name instead of path on group page 2017-06-23 13:43:32 -05:00
Robert Speicher 45fb1f9542 Change `login_as` uses to `gitlab_sign_in` 2017-06-19 18:59:01 -05:00
Robert Speicher a6ec5121f0 Correct RSpec/SingleLineHook cop offenses 2017-06-14 13:18:56 -05:00
Douwe Maan 26bcef97d6 Merge branch 'rework-authorizations-performance' into 'master'
Rework project authorizations and nested groups for better performance

See merge request !10885
2017-05-29 15:49:56 +00:00
Alexis Reigel dfc2542f55 use full caps RSS instead of rss 2017-05-24 22:29:59 +02:00
Alexis Reigel 6efe9c2f14 atom links with rss token instead of private token 2017-05-24 22:29:59 +02:00
Oswaldo Ferreira 2338785ec9 Use wait_for_requests to wait all JS request 2017-05-22 20:39:49 -03:00
Yorick Peterse ac382b5682
Use CTEs for nested groups and authorizations
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.
2017-05-17 16:51:08 +02:00
Toon Claes 3531ea096f Devise can assign trackable fields, but only allow writes once/hour
Not assigning the trackable fields seems to cause strange side-effects.
2017-05-08 08:48:38 +02:00
Michael Kozono 7d02bcd2e0 Redirect from redirect routes to canonical routes 2017-05-05 12:11:57 -07:00
Michael Kozono f4a2dfb46f Add happy path feature tests for redirect behavior 2017-05-05 12:11:57 -07:00
Phil Hughes dab6aab220 Assignee filter on group issues/merge requests only loads group users
Closes #29490
2017-04-24 16:15:24 +01:00
Douwe Maan d39bcf8c7e Merge branch 'dz-refactor-create-members' into 'master'
Refactor code that creates and destroys project/group members

See merge request !10735
2017-04-20 14:36:21 +00:00
Phil Hughes c2b311e034 Fixed group milestones date pickers not working
Closes #31095
2017-04-19 10:04:24 +01:00
Dmitriy Zaporozhets 5f08760482
Move some project/group members spinach tests to rspec
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2017-04-17 21:03:30 +03:00
Luke "Jared" Bennett 7c5198219a MR empty state 2017-04-05 12:43:03 +00:00
Sam Rose 004f3a0bc2 Activate group name toggle based on horizontal space 2017-03-25 09:24:04 -04:00
Sam Rose 35de410de1 Append _spec to group_name_toggle spec file 2017-03-17 19:45:12 -04:00
Sam Rose db59e735ae Toggle project name if too long 2017-03-13 19:25:13 -04:00
Michael Kozono a2670ee06b Show public RSS feeds to anonymous users 2017-02-28 12:50:57 -08:00
Phil Hughes 3894ae3bd0 Added ability to change user permissions in group to owner
Closes #28233
2017-02-16 09:40:38 +00:00
Dmitriy Zaporozhets 5f85487c15
Show parent group members for nested group
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2017-02-10 17:34:12 +02:00
Semyon Pupkov 3deb66ea56 Add traits for ProjectFeatures to Project factory
https://gitlab.com/gitlab-org/gitlab-ce/issues/24007
2017-02-05 13:11:45 +05:00
Semyon Pupkov a92c0f9c11 Use archived trait for project in specs instead model column 2017-01-22 19:19:45 +05:00
Nur Rony ecea127cd1 Improve test for sort dropdown on members page 2016-12-16 20:30:27 -02:00
Douglas Barbosa Alexandre 0ef2c8dfbe Use factories to create project/group membership on specs 2016-12-16 20:28:40 -02:00
Douglas Barbosa Alexandre 3a2905f507 Sort group/project members alphabetically by default 2016-12-16 20:28:38 -02:00
Douglas Barbosa Alexandre 4b7a3d0c38 Add feature spec for sort functionality on group/project members list 2016-12-16 20:28:38 -02:00