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 ...@@ -1137,8 +1137,11 @@ class MergeRequest < ActiveRecord::Base
project.merge_requests.merged.where(author_id: author_id).empty? project.merge_requests.merged.where(author_id: author_id).empty?
end end
# TODO: remove once production database rename completes
alias_attribute :allow_collaboration, :allow_maintainer_to_push
def allow_collaboration def allow_collaboration
collaborative_push_possible? && super collaborative_push_possible? && allow_maintainer_to_push
end end
alias_method :allow_collaboration?, :allow_collaboration alias_method :allow_collaboration?, :allow_collaboration
......
...@@ -41,7 +41,9 @@ module MergeRequests ...@@ -41,7 +41,9 @@ module MergeRequests
end end
def ref def ref
@ref || project.default_branch || 'master' return @ref if project.repository.branch_exists?(@ref)
project.default_branch || 'master'
end end
def merge_request def merge_request
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
%section.settings.as-account-limit.no-animate#js-account-settings{ class: ('expanded' if expanded) } %section.settings.as-account-limit.no-animate#js-account-settings{ class: ('expanded' if expanded) }
.settings-header .settings-header
%h4 %h4
= _('Account and limit settings') = _('Account and limit')
%button.btn.js-settings-toggle{ type: 'button' } %button.btn.js-settings-toggle{ type: 'button' }
= expanded ? _('Collapse') : _('Expand') = expanded ? _('Collapse') : _('Expand')
%p %p
...@@ -317,7 +317,7 @@ ...@@ -317,7 +317,7 @@
%section.settings.as-mirror.no-animate#js-mirror-settings{ class: ('expanded' if expanded) } %section.settings.as-mirror.no-animate#js-mirror-settings{ class: ('expanded' if expanded) }
.settings-header .settings-header
%h4 %h4
= _('Repository mirror settings') = _('Repository mirror')
%button.btn.js-settings-toggle{ type: 'button' } %button.btn.js-settings-toggle{ type: 'button' }
= expanded ? 'Collapse' : 'Expand' = expanded ? 'Collapse' : 'Expand'
%p %p
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
%section.settings#runners-settings.no-animate{ class: ('expanded' if expanded) } %section.settings#runners-settings.no-animate{ class: ('expanded' if expanded) }
.settings-header .settings-header
%h4 %h4
= _('Runners settings') = _('Runners')
%button.btn.btn-default.js-settings-toggle{ type: "button" } %button.btn.btn-default.js-settings-toggle{ type: "button" }
= expanded ? _('Collapse') : _('Expand') = expanded ? _('Collapse') : _('Expand')
%p %p
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
%section.settings.general-settings.no-animate{ class: ('expanded' if expanded) } %section.settings.general-settings.no-animate{ class: ('expanded' if expanded) }
.settings-header .settings-header
%h4 %h4
General project settings General project
%button.btn.js-settings-toggle{ type: 'button' } %button.btn.js-settings-toggle{ type: 'button' }
= expanded ? 'Collapse' : 'Expand' = expanded ? 'Collapse' : 'Expand'
%p %p
...@@ -85,7 +85,7 @@ ...@@ -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)] } %section.settings.merge-requests-feature.no-animate{ class: [('expanded' if expanded), ('hidden' if @project.project_feature.send(:merge_requests_access_level) == 0)] }
.settings-header .settings-header
%h4 %h4
Merge request settings Merge request
%button.btn.js-settings-toggle{ type: 'button' } %button.btn.js-settings-toggle{ type: 'button' }
= expanded ? 'Collapse' : 'Expand' = expanded ? 'Collapse' : 'Expand'
%p %p
...@@ -104,7 +104,7 @@ ...@@ -104,7 +104,7 @@
%section.settings.advanced-settings.no-animate{ class: ('expanded' if expanded) } %section.settings.advanced-settings.no-animate{ class: ('expanded' if expanded) }
.settings-header .settings-header
%h4 %h4
Advanced settings Advanced
%button.btn.js-settings-toggle{ type: 'button' } %button.btn.js-settings-toggle{ type: 'button' }
= expanded ? 'Collapse' : 'Expand' = expanded ? 'Collapse' : 'Expand'
%p %p
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
%section.settings#js-general-pipeline-settings.no-animate{ class: ('expanded' if general_expanded) } %section.settings#js-general-pipeline-settings.no-animate{ class: ('expanded' if general_expanded) }
.settings-header .settings-header
%h4 %h4
General pipelines settings General pipelines
%button.btn.js-settings-toggle{ type: 'button' } %button.btn.js-settings-toggle{ type: 'button' }
= expanded ? 'Collapse' : 'Expand' = expanded ? 'Collapse' : 'Expand'
%p %p
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
%section.settings.no-animate{ class: ('expanded' if expanded) } %section.settings.no-animate{ class: ('expanded' if expanded) }
.settings-header .settings-header
%h4 %h4
Runners settings Runners
%button.btn.js-settings-toggle{ type: 'button' } %button.btn.js-settings-toggle{ type: 'button' }
= expanded ? 'Collapse' : 'Expand' = expanded ? 'Collapse' : 'Expand'
%p %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 ...@@ -6,10 +6,12 @@ class RenameMergeRequestsAllowMaintainerToPush < ActiveRecord::Migration
disable_ddl_transaction! disable_ddl_transaction!
def up def up
rename_column_concurrently :merge_requests, :allow_maintainer_to_push, :allow_collaboration # NOOP
end end
def down 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
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 ...@@ -6,10 +6,12 @@ class CleanupMergeRequestsAllowMaintainerToPushRename < ActiveRecord::Migration
disable_ddl_transaction! disable_ddl_transaction!
def up def up
cleanup_concurrent_column_rename :merge_requests, :allow_maintainer_to_push, :allow_collaboration # NOOP
end end
def down 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
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 @@ ...@@ -11,7 +11,7 @@
# #
# It's strongly recommended that you check this file into your version control system. # 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 # These are extensions that must be enabled in order to support this database
enable_extension "plpgsql" enable_extension "plpgsql"
...@@ -1641,8 +1641,8 @@ ActiveRecord::Schema.define(version: 20180607154645) do ...@@ -1641,8 +1641,8 @@ ActiveRecord::Schema.define(version: 20180607154645) do
t.string "merge_jid" t.string "merge_jid"
t.boolean "discussion_locked" t.boolean "discussion_locked"
t.integer "latest_merge_request_diff_id" t.integer "latest_merge_request_diff_id"
t.boolean "allow_collaboration"
t.boolean "squash", default: false, null: false t.boolean "squash", default: false, null: false
t.boolean "allow_maintainer_to_push"
end end
add_index "merge_requests", ["assignee_id"], name: "index_merge_requests_on_assignee_id", using: :btree add_index "merge_requests", ["assignee_id"], name: "index_merge_requests_on_assignee_id", using: :btree
......
...@@ -1925,6 +1925,9 @@ msgstr "" ...@@ -1925,6 +1925,9 @@ msgstr ""
msgid "Creating epic" msgid "Creating epic"
msgstr "" msgstr ""
msgid "Created by me"
msgstr ""
msgid "Cron Timezone" msgid "Cron Timezone"
msgstr "" msgstr ""
...@@ -2131,6 +2134,9 @@ msgstr "" ...@@ -2131,6 +2134,9 @@ msgstr ""
msgid "Descending" msgid "Descending"
msgstr "" msgstr ""
msgid "Deprioritize label"
msgstr ""
msgid "Description" msgid "Description"
msgstr "" msgstr ""
...@@ -3788,6 +3794,9 @@ msgstr "" ...@@ -3788,6 +3794,9 @@ msgstr ""
msgid "Other information" msgid "Other information"
msgstr "" msgstr ""
msgid "Other Labels"
msgstr ""
msgid "Otherwise it is recommended you start with one of the options below." msgid "Otherwise it is recommended you start with one of the options below."
msgstr "" msgstr ""
...@@ -6012,6 +6021,9 @@ msgstr "" ...@@ -6012,6 +6021,9 @@ msgstr ""
msgid "You do not have the correct permissions to override the settings from the LDAP group sync." msgid "You do not have the correct permissions to override the settings from the LDAP group sync."
msgstr "" msgstr ""
msgid "You do not have any assigned merge requests"
msgstr ""
msgid "You have no permissions" msgid "You have no permissions"
msgstr "" msgstr ""
......
...@@ -6,7 +6,7 @@ module QA # rubocop:disable Naming/FileName ...@@ -6,7 +6,7 @@ module QA # rubocop:disable Naming/FileName
include Common include Common
view 'app/views/projects/settings/ci_cd/show.html.haml' do 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 :secret_variables, 'Variables'
element :auto_devops_section, 'Auto DevOps' element :auto_devops_section, 'Auto DevOps'
end end
...@@ -18,7 +18,7 @@ module QA # rubocop:disable Naming/FileName ...@@ -18,7 +18,7 @@ module QA # rubocop:disable Naming/FileName
end end
def expand_runners_settings(&block) def expand_runners_settings(&block)
expand_section('Runners settings') do expand_section('Runners') do
Settings::Runners.perform(&block) Settings::Runners.perform(&block)
end end
end end
......
...@@ -6,7 +6,7 @@ module QA ...@@ -6,7 +6,7 @@ module QA
include Common include Common
view 'app/views/projects/edit.html.haml' do view 'app/views/projects/edit.html.haml' do
element :advanced_settings_section, 'Advanced settings' element :advanced_settings_section, 'Advanced'
end end
def expand_advanced_settings(&block) def expand_advanced_settings(&block)
......
...@@ -10,12 +10,12 @@ module QA ...@@ -10,12 +10,12 @@ module QA
end end
view 'app/views/projects/edit.html.haml' do 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 element :save_merge_request_changes
end end
def enable_ff_only def enable_ff_only
expand_section('Merge request settings') do expand_section('Merge request') do
click_element :radio_button_merge_ff click_element :radio_button_merge_ff
click_element :save_merge_request_changes click_element :save_merge_request_changes
end end
......
...@@ -173,7 +173,7 @@ MergeRequest: ...@@ -173,7 +173,7 @@ MergeRequest:
- last_edited_by_id - last_edited_by_id
- head_pipeline_id - head_pipeline_id
- discussion_locked - discussion_locked
- allow_collaboration - allow_maintainer_to_push
MergeRequestDiff: MergeRequestDiff:
- id - id
- state - state
......
...@@ -125,9 +125,14 @@ describe MergeRequests::CreateFromIssueService do ...@@ -125,9 +125,14 @@ describe MergeRequests::CreateFromIssueService do
end end
context 'when ref branch does not exist' do context 'when ref branch does not exist' do
it 'does not create a merge request' do subject { described_class.new(project, user, issue_iid: issue.iid, ref: 'no-such-branch').execute }
expect { described_class.new(project, user, issue_iid: issue.iid, ref: 'nobr').execute }
.not_to change { project.merge_requests.count } 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 end
end end
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
# Files and directories created by pub # Files and directories created by pub
.dart_tool/ .dart_tool/
.packages .packages
.pub/
build/ build/
# If you're building an application, you may want to check-in your pubspec.lock # If you're building an application, you may want to check-in your pubspec.lock
pubspec.lock pubspec.lock
...@@ -11,3 +10,12 @@ pubspec.lock ...@@ -11,3 +10,12 @@ pubspec.lock
# Directory created by dartdoc # Directory created by dartdoc
# If you don't generate documentation locally you can remove this line. # If you don't generate documentation locally you can remove this line.
doc/api/ 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 @@ ...@@ -14,6 +14,7 @@
.idea/**/sqlDataSources.xml .idea/**/sqlDataSources.xml
.idea/**/dynamic.xml .idea/**/dynamic.xml
.idea/**/uiDesigner.xml .idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml
# Gradle # Gradle
.idea/**/gradle.xml .idea/**/gradle.xml
......
...@@ -59,3 +59,9 @@ typings/ ...@@ -59,3 +59,9 @@ typings/
# next.js build output # next.js build output
.next .next
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless
.sass-cache/ .sass-cache/
*.css.map *.css.map
*.sass.map
*.scss.map
...@@ -40,6 +40,10 @@ ...@@ -40,6 +40,10 @@
*.synctex.gz(busy) *.synctex.gz(busy)
*.pdfsync *.pdfsync
## Build tool directories for auxiliary files
# latexrun
latex.out/
## Auxiliary and intermediate files from other packages: ## Auxiliary and intermediate files from other packages:
# algorithms # algorithms
*.alg *.alg
......
# Local .terraform directories # Local .terraform directories
**/.terraform/* **/.terraform/*
# .tfstate files # .tfstate files
*.tfstate *.tfstate
*.tfstate.* *.tfstate.*
# .tfvars files # Crash log files
*.tfvars 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/ ...@@ -52,7 +52,6 @@ BenchmarkDotNet.Artifacts/
project.lock.json project.lock.json
project.fragment.lock.json project.fragment.lock.json
artifacts/ artifacts/
**/Properties/launchSettings.json
# StyleCop # StyleCop
StyleCopReport.xml 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