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
c68b31bf
Commit
c68b31bf
authored
Jun 16, 2021
by
Spencer Phillip Young
Committed by
Michael Kozono
Jun 16, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only update required instance CI template when the parameter is present
Changelog: fixed
parent
ee5bcb32
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
4 deletions
+13
-4
app/controllers/admin/application_settings_controller.rb
app/controllers/admin/application_settings_controller.rb
+5
-4
ee/spec/controllers/admin/application_settings_controller_spec.rb
...controllers/admin/application_settings_controller_spec.rb
+8
-0
No files found.
app/controllers/admin/application_settings_controller.rb
View file @
c68b31bf
...
@@ -208,7 +208,10 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
...
@@ -208,7 +208,10 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
params
[
:application_setting
][
:import_sources
]
&
.
delete
(
""
)
params
[
:application_setting
][
:import_sources
]
&
.
delete
(
""
)
params
[
:application_setting
][
:restricted_visibility_levels
]
&
.
delete
(
""
)
params
[
:application_setting
][
:restricted_visibility_levels
]
&
.
delete
(
""
)
params
[
:application_setting
][
:required_instance_ci_template
]
=
nil
if
params
[
:application_setting
][
:required_instance_ci_template
].
blank?
if
params
[
:application_setting
].
key?
(
:required_instance_ci_template
)
params
[
:application_setting
][
:required_instance_ci_template
]
=
nil
if
params
[
:application_setting
][
:required_instance_ci_template
].
empty?
end
remove_blank_params_for!
(
:elasticsearch_aws_secret_access_key
,
:eks_secret_access_key
)
remove_blank_params_for!
(
:elasticsearch_aws_secret_access_key
,
:eks_secret_access_key
)
...
@@ -217,9 +220,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
...
@@ -217,9 +220,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
params
.
delete
(
:domain_denylist_raw
)
if
params
[
:domain_denylist
]
params
.
delete
(
:domain_denylist_raw
)
if
params
[
:domain_denylist
]
params
.
delete
(
:domain_allowlist_raw
)
if
params
[
:domain_allowlist
]
params
.
delete
(
:domain_allowlist_raw
)
if
params
[
:domain_allowlist
]
params
.
require
(
:application_setting
).
permit
(
params
[
:application_setting
].
permit
(
visible_application_setting_attributes
)
visible_application_setting_attributes
)
end
end
def
recheck_user_consent?
def
recheck_user_consent?
...
...
ee/spec/controllers/admin/application_settings_controller_spec.rb
View file @
c68b31bf
...
@@ -194,6 +194,14 @@ RSpec.describe Admin::ApplicationSettingsController do
...
@@ -194,6 +194,14 @@ RSpec.describe Admin::ApplicationSettingsController do
expect
(
ApplicationSetting
.
current
.
required_instance_ci_template
).
to
be_nil
expect
(
ApplicationSetting
.
current
.
required_instance_ci_template
).
to
be_nil
end
end
end
end
context
'without key'
do
it
'does not set required_instance_ci_template to nil'
do
put
:update
,
params:
{
application_setting:
{}
}
expect
(
ApplicationSetting
.
current
.
required_instance_ci_template
).
to
be
==
'Auto-DevOps'
end
end
end
end
end
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