- 17 Oct, 2017 1 commit
-
-
Bob Van Landuyt authored
The problem would occur when the `ForkedProjectLink` was deleted, but the `ForkNetworkMember` was not. The delete would be rolled back and retried. But the error would not be saved because `Project#forked?` would still be true, because the `ForkNetworkMember` exists. But the `Project#forked_project_link` would be `nil`. So the validation for the visibility level would fail.
-
- 07 Oct, 2017 1 commit
-
-
Bob Van Landuyt authored
So we can keep showing it to a user in his project page.
-
- 14 Aug, 2017 1 commit
-
-
Tiago Botelho authored
Fix positive raise_error expectation without specifying the error type expected in Project::DestroyService specs
-
- 27 Jul, 2017 2 commits
-
-
Rémy Coutable authored
Signed-off-by:
Rémy Coutable <remy@rymai.me>
-
Rémy Coutable authored
Remove superfluous lib: true, type: redis, service: true, models: true, services: true, no_db: true, api: true Signed-off-by:
Rémy Coutable <remy@rymai.me>
-
- 26 Jul, 2017 1 commit
-
-
Tiago Botelho authored
-
- 20 Jul, 2017 1 commit
-
-
Timothy Andrew authored
1. Rescue all errors that `Projects::DestroyService` might throw, to prevent the worker from leaving things in an inconsistent state 2. Unmark the project as `pending_delete` 3. Add a `delete_error` text column to `projects`, and save the error message in there, to be shown to the project masters/owners.
-
- 11 Jul, 2017 1 commit
-
-
Paul Charlton authored
-
- 24 Jun, 2017 1 commit
-
-
Gabriel Mazetto authored
-
- 17 May, 2017 1 commit
-
-
Yorick Peterse authored
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.
-
- 04 Apr, 2017 1 commit
-
-
Grzegorz Bizon authored
-
- 03 Apr, 2017 1 commit
-
-
Grzegorz Bizon authored
-
- 31 Mar, 2017 1 commit
-
-
Grzegorz Bizon authored
-
- 28 Mar, 2017 1 commit
-
-
Robert Speicher authored
-
- 24 Mar, 2017 1 commit
-
-
Grzegorz Bizon authored
-
- 23 Mar, 2017 2 commits
-
-
Grzegorz Bizon authored
-
Grzegorz Bizon authored
-
- 22 Feb, 2017 1 commit
-
-
Andre Guedes authored
-
- 19 Feb, 2017 1 commit
-
-
Stan Hu authored
There are two issues with truncating the project team early: 1. `Projects::UnlinkForkService` may not close merge requests properly since permissions may be revoked early. 2. If an error is encountered during flushing of caches, then the user will lose all privileges, possibly causing an issue on deletion on retry.
-
- 03 Feb, 2017 2 commits
-
-
Lin Jen-Shin authored
-
Lin Jen-Shin authored
-
- 01 Dec, 2016 1 commit
-
-
Lin Jen-Shin authored
For now deleting with optimistic locking is broken when lock_version is still NULL, because Rails would try to delete with `lock_version = 0` while in the database the column is still `NULL`. The monkey patches would force Rails just pass whatever in the column, and stop Rails from casting `NULL` into `0` when the value is read from database. Closes #24766
-
- 05 Oct, 2016 1 commit
-
-
Stan Hu authored
Projects that are destroyed are put in the pending_delete state. The ProjectDestroyWorker checks whether the current user has access, but since the ProjectFeature class uses the default scope of the Project, it will not be able to find the right project. This was a regression in 8.12 that caused the following stack trace: ``` NoMethodError: undefined method `team' for nil:NilClass from app/models/project_feature.rb:62:in `get_permission' from app/models/project_feature.rb:34:in `feature_available?' from app/models/project.rb:21:in `feature_available?' from app/policies/project_policy.rb:170:in `disabled_features!' from app/policies/project_policy.rb:29:in `rules' from app/policies/base_policy.rb:82:in `block in abilities' from app/policies/base_policy.rb:113:in `collect_rules' from app/policies/base_policy.rb:82:in `abilities' from app/policies/base_policy.rb:50:in `abilities' from app/models/ability.rb:64:in `uncached_allowed' from app/models/ability.rb:58:in `allowed' from app/models/ability.rb:49:in `allowed?' from app/services/base_service.rb:11:in `can?' from lib/gitlab/metrics/instrumentation.rb:155:in `block in can?' from lib/gitlab/metrics/method_call.rb:23:in `measure' from lib/gitlab/metrics/instrumentation.rb:155:in `can?' from app/services/projects/destroy_service.rb:18:in `execute' ``` Closes #22948
-
- 03 Jun, 2016 2 commits
-
-
James Lopez authored
This reverts commit 7a0cd631f3f5.
-
James Lopez authored
# Conflicts: # app/models/project.rb
-
- 16 May, 2016 2 commits
-
-
Kamil Trzcinski authored
-
Kamil Trzcinski authored
-
- 08 May, 2016 1 commit
-
-
Connor Shea authored
This reports uses of `File.exists?` and `Dir.exists?`, which were both deprecated in Ruby and will eventually be removed in favor of `.exist?`. Also fixes all existing uses of the deprecated methods.
-
- 09 Dec, 2015 1 commit
-
-
Douwe Maan authored
-
- 13 Jun, 2015 2 commits
-
-
Robert Speicher authored
-
Robert Speicher authored
-
- 03 Jun, 2015 1 commit
-
-
Dmitriy Zaporozhets authored
Signed-off-by:
Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
-