diff options
author | Stan Hu <stanhu@gmail.com> | 2019-04-24 15:50:45 +0000 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-04-24 15:50:45 +0000 |
commit | 23e5d9edcee5c0504bec9aade0e5abbb86ce06b1 (patch) | |
tree | c70ebb687b951e80abea971d1d2cc882e97db113 | |
parent | 90ddfda612eba5533dccebbba205bac9dd8f0ac6 (diff) | |
parent | ef67a54afa19f16585f8b78bc44ad6c91a7724b0 (diff) | |
download | gitlab-ce-23e5d9edcee5c0504bec9aade0e5abbb86ce06b1.tar.gz |
Merge branch '54656-500-error-on-save-of-general-pipeline-settings-timeout' into 'master'
Resolve "500 error on save of general pipeline settings timeout"
Closes gitlab-ee#11281
See merge request gitlab-org/gitlab-ce!27416
3 files changed, 15 insertions, 1 deletions
diff --git a/app/controllers/projects/settings/ci_cd_controller.rb b/app/controllers/projects/settings/ci_cd_controller.rb index d1c5cef76fa..c4dff95a4b9 100644 --- a/app/controllers/projects/settings/ci_cd_controller.rb +++ b/app/controllers/projects/settings/ci_cd_controller.rb @@ -19,7 +19,7 @@ module Projects redirect_to project_settings_ci_cd_path(@project) else - render 'show' + redirect_to project_settings_ci_cd_path(@project), alert: result[:message] end end end diff --git a/changelogs/unreleased/54656-500-error-on-save-of-general-pipeline-settings-timeout.yml b/changelogs/unreleased/54656-500-error-on-save-of-general-pipeline-settings-timeout.yml new file mode 100644 index 00000000000..8b4f4894048 --- /dev/null +++ b/changelogs/unreleased/54656-500-error-on-save-of-general-pipeline-settings-timeout.yml @@ -0,0 +1,5 @@ +--- +title: Fix 500 in general pipeline settings when passing an invalid build timeout. +merge_request: 27416 +author: +type: fixed diff --git a/spec/controllers/projects/settings/ci_cd_controller_spec.rb b/spec/controllers/projects/settings/ci_cd_controller_spec.rb index fc9a0adeed2..db53e5bc8a4 100644 --- a/spec/controllers/projects/settings/ci_cd_controller_spec.rb +++ b/spec/controllers/projects/settings/ci_cd_controller_spec.rb @@ -191,6 +191,15 @@ describe Projects::Settings::CiCdController do expect(project.build_timeout).to eq(5400) end end + + context 'when build_timeout_human_readable is invalid' do + let(:params) { { build_timeout_human_readable: '5m' } } + + it 'set specified timeout' do + expect(subject).to set_flash[:alert] + expect(response).to redirect_to(namespace_project_settings_ci_cd_path) + end + end end end end |