Commit b9866919 authored by Robert Speicher's avatar Robert Speicher

Merge branch...

Merge branch 'ee-43662-can-t-modify-frozen-hash-error-in-development-when-running-a-rake-task' into 'master'

[EE] Fix a "can't modify frozen Hash" error in lib/api/services.rb in development env

See merge request gitlab-org/gitlab-ee!4748
parents adf64460 24e1a608
...@@ -139,7 +139,7 @@ module API ...@@ -139,7 +139,7 @@ module API
} }
].freeze ].freeze
SERVICES = { services = {
'asana' => [ 'asana' => [
{ {
required: true, required: true,
...@@ -719,9 +719,9 @@ module API ...@@ -719,9 +719,9 @@ module API
desc: 'Should unstable builds be treated as passing?' desc: 'Should unstable builds be treated as passing?'
} }
] ]
}.freeze }
SERVICE_CLASSES = [ service_classes = [
AsanaService, AsanaService,
AssemblaService, AssemblaService,
BambooService, BambooService,
...@@ -752,10 +752,10 @@ module API ...@@ -752,10 +752,10 @@ module API
TeamcityService, TeamcityService,
JenkinsService, JenkinsService,
JenkinsDeprecatedService JenkinsDeprecatedService
].freeze ]
if Rails.env.development? if Rails.env.development?
SERVICES['mock-ci'] = [ services['mock-ci'] = [
{ {
required: true, required: true,
name: :mock_service_url, name: :mock_service_url,
...@@ -763,16 +763,19 @@ module API ...@@ -763,16 +763,19 @@ module API
desc: 'URL to the mock service' desc: 'URL to the mock service'
} }
] ]
SERVICES['mock-deployment'] = [] services['mock-deployment'] = []
SERVICES['mock-monitoring'] = [] services['mock-monitoring'] = []
SERVICE_CLASSES += [ service_classes += [
MockCiService, MockCiService,
MockDeploymentService, MockDeploymentService,
MockMonitoringService MockMonitoringService
] ]
end end
SERVICES = services.freeze
SERVICE_CLASSES = service_classes.freeze
SERVICE_CLASSES.each do |service| SERVICE_CLASSES.each do |service|
event_names = service.try(:event_names) || next event_names = service.try(:event_names) || next
event_names.each do |event_name| event_names.each do |event_name|
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment