Commit 05efac0b authored by Michael Kozono's avatar Michael Kozono

Merge branch '10725-restructure-project-merge-request-settings-page' into 'master'

Resolve "Restructure project merge request settings page"

Closes #10725

See merge request gitlab-org/gitlab-ee!10491
parents d7e1db1c eaccacbe
- form = local_assigns.fetch(:form)
.form-group
%b= s_('ProjectSettings|Merge checks')
%p.text-secondary= s_('ProjectSettings|These checks must pass before merge requests can be merged')
.form-check.mb-2.builds-feature{ class: ("hidden" if @project && @project.project_feature.send(:builds_access_level) == 0) }
= form.check_box :only_allow_merge_if_pipeline_succeeds, class: 'form-check-input'
= form.label :only_allow_merge_if_pipeline_succeeds, class: 'form-check-label' do
= s_('ProjectSettings|Pipelines must succeed')
.descr.text-secondary
= s_('ProjectSettings|Pipelines need to be configured to enable this feature.')
= link_to icon('question-circle'),
help_page_path('ci/merge_request_pipelines/index.md',
anchor: 'pipelines-for-merge-requests'),
target: '_blank'
.form-check.mb-2
= form.check_box :only_allow_merge_if_all_discussions_are_resolved, class: 'form-check-input'
= form.label :only_allow_merge_if_all_discussions_are_resolved, class: 'form-check-label' do
= s_('ProjectSettings|All discussions must be resolved')
- form = local_assigns.fetch(:form)
.form-group
= label_tag :merge_method_merge, class: 'label-bold' do
= _('Merge method')
.form-check
%b= s_('ProjectSettings|Merge method')
%p.text-secondary= s_('ProjectSettings|This will dictate the commit history when you merge a merge request')
.form-check.mb-2
= form.radio_button :merge_method, :merge, class: "js-merge-method-radio form-check-input"
= label_tag :project_merge_method_merge, class: 'form-check-label' do
.mb-3
= _('Merge commit')
.text-secondary
= _('A merge commit is created for every merge, and merging is allowed as long as there are no conflicts.')
= s_('ProjectSettings|Merge commit')
.descr.text-secondary
= s_('ProjectSettings|Every merge creates a merge commit')
.form-check
= form.radio_button :merge_method, :rebase_merge, class: "js-merge-method-radio form-check-input"
= label_tag :project_merge_method_rebase_merge, class: 'form-check-label' do
.mb-3
= _('Merge commit with semi-linear history')
.text-secondary
= _('A merge commit is created for every merge, but merging is only allowed if fast-forward merge is possible. This way you could make sure that if this merge request would build, after merging to target branch it would also build.')
.text-secondary
= _('When fast-forward merge is not possible, the user is given the option to rebase.')
.form-check.mb-2
= form.radio_button :merge_method, :rebase_merge, class: "js-merge-method-radio form-check-input"
= label_tag :project_merge_method_rebase_merge, class: 'form-check-label' do
= s_('ProjectSettings|Merge commit with semi-linear history')
.descr.text-secondary
= s_('ProjectSettings|Every merge creates a merge commit')
%br
= s_('ProjectSettings|Fast-forward merges only')
%br
= s_('ProjectSettings|When conflicts arise the user is given the option to rebase')
.form-check
= form.radio_button :merge_method, :ff, class: "js-merge-method-radio qa-radio-button-merge-ff form-check-input"
= label_tag :project_merge_method_ff, class: 'form-check-label' do
.mb-3
= _('Fast-forward merge')
.text-secondary
= _('No merge commits are created and all merges are fast-forwarded, which means that merging is only allowed if the branch could be fast-forwarded. When fast-forward merge is not possible, the user is given the option to rebase.')
.form-check.mb-2
= form.radio_button :merge_method, :ff, class: "js-merge-method-radio qa-radio-button-merge-ff form-check-input"
= label_tag :project_merge_method_ff, class: 'form-check-label' do
= s_('ProjectSettings|Fast-forward merge')
.descr.text-secondary
= s_('ProjectSettings|No merge commits are created')
%br
= s_('ProjectSettings|Fast-forward merges only')
%br
= s_('ProjectSettings|When conflicts arise the user is given the option to rebase')
- form = local_assigns.fetch(:form)
.form-group
%b= s_('ProjectSettings|Merge options')
%p.text-secondary= s_('ProjectSettings|Additional merge request capabilities that influence how and when merges will be performed')
= render_if_exists 'projects/merge_pipelines_settings', form: form
.form-check.mb-2
= form.check_box :resolve_outdated_diff_discussions, class: 'form-check-input'
= form.label :resolve_outdated_diff_discussions, class: 'form-check-label' do
= s_('ProjectSettings|Automatically resolve merge request diff discussions when they become outdated')
.form-check.mb-2
= form.check_box :printing_merge_request_link_enabled, class: 'form-check-input'
= form.label :printing_merge_request_link_enabled, class: 'form-check-label' do
= s_('ProjectSettings|Show link to create/view merge request when pushing from the command line')
- form = local_assigns.fetch(:form)
.form-group
.form-check.builds-feature{ class: ("hidden" if @project && @project.project_feature.send(:builds_access_level) == 0) }
= form.check_box :only_allow_merge_if_pipeline_succeeds, class: 'form-check-input'
= form.label :only_allow_merge_if_pipeline_succeeds, class: 'form-check-label' do
.mb-3
= _('Only allow merge requests to be merged if the pipeline succeeds')
.text-secondary
= _('Pipelines need to be configured to enable this feature.')
= link_to icon('question-circle'), help_page_path('user/project/merge_requests/merge_when_pipeline_succeeds', anchor: 'only-allow-merge-requests-to-be-merged-if-the-pipeline-succeeds'), target: '_blank'
= render_if_exists 'projects/merge_pipelines_settings', form: form
.form-check
= form.check_box :only_allow_merge_if_all_discussions_are_resolved, class: 'form-check-input'
= form.label :only_allow_merge_if_all_discussions_are_resolved, class: 'form-check-label' do
%p= _('Only allow merge requests to be merged if all discussions are resolved')
.form-check
= form.check_box :resolve_outdated_diff_discussions, class: 'form-check-input'
= form.label :resolve_outdated_diff_discussions, class: 'form-check-label' do
%p= _('Automatically resolve merge request diff discussions when they become outdated')
.form-check
= form.check_box :printing_merge_request_link_enabled, class: 'form-check-input'
= form.label :printing_merge_request_link_enabled, class: 'form-check-label' do
%p= _('Show link to create/view merge request when pushing from the command line')
......@@ -2,4 +2,6 @@
= render 'projects/merge_request_merge_method_settings', project: @project, form: form
= render 'projects/merge_request_merge_settings', form: form
= render 'projects/merge_request_merge_options_settings', project: @project, form: form
= render 'projects/merge_request_merge_checks_settings', project: @project, form: form
......@@ -27,7 +27,7 @@
.settings-header
%h4.settings-title.js-settings-toggle.js-settings-toggle-trigger-only= _('Merge requests')
%button.btn.btn-default.js-settings-toggle{ type: 'button' }= expanded ? _('Collapse') : _('Expand')
%p= _('Choose your merge method, set up a default merge request description template.')
%p= _('Choose your merge method, options, checks, and set up a default merge request description template.')
.settings-content
= render_if_exists 'shared/promotions/promote_mr_features'
......
---
title: Reorganize project merge request settings
merge_request: 26834
author:
type: changed
......@@ -3,8 +3,10 @@
.form-check.builds-feature
= form.check_box :merge_pipelines_enabled, class: 'form-check-input'
= form.label :merge_pipelines_enabled, class: 'form-check-label' do
%p.mb-0
= _('Merge pipelines will try to validate the post-merge result prior to merging')
.text-secondary.mb-3
= _('Pipelines need to be configured to enable this feature.')
= link_to icon('question-circle'), help_page_path('user/project/merge_requests/merge_when_pipeline_succeeds', anchor: 'only-allow-merge-requests-to-be-merged-if-the-pipeline-succeeds'), target: '_blank'
= s_('ProjectSettings|Merge pipelines will try to validate the post-merge result prior to merging')
.descr.text-secondary.mb-2
= s_('ProjectSettings|Pipelines need to be configured to enable this feature.')
= link_to icon('question-circle'),
help_page_path('ci/merge_request_pipelines/index.md',
anchor: 'pipelines-for-merge-requests'),
target: '_blank'
......@@ -2,6 +2,10 @@
= render_ce 'projects/merge_request_merge_method_settings', project: @project, form: form
= render_ce 'projects/merge_request_merge_options_settings', project: @project, form: form
= render_ce 'projects/merge_request_merge_checks_settings', project: @project, form: form
- if @project.feature_available?(:issuable_default_templates)
.form-group
= form.label :merge_requests_template, class: 'label-bold' do
......@@ -11,6 +15,3 @@
.text-secondary
- link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: help_page_path('user/markdown') }
= _('Description parsed with %{link_start}GitLab Flavored Markdown%{link_end}').html_safe % { link_start: link_start, link_end: '</a>'.html_safe }
= render_ce 'projects/merge_request_merge_settings', form: form
......@@ -470,12 +470,6 @@ msgstr ""
msgid "A member of GitLab's abuse team will review your report as soon as possible."
msgstr ""
msgid "A merge commit is created for every merge, and merging is allowed as long as there are no conflicts."
msgstr ""
msgid "A merge commit is created for every merge, but merging is only allowed if fast-forward merge is possible. This way you could make sure that if this merge request would build, after merging to target branch it would also build."
msgstr ""
msgid "A new branch will be created in your fork and a new merge request will be started."
msgstr ""
......@@ -1536,9 +1530,6 @@ msgstr ""
msgid "Automatically marked as default internal user"
msgstr ""
msgid "Automatically resolve merge request diff discussions when they become outdated"
msgstr ""
msgid "Automatically resolved"
msgstr ""
......@@ -2223,7 +2214,7 @@ msgstr ""
msgid "Choose which shards you wish to synchronize to this secondary node."
msgstr ""
msgid "Choose your merge method, set up a default merge request description template."
msgid "Choose your merge method, options, checks, and set up a default merge request description template."
msgstr ""
msgid "CiStatusLabel|canceled"
......@@ -4807,9 +4798,6 @@ msgstr ""
msgid "Failure"
msgstr ""
msgid "Fast-forward merge"
msgstr ""
msgid "Fast-forward merge without a merge commit"
msgstr ""
......@@ -7262,15 +7250,9 @@ msgstr ""
msgid "Merge Requests created"
msgstr ""
msgid "Merge commit"
msgstr ""
msgid "Merge commit message"
msgstr ""
msgid "Merge commit with semi-linear history"
msgstr ""
msgid "Merge events"
msgstr ""
......@@ -7280,12 +7262,6 @@ msgstr ""
msgid "Merge in progress"
msgstr ""
msgid "Merge method"
msgstr ""
msgid "Merge pipelines will try to validate the post-merge result prior to merging"
msgstr ""
msgid "Merge request"
msgstr ""
......@@ -7894,9 +7870,6 @@ msgstr ""
msgid "No matching results"
msgstr ""
msgid "No merge commits are created and all merges are fast-forwarded, which means that merging is only allowed if the branch could be fast-forwarded. When fast-forward merge is not possible, the user is given the option to rebase."
msgstr ""
msgid "No merge requests for the selected time period."
msgstr ""
......@@ -8127,12 +8100,6 @@ msgstr ""
msgid "Only admins"
msgstr ""
msgid "Only allow merge requests to be merged if all discussions are resolved"
msgstr ""
msgid "Only allow merge requests to be merged if the pipeline succeeds"
msgstr ""
msgid "Only mirror protected branches"
msgstr ""
......@@ -8457,9 +8424,6 @@ msgstr ""
msgid "Pipelines for last year"
msgstr ""
msgid "Pipelines need to be configured to enable this feature."
msgstr ""
msgid "Pipelines settings for '%{project_name}' were successfully updated."
msgstr ""
......@@ -9147,6 +9111,15 @@ msgstr ""
msgid "ProjectPage|Project ID: %{project_id}"
msgstr ""
msgid "ProjectSettings|Additional merge request capabilities that influence how and when merges will be performed"
msgstr ""
msgid "ProjectSettings|All discussions must be resolved"
msgstr ""
msgid "ProjectSettings|Automatically resolve merge request diff discussions when they become outdated"
msgstr ""
msgid "ProjectSettings|Badges"
msgstr ""
......@@ -9156,18 +9129,60 @@ msgstr ""
msgid "ProjectSettings|Customize your project badges."
msgstr ""
msgid "ProjectSettings|Every merge creates a merge commit"
msgstr ""
msgid "ProjectSettings|Failed to protect the tag"
msgstr ""
msgid "ProjectSettings|Failed to update tag!"
msgstr ""
msgid "ProjectSettings|Fast-forward merge"
msgstr ""
msgid "ProjectSettings|Fast-forward merges only"
msgstr ""
msgid "ProjectSettings|Learn more about badges."
msgstr ""
msgid "ProjectSettings|Merge checks"
msgstr ""
msgid "ProjectSettings|Merge commit"
msgstr ""
msgid "ProjectSettings|Merge commit with semi-linear history"
msgstr ""
msgid "ProjectSettings|Merge method"
msgstr ""
msgid "ProjectSettings|Merge options"
msgstr ""
msgid "ProjectSettings|Merge pipelines will try to validate the post-merge result prior to merging"
msgstr ""
msgid "ProjectSettings|No merge commits are created"
msgstr ""
msgid "ProjectSettings|Only signed commits can be pushed to this repository."
msgstr ""
msgid "ProjectSettings|Pipelines must succeed"
msgstr ""
msgid "ProjectSettings|Pipelines need to be configured to enable this feature."
msgstr ""
msgid "ProjectSettings|Show link to create/view merge request when pushing from the command line"
msgstr ""
msgid "ProjectSettings|These checks must pass before merge requests can be merged"
msgstr ""
msgid "ProjectSettings|This setting is applied on the server level and can be overridden by an admin."
msgstr ""
......@@ -9177,9 +9192,15 @@ msgstr ""
msgid "ProjectSettings|This setting will be applied to all projects unless overridden by an admin."
msgstr ""
msgid "ProjectSettings|This will dictate the commit history when you merge a merge request"
msgstr ""
msgid "ProjectSettings|Users can only push commits to this repository that were committed with one of their own verified emails."
msgstr ""
msgid "ProjectSettings|When conflicts arise the user is given the option to rebase"
msgstr ""
msgid "Projects"
msgstr ""
......@@ -10652,9 +10673,6 @@ msgstr ""
msgid "Show latest version"
msgstr ""
msgid "Show link to create/view merge request when pushing from the command line"
msgstr ""
msgid "Show parent pages"
msgstr ""
......@@ -13189,9 +13207,6 @@ msgstr ""
msgid "When enabled, users cannot use GitLab until the terms have been accepted."
msgstr ""
msgid "When fast-forward merge is not possible, the user is given the option to rebase."
msgstr ""
msgid "When leaving the URL blank, classification labels can still be specified without disabling cross project features or performing external authorization checks."
msgstr ""
......
# frozen_string_literal: true
require 'spec_helper'
describe 'Projects > Settings > User manages merge request settings' do
......@@ -30,16 +31,16 @@ describe 'Projects > Settings > User manages merge request settings' do
context 'when Merge Request and Pipelines are initially enabled', :js do
context 'when Pipelines are initially enabled' do
it 'shows the Merge Requests settings' do
expect(page).to have_content('Only allow merge requests to be merged if the pipeline succeeds')
expect(page).to have_content('Only allow merge requests to be merged if all discussions are resolved')
expect(page).to have_content 'Pipelines must succeed'
expect(page).to have_content 'All discussions must be resolved'
within('.sharing-permissions-form') do
find('.project-feature-controls[data-for="project[project_feature_attributes][merge_requests_access_level]"] .project-feature-toggle').click
find('input[value="Save changes"]').send_keys(:return)
end
expect(page).not_to have_content('Only allow merge requests to be merged if the pipeline succeeds')
expect(page).not_to have_content('Only allow merge requests to be merged if all discussions are resolved')
expect(page).not_to have_content 'Pipelines must succeed'
expect(page).not_to have_content 'All discussions must be resolved'
end
end
......@@ -50,16 +51,16 @@ describe 'Projects > Settings > User manages merge request settings' do
end
it 'shows the Merge Requests settings that do not depend on Builds feature' do
expect(page).not_to have_content('Only allow merge requests to be merged if the pipeline succeeds')
expect(page).to have_content('Only allow merge requests to be merged if all discussions are resolved')
expect(page).not_to have_content 'Pipelines must succeed'
expect(page).to have_content 'All discussions must be resolved'
within('.sharing-permissions-form') do
find('.project-feature-controls[data-for="project[project_feature_attributes][builds_access_level]"] .project-feature-toggle').click
find('input[value="Save changes"]').send_keys(:return)
end
expect(page).to have_content('Only allow merge requests to be merged if the pipeline succeeds')
expect(page).to have_content('Only allow merge requests to be merged if all discussions are resolved')
expect(page).to have_content 'Pipelines must succeed'
expect(page).to have_content 'All discussions must be resolved'
end
end
end
......@@ -71,16 +72,16 @@ describe 'Projects > Settings > User manages merge request settings' do
end
it 'does not show the Merge Requests settings' do
expect(page).not_to have_content('Only allow merge requests to be merged if the pipeline succeeds')
expect(page).not_to have_content('Only allow merge requests to be merged if all discussions are resolved')
expect(page).not_to have_content 'Pipelines must succeed'
expect(page).not_to have_content 'All discussions must be resolved'
within('.sharing-permissions-form') do
find('.project-feature-controls[data-for="project[project_feature_attributes][merge_requests_access_level]"] .project-feature-toggle').click
find('input[value="Save changes"]').send_keys(:return)
end
expect(page).to have_content('Only allow merge requests to be merged if the pipeline succeeds')
expect(page).to have_content('Only allow merge requests to be merged if all discussions are resolved')
expect(page).to have_content 'Pipelines must succeed'
expect(page).to have_content 'All discussions must be resolved'
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