Commit a56516b6 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'return-rebase-checkbox' into 'master'

Return rebase checkbox

Should be backported to 7.12

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/1816

See merge request !425
parents 8883e292 20fefc4f
# This file is generated by GitLab CI
before_script: before_script:
- export PATH=$HOME/bin:/usr/local/bin:/usr/bin:/bin - export PATH=$HOME/bin:/usr/local/bin:/usr/bin:/bin
- ruby -v - ruby -v
...@@ -7,33 +8,44 @@ before_script: ...@@ -7,33 +8,44 @@ before_script:
- echo $PATH - echo $PATH
- cp config/database.yml.mysql config/database.yml - cp config/database.yml.mysql config/database.yml
- cp config/gitlab.yml.example config/gitlab.yml - cp config/gitlab.yml.example config/gitlab.yml
- ! 'sed "s/username\:.*$/username\: runner/" -i config/database.yml' - 'sed "s/username\:.*$/username\: runner/" -i config/database.yml'
- ! 'sed "s/password\:.*$/password\: ''password''/" -i config/database.yml' - 'sed "s/password\:.*$/password\: ''password''/" -i config/database.yml'
- sed "s/gitlabhq_test/gitlabhq_test_$((RANDOM/5000))/" -i config/database.yml - sed "s/gitlabhq_test/gitlabhq_test_$((RANDOM/5000))/" -i config/database.yml
- touch log/application.log - touch log/application.log
- touch log/test.log - touch log/test.log
- bundle install --without postgres production --jobs $(nproc) - bundle install --without postgres production --jobs $(nproc)
- bundle exec rake db:create RAILS_ENV=test - bundle exec rake db:create RAILS_ENV=test
jobs: Rspec:
- script: script:
- RAILS_ENV=test SIMPLECOV=true bundle exec rake spec - RAILS_ENV=test SIMPLECOV=true bundle exec rake spec
name: Rspec tags:
runner: ruby,mysql - ruby
- script: - mysql
- RAILS_ENV=test SIMPLECOV=true bundle exec rake spinach
name: Spinach Spinach:
runner: ruby,mysql script:
- script: - RAILS_ENV=test SIMPLECOV=true bundle exec rake spinach
- RAILS_ENV=test SIMPLECOV=true bundle exec rake jasmine:ci tags:
name: Jasmine - ruby
runner: ruby,mysql - mysql
- script:
- bundle exec rubocop Jasmine:
name: Rubocop script:
runner: ruby,mysql - RAILS_ENV=test SIMPLECOV=true bundle exec rake jasmine:ci
- script: tags:
- bundle exec rake brakeman - ruby
name: Brakeman - mysql
runner: ruby,mysql
deploy_jobs: [] Rubocop:
skip_refs: '' script:
- bundle exec rubocop
tags:
- ruby
- mysql
Brakeman:
script:
- bundle exec rake brakeman
tags:
- ruby
- mysql
\ No newline at end of file
...@@ -9,6 +9,12 @@ ...@@ -9,6 +9,12 @@
= label_tag :should_remove_source_branch, class: "remove_source_checkbox" do = label_tag :should_remove_source_branch, class: "remove_source_checkbox" do
= check_box_tag :should_remove_source_branch = check_box_tag :should_remove_source_branch
Remove source-branch Remove source-branch
- if @merge_request.target_project.merge_requests_rebase_enabled && can_rebase?(@merge_request.target_project, @merge_request.target_branch)
.accept-control.remove_branch_holder.checkbox
= label_tag :should_rebase do
= check_box_tag :should_rebase, "1", @project.merge_requests_rebase_default
%strong Rebase before merge
.accept-control .accept-control
= link_to "#", class: "modify-merge-commit-link js-toggle-button", title: "Modify merge commit message" do = link_to "#", class: "modify-merge-commit-link js-toggle-button", title: "Modify merge commit message" do
%i.fa.fa-edit %i.fa.fa-edit
......
...@@ -227,3 +227,11 @@ Feature: Project Merge Requests ...@@ -227,3 +227,11 @@ Feature: Project Merge Requests
And I should not see merge button And I should not see merge button
When I click link "Approve" When I click link "Approve"
Then I should see approved merge request "Bug NS-04" Then I should see approved merge request "Bug NS-04"
Scenario: I should see rebase checkbox
Given project "Shop" have "Bug NS-05" open merge request with diffs inside
And rebase before merge enabled
And merge request "Bug NS-05" is mergeable
And I visit merge request page "Bug NS-05"
And merge request is mergeable
Then I should see rebase checkbox
...@@ -356,6 +356,16 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps ...@@ -356,6 +356,16 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
end end
end end
step 'rebase before merge enabled' do
project = merge_request.target_project
project.merge_requests_rebase_enabled = true
project.save!
end
step 'I should see rebase checkbox' do
expect(page).to have_content 'Rebase before merge'
end
def merge_request def merge_request
@merge_request ||= MergeRequest.find_by!(title: "Bug NS-05") @merge_request ||= MergeRequest.find_by!(title: "Bug NS-05")
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