Commit 5b12631c authored by Martin Wortschack's avatar Martin Wortschack

Merge branch '207203-forward-deployment-ui' into 'master'

"Drop older active deployment" UI setting

See merge request gitlab-org/gitlab!25520
parents abdc3fd3 d33513a8
...@@ -66,7 +66,7 @@ module Projects ...@@ -66,7 +66,7 @@ module Projects
[ [
:runners_token, :builds_enabled, :build_allow_git_fetch, :runners_token, :builds_enabled, :build_allow_git_fetch,
:build_timeout_human_readable, :build_coverage_regex, :public_builds, :build_timeout_human_readable, :build_coverage_regex, :public_builds,
:auto_cancel_pending_pipelines, :ci_config_path, :auto_cancel_pending_pipelines, :forward_deployment_enabled, :ci_config_path,
auto_devops_attributes: [:id, :domain, :enabled, :deploy_strategy], auto_devops_attributes: [:id, :domain, :enabled, :deploy_strategy],
ci_cd_settings_attributes: [:default_git_depth] ci_cd_settings_attributes: [:default_git_depth]
].tap do |list| ].tap do |list|
......
...@@ -31,7 +31,7 @@ class ProjectCiCdSetting < ApplicationRecord ...@@ -31,7 +31,7 @@ class ProjectCiCdSetting < ApplicationRecord
end end
def forward_deployment_enabled? def forward_deployment_enabled?
super && ::Feature.enabled?(:forward_deployment_enabled, project) super && ::Feature.enabled?(:forward_deployment_enabled, project, default_enabled: true)
end end
private private
......
...@@ -88,6 +88,15 @@ ...@@ -88,6 +88,15 @@
= _("New pipelines will cancel older, pending pipelines on the same branch") = _("New pipelines will cancel older, pending pipelines on the same branch")
= link_to icon('question-circle'), help_page_path('user/project/pipelines/settings', anchor: 'auto-cancel-pending-pipelines'), target: '_blank' = link_to icon('question-circle'), help_page_path('user/project/pipelines/settings', anchor: 'auto-cancel-pending-pipelines'), target: '_blank'
.form-group
.form-check
= f.check_box :forward_deployment_enabled, { class: 'form-check-input' }
= f.label :forward_deployment_enabled, class: 'form-check-label' do
%strong= _("Skip older, pending deployment jobs")
.form-text.text-muted
= _("When a deployment job is successful, skip older deployment jobs that are still pending")
= link_to icon('question-circle'), help_page_path('user/project/pipelines/settings', anchor: 'skip-older-pending-deployment-jobs'), target: '_blank'
%hr %hr
.form-group .form-group
= f.label :build_coverage_regex, _("Test coverage parsing"), class: 'label-bold' = f.label :build_coverage_regex, _("Test coverage parsing"), class: 'label-bold'
......
---
title: Added Drop older active deployments project setting
merge_request: 25520
author:
type: added
...@@ -191,6 +191,25 @@ you can enable this in the project settings: ...@@ -191,6 +191,25 @@ you can enable this in the project settings:
1. Check the **Auto-cancel redundant, pending pipelines** checkbox. 1. Check the **Auto-cancel redundant, pending pipelines** checkbox.
1. Click **Save changes**. 1. Click **Save changes**.
## Skip older, pending deployment jobs
> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/25276) in GitLab 12.9.
Your project may have multiple concurrent deployment jobs that are
scheduled to run within the same time frame.
This can lead to a situation where an older deployment job runs after a
newer one, which may not be what you want.
To avoid this scenario:
1. Go to **{settings}** **Settings > CI / CD**.
1. Expand **General pipelines**.
1. Check the **Skip older, pending deployment jobs** checkbox.
1. Click **Save changes**.
The pending deployment jobs will be skipped.
## Pipeline Badges ## Pipeline Badges
In the pipelines settings page you can find pipeline status and test coverage In the pipelines settings page you can find pipeline status and test coverage
......
...@@ -17914,6 +17914,9 @@ msgstr "" ...@@ -17914,6 +17914,9 @@ msgstr ""
msgid "Size settings for static websites" msgid "Size settings for static websites"
msgstr "" msgstr ""
msgid "Skip older, pending deployment jobs"
msgstr ""
msgid "Skip this for now" msgid "Skip this for now"
msgstr "" msgstr ""
...@@ -22049,6 +22052,9 @@ msgstr "" ...@@ -22049,6 +22052,9 @@ msgstr ""
msgid "What are you searching for?" msgid "What are you searching for?"
msgstr "" msgstr ""
msgid "When a deployment job is successful, skip older deployment jobs that are still pending"
msgstr ""
msgid "When a runner is locked, it cannot be assigned to other projects" msgid "When a runner is locked, it cannot be assigned to other projects"
msgstr "" msgstr ""
......
...@@ -61,6 +61,28 @@ describe "Projects > Settings > Pipelines settings" do ...@@ -61,6 +61,28 @@ describe "Projects > Settings > Pipelines settings" do
expect(checkbox).to be_checked expect(checkbox).to be_checked
end end
it 'updates forward_deployment_enabled' do
visit project_settings_ci_cd_path(project)
checkbox = find_field('project_forward_deployment_enabled')
expect(checkbox).to be_checked
checkbox.set(false)
page.within '#js-general-pipeline-settings' do
click_on 'Save changes'
end
expect(page.status_code).to eq(200)
page.within '#js-general-pipeline-settings' do
expect(page).to have_button('Save changes', disabled: false)
end
checkbox = find_field('project_forward_deployment_enabled')
expect(checkbox).not_to be_checked
end
describe 'Auto DevOps' do describe 'Auto DevOps' do
context 'when auto devops is turned on instance-wide' do context 'when auto devops is turned on instance-wide' do
before do before do
......
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