summaryrefslogtreecommitdiff
path: root/spec/finders
Commit message (Collapse)AuthorAgeFilesLines
* Remove superfluous lib: true, type: redis, service: true, models: true, ↵Rémy Coutable2017-07-271-1/+1
| | | | | | services: true, no_db: true, api: true Signed-off-by: Rémy Coutable <remy@rymai.me>
* Use `match_array` rather than `eq` in ProjectsFinder specrs-project-finder-spec-mysqlRobert Speicher2017-07-241-4/+4
|
* Decrease ABC threshold to 56.96Maxim Rydkin2017-07-241-0/+136
|
* Merge branch 'feature/user-datetime-search-api-mysql' into 'master'Douwe Maan2017-07-071-0/+11
|\ | | | | | | | | | | | | Add creation time filters to user search API for admins Closes #29507 See merge request !12682
| * improve finder specJames Lopez2017-07-071-1/+4
| |
| * add created at filter logic to users finder and APIJames Lopez2017-07-071-1/+3
| |
| * add finder and users API specJames Lopez2017-07-071-0/+6
| |
* | Native group milestonesFelipe Artur2017-07-073-0/+126
|/
* Hide archived project labels from group issue trackerHoracio Bertorello2017-06-301-3/+3
|
* Make finders responsible for counter cache keysSean McGivern2017-06-301-9/+9
|
* Only do complicated confidentiality checks when necessarySean McGivern2017-06-301-13/+112
| | | | | | | | | | | When we are filtering by a single project, and the current user has access to see confidential issues on that project, we don't need to filter by confidentiality at all - just as if the user were an admin. The filter by confidentiality often picks a non-optimal query plan: for instance, AND-ing the results of all issues in the project (a relatively small set), and all issues in the states requested (a huge set), rather than just starting small and winnowing further.
* Merge branch 'add-since-and-until-params-to-issuables' into 'master'Rémy Coutable2017-06-192-2/+62
|\ | | | | | | | | | | | | add created_after and created_before params to issuables Closes #32901 See merge request !12151
| * add since and until params to issuablesKyle Bishop2017-06-182-2/+62
| |
* | Merge branch 'tc-fix-group-finder-subgrouping' into 'master'Douwe Maan2017-06-161-7/+58
|\ \ | | | | | | | | | | | | | | | | | | Show private subgroups if member of parent group Closes #32135 See merge request !11764
| * | Make the GroupFinder specs more strictToon Claes2017-06-151-17/+35
| | | | | | | | | | | | | | | | | | | | | Ensure the results match exactly and project authorizations do allow access to sibling groups/projects deeper down. Also apply WHERE scopes before running the UNION, to increase performance.
| * | Subgroups page should show groups authorized through inheritanceToon Claes2017-06-151-3/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a user is authorized to a group, they are also authorized to see all the ancestor groups and descendant groups. When a user is authorized to a project, they are authorized to see all the ancestor groups too. Closes #32135 See merge request !11764
* | | Fix intermittent spec failures in spec/finders/pipelines_finder_spec.rbsh-improve-pipelines-finder-specStan Hu2017-06-151-1/+1
|/ / | | | | | | | | The spec was trying to sort pipelines by user ID, but the same user ID was being used for each pipeline in the spec. This is similar to #33001.
* | Correct RSpec/SingleLineHook cop offensesRobert Speicher2017-06-144-24/+72
|/
* Introduce an Events APIMark Fletcher2017-06-061-0/+44
| | | | | | | | | | | * Meld the following disparate endpoints: * `/projects/:id/events` * `/events` * `/users/:id/events` + Add result filtering to the above endpoints: * action * target_type * before and after dates
* Add :owned param to ProjectFinderToon Claes2017-05-301-0/+7
| | | | And use it in the API.
* Change ProjectFinder so starred can be combined with other filtersToon Claes2017-05-301-1/+7
| | | | | The `starred` parameter couldn't be used in combination with `trending` or `non_public`. But this is changed now.
* Merge branch 'rework-authorizations-performance' into 'master'Douwe Maan2017-05-292-2/+2
|\ | | | | | | | | Rework project authorizations and nested groups for better performance See merge request !10885
| * Use CTEs for nested groups and authorizationsYorick Peterse2017-05-172-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Fix trailing ',' in hash.Bob Van Landuyt2017-05-151-1/+1
| |
* | Create a Users FinderGeorge Andrinopoulos2017-05-151-0/+66
|/
* Use `described_class` in SnippetsFinder-specBob Van Landuyt2017-05-101-21/+21
|
* Merge branch 'tc-fix-private-subgroups-shown' into 'security' Douwe Maan2017-05-101-11/+46
| | | | | Use GroupsFinder to find subgroups the user has access to See merge request !2096
* Merge branch 'snippets-finder-visibility' into 'security'Douwe Maan2017-05-101-25/+100
| | | | | | Refactor snippets finder & dont return internal snippets for external users See merge request !2094
* Add Pipeline Schedules that supersedes experimental Trigger ScheduleZeger-Jan van de Weg2017-05-071-0/+41
|
* [Multiple issue assignee] Fix a number of specsValery Sizov2017-05-051-11/+11
|
* Backport of multiple_assignees_feature [ci skip]Valery Sizov2017-05-041-13/+13
|
* Merge branch ↵Robert Speicher2017-05-031-25/+180
|\ | | | | | | | | | | | | | | | | '28408-feature-proposal-include-search-options-to-pipelines-api' into 'master' Resolve "Feature Proposal: Include search options to pipelines API" Closes #28408 See merge request !9367
| * Improve pipelines_finder.rbShinya Maeda2017-05-031-4/+4
| |
| * Avoid using sampleShinya Maeda2017-05-031-1/+1
| |
| * Use HasStatus::AVAILABLE_STATUSES instead of hard codingShinya Maeda2017-05-031-2/+2
| |
| * Improve api/pipelines_spec.rbShinya Maeda2017-05-031-3/+7
| |
| * Add another pipeline for spec statusShinya Maeda2017-05-031-0/+5
| |
| * Add space before bracketShinya Maeda2017-05-031-6/+6
| |
| * Improve pipelines_finder_spec.rbShinya Maeda2017-05-031-113/+70
| |
| * Ci::Pipeline to project.pipelinesShinya Maeda2017-05-031-23/+23
| |
| * Fix improper method name and spec descriptionShinya Maeda2017-05-031-3/+3
| |
| * Fix created_at to user_id in specShinya Maeda2017-05-031-6/+6
| |
| * Change sort spec descriptionShinya Maeda2017-05-031-2/+2
| |
| * Allow only indexed columns in #order_and_sort. Remove present (Because ↵Shinya Maeda2017-05-031-1/+9
| | | | | | | | unnecessary) from condition. Added spec just in case.
| * Normalize wordingShinya Maeda2017-05-031-47/+39
| |
| * Finish pipelines_specShinya Maeda2017-05-031-1/+1
| |
| * Use eq instead of match_array for comparison of arrayShinya Maeda2017-05-031-5/+5
| |
| * No need 'a'Shinya Maeda2017-05-031-13/+13
| |
| * Add name(User)Shinya Maeda2017-05-031-6/+24
| |
| * Change name to usernameShinya Maeda2017-05-031-1/+1
| |