Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
e35a8709
Commit
e35a8709
authored
Aug 16, 2018
by
Yorick Peterse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable DestroyAll for all existing EE offenses
parent
9e5843d4
Changes
20
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
32 additions
and
32 deletions
+32
-32
app/models/members/project_member.rb
app/models/members/project_member.rb
+2
-2
app/models/project_group_link.rb
app/models/project_group_link.rb
+2
-2
app/services/protected_branches/legacy_api_update_service.rb
app/services/protected_branches/legacy_api_update_service.rb
+8
-8
ee/app/controllers/groups/ldap_group_links_controller.rb
ee/app/controllers/groups/ldap_group_links_controller.rb
+1
-1
ee/app/services/concerns/cleanup_approvers.rb
ee/app/services/concerns/cleanup_approvers.rb
+2
-2
ee/app/services/merge_requests/remove_approval_service.rb
ee/app/services/merge_requests/remove_approval_service.rb
+1
-1
ee/spec/controllers/projects/settings/integrations_controller_spec.rb
...rollers/projects/settings/integrations_controller_spec.rb
+1
-1
ee/spec/features/admin/licenses/admin_uploads_license_spec.rb
...pec/features/admin/licenses/admin_uploads_license_spec.rb
+1
-1
ee/spec/lib/gitlab/database/load_balancing_spec.rb
ee/spec/lib/gitlab/database/load_balancing_spec.rb
+1
-1
ee/spec/models/burndown_spec.rb
ee/spec/models/burndown_spec.rb
+2
-2
ee/spec/models/license_spec.rb
ee/spec/models/license_spec.rb
+1
-1
ee/spec/models/project_services/jenkins_deprecated_service_spec.rb
...odels/project_services/jenkins_deprecated_service_spec.rb
+1
-1
ee/spec/models/project_services/jenkins_service_spec.rb
ee/spec/models/project_services/jenkins_service_spec.rb
+1
-1
ee/spec/models/project_spec.rb
ee/spec/models/project_spec.rb
+2
-2
ee/spec/spec_helper.rb
ee/spec/spec_helper.rb
+1
-1
ee/spec/workers/historical_data_worker_spec.rb
ee/spec/workers/historical_data_worker_spec.rb
+1
-1
ee/spec/workers/ldap_all_groups_sync_worker_spec.rb
ee/spec/workers/ldap_all_groups_sync_worker_spec.rb
+1
-1
ee/spec/workers/ldap_group_sync_worker_spec.rb
ee/spec/workers/ldap_group_sync_worker_spec.rb
+1
-1
ee/spec/workers/ldap_sync_worker_spec.rb
ee/spec/workers/ldap_sync_worker_spec.rb
+1
-1
spec/services/merge_requests/update_service_spec.rb
spec/services/merge_requests/update_service_spec.rb
+1
-1
No files found.
app/models/members/project_member.rb
View file @
e35a8709
...
...
@@ -97,8 +97,8 @@ class ProjectMember < Member
def
delete_member_branch_protection
if
user
.
present?
&&
project
.
present?
project
.
protected_branches
.
merge_access_by_user
(
user
).
destroy_all
project
.
protected_branches
.
push_access_by_user
(
user
).
destroy_all
project
.
protected_branches
.
merge_access_by_user
(
user
).
destroy_all
# rubocop: disable DestroyAll
project
.
protected_branches
.
push_access_by_user
(
user
).
destroy_all
# rubocop: disable DestroyAll
end
end
...
...
app/models/project_group_link.rb
View file @
e35a8709
...
...
@@ -51,8 +51,8 @@ class ProjectGroupLink < ActiveRecord::Base
def
delete_branch_protection
if
group
.
present?
&&
project
.
present?
project
.
protected_branches
.
merge_access_by_group
(
group
).
destroy_all
project
.
protected_branches
.
push_access_by_group
(
group
).
destroy_all
project
.
protected_branches
.
merge_access_by_group
(
group
).
destroy_all
# rubocop: disable DestroyAll
project
.
protected_branches
.
push_access_by_group
(
group
).
destroy_all
# rubocop: disable DestroyAll
end
end
...
...
app/services/protected_branches/legacy_api_update_service.rb
View file @
e35a8709
...
...
@@ -38,11 +38,11 @@ module ProtectedBranches
def
delete_redundant_access_levels
unless
@developers_can_merge
.
nil?
@protected_branch
.
merge_access_levels
.
destroy_all
# rubocop: disable DestroyAll
@protected_branch
.
merge_access_levels
.
destroy_all
# rubocop: disable DestroyAll
# rubocop: disable DestroyAll
end
unless
@developers_can_push
.
nil?
@protected_branch
.
push_access_levels
.
destroy_all
# rubocop: disable DestroyAll
@protected_branch
.
push_access_levels
.
destroy_all
# rubocop: disable DestroyAll
# rubocop: disable DestroyAll
end
end
...
...
@@ -52,18 +52,18 @@ module ProtectedBranches
def
delete_redundant_ee_access_levels
case
@developers_can_merge
when
true
@protected_branch
.
merge_access_levels
.
developer
.
destroy_all
@protected_branch
.
merge_access_levels
.
developer
.
destroy_all
# rubocop: disable DestroyAll
when
false
@protected_branch
.
merge_access_levels
.
developer
.
destroy_all
@protected_branch
.
merge_access_levels
.
maintainer
.
destroy_all
@protected_branch
.
merge_access_levels
.
developer
.
destroy_all
# rubocop: disable DestroyAll
@protected_branch
.
merge_access_levels
.
maintainer
.
destroy_all
# rubocop: disable DestroyAll
end
case
@developers_can_push
when
true
@protected_branch
.
push_access_levels
.
developer
.
destroy_all
@protected_branch
.
push_access_levels
.
developer
.
destroy_all
# rubocop: disable DestroyAll
when
false
@protected_branch
.
push_access_levels
.
developer
.
destroy_all
@protected_branch
.
push_access_levels
.
maintainer
.
destroy_all
@protected_branch
.
push_access_levels
.
developer
.
destroy_all
# rubocop: disable DestroyAll
@protected_branch
.
push_access_levels
.
maintainer
.
destroy_all
# rubocop: disable DestroyAll
end
end
end
...
...
ee/app/controllers/groups/ldap_group_links_controller.rb
View file @
e35a8709
...
...
@@ -26,7 +26,7 @@ class Groups::LdapGroupLinksController < Groups::ApplicationController
end
def
destroy
@group
.
ldap_group_links
.
where
(
id:
params
[
:id
]).
destroy_all
@group
.
ldap_group_links
.
where
(
id:
params
[
:id
]).
destroy_all
# rubocop: disable DestroyAll
redirect_back_or_default
(
default:
{
action:
'index'
},
options:
{
notice:
'LDAP link removed'
})
end
...
...
ee/app/services/concerns/cleanup_approvers.rb
View file @
e35a8709
...
...
@@ -7,8 +7,8 @@ module CleanupApprovers
private
def
cleanup_approvers
(
target
,
reload:
false
)
target
.
approvers
.
where
.
not
(
user_id:
params
[
:approver_ids
]).
destroy_all
target
.
approver_groups
.
where
.
not
(
group_id:
params
[
:approver_group_ids
]).
destroy_all
target
.
approvers
.
where
.
not
(
user_id:
params
[
:approver_ids
]).
destroy_all
# rubocop: disable DestroyAll
target
.
approver_groups
.
where
.
not
(
group_id:
params
[
:approver_group_ids
]).
destroy_all
# rubocop: disable DestroyAll
# If the target already has `approvers` and/or `approver_groups` loaded then we need to
# force a reload in order to not return stale information after the destroys above
...
...
ee/app/services/merge_requests/remove_approval_service.rb
View file @
e35a8709
...
...
@@ -8,7 +8,7 @@ module MergeRequests
currently_approved
=
merge_request
.
approved?
if
approval
.
destroy_all
if
approval
.
destroy_all
# rubocop: disable DestroyAll
merge_request
.
reset_approval_cache!
create_note
(
merge_request
)
...
...
ee/spec/controllers/projects/settings/integrations_controller_spec.rb
View file @
e35a8709
...
...
@@ -48,7 +48,7 @@ describe Projects::Settings::IntegrationsController do
context
'without a license key'
do
before
do
License
.
destroy_all
License
.
destroy_all
# rubocop: disable DestroyAll
end
it_behaves_like
'endpoint with some disabled services'
...
...
ee/spec/features/admin/licenses/admin_uploads_license_spec.rb
View file @
e35a8709
...
...
@@ -11,7 +11,7 @@ describe "Admin uploads license" do
set
(
:license
)
{
build
(
:license
,
data:
build
(
:gitlab_license
,
restrictions:
{
active_user_count:
2000
}).
export
)
}
before
do
License
.
destroy_all
License
.
destroy_all
# rubocop: disable DestroyAll
visit
(
admin_license_path
(
trial_key:
license
.
data
))
end
...
...
ee/spec/lib/gitlab/database/load_balancing_spec.rb
View file @
e35a8709
...
...
@@ -156,7 +156,7 @@ describe Gitlab::Database::LoadBalancing do
context
'without a license'
do
before
do
License
.
destroy_all
License
.
destroy_all
# rubocop: disable DestroyAll
end
it
'is disabled'
do
...
...
ee/spec/models/burndown_spec.rb
View file @
e35a8709
...
...
@@ -53,7 +53,7 @@ describe Burndown do
context
"when all closed issues does not have closed events"
do
before
do
Event
.
where
(
target:
milestone
.
issues
,
action:
Event
::
CLOSED
).
destroy_all
Event
.
where
(
target:
milestone
.
issues
,
action:
Event
::
CLOSED
).
destroy_all
# rubocop: disable DestroyAll
end
it
"considers closed_at as milestone start date"
do
...
...
@@ -73,7 +73,7 @@ describe Burndown do
context
"when one or more closed issues does not have a closed event"
do
before
do
Event
.
where
(
target:
milestone
.
issues
.
closed
.
first
,
action:
Event
::
CLOSED
).
destroy_all
Event
.
where
(
target:
milestone
.
issues
.
closed
.
first
,
action:
Event
::
CLOSED
).
destroy_all
# rubocop: disable DestroyAll
end
it
"sets attribute accurate to false"
do
...
...
ee/spec/models/license_spec.rb
View file @
e35a8709
...
...
@@ -560,7 +560,7 @@ describe License do
let
(
:license
)
{
create
(
:license
,
trial:
true
,
expired:
true
)
}
before
(
:all
)
do
described_class
.
destroy_all
described_class
.
destroy_all
# rubocop: disable DestroyAll
end
::
License
::
EES_FEATURES
.
each
do
|
feature
|
...
...
ee/spec/models/project_services/jenkins_deprecated_service_spec.rb
View file @
e35a8709
...
...
@@ -134,7 +134,7 @@ ICON_STATUS_HTML
context
'without a license key'
do
before
do
License
.
destroy_all
License
.
destroy_all
# rubocop: disable DestroyAll
end
it_behaves_like
'a disabled jenkins deprecated service'
...
...
ee/spec/models/project_services/jenkins_service_spec.rb
View file @
e35a8709
...
...
@@ -164,7 +164,7 @@ describe JenkinsService do
context
'without a license key'
do
before
do
License
.
destroy_all
License
.
destroy_all
# rubocop: disable DestroyAll
end
it_behaves_like
'project with disabled Jenkins service'
...
...
ee/spec/models/project_spec.rb
View file @
e35a8709
...
...
@@ -774,7 +774,7 @@ describe Project do
context
'without a License'
do
before
do
License
.
destroy_all
License
.
destroy_all
# rubocop: disable DestroyAll
end
it
'is disabled'
do
...
...
@@ -1123,7 +1123,7 @@ describe Project do
context
'without a license key'
do
before
do
License
.
destroy_all
License
.
destroy_all
# rubocop: disable DestroyAll
end
it_behaves_like
'project with disabled services'
...
...
ee/spec/spec_helper.rb
View file @
e35a8709
...
...
@@ -7,7 +7,7 @@ RSpec.configure do |config|
config
.
include
EE
::
LicenseHelpers
config
.
before
(
:all
)
do
License
.
destroy_all
License
.
destroy_all
# rubocop: disable DestroyAll
TestLicense
.
init
end
...
...
ee/spec/workers/historical_data_worker_spec.rb
View file @
e35a8709
...
...
@@ -30,7 +30,7 @@ describe HistoricalDataWorker do
context
'when there is not a license key'
do
it
'does not track historical data'
do
License
.
destroy_all
License
.
destroy_all
# rubocop: disable DestroyAll
expect
(
HistoricalData
).
not_to
receive
(
:track!
)
...
...
ee/spec/workers/ldap_all_groups_sync_worker_spec.rb
View file @
e35a8709
...
...
@@ -19,7 +19,7 @@ describe LdapAllGroupsSyncWorker do
context
'without a license key'
do
before
do
License
.
destroy_all
License
.
destroy_all
# rubocop: disable DestroyAll
end
it
'does not sync all groups'
do
...
...
ee/spec/workers/ldap_group_sync_worker_spec.rb
View file @
e35a8709
...
...
@@ -35,7 +35,7 @@ describe LdapGroupSyncWorker do
context
'without a license key'
do
before
do
License
.
destroy_all
License
.
destroy_all
# rubocop: disable DestroyAll
end
it
'does not sync groups'
do
...
...
ee/spec/workers/ldap_sync_worker_spec.rb
View file @
e35a8709
...
...
@@ -21,7 +21,7 @@ describe LdapSyncWorker do
context
'without a license key'
do
before
do
License
.
destroy_all
License
.
destroy_all
# rubocop: disable DestroyAll
end
it
'does not sync LDAP users'
do
...
...
spec/services/merge_requests/update_service_spec.rb
View file @
e35a8709
...
...
@@ -448,7 +448,7 @@ describe MergeRequests::UpdateService, :mailer do
update_merge_request
(
approver_ids:
[
existing_approver
,
removed_approver
].
map
(
&
:id
).
join
(
','
))
end
Todo
.
where
(
action:
Todo
::
APPROVAL_REQUIRED
).
destroy_all
Todo
.
where
(
action:
Todo
::
APPROVAL_REQUIRED
).
destroy_all
# rubocop: disable DestroyAll
ActionMailer
::
Base
.
deliveries
.
clear
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment