Commit f6fdaa51 authored by Eugie Limpin's avatar Eugie Limpin Committed by Natalia Tepluhina

Add "Enable pipeline suggestion banner" setting

parent f6093ed9
...@@ -400,7 +400,8 @@ module ApplicationSettingsHelper ...@@ -400,7 +400,8 @@ module ApplicationSettingsHelper
:user_deactivation_emails_enabled, :user_deactivation_emails_enabled,
:sidekiq_job_limiter_mode, :sidekiq_job_limiter_mode,
:sidekiq_job_limiter_compression_threshold_bytes, :sidekiq_job_limiter_compression_threshold_bytes,
:sidekiq_job_limiter_limit_bytes :sidekiq_job_limiter_limit_bytes,
:suggest_pipeline_enabled
].tap do |settings| ].tap do |settings|
settings << :deactivate_dormant_users unless Gitlab.com? settings << :deactivate_dormant_users unless Gitlab.com?
end end
......
...@@ -159,6 +159,7 @@ module ApplicationSettingImplementation ...@@ -159,6 +159,7 @@ module ApplicationSettingImplementation
spam_check_endpoint_enabled: false, spam_check_endpoint_enabled: false,
spam_check_endpoint_url: nil, spam_check_endpoint_url: nil,
spam_check_api_key: nil, spam_check_api_key: nil,
suggest_pipeline_enabled: true,
terminal_max_session_time: 0, terminal_max_session_time: 0,
throttle_authenticated_api_enabled: false, throttle_authenticated_api_enabled: false,
throttle_authenticated_api_period_in_seconds: 3600, throttle_authenticated_api_period_in_seconds: 3600,
......
...@@ -69,5 +69,12 @@ ...@@ -69,5 +69,12 @@
%p.form-text.text-muted %p.form-text.text-muted
= _("The default CI/CD configuration file and path for new projects.").html_safe = _("The default CI/CD configuration file and path for new projects.").html_safe
= link_to sprite_icon('question-o'), help_page_path('ci/pipelines/settings', anchor: 'specify-a-custom-cicd-configuration-file'), target: '_blank' = link_to sprite_icon('question-o'), help_page_path('ci/pipelines/settings', anchor: 'specify-a-custom-cicd-configuration-file'), target: '_blank'
.form-group
.form-check
= f.check_box :suggest_pipeline_enabled, class: 'form-check-input'
= f.label :suggest_pipeline_enabled, class: 'form-check-label' do
= s_('AdminSettings|Enable pipeline suggestion banner')
.form-text.text-muted
= s_('AdminSettings|Display a banner on merge requests in projects with no pipelines to initiate steps to add a .gitlab-ci.yml file.')
= f.submit _('Save changes'), class: "gl-button btn btn-confirm" = f.submit _('Save changes'), class: "gl-button btn btn-confirm"
...@@ -216,6 +216,20 @@ of your GitLab instance (`.gitlab-ci.yml` if not set): ...@@ -216,6 +216,20 @@ of your GitLab instance (`.gitlab-ci.yml` if not set):
It is also possible to specify a [custom CI/CD configuration file for a specific project](../../../ci/pipelines/settings.md#specify-a-custom-cicd-configuration-file). It is also possible to specify a [custom CI/CD configuration file for a specific project](../../../ci/pipelines/settings.md#specify-a-custom-cicd-configuration-file).
## Enable or disable the pipeline suggestion banner
By default, a banner displays in merge requests with no pipeline suggesting a
walkthrough on how to add one.
![Suggest pipeline banner](img/suggest_pipeline_banner.png)
To enable or disable the banner:
1. On the top bar, select **Menu > Admin**.
1. On the left sidebar, select **Settings > CI/CD**.
1. Select or clear the **Enable pipeline suggestion banner** checkbox.
1. Select **Save changes**.
## Required pipeline configuration **(PREMIUM SELF)** ## Required pipeline configuration **(PREMIUM SELF)**
WARNING: WARNING:
......
...@@ -2401,9 +2401,15 @@ msgstr "" ...@@ -2401,9 +2401,15 @@ msgstr ""
msgid "AdminSettings|Disable public access to Pages sites" msgid "AdminSettings|Disable public access to Pages sites"
msgstr "" msgstr ""
msgid "AdminSettings|Display a banner on merge requests in projects with no pipelines to initiate steps to add a .gitlab-ci.yml file."
msgstr ""
msgid "AdminSettings|Domain verification is an essential security measure for public GitLab sites. Users are required to demonstrate they control a domain before it is enabled. %{link_start}Learn more.%{link_end}" msgid "AdminSettings|Domain verification is an essential security measure for public GitLab sites. Users are required to demonstrate they control a domain before it is enabled. %{link_start}Learn more.%{link_end}"
msgstr "" msgstr ""
msgid "AdminSettings|Enable pipeline suggestion banner"
msgstr ""
msgid "AdminSettings|Enable shared runners for new projects" msgid "AdminSettings|Enable shared runners for new projects"
msgstr "" msgstr ""
......
...@@ -314,12 +314,14 @@ RSpec.describe 'Admin updates settings' do ...@@ -314,12 +314,14 @@ RSpec.describe 'Admin updates settings' do
check 'Default to Auto DevOps pipeline for all projects' check 'Default to Auto DevOps pipeline for all projects'
fill_in 'application_setting_auto_devops_domain', with: 'domain.com' fill_in 'application_setting_auto_devops_domain', with: 'domain.com'
uncheck 'Keep the latest artifacts for all jobs in the latest successful pipelines' uncheck 'Keep the latest artifacts for all jobs in the latest successful pipelines'
uncheck 'Enable pipeline suggestion banner'
click_button 'Save changes' click_button 'Save changes'
end end
expect(current_settings.auto_devops_enabled?).to be true expect(current_settings.auto_devops_enabled?).to be true
expect(current_settings.auto_devops_domain).to eq('domain.com') expect(current_settings.auto_devops_domain).to eq('domain.com')
expect(current_settings.keep_latest_artifact).to be false expect(current_settings.keep_latest_artifact).to be false
expect(current_settings.suggest_pipeline_enabled).to be false
expect(page).to have_content "Application settings saved successfully" expect(page).to have_content "Application settings saved successfully"
end end
......
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