summaryrefslogtreecommitdiff
path: root/spec/models/namespace_spec.rb
Commit message (Collapse)AuthorAgeFilesLines
* Use hashed storage in the specs40744-hashed-storage-specsNick Thomas2018-02-071-81/+125
|
* Validate path uniqueness only on Route, and bubble up appropriatelyDouwe Maan2018-02-061-1/+0
|
* 31885 - Ability to transfer a single group to another groupMayra Cabrera2018-02-061-30/+40
|
* Fix export removal for hashed-storage projects within a renamed or deleted ↵Nick Thomas2018-02-051-0/+20
| | | | namespace
* port of 594e6a0a625^..f74c90f68c6Micaël Bergeron2018-02-011-1/+1
|
* Remove soft removals related codeYorick Peterse2018-01-081-11/+0
| | | | | | | | | | | | | | This removes all usage of soft removals except for the "pending delete" system implemented for projects. This in turn simplifies all the query plans of the models that used soft removals. Since we don't really use soft removals for anything useful there's no point in keeping it around. This _does_ mean that hard removals of issues (which only admins can do if I'm not mistaken) can influence the "iid" values, but that code is broken to begin with. More on this (and how to fix it) can be found in https://gitlab.com/gitlab-org/gitlab-ce/issues/31114. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/37447
* Fix specsremove-project-repoJacob Vosmaer2018-01-051-3/+7
|
* Fix TestEnv.copy_repo to use disk_path instead of full_pathDouglas Barbosa Alexandre2018-01-031-1/+1
|
* Update project full path in .git/config when renaming namespaceDouglas Barbosa Alexandre2018-01-031-0/+14
|
* Allow git pull/push on project redirectsMayra Cabrera2017-12-081-0/+30
|
* Cache the forks in a namespace in the RequestStoreBob Van Landuyt2017-12-041-1/+9
| | | | | | | | | On the `show` of a project that is part of a fork network. We check if the user already created a fork of this project in their personal namespace. We do this in several places, so caching the result of this query in the request store prevents us from repeating it.
* Merge branch 'master' into sh-security-fix-backports-masterStan Hu2017-10-171-0/+14
|\
| * Merge branch 'master' into bvl-group-treesBob Van Landuyt2017-10-101-13/+38
| |\
| * | Move the `ancestors_upto` to `Project` and `Namespace`Bob Van Landuyt2017-10-101-0/+14
| | |
* | | Merge branch 'security-10-1' into '10-1-stable'Jen-Shin Lin2017-10-171-10/+4
| |/ |/| | | | | | | Security fixes for 10.1 RC See merge request gitlab/gitlabhq!2209
* | Find forks within users/namespaces using fork membershipsBob Van Landuyt2017-10-071-0/+23
| |
* | Fix namespace deletion testsZeger-Jan van de Weg2017-10-051-13/+15
|/
* Merge branch 'improve-share-locking-feature-for-subgroups' into 'master'Douwe Maan2017-09-071-0/+112
|\ | | | | | | | | | | | | Improve "Share with group lock" feature for subgroups Closes #30550 See merge request !13944
| * Refer to “Share with group lock” consistentlyimprove-share-locking-feature-for-subgroupsMichael Kozono2017-09-061-21/+21
| |
| * Refactor based on code reviewMichael Kozono2017-09-061-3/+3
| |
| * Specify nested_groups specsMichael Kozono2017-09-061-1/+1
| |
| * Enable share_with_group_lock on subgroupMichael Kozono2017-09-061-0/+112
| | | | | | | | …when needed
* | Removes default scope from sortable23079-remove-default-scope-in-sortableTiago Botelho2017-09-071-1/+1
|/
* Speed up Group#user_ids_for_project_authorizationsNick Thomas2017-08-141-0/+30
|
* Change all `:empty_project` to `:project`rs-empty_project-defaultRobert Speicher2017-08-021-3/+3
|
* Use described_class when possibleRémy Coutable2017-07-271-7/+7
| | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* Remove superfluous lib: true, type: redis, service: true, models: true, ↵Rémy Coutable2017-07-271-3/+3
| | | | | | services: true, no_db: true, api: true Signed-off-by: Rémy Coutable <remy@rymai.me>
* Allow groups with the name systembvl-free-system-namespaceBob Van Landuyt2017-07-181-1/+1
|
* Promote visibility level helpers from Group to NamespaceNick Thomas2017-07-171-0/+8
| | | | | In EE, we make use of `namespace#public?` in projects. When the project is in a personal namespace, this breaks as the `public?` helper isn't present.
* Defer project destroys within a namespace in ↵Stan Hu2017-06-291-0/+11
| | | | | | | | | | | Groups::DestroyService#async_execute Group#destroy would actually hard-delete all associated projects even though the acts_as_paranoia gem is used, preventing Projects::DestroyService from doing any work. We first noticed this while trying to log all projects deletion to the Geo log.
* Add "members_count" and "parent_id" data on namespaces APIOswaldo Ferreira2017-06-281-0/+19
|
* Enable Style/DotPosition Rubocop :cop:Grzegorz Bizon2017-06-211-2/+2
|
* Bring in security changes from the 9.2.5 releaseDJ Mountney2017-06-071-2/+8
| | | | | | | | | | | | | Ran: - git format-patch v9.2.2..v9.2.5 --stdout > patchfile.patch - git checkout -b 9-2-5-security-patch origin/v9.2.2 - git apply patchfile.patch - git commit - [Got the sha ref for the commit] - git checkout -b upstream-9-2-security master - git cherry-pick <SHA of the patchfile commit> - [Resolved conflicts] - git cherry-pick --continue
* Merge branch 'rework-authorizations-performance' into 'master'Douwe Maan2017-05-291-8/+8
|\ | | | | | | | | Rework project authorizations and nested groups for better performance See merge request !10885
| * Use CTEs for nested groups and authorizationsYorick Peterse2017-05-171-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Revert "Remove changes that are not absolutely necessary"Douwe Maan2017-05-241-2/+2
| | | | | | This reverts commit b0498c176fa134761d899c9b369be12f1ca789c5
* | Remove changes that are not absolutely necessarydm-fix-routesDouwe Maan2017-05-231-2/+2
| |
* | Fix ambiguous routing issues by teaching router about reserved wordsDouwe Maan2017-05-231-3/+3
|/
* The dynamic path validator can block out partial pathsBob Van Landuyt2017-05-011-0/+7
| | | | So we can block `objects` only when it is contained in `info/lfs` or `gitlab-lfs`
* Check `has_parent?` for determining validation typeBob Van Landuyt2017-05-011-0/+1
|
* Merge branch 'master' into feature/multi-level-container-registry-imagesGrzegorz Bizon2017-04-061-13/+38
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (94 commits) Merge branch 'open-redirect-fix-continue-to' into 'security' Merge branch 'open-redirect-host-fix' into 'security' Merge branch 'path-disclosure-proj-import-export' into 'security' Merge branch '29364-private-projects-mr-fix' Merge branch '30125-markdown-security' Issue title realtime Update CHANGELOG.md for 8.16.9 Update CHANGELOG.md for 8.17.5 Update CHANGELOG.md for 9.0.4 Add "search" optional param and docs for V4 Use PDFLab to render PDFs in GitLab Separate Scala from Java in CI examples Fix broken link Reorganize CI examples, add more links Refactor CI index page Remove deprecated field from workhorse response Use gitlab-workhorse 1.4.3 Document how ETag caching middleware handles query parameters Make group skip validation in the frontend Use NamespaceValidator::WILDCARD_ROUTES in ETag caching middleware ...
| * Fix subgroup repository disappearance if group was moveddz-fix-group-moveDmitriy Zaporozhets2017-04-051-13/+38
| | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* | Fix namespace specs related to container registryGrzegorz Bizon2017-04-031-1/+3
| |
* | Refactor container registry repository tag stubsGrzegorz Bizon2017-04-031-1/+1
| |
* | Merge branch 'master' into feature/multi-level-container-registry-imagesGrzegorz Bizon2017-04-031-10/+69
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (230 commits) Fix N+1 query in loading pipelines in merge requests Fix Spinach and Capybara dependencies Prevent users from disconnecting gitlab account from CAS 30276 Move issue, mr, todos next to profile dropdown in top nav Refactor SearchController#show Properly eagerly-load the Capybara server for JS feature specs only Updating documentation to include a missing step in the update procedure Eager-load the Capybara server to prevent timeouts Increase Capybara's timeout Add metrics button to Environment Overview page Fix link to Jira service documentation Handle parsing OpenBSD ps output properly to display sidekiq infos on ... Eliminate unnecessary queries that add ~500 ms of load time for a large issue 20914 Limits line length for project home page Allow users to import GitHub projects to subgroups Update dpl CI example Fix the docs:check:links job Don't clean up the gitlab-test-fork_bare repo Make GitLab use Gitaly for commit_is_ancestor Remove unnecessary ORDER BY clause from `forked_to_project_id` subquery ...
| * Merge branch '29843-project-subgroup-transfer' into 'security'Rémy Coutable2017-03-291-10/+69
| | | | | | | | | | | | Use full path for moving directories when changing namespace path See merge request !2078
* | Merge branch 'master' into feature/multi-level-container-registry-imagesGrzegorz Bizon2017-03-271-2/+4
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (192 commits) Implement new service for creating user Update sentry-raven 2.0.2 -> 2.4.0 Update webmock 1.21.0 -> 1.24.6 Update spring 1.7.2 -> 2.0.1 Update simplecov 0.12.0 -> 0.14.1 Update pry-rails 0.3.4 -> 0.3.5 Update pry-byebug 3.4.1 -> 3.4.2 Update flay 2.6.1 -> 2.8.1 Remove Tags filter from Projects Explore dropdown Update capybara-screenshot 1.0.11 -> 1.0.14 Update bullet 5.2.0 -> 5.5.1 Update brakeman 3.4.1 -> 3.6.1 Remove web-console gem Update better_errors 1.0.1 -> 2.1.1 Display flash message to unauthenticated user when creating new issue Fix up emoji tests that should have failed :/ Fix RSpec/DescribeSymbol cop violations Add event limit warning all tabs Cycle Analytics Adding non_archived scope for counting projects Resolve "Gitlab administrator cannot create projects in every group" ... Conflicts: db/schema.rb
| * Fix RSpec/DescribeSymbol cop violationsRobert Speicher2017-03-241-1/+1
| |
| * Add spec that tests ‘LIKE’ query for routes with _Jarka Kadlecova2017-03-221-1/+3
| |
* | Rename container image to repository in specsGrzegorz Bizon2017-03-231-2/+2
| |