Commit cd74f408 authored by Stan Hu's avatar Stan Hu

Merge branch 'ce-to-ee-2018-06-08' into 'master'

CE upstream - 2018-06-08 15:42 UTC

See merge request gitlab-org/gitlab-ee!6061
parents 4b512c78 6cedaa3f
......@@ -1137,8 +1137,11 @@ class MergeRequest < ActiveRecord::Base
project.merge_requests.merged.where(author_id: author_id).empty?
end
# TODO: remove once production database rename completes
alias_attribute :allow_collaboration, :allow_maintainer_to_push
def allow_collaboration
collaborative_push_possible? && super
collaborative_push_possible? && allow_maintainer_to_push
end
alias_method :allow_collaboration?, :allow_collaboration
......
......@@ -41,7 +41,9 @@ module MergeRequests
end
def ref
@ref || project.default_branch || 'master'
return @ref if project.repository.branch_exists?(@ref)
project.default_branch || 'master'
end
def merge_request
......
......@@ -17,7 +17,7 @@
%section.settings.as-account-limit.no-animate#js-account-settings{ class: ('expanded' if expanded) }
.settings-header
%h4
= _('Account and limit settings')
= _('Account and limit')
%button.btn.js-settings-toggle{ type: 'button' }
= expanded ? _('Collapse') : _('Expand')
%p
......@@ -317,7 +317,7 @@
%section.settings.as-mirror.no-animate#js-mirror-settings{ class: ('expanded' if expanded) }
.settings-header
%h4
= _('Repository mirror settings')
= _('Repository mirror')
%button.btn.js-settings-toggle{ type: 'button' }
= expanded ? 'Collapse' : 'Expand'
%p
......
......@@ -18,7 +18,7 @@
%section.settings#runners-settings.no-animate{ class: ('expanded' if expanded) }
.settings-header
%h4
= _('Runners settings')
= _('Runners')
%button.btn.btn-default.js-settings-toggle{ type: "button" }
= expanded ? _('Collapse') : _('Expand')
%p
......
......@@ -7,7 +7,7 @@
%section.settings.general-settings.no-animate{ class: ('expanded' if expanded) }
.settings-header
%h4
General project settings
General project
%button.btn.js-settings-toggle{ type: 'button' }
= expanded ? 'Collapse' : 'Expand'
%p
......@@ -85,7 +85,7 @@
%section.settings.merge-requests-feature.no-animate{ class: [('expanded' if expanded), ('hidden' if @project.project_feature.send(:merge_requests_access_level) == 0)] }
.settings-header
%h4
Merge request settings
Merge request
%button.btn.js-settings-toggle{ type: 'button' }
= expanded ? 'Collapse' : 'Expand'
%p
......@@ -104,7 +104,7 @@
%section.settings.advanced-settings.no-animate{ class: ('expanded' if expanded) }
.settings-header
%h4
Advanced settings
Advanced
%button.btn.js-settings-toggle{ type: 'button' }
= expanded ? 'Collapse' : 'Expand'
%p
......
......@@ -8,7 +8,7 @@
%section.settings#js-general-pipeline-settings.no-animate{ class: ('expanded' if general_expanded) }
.settings-header
%h4
General pipelines settings
General pipelines
%button.btn.js-settings-toggle{ type: 'button' }
= expanded ? 'Collapse' : 'Expand'
%p
......@@ -31,7 +31,7 @@
%section.settings.no-animate{ class: ('expanded' if expanded) }
.settings-header
%h4
Runners settings
Runners
%button.btn.js-settings-toggle{ type: 'button' }
= expanded ? 'Collapse' : 'Expand'
%p
......
---
title: Set MR target branch to default branch if target branch is not valid
merge_request: 19067
author:
type: fixed
---
title: Use same gem versions for rails5 as for rails4 where possible
merge_request: 19498
author: Jasper Maes
type: fixed
......@@ -6,10 +6,12 @@ class RenameMergeRequestsAllowMaintainerToPush < ActiveRecord::Migration
disable_ddl_transaction!
def up
rename_column_concurrently :merge_requests, :allow_maintainer_to_push, :allow_collaboration
# NOOP
end
def down
cleanup_concurrent_column_rename :merge_requests, :allow_collaboration, :allow_maintainer_to_push
if column_exists?(:merge_requests, :allow_collaboration)
cleanup_concurrent_column_rename :merge_requests, :allow_collaboration, :allow_maintainer_to_push
end
end
end
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
class RenameMergeRequestsAllowCollaboration < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
# Set this constant to true if this migration requires downtime.
DOWNTIME = false
disable_ddl_transaction!
def up
if column_exists?(:merge_requests, :allow_collaboration)
rename_column_concurrently :merge_requests, :allow_collaboration, :allow_maintainer_to_push
end
end
def down
# NOOP
end
end
......@@ -6,10 +6,12 @@ class CleanupMergeRequestsAllowMaintainerToPushRename < ActiveRecord::Migration
disable_ddl_transaction!
def up
cleanup_concurrent_column_rename :merge_requests, :allow_maintainer_to_push, :allow_collaboration
# NOOP
end
def down
rename_column_concurrently :merge_requests, :allow_collaboration, :allow_maintainer_to_push
if column_exists?(:merge_requests, :allow_collaboration)
rename_column_concurrently :merge_requests, :allow_collaboration, :allow_maintainer_to_push
end
end
end
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
class CleanupMergeRequestsAllowCollaborationRename < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
if column_exists?(:merge_requests, :allow_collaboration)
cleanup_concurrent_column_rename :merge_requests, :allow_collaboration, :allow_maintainer_to_push
end
end
def down
# NOOP
end
end
......@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20180607154645) do
ActiveRecord::Schema.define(version: 20180608201435) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
......@@ -1641,8 +1641,8 @@ ActiveRecord::Schema.define(version: 20180607154645) do
t.string "merge_jid"
t.boolean "discussion_locked"
t.integer "latest_merge_request_diff_id"
t.boolean "allow_collaboration"
t.boolean "squash", default: false, null: false
t.boolean "allow_maintainer_to_push"
end
add_index "merge_requests", ["assignee_id"], name: "index_merge_requests_on_assignee_id", using: :btree
......
......@@ -1925,6 +1925,9 @@ msgstr ""
msgid "Creating epic"
msgstr ""
msgid "Created by me"
msgstr ""
msgid "Cron Timezone"
msgstr ""
......@@ -2131,6 +2134,9 @@ msgstr ""
msgid "Descending"
msgstr ""
msgid "Deprioritize label"
msgstr ""
msgid "Description"
msgstr ""
......@@ -3788,6 +3794,9 @@ msgstr ""
msgid "Other information"
msgstr ""
msgid "Other Labels"
msgstr ""
msgid "Otherwise it is recommended you start with one of the options below."
msgstr ""
......@@ -6012,6 +6021,9 @@ msgstr ""
msgid "You do not have the correct permissions to override the settings from the LDAP group sync."
msgstr ""
msgid "You do not have any assigned merge requests"
msgstr ""
msgid "You have no permissions"
msgstr ""
......
......@@ -6,7 +6,7 @@ module QA # rubocop:disable Naming/FileName
include Common
view 'app/views/projects/settings/ci_cd/show.html.haml' do
element :runners_settings, 'Runners settings'
element :runners_settings, 'Runners'
element :secret_variables, 'Variables'
element :auto_devops_section, 'Auto DevOps'
end
......@@ -18,7 +18,7 @@ module QA # rubocop:disable Naming/FileName
end
def expand_runners_settings(&block)
expand_section('Runners settings') do
expand_section('Runners') do
Settings::Runners.perform(&block)
end
end
......
......@@ -6,7 +6,7 @@ module QA
include Common
view 'app/views/projects/edit.html.haml' do
element :advanced_settings_section, 'Advanced settings'
element :advanced_settings_section, 'Advanced'
end
def expand_advanced_settings(&block)
......
......@@ -10,12 +10,12 @@ module QA
end
view 'app/views/projects/edit.html.haml' do
element :merge_request_settings, 'Merge request settings'
element :merge_request_settings, 'Merge request'
element :save_merge_request_changes
end
def enable_ff_only
expand_section('Merge request settings') do
expand_section('Merge request') do
click_element :radio_button_merge_ff
click_element :save_merge_request_changes
end
......
......@@ -173,7 +173,7 @@ MergeRequest:
- last_edited_by_id
- head_pipeline_id
- discussion_locked
- allow_collaboration
- allow_maintainer_to_push
MergeRequestDiff:
- id
- state
......
......@@ -125,9 +125,14 @@ describe MergeRequests::CreateFromIssueService do
end
context 'when ref branch does not exist' do
it 'does not create a merge request' do
expect { described_class.new(project, user, issue_iid: issue.iid, ref: 'nobr').execute }
.not_to change { project.merge_requests.count }
subject { described_class.new(project, user, issue_iid: issue.iid, ref: 'no-such-branch').execute }
it 'creates a merge request' do
expect { subject }.to change(project.merge_requests, :count).by(1)
end
it 'sets the merge request target branch to the project default branch' do
expect(subject[:merge_request].target_branch).to eq(project.default_branch)
end
end
end
......
......@@ -3,7 +3,6 @@
# Files and directories created by pub
.dart_tool/
.packages
.pub/
build/
# If you're building an application, you may want to check-in your pubspec.lock
pubspec.lock
......@@ -11,3 +10,12 @@ pubspec.lock
# Directory created by dartdoc
# If you don't generate documentation locally you can remove this line.
doc/api/
# Avoid committing generated Javascript files:
*.dart.js
*.info.json # Produced by the --dump-info flag.
*.js # When generated by dart2js. Don't specify *.js if your
# project includes source files written in JavaScript.
*.js_
*.js.deps
*.js.map
......@@ -14,6 +14,7 @@
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml
# Gradle
.idea/**/gradle.xml
......
......@@ -59,3 +59,9 @@ typings/
# next.js build output
.next
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless
.sass-cache/
*.css.map
*.sass.map
*.scss.map
......@@ -40,6 +40,10 @@
*.synctex.gz(busy)
*.pdfsync
## Build tool directories for auxiliary files
# latexrun
latex.out/
## Auxiliary and intermediate files from other packages:
# algorithms
*.alg
......
# Local .terraform directories
# Local .terraform directories
**/.terraform/*
# .tfstate files
*.tfstate
*.tfstate.*
# .tfvars files
*.tfvars
# Crash log files
crash.log
# Ignore any .tfvars files that are generated automatically for each Terraform run. Most
# .tfvars files are managed as part of configuration and so should be included in
# version control.
#
# example.tfvars
......@@ -52,7 +52,6 @@ BenchmarkDotNet.Artifacts/
project.lock.json
project.fragment.lock.json
artifacts/
**/Properties/launchSettings.json
# StyleCop
StyleCopReport.xml
......
# This template has been DEPRECATED. Consider using Auto DevOps instead:
# https://docs.gitlab.com/ee/topics/autodevops
# Explanation on the scripts:
# https://gitlab.com/gitlab-examples/kubernetes-deploy/blob/master/README.md
image: registry.gitlab.com/gitlab-examples/kubernetes-deploy
variables:
# Application deployment domain
KUBE_DOMAIN: domain.example.com
stages:
- build
- test
- review
- staging
- canary
- production
- cleanup
build:
stage: build
script:
- command build
only:
- branches
canary:
stage: canary
script:
- command canary
environment:
name: production
url: http://$CI_PROJECT_PATH_SLUG.$KUBE_DOMAIN
when: manual
only:
- master
production:
stage: production
script:
- command deploy
environment:
name: production
url: http://$CI_PROJECT_PATH_SLUG.$KUBE_DOMAIN
when: manual
only:
- master
staging:
stage: staging
script:
- command deploy
environment:
name: staging
url: http://$CI_PROJECT_PATH_SLUG-staging.$KUBE_DOMAIN
only:
- master
review:
stage: review
script:
- command deploy
environment:
name: review/$CI_COMMIT_REF_NAME
url: http://$CI_PROJECT_PATH_SLUG-$CI_ENVIRONMENT_SLUG.$KUBE_DOMAIN
on_stop: stop_review
only:
- branches
except:
- master
stop_review:
stage: cleanup
variables:
GIT_STRATEGY: none
script:
- command destroy
environment:
name: review/$CI_COMMIT_REF_NAME
action: stop
when: manual
allow_failure: true
only:
- branches
except:
- master
# This template has been DEPRECATED. Consider using Auto DevOps instead:
# https://docs.gitlab.com/ee/topics/autodevops
# Explanation on the scripts:
# https://gitlab.com/gitlab-examples/kubernetes-deploy/blob/master/README.md
image: registry.gitlab.com/gitlab-examples/kubernetes-deploy
variables:
# Application deployment domain
KUBE_DOMAIN: domain.example.com
stages:
- build
- test
- review
- staging
- production
- cleanup
build:
stage: build
script:
- command build
only:
- branches
production:
stage: production
script:
- command deploy
environment:
name: production
url: http://$CI_PROJECT_PATH_SLUG.$KUBE_DOMAIN
when: manual
only:
- master
staging:
stage: staging
script:
- command deploy
environment:
name: staging
url: http://$CI_PROJECT_PATH_SLUG-staging.$KUBE_DOMAIN
only:
- master
review:
stage: review
script:
- command deploy
environment:
name: review/$CI_COMMIT_REF_NAME
url: http://$CI_PROJECT_PATH_SLUG-$CI_ENVIRONMENT_SLUG.$KUBE_DOMAIN
on_stop: stop_review
only:
- branches
except:
- master
stop_review:
stage: cleanup
variables:
GIT_STRATEGY: none
script:
- command destroy
environment:
name: review/$CI_COMMIT_REF_NAME
action: stop
when: manual
only:
- branches
except:
- master
# This template has been DEPRECATED. Consider using Auto DevOps instead:
# https://docs.gitlab.com/ee/topics/autodevops
# Explanation on the scripts:
# https://gitlab.com/gitlab-examples/openshift-deploy/blob/master/README.md
image: registry.gitlab.com/gitlab-examples/openshift-deploy
variables:
# Application deployment domain
KUBE_DOMAIN: domain.example.com
stages:
- build
- test
- review
- staging
- production
- cleanup
build:
stage: build
script:
- command build
only:
- branches
production:
stage: production
script:
- command deploy
environment:
name: production
url: http://$CI_PROJECT_PATH_SLUG.$KUBE_DOMAIN
when: manual
only:
- master
staging:
stage: staging
script:
- command deploy
environment:
name: staging
url: http://$CI_PROJECT_PATH_SLUG-staging.$KUBE_DOMAIN
only:
- master
review:
stage: review
script:
- command deploy
environment:
name: review/$CI_COMMIT_REF_NAME
url: http://$CI_PROJECT_PATH_SLUG-$CI_ENVIRONMENT_SLUG.$KUBE_DOMAIN
on_stop: stop_review
only:
- branches
except:
- master
stop_review:
stage: cleanup
variables:
GIT_STRATEGY: none
script:
- command destroy
environment:
name: review/$CI_COMMIT_REF_NAME
action: stop
when: manual
only:
- branches
except:
- master
This diff is collapsed.
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