Commit f8409031 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'master' of dev.gitlab.org:gitlab/gitlabhq into ce-to-ee

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>

Conflicts:
	app/helpers/tab_helper.rb
	app/models/merge_request.rb
	app/views/layouts/nav/_project_settings.html.haml
	app/views/projects/merge_requests/show/_mr_accept.html.haml
	doc/api/groups.md
parents 7bf9dcaf b07cf118
Please view this file on the master branch, on stable branches it's out of date. Please view this file on the master branch, on stable branches it's out of date.
v 7.12.0 (unreleased) v 7.12.0 (unreleased)
- Update oauth button logos for Twitter and Google to recommended assets
- Update browser gem to version 0.8.0 for IE11 support (Stan Hu)
- Fix timeout when rendering file with thousands of lines. - Fix timeout when rendering file with thousands of lines.
- Add "Remember me" checkbox to LDAP signin form.
- Don't notify users mentioned in code blocks or blockquotes. - Don't notify users mentioned in code blocks or blockquotes.
- Omit link to generate labels if user does not have access to create them (Stan Hu) - Omit link to generate labels if user does not have access to create them (Stan Hu)
- Show warning when a comment will add 10 or more people to the discussion. - Show warning when a comment will add 10 or more people to the discussion.
......
...@@ -30,7 +30,7 @@ gem 'rqrcode-rails3' ...@@ -30,7 +30,7 @@ gem 'rqrcode-rails3'
gem 'attr_encrypted', '1.3.4' gem 'attr_encrypted', '1.3.4'
# Browser detection # Browser detection
gem "browser" gem "browser", '~> 0.8.0'
# Extracting information from a git repository # Extracting information from a git repository
# Provide access to Gitlab::Git library # Provide access to Gitlab::Git library
...@@ -82,7 +82,7 @@ gem "carrierwave" ...@@ -82,7 +82,7 @@ gem "carrierwave"
gem 'dropzonejs-rails' gem 'dropzonejs-rails'
# for aws storage # for aws storage
gem "fog", "~> 1.14" gem "fog", "~> 1.25.0"
gem "unf" gem "unf"
# Authorization # Authorization
...@@ -257,10 +257,10 @@ group :development, :test do ...@@ -257,10 +257,10 @@ group :development, :test do
end end
group :test do group :test do
gem "simplecov", require: false gem 'simplecov', require: false
gem "shoulda-matchers", "~> 2.7.0" gem 'shoulda-matchers', '~> 2.8.0', require: false
gem 'email_spec' gem 'email_spec'
gem "webmock" gem 'webmock', '~> 1.21.0'
gem 'test_after_commit' gem 'test_after_commit'
end end
......
GEM GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
CFPropertyList (2.3.1)
RedCloth (4.2.9) RedCloth (4.2.9)
ace-rails-ap (2.0.1) ace-rails-ap (2.0.1)
actionmailer (4.1.9) actionmailer (4.1.9)
...@@ -35,7 +36,7 @@ GEM ...@@ -35,7 +36,7 @@ GEM
tzinfo (~> 1.1) tzinfo (~> 1.1)
acts-as-taggable-on (3.5.0) acts-as-taggable-on (3.5.0)
activerecord (>= 3.2, < 5) activerecord (>= 3.2, < 5)
addressable (2.3.5) addressable (2.3.8)
annotate (2.6.0) annotate (2.6.0)
activerecord (>= 2.3.0) activerecord (>= 2.3.0)
rake (>= 0.8.7) rake (>= 0.8.7)
...@@ -75,7 +76,7 @@ GEM ...@@ -75,7 +76,7 @@ GEM
ruby_parser (~> 3.5.0) ruby_parser (~> 3.5.0)
sass (~> 3.0) sass (~> 3.0)
terminal-table (~> 1.4) terminal-table (~> 1.4)
browser (0.7.2) browser (0.8.0)
builder (3.2.2) builder (3.2.2)
byebug (3.2.0) byebug (3.2.0)
columnize (~> 0.8) columnize (~> 0.8)
...@@ -118,8 +119,8 @@ GEM ...@@ -118,8 +119,8 @@ GEM
simplecov (>= 0.7) simplecov (>= 0.7)
term-ansicolor term-ansicolor
thor thor
crack (0.4.1) crack (0.4.2)
safe_yaml (~> 0.9.0) safe_yaml (~> 1.0.0)
creole (0.3.8) creole (0.3.8)
d3_rails (3.5.5) d3_rails (3.5.5)
railties (>= 3.1.0) railties (>= 3.1.0)
...@@ -163,7 +164,7 @@ GEM ...@@ -163,7 +164,7 @@ GEM
erubis (2.7.0) erubis (2.7.0)
escape_utils (0.2.4) escape_utils (0.2.4)
eventmachine (1.0.4) eventmachine (1.0.4)
excon (0.32.1) excon (0.45.3)
execjs (2.5.2) execjs (2.5.2)
expression_parser (0.9.0) expression_parser (0.9.0)
factory_girl (4.3.0) factory_girl (4.3.0)
...@@ -178,29 +179,69 @@ GEM ...@@ -178,29 +179,69 @@ GEM
fastercsv (1.5.5) fastercsv (1.5.5)
ffaker (2.0.0) ffaker (2.0.0)
ffi (1.9.8) ffi (1.9.8)
fog (1.21.0) fission (0.5.0)
fog-brightbox CFPropertyList (~> 2.2)
fog-core (~> 1.21, >= 1.21.1) fog (1.25.0)
fog-brightbox (~> 0.4)
fog-core (~> 1.25)
fog-json fog-json
fog-profitbricks
fog-radosgw (>= 0.0.2)
fog-sakuracloud (>= 0.0.4)
fog-softlayer
fog-terremark
fog-vmfusion
fog-voxel
fog-xml (~> 0.1.1)
ipaddress (~> 0.5)
nokogiri (~> 1.5, >= 1.5.11) nokogiri (~> 1.5, >= 1.5.11)
fog-brightbox (0.0.1) opennebula
fog-core fog-brightbox (0.7.1)
fog-core (~> 1.22)
fog-json fog-json
fog-core (1.21.1) inflecto (~> 0.0.2)
fog-core (1.30.0)
builder builder
excon (~> 0.32) excon (~> 0.45)
formatador (~> 0.2.0) formatador (~> 0.2)
mime-types mime-types
net-scp (~> 1.1) net-scp (~> 1.1)
net-ssh (>= 2.1.3) net-ssh (>= 2.1.3)
fog-json (1.0.0) fog-json (1.0.2)
multi_json (~> 1.0) fog-core (~> 1.0)
multi_json (~> 1.10)
fog-profitbricks (0.0.3)
fog-core
fog-xml
nokogiri
fog-radosgw (0.0.4)
fog-core (>= 1.21.0)
fog-json
fog-xml (>= 0.0.1)
fog-sakuracloud (1.0.1)
fog-core
fog-json
fog-softlayer (0.4.6)
fog-core
fog-json
fog-terremark (0.1.0)
fog-core
fog-xml
fog-vmfusion (0.1.0)
fission
fog-core
fog-voxel (0.1.0)
fog-core
fog-xml
fog-xml (0.1.2)
fog-core
nokogiri (~> 1.5, >= 1.5.11)
font-awesome-rails (4.2.0.0) font-awesome-rails (4.2.0.0)
railties (>= 3.2, < 5.0) railties (>= 3.2, < 5.0)
foreman (0.63.0) foreman (0.63.0)
dotenv (>= 0.7) dotenv (>= 0.7)
thor (>= 0.13.6) thor (>= 0.13.6)
formatador (0.2.4) formatador (0.2.5)
gemnasium-gitlab-service (0.2.6) gemnasium-gitlab-service (0.2.6)
rugged (~> 0.21) rugged (~> 0.21)
gemojione (2.0.0) gemojione (2.0.0)
...@@ -288,6 +329,8 @@ GEM ...@@ -288,6 +329,8 @@ GEM
i18n (0.7.0) i18n (0.7.0)
ice_cube (0.11.1) ice_cube (0.11.1)
ice_nine (0.10.0) ice_nine (0.10.0)
inflecto (0.0.2)
ipaddress (0.8.0)
jquery-atwho-rails (1.0.1) jquery-atwho-rails (1.0.1)
jquery-rails (3.1.2) jquery-rails (3.1.2)
railties (>= 3.0, < 5.0) railties (>= 3.0, < 5.0)
...@@ -329,9 +372,9 @@ GEM ...@@ -329,9 +372,9 @@ GEM
multipart-post (1.2.0) multipart-post (1.2.0)
mysql2 (0.3.16) mysql2 (0.3.16)
net-ldap (0.11) net-ldap (0.11)
net-scp (1.1.2) net-scp (1.2.1)
net-ssh (>= 2.6.5) net-ssh (>= 2.6.5)
net-ssh (2.8.0) net-ssh (2.9.2)
newrelic_rpm (3.9.4.245) newrelic_rpm (3.9.4.245)
nokogiri (1.6.6.2) nokogiri (1.6.6.2)
mini_portile (~> 0.6.0) mini_portile (~> 0.6.0)
...@@ -380,6 +423,10 @@ GEM ...@@ -380,6 +423,10 @@ GEM
omniauth-twitter (1.0.1) omniauth-twitter (1.0.1)
multi_json (~> 1.3) multi_json (~> 1.3)
omniauth-oauth (~> 1.0) omniauth-oauth (~> 1.0)
opennebula (4.12.1)
json
nokogiri
rbvmomi
org-ruby (0.9.12) org-ruby (0.9.12)
rubypants (~> 0.2) rubypants (~> 0.2)
orm_adapter (0.5.0) orm_adapter (0.5.0)
...@@ -447,6 +494,10 @@ GEM ...@@ -447,6 +494,10 @@ GEM
rb-fsevent (0.9.4) rb-fsevent (0.9.4)
rb-inotify (0.9.5) rb-inotify (0.9.5)
ffi (>= 0.5.0) ffi (>= 0.5.0)
rbvmomi (1.8.2)
builder
nokogiri (>= 1.4.1)
trollop
rdoc (3.12.2) rdoc (3.12.2)
json (~> 1.4) json (~> 1.4)
redcarpet (3.2.3) redcarpet (3.2.3)
...@@ -514,7 +565,7 @@ GEM ...@@ -514,7 +565,7 @@ GEM
rubypants (0.2.0) rubypants (0.2.0)
rugged (0.22.2) rugged (0.22.2)
rugments (1.0.0.beta7) rugments (1.0.0.beta7)
safe_yaml (0.9.7) safe_yaml (1.0.4)
sanitize (2.1.0) sanitize (2.1.0)
nokogiri (>= 1.4.4) nokogiri (>= 1.4.4)
sass (3.2.19) sass (3.2.19)
...@@ -536,7 +587,7 @@ GEM ...@@ -536,7 +587,7 @@ GEM
thor (~> 0.14) thor (~> 0.14)
settingslogic (2.0.9) settingslogic (2.0.9)
sexp_processor (4.4.5) sexp_processor (4.4.5)
shoulda-matchers (2.7.0) shoulda-matchers (2.8.0)
activesupport (>= 3.0.0) activesupport (>= 3.0.0)
sidekiq (3.3.0) sidekiq (3.3.0)
celluloid (>= 0.16.0) celluloid (>= 0.16.0)
...@@ -622,6 +673,7 @@ GEM ...@@ -622,6 +673,7 @@ GEM
multi_json (~> 1.7) multi_json (~> 1.7)
twitter-stream (~> 0.1) twitter-stream (~> 0.1)
tins (0.13.1) tins (0.13.1)
trollop (2.1.2)
turbolinks (2.5.3) turbolinks (2.5.3)
coffee-rails coffee-rails
twitter-stream (0.1.16) twitter-stream (0.1.16)
...@@ -653,8 +705,8 @@ GEM ...@@ -653,8 +705,8 @@ GEM
equalizer (~> 0.0.7) equalizer (~> 0.0.7)
warden (1.2.3) warden (1.2.3)
rack (>= 1.0) rack (>= 1.0)
webmock (1.16.0) webmock (1.21.0)
addressable (>= 2.2.7) addressable (>= 2.3.6)
crack (>= 0.3.2) crack (>= 0.3.2)
websocket-driver (0.3.3) websocket-driver (0.3.3)
wikicloth (0.8.1) wikicloth (0.8.1)
...@@ -681,7 +733,7 @@ DEPENDENCIES ...@@ -681,7 +733,7 @@ DEPENDENCIES
binding_of_caller binding_of_caller
bootstrap-sass (~> 3.0) bootstrap-sass (~> 3.0)
brakeman brakeman
browser browser (~> 0.8.0)
byebug byebug
cal-heatmap-rails (~> 0.0.1) cal-heatmap-rails (~> 0.0.1)
capybara (~> 2.2.1) capybara (~> 2.2.1)
...@@ -705,7 +757,7 @@ DEPENDENCIES ...@@ -705,7 +757,7 @@ DEPENDENCIES
enumerize enumerize
factory_girl_rails factory_girl_rails
ffaker (~> 2.0.0) ffaker (~> 2.0.0)
fog (~> 1.14) fog (~> 1.25.0)
font-awesome-rails (~> 4.2) font-awesome-rails (~> 4.2)
foreman foreman
gemnasium-gitlab-service (~> 0.2) gemnasium-gitlab-service (~> 0.2)
...@@ -775,7 +827,7 @@ DEPENDENCIES ...@@ -775,7 +827,7 @@ DEPENDENCIES
seed-fu seed-fu
select2-rails select2-rails
settingslogic settingslogic
shoulda-matchers (~> 2.7.0) shoulda-matchers (~> 2.8.0)
sidekiq (~> 3.3) sidekiq (~> 3.3)
sidetiq (= 0.6.3) sidetiq (= 0.6.3)
simplecov simplecov
...@@ -804,5 +856,5 @@ DEPENDENCIES ...@@ -804,5 +856,5 @@ DEPENDENCIES
unicorn-worker-killer unicorn-worker-killer
version_sorter version_sorter
virtus virtus
webmock webmock (~> 1.21.0)
wikicloth (= 0.8.1) wikicloth (= 0.8.1)
...@@ -25,6 +25,7 @@ class @Calendar ...@@ -25,6 +25,7 @@ class @Calendar
30 30
] ]
legendCellPadding: 3 legendCellPadding: 3
cellSize: $('.user-calendar').width() / 80
onClick: (date, count) -> onClick: (date, count) ->
formated_date = date.getFullYear() + "-" + (date.getMonth()+1) + "-" + date.getDate() formated_date = date.getFullYear() + "-" + (date.getMonth()+1) + "-" + date.getDate()
$.ajax $.ajax
......
...@@ -11,12 +11,6 @@ class @MergeRequest ...@@ -11,12 +11,6 @@ class @MergeRequest
# commits_loaded - Boolean, have commits been pre-rendered server-side? # commits_loaded - Boolean, have commits been pre-rendered server-side?
# (default: false) # (default: false)
# #
# check_enable - Boolean, whether to check automerge status
# url_to_automerge_check - String, URL to use to check automerge status
# current_status - String, current automerge status
# ci_enable - Boolean, whether a CI service is enabled
# url_to_ci_check - String, URL to use to check CI status
#
constructor: (@opts) -> constructor: (@opts) ->
@initContextWidget() @initContextWidget()
this.$el = $('.merge-request') this.$el = $('.merge-request')
...@@ -27,14 +21,9 @@ class @MergeRequest ...@@ -27,14 +21,9 @@ class @MergeRequest
this.bindEvents() this.bindEvents()
this.activateTabFromPath() this.activateTabFromPath()
this.initMergeWidget()
this.$('.show-all-commits').on 'click', => this.$('.show-all-commits').on 'click', =>
this.showAllCommits() this.showAllCommits()
modal = $('#modal_merge_info').modal(show: false)
disableButtonIfEmptyField '#commit_message', '.accept_merge_request'
# Prevent duplicate event bindings # Prevent duplicate event bindings
@disableTaskList() @disableTaskList()
...@@ -63,20 +52,6 @@ class @MergeRequest ...@@ -63,20 +52,6 @@ class @MergeRequest
$(".context .inline-update").on "change", "#merge_request_assignee_id", -> $(".context .inline-update").on "change", "#merge_request_assignee_id", ->
$(this).submit() $(this).submit()
initMergeWidget: ->
this.showState( @opts.current_status )
if this.$('.automerge_widget').length and @opts.check_enable
$.get @opts.url_to_automerge_check, (data) =>
this.showState( data.merge_status )
, 'json'
if @opts.ci_enable
$.get @opts.url_to_ci_check, (data) =>
this.showCiState data.status
if data.coverage
this.showCiCoverage data.coverage
, 'json'
bindEvents: -> bindEvents: ->
this.$('.merge-request-tabs a[data-toggle="tab"]').on 'shown.bs.tab', (e) => this.$('.merge-request-tabs a[data-toggle="tab"]').on 'shown.bs.tab', (e) =>
...@@ -92,22 +67,6 @@ class @MergeRequest ...@@ -92,22 +67,6 @@ class @MergeRequest
unless @opts.action == 'new' unless @opts.action == 'new'
@setCurrentAction(tab_action) @setCurrentAction(tab_action)
this.$('.accept_merge_request').on 'click', ->
$('.automerge_widget.can_be_merged').hide()
$('.merge-in-progress').show()
this.$('.remove_source_branch').on 'click', ->
$('.remove_source_branch_widget').hide()
$('.remove_source_branch_in_progress').show()
this.$(".remove_source_branch").on "ajax:success", (e, data, status, xhr) ->
location.reload()
this.$(".remove_source_branch").on "ajax:error", (e, data, status, xhr) =>
this.$('.remove_source_branch_widget').hide()
this.$('.remove_source_branch_in_progress').hide()
this.$('.remove_source_branch_widget.failed').show()
# Activate a tab based on the current URL path # Activate a tab based on the current URL path
# #
# If the current action is 'show' or 'new' (i.e., initial page load), # If the current action is 'show' or 'new' (i.e., initial page load),
...@@ -157,30 +116,6 @@ class @MergeRequest ...@@ -157,30 +116,6 @@ class @MergeRequest
# See https://github.com/rails/turbolinks/issues/363 # See https://github.com/rails/turbolinks/issues/363
history.replaceState {turbolinks: true, url: new_state}, '', new_state history.replaceState {turbolinks: true, url: new_state}, '', new_state
showState: (state) ->
$('.automerge_widget').hide()
$('.automerge_widget.' + state).show()
showCiState: (state) ->
$('.ci_widget').hide()
allowed_states = ["failed", "canceled", "running", "pending", "success"]
if state in allowed_states
$('.ci_widget.ci-' + state).show()
switch state
when "failed", "canceled"
@setMergeButtonClass('btn-danger')
when "running", "pending"
@setMergeButtonClass('btn-warning')
else
$('.ci_widget.ci-error').show()
@setMergeButtonClass('btn-danger')
showCiCoverage: (coverage) ->
cov_html = $('<span>')
cov_html.addClass('ci-coverage')
cov_html.text('Coverage ' + coverage + '%')
$('.ci_widget:visible').append(cov_html)
loadDiff: (event) -> loadDiff: (event) ->
$.ajax $.ajax
type: 'GET' type: 'GET'
...@@ -198,26 +133,6 @@ class @MergeRequest ...@@ -198,26 +133,6 @@ class @MergeRequest
this.$('.first-commits').remove() this.$('.first-commits').remove()
this.$('.all-commits').removeClass 'hide' this.$('.all-commits').removeClass 'hide'
alreadyOrCannotBeMerged: ->
this.$('.automerge_widget').hide()
this.$('.merge-in-progress').hide()
this.$('.automerge_widget.already_cannot_be_merged').show()
setMergeButtonClass: (css_class) ->
$('.accept_merge_request').removeClass("btn-create").addClass(css_class)
mergeInProgress: ->
$.ajax
type: 'GET'
url: $('.merge-request').data('url')
success: (data) =>
switch data.state
when 'merged'
location.reload()
else
setTimeout(merge_request.mergeInProgress, 3000)
dataType: 'json'
initTaskList: -> initTaskList: ->
$('.merge-request-details .js-task-list-container').taskList('enable') $('.merge-request-details .js-task-list-container').taskList('enable')
$(document).on 'tasklist:changed', '.merge-request-details .js-task-list-container', @updateTaskList $(document).on 'tasklist:changed', '.merge-request-details .js-task-list-container', @updateTaskList
......
class @MergeRequestWidget
# Initialize MergeRequestWidget behavior
#
# check_enable - Boolean, whether to check automerge status
# url_to_automerge_check - String, URL to use to check automerge status
# current_status - String, current automerge status
# ci_enable - Boolean, whether a CI service is enabled
# url_to_ci_check - String, URL to use to check CI status
#
constructor: (@opts) ->
modal = $('#modal_merge_info').modal(show: false)
mergeInProgress: ->
$.ajax
type: 'GET'
url: $('.merge-request').data('url')
success: (data) =>
switch data.state
when 'merged'
location.reload()
else
setTimeout(merge_request_widget.mergeInProgress, 3000)
dataType: 'json'
getMergeStatus: ->
$.get @opts.url_to_automerge_check, (data) ->
$('.mr-state-widget').replaceWith(data)
getCiStatus: ->
if @opts.ci_enable
$.get @opts.url_to_ci_check, (data) =>
this.showCiState data.status
if data.coverage
this.showCiCoverage data.coverage
, 'json'
showCiState: (state) ->
$('.ci_widget').hide()
allowed_states = ["failed", "canceled", "running", "pending", "success"]
if state in allowed_states
$('.ci_widget.ci-' + state).show()
switch state
when "failed", "canceled"
@setMergeButtonClass('btn-danger')
when "running", "pending"
@setMergeButtonClass('btn-warning')
else
$('.ci_widget.ci-error').show()
@setMergeButtonClass('btn-danger')
showCiCoverage: (coverage) ->
cov_html = $('<span>')
cov_html.addClass('ci-coverage')
cov_html.text('Coverage ' + coverage + '%')
$('.ci_widget:visible').append(cov_html)
setMergeButtonClass: (css_class) ->
$('.accept_merge_request').removeClass("btn-create").addClass(css_class)
...@@ -50,7 +50,7 @@ class @ContributorsGraph ...@@ -50,7 +50,7 @@ class @ContributorsGraph
class @ContributorsMasterGraph extends ContributorsGraph class @ContributorsMasterGraph extends ContributorsGraph
constructor: (@data) -> constructor: (@data) ->
@width = $('.container').width() - 345 @width = $('.content').width() - 70
@height = 200 @height = 200
@x = null @x = null
@y = null @y = null
...@@ -123,7 +123,7 @@ class @ContributorsMasterGraph extends ContributorsGraph ...@@ -123,7 +123,7 @@ class @ContributorsMasterGraph extends ContributorsGraph
class @ContributorsAuthorGraph extends ContributorsGraph class @ContributorsAuthorGraph extends ContributorsGraph
constructor: (@data) -> constructor: (@data) ->
@width = $('.container').width()/2 - 225 @width = $('.content').width()/2 - 100
@height = 200 @height = 200
@x = null @x = null
@y = null @y = null
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* MR -> show: Automerge widget * MR -> show: Automerge widget
* *
*/ */
.automerge_widget { .mr-state-widget {
form { form {
margin-bottom: 0; margin-bottom: 0;
.clearfix { .clearfix {
......
...@@ -5,7 +5,7 @@ class Admin::ProjectsController < Admin::ApplicationController ...@@ -5,7 +5,7 @@ class Admin::ProjectsController < Admin::ApplicationController
def index def index
@projects = Project.all @projects = Project.all
@projects = @projects.where(namespace_id: params[:namespace_id]) if params[:namespace_id].present? @projects = @projects.in_namespace(params[:namespace_id]) if params[:namespace_id].present?
@projects = @projects.where("visibility_level IN (?)", params[:visibility_levels]) if params[:visibility_levels].present? @projects = @projects.where("visibility_level IN (?)", params[:visibility_levels]) if params[:visibility_levels].present?
@projects = @projects.with_push if params[:with_push].present? @projects = @projects.with_push if params[:with_push].present?
@projects = @projects.abandoned if params[:abandoned].present? @projects = @projects.abandoned if params[:abandoned].present?
......
...@@ -25,7 +25,7 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController ...@@ -25,7 +25,7 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController
@user = Gitlab::LDAP::User.new(oauth) @user = Gitlab::LDAP::User.new(oauth)
@user.save if @user.changed? # will also save new users @user.save if @user.changed? # will also save new users
gl_user = @user.gl_user gl_user = @user.gl_user
gl_user.remember_me = true if @user.persisted? gl_user.remember_me = params[:remember_me] if @user.persisted?
# Do additional LDAP checks for the user filter and EE features # Do additional LDAP checks for the user filter and EE features
if @user.allowed? if @user.allowed?
......
...@@ -139,11 +139,13 @@ class Projects::MergeRequestsController < Projects::ApplicationController ...@@ -139,11 +139,13 @@ class Projects::MergeRequestsController < Projects::ApplicationController
@merge_request.check_if_can_be_merged @merge_request.check_if_can_be_merged
end end
render json: { merge_status: @merge_request.automerge_status } closes_issues
render partial: "projects/merge_requests/widget/show.html.haml", layout: false
end end
def automerge def automerge
return access_denied! unless allowed_to_merge? return access_denied! unless @merge_request.can_be_merged_by?(current_user)
if @merge_request.automergeable? if @merge_request.automergeable?
AutoMergeWorker.perform_async(@merge_request.id, current_user.id, params) AutoMergeWorker.perform_async(@merge_request.id, current_user.id, params)
...@@ -260,8 +262,6 @@ class Projects::MergeRequestsController < Projects::ApplicationController ...@@ -260,8 +262,6 @@ class Projects::MergeRequestsController < Projects::ApplicationController
@commits = @merge_request.commits @commits = @merge_request.commits
@merge_request_diff = @merge_request.merge_request_diff @merge_request_diff = @merge_request.merge_request_diff
@allowed_to_merge = allowed_to_merge?
@show_merge_controls = @merge_request.open? && @commits.any? && @allowed_to_merge
@source_branch = @merge_request.source_project.repository.find_branch(@merge_request.source_branch).try(:name) @source_branch = @merge_request.source_project.repository.find_branch(@merge_request.source_branch).try(:name)
if @merge_request.locked_long_ago? if @merge_request.locked_long_ago?
...@@ -270,19 +270,11 @@ class Projects::MergeRequestsController < Projects::ApplicationController ...@@ -270,19 +270,11 @@ class Projects::MergeRequestsController < Projects::ApplicationController
end end
end end
def allowed_to_merge?
allowed_to_push_code?(project, @merge_request.target_branch)
end
def invalid_mr def invalid_mr
# Render special view for MR with removed source or target branch # Render special view for MR with removed source or target branch
render 'invalid' render 'invalid'
end end
def allowed_to_push_code?(project, branch)
::Gitlab::GitAccess.new(current_user, project).can_push_to_branch?(branch)
end
def merge_request_params def merge_request_params
params.require(:merge_request).permit( params.require(:merge_request).permit(
:title, :assignee_id, :source_project_id, :source_branch, :title, :assignee_id, :source_project_id, :source_branch,
......
...@@ -2,8 +2,6 @@ class Projects::ProjectMembersController < Projects::ApplicationController ...@@ -2,8 +2,6 @@ class Projects::ProjectMembersController < Projects::ApplicationController
# Authorize # Authorize
before_action :authorize_admin_project!, except: :leave before_action :authorize_admin_project!, except: :leave
layout "project_settings"
def index def index
@project_members = @project.project_members @project_members = @project.project_members
@project_members = @project_members.non_invite unless can?(current_user, :admin_project, @project) @project_members = @project_members.non_invite unless can?(current_user, :admin_project, @project)
......
...@@ -89,7 +89,7 @@ module TabHelper ...@@ -89,7 +89,7 @@ module TabHelper
def project_tab_class def project_tab_class
return "active" if current_page?(controller: "/projects", action: :edit, id: @project) return "active" if current_page?(controller: "/projects", action: :edit, id: @project)
if ['services', 'git_hooks', 'hooks', 'deploy_keys', 'project_members', 'protected_branches'].include? controller.controller_name if ['services', 'hooks', 'deploy_keys', 'protected_branches', 'git_hooks'].include? controller.controller_name
"active" "active"
end end
end end
......
...@@ -172,10 +172,8 @@ class Commit ...@@ -172,10 +172,8 @@ class Commit
@raw.send(m, *args, &block) @raw.send(m, *args, &block)
end end
def respond_to?(method) def respond_to_missing?(method, include_private = false)
return true if @raw.respond_to?(method) @raw.respond_to?(method, include_private) || super
super
end end
# Truncate sha to 8 characters # Truncate sha to 8 characters
......
require 'task_list' require 'task_list'
require 'task_list/filter'
# Contains functionality for objects that can have task lists in their # Contains functionality for objects that can have task lists in their
# descriptions. Task list items can be added with Markdown like "* [x] Fix # descriptions. Task list items can be added with Markdown like "* [x] Fix
......
...@@ -433,4 +433,16 @@ class MergeRequest < ActiveRecord::Base ...@@ -433,4 +433,16 @@ class MergeRequest < ActiveRecord::Base
def approved_by_users def approved_by_users
approvals.map(&:user) approvals.map(&:user)
end end
def has_ci?
source_project.ci_service && commits.any?
end
def branch_missing?
!source_branch_exists? || !target_branch_exists?
end
def can_be_merged_by?(user)
::Gitlab::GitAccess.new(user, project).can_push_to_branch?(target_branch)
end
end end
...@@ -164,7 +164,7 @@ class Project < ActiveRecord::Base ...@@ -164,7 +164,7 @@ class Project < ActiveRecord::Base
scope :without_user, ->(user) { where('projects.id NOT IN (:ids)', ids: user.authorized_projects.map(&:id) ) } scope :without_user, ->(user) { where('projects.id NOT IN (:ids)', ids: user.authorized_projects.map(&:id) ) }
scope :without_team, ->(team) { team.projects.present? ? where('projects.id NOT IN (:ids)', ids: team.projects.map(&:id)) : scoped } scope :without_team, ->(team) { team.projects.present? ? where('projects.id NOT IN (:ids)', ids: team.projects.map(&:id)) : scoped }
scope :not_in_group, ->(group) { where('projects.id NOT IN (:ids)', ids: group.project_ids ) } scope :not_in_group, ->(group) { where('projects.id NOT IN (:ids)', ids: group.project_ids ) }
scope :in_namespace, ->(namespace) { where(namespace_id: namespace.id) } scope :in_namespace, ->(namespace_ids) { where(namespace_id: namespace_ids) }
scope :in_group_namespace, -> { joins(:group) } scope :in_group_namespace, -> { joins(:group) }
scope :personal, ->(user) { where(namespace_id: user.namespace_id) } scope :personal, ->(user) { where(namespace_id: user.namespace_id) }
scope :joined, ->(user) { where('namespace_id != ?', user.namespace_id) } scope :joined, ->(user) { where('namespace_id != ?', user.namespace_id) }
......
...@@ -163,10 +163,8 @@ class Repository ...@@ -163,10 +163,8 @@ class Repository
end end
end end
def respond_to?(method) def respond_to_missing?(method, include_private = false)
return true if raw_repository.respond_to?(method) raw_repository.respond_to?(method, include_private) || super
super
end end
def blob_at(sha, path) def blob_at(sha, path)
......
...@@ -381,8 +381,10 @@ class User < ActiveRecord::Base ...@@ -381,8 +381,10 @@ class User < ActiveRecord::Base
end end
def owned_projects def owned_projects
@owned_projects ||= begin @owned_projects ||=
Project.where(namespace_id: owned_groups.pluck(:id).push(namespace.id)).joins(:namespace) begin
namespace_ids = owned_groups.pluck(:id).push(namespace.id)
Project.in_namespace(namespace_ids).joins(:namespace)
end end
end end
......
...@@ -9,7 +9,7 @@ module Search ...@@ -9,7 +9,7 @@ module Search
def execute def execute
group = Group.find_by(id: params[:group_id]) if params[:group_id].present? group = Group.find_by(id: params[:group_id]) if params[:group_id].present?
projects = ProjectsFinder.new.execute(current_user) projects = ProjectsFinder.new.execute(current_user)
projects = projects.where(namespace_id: group.id) if group projects = projects.in_namespace(group.id) if group
project_ids = projects.pluck(:id) project_ids = projects.pluck(:id)
Gitlab::SearchResults.new(project_ids, params[:search]) Gitlab::SearchResults.new(project_ids, params[:search])
......
= form_tag(user_omniauth_callback_path(server['provider_name']), id: 'new_ldap_user' ) do = form_tag(user_omniauth_callback_path(server['provider_name']), id: 'new_ldap_user' ) do
= text_field_tag :username, nil, {class: "form-control top", placeholder: "#{server['label']} Login", autofocus: "autofocus"} = text_field_tag :username, nil, {class: "form-control top", placeholder: "#{server['label']} Login", autofocus: "autofocus"}
= password_field_tag :password, nil, {class: "form-control bottom", placeholder: "Password"} = password_field_tag :password, nil, {class: "form-control bottom", placeholder: "Password"}
- if devise_mapping.rememberable?
.remember-me.checkbox
%label{for: "remember_me"}
= check_box_tag :remember_me, '1', false, id: 'remember_me'
%span Remember me
= button_tag "#{server['label']} Sign in", class: "btn-save btn" = button_tag "#{server['label']} Sign in", class: "btn-save btn"
...@@ -56,6 +56,13 @@ ...@@ -56,6 +56,13 @@
Merge Requests Merge Requests
%span.count.merge_counter= @project.merge_requests.opened.count %span.count.merge_counter= @project.merge_requests.opened.count
- if project_nav_tab? :settings
= nav_link(controller: [:project_members, :teams]) do
= link_to namespace_project_project_members_path(@project.namespace, @project), title: 'Members', class: 'team-tab tab', data: {placement: 'right'} do
= icon('users fw')
%span
Members
- if project_nav_tab? :labels - if project_nav_tab? :labels
= nav_link(controller: :labels) do = nav_link(controller: :labels) do
= link_to namespace_project_labels_path(@project.namespace, @project), title: 'Labels', data: {placement: 'right'} do = link_to namespace_project_labels_path(@project.namespace, @project), title: 'Labels', data: {placement: 'right'} do
......
...@@ -10,14 +10,9 @@ ...@@ -10,14 +10,9 @@
%ul.project-settings-nav.sidebar-subnav %ul.project-settings-nav.sidebar-subnav
= nav_link(path: 'projects#edit') do = nav_link(path: 'projects#edit') do
= link_to edit_project_path(@project), title: 'Project', class: 'stat-tab tab', data: {placement: 'right'} do = link_to edit_project_path(@project), title: 'Project', class: 'stat-tab tab', data: {placement: 'right'} do
= icon('pencil-square-o') = icon('pencil-square-o fw')
%span %span
Project Settings Project Settings
= nav_link(controller: [:project_members, :teams]) do
= link_to namespace_project_project_members_path(@project.namespace, @project), title: 'Members', class: 'team-tab tab', data: {placement: 'right'} do
= icon('users')
%span
Members
= nav_link(controller: :group_links) do = nav_link(controller: :group_links) do
= link_to namespace_project_group_links_path(@project.namespace, @project) do = link_to namespace_project_group_links_path(@project.namespace, @project) do
%i.fa.fa-share-square-o %i.fa.fa-share-square-o
...@@ -25,12 +20,12 @@ ...@@ -25,12 +20,12 @@
Groups Groups
= nav_link(controller: :deploy_keys) do = nav_link(controller: :deploy_keys) do
= link_to namespace_project_deploy_keys_path(@project.namespace, @project), title: 'Deploy Keys', data: {placement: 'right'} do = link_to namespace_project_deploy_keys_path(@project.namespace, @project), title: 'Deploy Keys', data: {placement: 'right'} do
= icon('key') = icon('key fw')
%span %span
Deploy Keys Deploy Keys
= nav_link(controller: :hooks) do = nav_link(controller: :hooks) do
= link_to namespace_project_hooks_path(@project.namespace, @project), title: 'Web Hooks', data: {placement: 'right'} do = link_to namespace_project_hooks_path(@project.namespace, @project), title: 'Web Hooks', data: {placement: 'right'} do
= icon('link') = icon('link fw')
%span %span
Web Hooks Web Hooks
= nav_link(controller: :git_hooks) do = nav_link(controller: :git_hooks) do
...@@ -40,12 +35,12 @@ ...@@ -40,12 +35,12 @@
Git Hooks Git Hooks
= nav_link(controller: :services) do = nav_link(controller: :services) do
= link_to namespace_project_services_path(@project.namespace, @project), title: 'Services', data: {placement: 'right'} do = link_to namespace_project_services_path(@project.namespace, @project), title: 'Services', data: {placement: 'right'} do
= icon('cogs') = icon('cogs fw')
%span %span
Services Services
= nav_link(controller: :protected_branches) do = nav_link(controller: :protected_branches) do
= link_to namespace_project_protected_branches_path(@project.namespace, @project), title: 'Protected Branches', data: {placement: 'right'} do = link_to namespace_project_protected_branches_path(@project.namespace, @project), title: 'Protected Branches', data: {placement: 'right'} do
= icon('lock') = icon('lock fw')
%span %span
Protected branches Protected branches
= nav_link(controller: :audit_events) do = nav_link(controller: :audit_events) do
......
...@@ -2,8 +2,10 @@ ...@@ -2,8 +2,10 @@
%h2.page-title Two-Factor Authentication (2FA) %h2.page-title Two-Factor Authentication (2FA)
%p %p
Download the Google Authenticator application from App Store for iOS or Download the Google Authenticator application from App Store for iOS or Google
Google Play for Android and scan this code. Play for Android and scan this code.
More information is available in the #{link_to('documentation', help_page_path('workflow', 'two_factor_authentication'))}.
%hr %hr
...@@ -12,10 +14,9 @@ ...@@ -12,10 +14,9 @@
.alert.alert-danger .alert.alert-danger
= @error = @error
.form-group .form-group
.col-sm-2 .col-lg-2.col-lg-offset-2
.col-sm-2
= raw @qr_code = raw @qr_code
.col-sm-8.manual-instructions .col-lg-7.col-lg-offset-1.manual-instructions
%h3 Can't scan the code? %h3 Can't scan the code?
%p %p
...@@ -33,7 +34,7 @@ ...@@ -33,7 +34,7 @@
%dd Yes %dd Yes
.form-group .form-group
= label_tag :pin_code, nil, class: "control-label" = label_tag :pin_code, nil, class: "control-label"
.col-sm-10 .col-lg-10
= text_field_tag :pin_code, nil, class: "form-control", required: true, autofocus: true = text_field_tag :pin_code, nil, class: "form-control", required: true, autofocus: true
.form-actions .form-actions
= submit_tag 'Submit', class: 'btn btn-success' = submit_tag 'Submit', class: 'btn btn-success'
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
.md-header.clearfix .md-header.clearfix
%ul.nav.nav-tabs %ul.nav.nav-tabs
%li.active %li.active
= link_to '#md-write-holder', class: 'js-md-write-button' do = link_to '#md-write-holder', class: 'js-md-write-button', tabindex: '-1' do
Write Write
%li %li
= link_to '#md-preview-holder', class: 'js-md-preview-button' do = link_to '#md-preview-holder', class: 'js-md-preview-button', tabindex: '-1' do
Preview Preview
- if defined?(referenced_users) && referenced_users - if defined?(referenced_users) && referenced_users
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
Project settings Project settings
%hr %hr
.panel-body .panel-body
= form_for [@project.namespace.becomes(Namespace), @project], remote: true, html: { multipart: true, class: "edit_project form-horizontal" }, authenticity_token: true do |f| = form_for [@project.namespace.becomes(Namespace), @project], remote: true, html: { multipart: true, class: "edit_project form-horizontal fieldset-form" }, authenticity_token: true do |f|
%fieldset %fieldset
.form-group.project_name_holder .form-group.project_name_holder
...@@ -41,31 +41,39 @@ ...@@ -41,31 +41,39 @@
%legend %legend
Features: Features:
.form-group .form-group
= f.label :issues_enabled, "Issues", class: 'control-label' .col-sm-offset-2.col-sm-10
.col-sm-10
.checkbox .checkbox
= f.label :issues_enabled do
= f.check_box :issues_enabled = f.check_box :issues_enabled
%strong Issues
%br
%span.descr Lightweight issue tracking system for this project %span.descr Lightweight issue tracking system for this project
.form-group .form-group
= f.label :merge_requests_enabled, "Merge Requests", class: 'control-label' .col-sm-offset-2.col-sm-10
.col-sm-10
.checkbox .checkbox
= f.label :merge_requests_enabled do
= f.check_box :merge_requests_enabled = f.check_box :merge_requests_enabled
%strong Merge Requests
%br
%span.descr Submit changes to be merged upstream. %span.descr Submit changes to be merged upstream.
.form-group .form-group
= f.label :wiki_enabled, "Wiki", class: 'control-label' .col-sm-offset-2.col-sm-10
.col-sm-10
.checkbox .checkbox
= f.label :wiki_enabled do
= f.check_box :wiki_enabled = f.check_box :wiki_enabled
%strong Wiki
%br
%span.descr Pages for project documentation %span.descr Pages for project documentation
.form-group .form-group
= f.label :snippets_enabled, "Snippets", class: 'control-label' .col-sm-offset-2.col-sm-10
.col-sm-10
.checkbox .checkbox
= f.label :snippets_enabled do
= f.check_box :snippets_enabled = f.check_box :snippets_enabled
%strong Snippets
%br
%span.descr Share code pastes with others out of git repository %span.descr Share code pastes with others out of git repository
= render 'merge_request_settings', f: f = render 'merge_request_settings', f: f
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
%li= link_to "Plain Diff", merge_request_path(@merge_request, format: :diff) %li= link_to "Plain Diff", merge_request_path(@merge_request, format: :diff)
= render "projects/merge_requests/show/how_to_merge" = render "projects/merge_requests/show/how_to_merge"
= render "projects/merge_requests/show/state_widget" = render "projects/merge_requests/widget/show.html.haml"
- if @commits.present? - if @commits.present?
%ul.nav.nav-tabs.merge-request-tabs %ul.nav.nav-tabs.merge-request-tabs
...@@ -69,10 +69,5 @@ ...@@ -69,10 +69,5 @@
var merge_request; var merge_request;
merge_request = new MergeRequest({ merge_request = new MergeRequest({
url_to_automerge_check: "#{automerge_check_namespace_project_merge_request_path(@project.namespace, @project, @merge_request)}",
check_enable: #{@merge_request.unchecked? ? "true" : "false"},
url_to_ci_check: "#{ci_status_namespace_project_merge_request_path(@project.namespace, @project, @merge_request)}",
ci_enable: #{@project.ci_service ? "true" : "false"},
current_status: "#{@merge_request.automerge_status}",
action: "#{controller.action_name}" action: "#{controller.action_name}"
}); });
-if @status - if @status
:plain :plain
merge_request.mergeInProgress(); merge_request_widget.mergeInProgress();
-else - else
:plain :plain
merge_request.alreadyOrCannotBeMerged() $('.mr-widget-body').html("#{escape_javascript(render('projects/merge_requests/widget/open/reload'))}");
- unless @allowed_to_merge
- if @project.archived?
%p
%strong Archived projects do not provide commit access.
- else
.automerge_widget.cannot_be_merged.hide
%strong This merge request contains merge conflicts that must be resolved.
Only those with write access to this repository can merge merge requests.
.automerge_widget.work_in_progress.hide
%strong This merge request is marked as Work In Progress.
Only those with write access to this repository can merge merge requests.
.automerge_widget.can_be_merged.hide
%strong This request can be merged automatically.
Only those with write access to this repository can merge merge requests.
- if @show_merge_controls
.automerge_widget.can_be_merged.hide
.clearfix
- if @merge_request.requires_approve? && !@merge_request.approved?
= render 'projects/merge_requests/show/approve'
- else
= form_for [:automerge, @project.namespace.becomes(Namespace), @project, @merge_request], remote: true, method: :post do |f|
.accept-merge-holder.clearfix.js-toggle-container
.accept-action
= f.submit "Accept Merge Request", class: "btn btn-create accept_merge_request"
- if can_remove_branch?(@merge_request.source_project, @merge_request.source_branch) && !@merge_request.for_fork?
.accept-control.checkbox
= label_tag :should_remove_source_branch, class: "remove_source_checkbox" do
= check_box_tag :should_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
= label_tag :should_rebase, class: "checkbox" do
= check_box_tag :should_rebase, "1", @project.merge_requests_rebase_default
Rebase before merge
.accept-control
= link_to "#", class: "modify-merge-commit-link js-toggle-button", title: "Modify merge commit message" do
%i.fa.fa-edit
Modify commit message
.js-toggle-content.hide.prepend-top-20
= render 'shared/commit_message_container', params: params,
text: @merge_request.merge_commit_message,
rows: 14, hint: true
%br
.light
If you want to merge this request manually, you can use the
%strong
= link_to "command line", "#modal_merge_info", class: "how_to_merge_link vlink", title: "How To Merge", "data-toggle" => "modal"
- if @merge_request.approvals.any?
.approved-by-users
Approved by
- @merge_request.approved_by_users.each do |user|
= link_to_member(@project, user, name: false, size: 24)
.automerge_widget.no_satellite.hide
%p
%span
%strong This repository does not have a satellite. Please ask an administrator to fix this issue!
.automerge_widget.cannot_be_merged.hide
%h4
This merge request contains merge conflicts that must be resolved.
You can try it manually on the
%strong
= link_to "command line", "#modal_merge_info", class: "how_to_merge_link vlink", title: "How To Merge", "data-toggle" => "modal"
%p
%button.btn.disabled{:type => 'button'}
%i.fa.fa-warning
Accept Merge Request
&nbsp;
This happens when Git is not able to automatically resolve conflicts between branches.
.automerge_widget.work_in_progress.hide
%h4
This merge request cannot be accepted because it is marked as Work In Progress.
%p
%button.btn.disabled{:type => 'button'}
%i.fa.fa-warning
Accept Merge Request
&nbsp;
When the merge request is ready, remove the "WIP" prefix from the title to allow it to be accepted.
.automerge_widget.unchecked
%p
%strong
%i.fa.fa-spinner.fa-spin
Checking automatic merge…
.automerge_widget.already_cannot_be_merged.hide
%p
%strong This merge request cannot be merged. Try to reload the page.
.merge-in-progress.hide
%p
%i.fa.fa-spinner.fa-spin
&nbsp;
Merge is in progress. Please wait… Page will be reloaded automatically. &nbsp;
- if @commits.any?
.ci_widget.ci-success{style: "display:none"}
= icon("check")
%span CI build passed
for #{@merge_request.last_commit_short_sha}.
= link_to "View build page", ci_build_details_path(@merge_request), :"data-no-turbolink" => "data-no-turbolink"
.ci_widget.ci-failed{style: "display:none"}
= icon("times")
%span CI build failed
for #{@merge_request.last_commit_short_sha}.
= link_to "View build page", ci_build_details_path(@merge_request), :"data-no-turbolink" => "data-no-turbolink"
- [:running, :pending].each do |status|
.ci_widget{class: "ci-#{status}", style: "display:none"}
= icon("clock-o")
%span CI build #{status}
for #{@merge_request.last_commit_short_sha}.
= link_to "View build page", ci_build_details_path(@merge_request), :"data-no-turbolink" => "data-no-turbolink"
.ci_widget
= icon("spinner spin")
Checking for CI status for #{@merge_request.last_commit_short_sha}
.ci_widget.ci-canceled{style: "display:none"}
= icon("times")
%span CI build canceled
for #{@merge_request.last_commit_short_sha}.
= link_to "View build page", ci_build_details_path(@merge_request), :"data-no-turbolink" => "data-no-turbolink"
.ci_widget.ci-error{style: "display:none"}
= icon("times")
%span Cannot connect to the CI server. Please check your settings and try again.
- if @source_branch.blank?
Source branch has been removed
- elsif can_remove_branch?(@merge_request.source_project, @merge_request.source_branch) && @merge_request.merged?
.remove_source_branch_widget
%p Changes merged into #{@merge_request.target_branch}. You can remove source branch now
= link_to namespace_project_branch_path(@merge_request.source_project.namespace, @merge_request.source_project, @source_branch), remote: true, method: :delete, class: "btn btn-primary btn-sm remove_source_branch" do
%i.fa.fa-times
Remove Source Branch
.remove_source_branch_widget.failed.hide
Failed to remove source branch '#{@merge_request.source_branch}'
.remove_source_branch_in_progress.hide
%i.fa.fa-spinner.fa-spin
&nbsp;
Removing source branch '#{@merge_request.source_branch}'. Please wait. Page will be automatically reloaded. &nbsp;
.mr-state-widget
- if @merge_request.source_project.ci_service && @commits.any?
.mr-widget-heading
= render "projects/merge_requests/show/mr_ci"
.mr-widget-body
- if @merge_request.open?
- if @merge_request.source_branch_exists? && @merge_request.target_branch_exists?
= render "projects/merge_requests/show/mr_accept"
- else
= render "projects/merge_requests/show/no_accept"
- if @merge_request.closed?
%h4
Rejected
- if @merge_request.closed_event
by #{link_to_member(@project, @merge_request.closed_event.author, avatar: true)}
#{time_ago_with_tooltip(@merge_request.closed_event.created_at)}
%p Changes were not merged into target branch
- if @merge_request.merged?
%h4
Accepted
- if @merge_request.merge_event
by #{link_to_member(@project, @merge_request.merge_event.author, avatar: true)}
#{time_ago_with_tooltip(@merge_request.merge_event.created_at)}
= render "projects/merge_requests/show/remove_source_branch"
- if @merge_request.locked?
%h4
Merge in progress...
%p
Merging is in progress. While merging this request is locked and cannot be closed.
- unless @commits.any?
%h4 Nothing to merge
%p
Nothing to merge from
%span.label-branch #{@merge_request.source_branch}
to
%span.label-branch #{@merge_request.target_branch}
%br
Try to use different branches or push new code.
- if @closes_issues.present? && @merge_request.open?
.mr-widget-footer
%span
%i.fa.fa-check
Accepting this merge request will close #{@closes_issues.size == 1 ? 'issue' : 'issues'}
= succeed '.' do
!= gfm(issues_sentence(@closes_issues))
.mr-state-widget
= render 'projects/merge_requests/widget/heading'
.mr-widget-body
%h4
Rejected
- if @merge_request.closed_event
by #{link_to_member(@project, @merge_request.closed_event.author, avatar: true)}
#{time_ago_with_tooltip(@merge_request.closed_event.created_at)}
%p Changes were not merged into target branch
- if @merge_request.has_ci?
.mr-widget-heading
.ci_widget.ci-success{style: "display:none"}
= icon("check")
%span CI build passed
for #{@merge_request.last_commit_short_sha}.
= link_to "View build page", ci_build_details_path(@merge_request), :"data-no-turbolink" => "data-no-turbolink"
.ci_widget.ci-failed{style: "display:none"}
= icon("times")
%span CI build failed
for #{@merge_request.last_commit_short_sha}.
= link_to "View build page", ci_build_details_path(@merge_request), :"data-no-turbolink" => "data-no-turbolink"
- [:running, :pending].each do |status|
.ci_widget{class: "ci-#{status}", style: "display:none"}
= icon("clock-o")
%span CI build #{status}
for #{@merge_request.last_commit_short_sha}.
= link_to "View build page", ci_build_details_path(@merge_request), :"data-no-turbolink" => "data-no-turbolink"
.ci_widget
= icon("spinner spin")
Checking for CI status for #{@merge_request.last_commit_short_sha}
.ci_widget.ci-canceled{style: "display:none"}
= icon("times")
%span CI build canceled
for #{@merge_request.last_commit_short_sha}.
= link_to "View build page", ci_build_details_path(@merge_request), :"data-no-turbolink" => "data-no-turbolink"
.ci_widget.ci-error{style: "display:none"}
= icon("times")
%span Cannot connect to the CI server. Please check your settings and try again.
:coffeescript
$ ->
merge_request_widget.getCiStatus()
.mr-state-widget
= render 'projects/merge_requests/widget/heading'
.mr-widget-body
%h4
Merge in progress...
%p
Merging is in progress. While merging this request is locked and cannot be closed.
.mr-state-widget
= render 'projects/merge_requests/widget/heading'
.mr-widget-body
%h4
Accepted
- if @merge_request.merge_event
by #{link_to_member(@project, @merge_request.merge_event.author, avatar: true)}
#{time_ago_with_tooltip(@merge_request.merge_event.created_at)}
%div
- if @source_branch.blank?
Source branch has been removed
- elsif can_remove_branch?(@merge_request.source_project, @merge_request.source_branch) && @merge_request.merged?
.remove_source_branch_widget
%p Changes merged into #{@merge_request.target_branch}. You can remove source branch now
= link_to namespace_project_branch_path(@merge_request.source_project.namespace, @merge_request.source_project, @source_branch), remote: true, method: :delete, class: "btn btn-primary btn-sm remove_source_branch" do
%i.fa.fa-times
Remove Source Branch
.remove_source_branch_widget.failed.hide
Failed to remove source branch '#{@merge_request.source_branch}'
.remove_source_branch_in_progress.hide
%i.fa.fa-spinner.fa-spin
&nbsp;
Removing source branch '#{@merge_request.source_branch}'. Please wait. Page will be automatically reloaded. &nbsp;
:coffeescript
$('.remove_source_branch').on 'click', ->
$('.remove_source_branch_widget').hide()
$('.remove_source_branch_in_progress').show()
$(".remove_source_branch").on "ajax:success", (e, data, status, xhr) ->
location.reload()
$(".remove_source_branch").on "ajax:error", (e, data, status, xhr) ->
$('.remove_source_branch_widget').hide()
$('.remove_source_branch_in_progress').hide()
$('.remove_source_branch_widget.failed').show()
.mr-state-widget
= render 'projects/merge_requests/widget/heading'
.mr-widget-body
- if @project.archived?
= render 'projects/merge_requests/widget/open/archived'
- elsif !@project.satellite.exists?
= render 'projects/merge_requests/widget/open/no_satellite'
- elsif @merge_request.commits.blank?
= render 'projects/merge_requests/widget/open/nothing'
- elsif @merge_request.branch_missing?
= render 'projects/merge_requests/widget/open/missing_branch'
- elsif @merge_request.unchecked?
= render 'projects/merge_requests/widget/open/check'
- elsif @merge_request.cannot_be_merged?
= render 'projects/merge_requests/widget/open/conflicts'
- elsif @merge_request.work_in_progress?
= render 'projects/merge_requests/widget/open/wip'
- elsif !@merge_request.can_be_merged_by?(current_user)
= render 'projects/merge_requests/widget/open/not_allowed'
- elsif @merge_request.requires_approve? && !@merge_request.approved?
= render 'projects/merge_requests/widget/open/approve'
- elsif @merge_request.can_be_merged?
= render 'projects/merge_requests/widget/open/accept'
- if @closes_issues.present?
.mr-widget-footer
%span
%i.fa.fa-check
Accepting this merge request will close #{@closes_issues.size == 1 ? 'issue' : 'issues'}
= succeed '.' do
!= gfm(issues_sentence(@closes_issues))
- if @merge_request.open?
= render 'projects/merge_requests/widget/open'
- elsif @merge_request.merged?
= render 'projects/merge_requests/widget/merged'
- elsif @merge_request.closed?
= render 'projects/merge_requests/widget/closed'
- elsif @merge_request.locked?
= render 'projects/merge_requests/widget/locked'
:javascript
var merge_request_widget;
merge_request_widget = new MergeRequestWidget({
url_to_automerge_check: "#{automerge_check_namespace_project_merge_request_path(@project.namespace, @project, @merge_request)}",
check_enable: #{@merge_request.unchecked? ? "true" : "false"},
url_to_ci_check: "#{ci_status_namespace_project_merge_request_path(@project.namespace, @project, @merge_request)}",
ci_enable: #{@project.ci_service ? "true" : "false"},
current_status: "#{@merge_request.automerge_status}",
});
= form_for [:automerge, @project.namespace.becomes(Namespace), @project, @merge_request], remote: true, method: :post, html: { class: 'accept-mr-form' } do |f|
= hidden_field_tag :authenticity_token, form_authenticity_token
.accept-merge-holder.clearfix.js-toggle-container
.accept-action
= f.button class: "btn btn-create accept_merge_request" do
Accept Merge Request
- if can_remove_branch?(@merge_request.source_project, @merge_request.source_branch) && !@merge_request.for_fork?
.accept-control.checkbox
= label_tag :should_remove_source_branch, class: "remove_source_checkbox" do
= check_box_tag :should_remove_source_branch
Remove source-branch
.accept-control
= link_to "#", class: "modify-merge-commit-link js-toggle-button", title: "Modify merge commit message" do
%i.fa.fa-edit
Modify commit message
.js-toggle-content.hide.prepend-top-20
= render 'shared/commit_message_container', params: params,
text: @merge_request.merge_commit_message,
rows: 14, hint: true
%br
.light
If you want to merge this request manually, you can use the
%strong
= link_to "command line", "#modal_merge_info", class: "how_to_merge_link vlink", title: "How To Merge", "data-toggle" => "modal"
- if @merge_request.approvals.any?
.approved-by-users
Approved by
- @merge_request.approved_by_users.each do |user|
= link_to_member(@project, user, name: false, size: 24)
:coffeescript
disableButtonIfEmptyField '#commit_message', '.accept_merge_request'
$('.accept-mr-form').on 'ajax:before', ->
btn = $('.accept_merge_request')
btn.disable()
btn.html("<i class='fa fa-spinner fa-spin'></i> Merge in progress")
.clearfix %div
- unless @merge_request.approved_by?(current_user) - unless @merge_request.approved_by?(current_user)
.append-bottom-10 .append-bottom-10
= form_for [:approve, @project.namespace.becomes(Namespace), @project, @merge_request], method: :post do |f| = form_for [:approve, @project.namespace.becomes(Namespace), @project, @merge_request], method: :post do |f|
= f.submit "Approve Merge Request", class: "btn btn-reopen approve-btn" = f.submit "Approve Merge Request", class: "btn btn-reopen approve-btn"
%p This merge request must be approved by #{pluralize(@merge_request.approvals_required, 'user')} before it can be merged
%p This merge request must be approved by #{pluralize(@merge_request.approvals_required, 'user')} before it can be merged
- if @merge_request.approvals.any?
.approved-by-users
Approved by
- @merge_request.approved_by_users.each do |user|
= link_to_member(@project, user, name: false, size: 24)
%p
%strong Archived projects do not provide commit access.
%strong
%i.fa.fa-spinner.fa-spin
Checking automatic merge…
:coffeescript
$ ->
merge_request_widget.getMergeStatus()
- if @merge_request.can_be_merged_by?(current_user)
%h4
This merge request contains merge conflicts that must be resolved.
You can try it manually on the
%strong
= link_to "command line", "#modal_merge_info", class: "how_to_merge_link vlink", title: "How To Merge", "data-toggle" => "modal"
- else
%strong This merge request contains merge conflicts that must be resolved.
Only those with write access to this repository can merge merge requests.
%p
%span
%strong This repository does not have a satellite. Please ask an administrator to fix this issue!
%strong This request can be merged automatically.
Only those with write access to this repository can merge merge requests.
%h4 Nothing to merge
%p
Nothing to merge from
%span.label-branch #{@merge_request.source_branch}
to
%span.label-branch #{@merge_request.target_branch}
%br
Try to use different branches or push new code.
This merge request cannot be merged. Try to reload the page.
- if @merge_request.can_be_merged_by?(current_user)
%h4
This merge request cannot be accepted because it is marked as Work In Progress.
%p
%button.btn.disabled{:type => 'button'}
%i.fa.fa-warning
Accept Merge Request
&nbsp;
When the merge request is ready, remove the "WIP" prefix from the title to allow it to be accepted.
- else
%strong This merge request is marked as Work In Progress.
Only those with write access to this repository can merge merge requests.
# See https://github.com/jnicklas/carrierwave#using-amazon-s3 # See https://github.com/jnicklas/carrierwave#using-amazon-s3
# for more options # for more options
# If you change this file in a Merge Request, please also create
# a Merge Request on https://gitlab.com/gitlab-org/omnibus-gitlab/merge_requests
#
production: production:
access_key_id: AKIA1111111111111UA access_key_id: AKIA1111111111111UA
secret_access_key: secret secret_access_key: secret
......
...@@ -4,9 +4,13 @@ ...@@ -4,9 +4,13 @@
# #
########################### NOTE ##################################### ########################### NOTE #####################################
# This file should not receive new settings. All configuration options # # This file should not receive new settings. All configuration options #
# are being moved to ApplicationSetting model! # # that do not require application restart are being moved to #
# ApplicationSetting model! #
# If you change this file in a Merge Request, please also create #
# a MR on https://gitlab.com/gitlab-org/omnibus-gitlab/merge_requests #
######################################################################## ########################################################################
# #
#
# How to use: # How to use:
# 1. Copy file as gitlab.yml # 1. Copy file as gitlab.yml
# 2. Update gitlab -> host with your fully qualified domain name # 2. Update gitlab -> host with your fully qualified domain name
...@@ -290,6 +294,9 @@ production: &base ...@@ -290,6 +294,9 @@ production: &base
# aws_secret_access_key: 'secret123' # aws_secret_access_key: 'secret123'
# # The remote 'directory' to store your backups. For S3, this would be the bucket name. # # The remote 'directory' to store your backups. For S3, this would be the bucket name.
# remote_directory: 'my.s3.bucket' # remote_directory: 'my.s3.bucket'
# # Use multipart uploads when file size reaches 100MB, see
# # http://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html
# multipart_chunk_size: 104857600
## GitLab Shell settings ## GitLab Shell settings
gitlab_shell: gitlab_shell:
......
...@@ -207,6 +207,7 @@ Settings.backup['upload'] ||= Settingslogic.new({ 'remote_directory' => nil, 'co ...@@ -207,6 +207,7 @@ Settings.backup['upload'] ||= Settingslogic.new({ 'remote_directory' => nil, 'co
if Settings.backup['upload']['connection'] if Settings.backup['upload']['connection']
Settings.backup['upload']['connection'] = Hash[Settings.backup['upload']['connection'].map { |k, v| [k.to_sym, v] }] Settings.backup['upload']['connection'] = Hash[Settings.backup['upload']['connection'].map { |k, v| [k.to_sym, v] }]
end end
Settings.backup['upload']['multipart_chunk_size'] ||= 104857600
# #
# Git # Git
......
# 1. Rename this file to rack_attack.rb # 1. Rename this file to rack_attack.rb
# 2. Review the paths_to_be_protected and add any other path you need protecting # 2. Review the paths_to_be_protected and add any other path you need protecting
# #
# If you change this file in a Merge Request, please also create a Merge Request on https://gitlab.com/gitlab-org/omnibus-gitlab/merge_requests
paths_to_be_protected = [ paths_to_be_protected = [
"#{Rails.application.config.relative_url_root}/users/password", "#{Rails.application.config.relative_url_root}/users/password",
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
# #
# For full list of options and their values see http://api.rubyonrails.org/classes/ActionMailer/Base.html # For full list of options and their values see http://api.rubyonrails.org/classes/ActionMailer/Base.html
# #
# If you change this file in a Merge Request, please also create a Merge Request on https://gitlab.com/gitlab-org/omnibus-gitlab/merge_requests
if Rails.env.production? if Rails.env.production?
Gitlab::Application.config.action_mailer.delivery_method = :smtp Gitlab::Application.config.action_mailer.delivery_method = :smtp
......
# If you change this file in a Merge Request, please also create
# a Merge Request on https://gitlab.com/gitlab-org/omnibus-gitlab/merge_requests
#
development: redis://localhost:6379 development: redis://localhost:6379
test: redis://localhost:6379 test: redis://localhost:6379
production: unix:/var/run/redis/redis.sock production: unix:/var/run/redis/redis.sock
...@@ -8,6 +8,9 @@ ...@@ -8,6 +8,9 @@
# See http://unicorn.bogomips.org/Unicorn/Configurator.html for complete # See http://unicorn.bogomips.org/Unicorn/Configurator.html for complete
# documentation. # documentation.
# Note: If you change this file in a Merge Request, please also create a
# Merge Request on https://gitlab.com/gitlab-org/omnibus-gitlab/merge_requests
#
# WARNING: See config/application.rb under "Relative url support" for the list of # WARNING: See config/application.rb under "Relative url support" for the list of
# other files that need to be changed for relative url support # other files that need to be changed for relative url support
# #
......
...@@ -40,11 +40,11 @@ ActiveRecord::Schema.define(version: 20150609125332) do ...@@ -40,11 +40,11 @@ ActiveRecord::Schema.define(version: 20150609125332) do
t.boolean "twitter_sharing_enabled", default: true t.boolean "twitter_sharing_enabled", default: true
t.text "help_text" t.text "help_text"
t.text "restricted_visibility_levels" t.text "restricted_visibility_levels"
t.boolean "version_check_enabled", default: true
t.integer "max_attachment_size", default: 10, null: false t.integer "max_attachment_size", default: 10, null: false
t.integer "default_project_visibility" t.integer "default_project_visibility"
t.integer "default_snippet_visibility" t.integer "default_snippet_visibility"
t.text "restricted_signup_domains" t.text "restricted_signup_domains"
t.boolean "version_check_enabled", default: true
t.boolean "user_oauth_applications", default: true t.boolean "user_oauth_applications", default: true
t.string "after_sign_out_path" t.string "after_sign_out_path"
end end
...@@ -579,12 +579,12 @@ ActiveRecord::Schema.define(version: 20150609125332) do ...@@ -579,12 +579,12 @@ ActiveRecord::Schema.define(version: 20150609125332) do
t.string "bitbucket_access_token" t.string "bitbucket_access_token"
t.string "bitbucket_access_token_secret" t.string "bitbucket_access_token_secret"
t.string "location" t.string "location"
t.string "public_email", default: "", null: false
t.string "encrypted_otp_secret" t.string "encrypted_otp_secret"
t.string "encrypted_otp_secret_iv" t.string "encrypted_otp_secret_iv"
t.string "encrypted_otp_secret_salt" t.string "encrypted_otp_secret_salt"
t.boolean "otp_required_for_login" t.boolean "otp_required_for_login"
t.text "otp_backup_codes" t.text "otp_backup_codes"
t.string "public_email", default: "", null: false
end end
add_index "users", ["admin"], name: "index_users_on_admin", using: :btree add_index "users", ["admin"], name: "index_users_on_admin", using: :btree
......
...@@ -71,9 +71,14 @@ Xth: (1 working day before the 22nd) ...@@ -71,9 +71,14 @@ Xth: (1 working day before the 22nd)
- [ ] Update GitLab.com with the stable version (#LINK) - [ ] Update GitLab.com with the stable version (#LINK)
- [ ] Update ci.gitLab.com with the stable version (#LINK) - [ ] Update ci.gitLab.com with the stable version (#LINK)
22nd: 22nd before 12AM CET:
Release before 12AM CET / 3AM PST, to make sure the majority of our users
get the new version on the 22nd and there is sufficient time in the European
workday to quickly fix any issues.
- [ ] Release CE, EE and CI (#LINK) - [ ] Release CE, EE and CI (#LINK)
- [ ] Schedule a second tweet of the release announcement at 6PM CET / 9AM PST
``` ```
......
# Migrating projects to a GitLab instance # Migrating projects to a GitLab instance
1. [Bitbucket](doc/workflow/import_projects_from_bitbucket.md) 1. [Bitbucket](import_projects_from_bitbucket.md)
2. [GitHub](doc/workflow/import_projects_from_github.md) 2. [GitHub](import_projects_from_github.md)
3. [GitLab.com](doc/workflow/import_projects_from_gitlab_com.md) 3. [GitLab.com](import_projects_from_gitlab_com.md)
4. [SVN](doc/workflow/migrating_from_svn.md) 4. [SVN](migrating_from_svn.md)
...@@ -6,15 +6,15 @@ It takes just a few steps to import your existing Bitbucket projects to GitLab. ...@@ -6,15 +6,15 @@ It takes just a few steps to import your existing Bitbucket projects to GitLab.
* Click on "New project" * Click on "New project"
![New project in GitLab](bitbucket_importer/bitbucket_import_new_project.jpg) ![New project in GitLab](bitbucket_importer/bitbucket_import_new_project.png)
* Click on the "Bitbucket" button * Click on the "Bitbucket" button
![Bitbucket](bitbucket_importer/bitbucket_import_select_bitbucket.jpg) ![Bitbucket](bitbucket_importer/bitbucket_import_select_bitbucket.png)
* Grant GitLab access to your Bitbucket account * Grant GitLab access to your Bitbucket account
![Grant access](bitbucket_importer/bitbucket_import_grant_access.jpg) ![Grant access](bitbucket_importer/bitbucket_import_grant_access.png)
* Click on the projects that you'd like to import or "Import all projects" * Click on the projects that you'd like to import or "Import all projects"
......
...@@ -45,7 +45,7 @@ storage in a safe place. **Each code can be used only once** to log in to your ...@@ -45,7 +45,7 @@ storage in a safe place. **Each code can be used only once** to log in to your
account. account.
If you lose the recovery codes or just want to generate new ones, you can do so If you lose the recovery codes or just want to generate new ones, you can do so
from the **Profile Settings** > **Acount** page where you first enabled 2FA. from the **Profile Settings** > **Account** page where you first enabled 2FA.
## Logging in with 2FA Enabled ## Logging in with 2FA Enabled
...@@ -60,7 +60,7 @@ your phone's application or a recovery code to log in. ...@@ -60,7 +60,7 @@ your phone's application or a recovery code to log in.
1. Log in to your GitLab account. 1. Log in to your GitLab account.
1. Go to your **Profile Settings**. 1. Go to your **Profile Settings**.
1. Go to **Acount**. 1. Go to **Account**.
1. Click **Disable Two-factor Authentication**. 1. Click **Disable Two-factor Authentication**.
[Google Authenticator]: https://support.google.com/accounts/answer/1066447?hl=en [Google Authenticator]: https://support.google.com/accounts/answer/1066447?hl=en
......
...@@ -80,7 +80,7 @@ sudo docker pull sytse/gitlab-app:7.10.1 ...@@ -80,7 +80,7 @@ sudo docker pull sytse/gitlab-app:7.10.1
```bash ```bash
sudo docker run --name gitlab-data sytse/gitlab-data /bin/true sudo docker run --name gitlab-data sytse/gitlab-data /bin/true
sudo docker run --detach --name gitlab_app --publish 8080:80 --publish 2222:22 --volumes-from gitlab_data sytse/gitlab-app:7.10.1 sudo docker run --detach --name gitlab-app --publish 8080:80 --publish 2222:22 --volumes-from gitlab-data sytse/gitlab-app:7.10.1
``` ```
After this you can login to the web interface as explained above in 'After starting a container'. After this you can login to the web interface as explained above in 'After starting a container'.
...@@ -94,7 +94,12 @@ sudo docker build --tag gitlab-data docker/data/ ...@@ -94,7 +94,12 @@ sudo docker build --tag gitlab-data docker/data/
sudo docker build --tag gitlab-app:7.10.1 docker/app/ sudo docker build --tag gitlab-app:7.10.1 docker/app/
``` ```
After this run the images as described in the previous section. After this run the images:
```bash
sudo docker run --name gitlab-data gitlab-data /bin/true
sudo docker run --detach --name gitlab-app --publish 8080:80 --publish 2222:22 --volumes-from gitlab-data gitlab-app:7.10.1
```
We assume using a data volume container, this will simplify migrations and backups. We assume using a data volume container, this will simplify migrations and backups.
This empty container will exist to persist as volumes the 3 directories used by GitLab, so remember not to delete it. This empty container will exist to persist as volumes the 3 directories used by GitLab, so remember not to delete it.
...@@ -130,7 +135,7 @@ It Assumes that you're upgrading from 7.8.1 to 7.10.1 and you're in the updated ...@@ -130,7 +135,7 @@ It Assumes that you're upgrading from 7.8.1 to 7.10.1 and you're in the updated
sudo docker stop gitlab-app sudo docker stop gitlab-app
sudo docker rm gitlab-app sudo docker rm gitlab-app
sudo docker build --tag gitlab-app:7.10.1 docker/app/ sudo docker build --tag gitlab-app:7.10.1 docker/app/
sudo docker run --detach --name gitlab-app --publish 8080:80 --publish 2222:22 --volumes-from gitlab_data gitlab-app:7.10.1 sudo docker run --detach --name gitlab-app --publish 8080:80 --publish 2222:22 --volumes-from gitlab-data gitlab-app:7.10.1
``` ```
On the first run GitLab will reconfigure and update itself. If everything runs OK don't forget to cleanup the app image: On the first run GitLab will reconfigure and update itself. If everything runs OK don't forget to cleanup the app image:
...@@ -143,13 +148,13 @@ sudo docker rmi gitlab-app:7.8.1 ...@@ -143,13 +148,13 @@ sudo docker rmi gitlab-app:7.8.1
- Ensure the containers are running - Ensure the containers are running
- Login to Dockerhub with `sudo docker login` - Login to Dockerhub with `sudo docker login`
- Run the following (replace '7.9.2' with the version you're using and 'Sytse Sijbrandij' with your name): - Run the following (replace '7.10.1' with the version you're using and 'Sytse Sijbrandij' with your name):
```bash ```bash
sudo docker commit -m "Initial commit" -a "Sytse Sijbrandij" gitlab-app sytse/gitlab-app:7.10.1 sudo docker commit -m "Initial commit" -a "Sytse Sijbrandij" gitlab-app sytse/gitlab-app:7.10.1
sudo docker push sytse/gitlab-app:7.10.1 sudo docker push sytse/gitlab-app:7.10.1
sudo docker commit -m "Initial commit" -a "Sytse Sijbrandij" gitlab_data sytse/gitlab_data sudo docker commit -m "Initial commit" -a "Sytse Sijbrandij" gitlab-data sytse/gitlab-data
sudo docker push sytse/gitlab_data sudo docker push sytse/gitlab-data
``` ```
## Troubleshooting ## Troubleshooting
......
...@@ -35,6 +35,11 @@ Feature: Project Active Tab ...@@ -35,6 +35,11 @@ Feature: Project Active Tab
Then the active main tab should be Merge Requests Then the active main tab should be Merge Requests
And no other main tabs should be active And no other main tabs should be active
Scenario: On Project Members
Given I visit my project's members page
Then the active main tab should be Members
And no other main tabs should be active
Scenario: On Project Wiki Scenario: On Project Wiki
Given I visit my project's wiki page Given I visit my project's wiki page
Then the active main tab should be Wiki Then the active main tab should be Wiki
...@@ -49,13 +54,6 @@ Feature: Project Active Tab ...@@ -49,13 +54,6 @@ Feature: Project Active Tab
# Sub Tabs: Settings # Sub Tabs: Settings
Scenario: On Project Settings/Team
Given I visit my project's settings page
And I click the "Team" tab
Then the active sub nav should be Team
And no other sub navs should be active
And the active main tab should be Settings
Scenario: On Project Settings/Edit Scenario: On Project Settings/Edit
Given I visit my project's settings page Given I visit my project's settings page
And I click the "Edit" tab And I click the "Edit" tab
......
...@@ -69,14 +69,13 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps ...@@ -69,14 +69,13 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps
end end
step 'I visit big commit page' do step 'I visit big commit page' do
Commit::DIFF_SAFE_FILES = 20 stub_const('Commit::DIFF_SAFE_FILES', 20)
visit namespace_project_commit_path(@project.namespace, @project, sample_big_commit.id) visit namespace_project_commit_path(@project.namespace, @project, sample_big_commit.id)
end end
step 'I see big commit warning' do step 'I see big commit warning' do
page.should have_content sample_big_commit.message page.should have_content sample_big_commit.message
page.should have_content "Too many changes" page.should have_content "Too many changes"
Commit::DIFF_SAFE_FILES = 100
end end
step 'I visit a commit with an image that changed' do step 'I visit a commit with an image that changed' do
......
...@@ -190,6 +190,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps ...@@ -190,6 +190,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
end end
step 'merge request "Bug NS-05" is mergeable' do step 'merge request "Bug NS-05" is mergeable' do
merge_request.project.satellite.create
merge_request.mark_as_mergeable merge_request.mark_as_mergeable
end end
...@@ -198,7 +199,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps ...@@ -198,7 +199,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
merge!: true, merge!: true,
) )
within '.can_be_merged' do within '.mr-state-widget' do
click_button "Accept Merge Request" click_button "Accept Merge Request"
end end
end end
......
...@@ -255,6 +255,10 @@ module SharedPaths ...@@ -255,6 +255,10 @@ module SharedPaths
visit namespace_project_merge_requests_path(@project.namespace, @project) visit namespace_project_merge_requests_path(@project.namespace, @project)
end end
step "I visit my project's members page" do
visit namespace_project_project_members_path(@project.namespace, @project)
end
step "I visit my project's wiki page" do step "I visit my project's wiki page" do
visit namespace_project_wiki_path(@project.namespace, @project, :home) visit namespace_project_wiki_path(@project.namespace, @project, :home)
end end
......
...@@ -28,6 +28,10 @@ module SharedProjectTab ...@@ -28,6 +28,10 @@ module SharedProjectTab
ensure_active_main_tab('Issues') ensure_active_main_tab('Issues')
end end
step 'the active main tab should be Members' do
ensure_active_main_tab('Members')
end
step 'the active main tab should be Merge Requests' do step 'the active main tab should be Merge Requests' do
ensure_active_main_tab('Merge Requests') ensure_active_main_tab('Merge Requests')
end end
......
...@@ -46,7 +46,8 @@ module Backup ...@@ -46,7 +46,8 @@ module Backup
connection = ::Fog::Storage.new(connection_settings) connection = ::Fog::Storage.new(connection_settings)
directory = connection.directories.get(remote_directory) directory = connection.directories.get(remote_directory)
if directory.files.create(key: tar_file, body: File.open(tar_file), public: false) if directory.files.create(key: tar_file, body: File.open(tar_file), public: false,
multipart_chunk_size: Gitlab.config.backup.upload.multipart_chunk_size)
$progress.puts "done".green $progress.puts "done".green
else else
puts "uploading backup to #{remote_directory} failed".red puts "uploading backup to #{remote_directory} failed".red
......
module Gitlab
module GitoriousImport
GITORIOUS_HOST = "https://gitorious.org"
end
end
module Gitlab module Gitlab
module GitoriousImport module GitoriousImport
GITORIOUS_HOST = "https://gitorious.org"
class Client class Client
attr_reader :repo_list attr_reader :repo_list
......
module Gitlab module Gitlab
module GitoriousImport module GitoriousImport
GITORIOUS_HOST = "https://gitorious.org"
Repository = Struct.new(:full_name) do Repository = Struct.new(:full_name) do
def id def id
Digest::SHA1.hexdigest(full_name) Digest::SHA1.hexdigest(full_name)
......
...@@ -4,7 +4,11 @@ module Gitlab ...@@ -4,7 +4,11 @@ module Gitlab
def initialize(project_id, query, repository_ref = nil) def initialize(project_id, query, repository_ref = nil)
@project = Project.find(project_id) @project = Project.find(project_id)
@repository_ref = repository_ref @repository_ref = if repository_ref.present?
repository_ref
else
nil
end
@query = Shellwords.shellescape(query) if query.present? @query = Shellwords.shellescape(query) if query.present?
end end
......
## GitLab ## GitLab
## Contributors: randx, yin8086, sashkab, orkoden, axilleas, bbodenmiller, DouweM
## ##
## Lines starting with two hashes (##) are comments with information. ## Lines starting with two hashes (##) are comments with information.
## Lines starting with one hash (#) are configuration parameters that can be uncommented. ## Lines starting with one hash (#) are configuration parameters that can be uncommented.
## ##
################################## ##################################
## CONTRIBUTING ##
##################################
##
## If you change this file in a Merge Request, please also create
## a Merge Request on https://gitlab.com/gitlab-org/omnibus-gitlab/merge_requests
##
##################################
## CHUNKED TRANSFER ## ## CHUNKED TRANSFER ##
################################## ##################################
## ##
......
## GitLab ## GitLab
## Contributors: randx, yin8086, sashkab, orkoden, axilleas, bbodenmiller, DouweM
## ##
## Modified from nginx http version ## Modified from nginx http version
## Modified from http://blog.phusion.nl/2012/04/21/tutorial-setting-up-gitlab-on-debian-6/ ## Modified from http://blog.phusion.nl/2012/04/21/tutorial-setting-up-gitlab-on-debian-6/
...@@ -9,6 +8,13 @@ ...@@ -9,6 +8,13 @@
## Lines starting with one hash (#) are configuration parameters that can be uncommented. ## Lines starting with one hash (#) are configuration parameters that can be uncommented.
## ##
################################## ##################################
## CONTRIBUTING ##
##################################
##
## If you change this file in a Merge Request, please also create
## a Merge Request on https://gitlab.com/gitlab-org/omnibus-gitlab/merge_requests
##
##################################
## CHUNKED TRANSFER ## ## CHUNKED TRANSFER ##
################################## ##################################
## ##
......
...@@ -51,7 +51,7 @@ namespace :gitlab do ...@@ -51,7 +51,7 @@ namespace :gitlab do
git_base_path = Gitlab.config.gitlab_shell.repos_path git_base_path = Gitlab.config.gitlab_shell.repos_path
all_dirs = Dir.glob(git_base_path + '/*') all_dirs = Dir.glob(git_base_path + '/*')
global_projects = Project.where(namespace_id: nil).pluck(:path) global_projects = Project.in_namespace(nil).pluck(:path)
puts git_base_path.yellow puts git_base_path.yellow
puts "Looking for global repos to remove... " puts "Looking for global repos to remove... "
......
...@@ -51,11 +51,11 @@ namespace :gitlab do ...@@ -51,11 +51,11 @@ namespace :gitlab do
if namespace_path.blank? if namespace_path.blank?
Project Project
elsif namespace_path == '/' elsif namespace_path == '/'
Project.where(namespace_id: nil) Project.in_namespace(nil)
else else
namespace = Namespace.where(path: namespace_path).first namespace = Namespace.where(path: namespace_path).first
if namespace if namespace
Project.where(namespace_id: namespace.id) Project.in_namespace(namespace.id)
else else
puts "Namespace not found: #{namespace_path}".red puts "Namespace not found: #{namespace_path}".red
exit 2 exit 2
......
...@@ -16,7 +16,7 @@ describe Issue, "Issuable" do ...@@ -16,7 +16,7 @@ describe Issue, "Issuable" do
it { is_expected.to validate_presence_of(:iid) } it { is_expected.to validate_presence_of(:iid) }
it { is_expected.to validate_presence_of(:author) } it { is_expected.to validate_presence_of(:author) }
it { is_expected.to validate_presence_of(:title) } it { is_expected.to validate_presence_of(:title) }
it { is_expected.to ensure_length_of(:title).is_at_least(0).is_at_most(255) } it { is_expected.to validate_length_of(:title).is_at_least(0).is_at_most(255) }
end end
describe "Scope" do describe "Scope" do
......
...@@ -36,9 +36,7 @@ describe DeployKeysProject do ...@@ -36,9 +36,7 @@ describe DeployKeysProject do
it "doesn't destroy the deploy key" do it "doesn't destroy the deploy key" do
subject.destroy subject.destroy
expect { expect { deploy_key.reload }.not_to raise_error
deploy_key.reload
}.not_to raise_error(ActiveRecord::RecordNotFound)
end end
end end
...@@ -63,9 +61,7 @@ describe DeployKeysProject do ...@@ -63,9 +61,7 @@ describe DeployKeysProject do
it "doesn't destroy the deploy key" do it "doesn't destroy the deploy key" do
subject.destroy subject.destroy
expect { expect { deploy_key.reload }.not_to raise_error
deploy_key.reload
}.not_to raise_error(ActiveRecord::RecordNotFound)
end end
end end
end end
......
...@@ -26,8 +26,8 @@ describe Key do ...@@ -26,8 +26,8 @@ describe Key do
describe "Validation" do describe "Validation" do
it { is_expected.to validate_presence_of(:title) } it { is_expected.to validate_presence_of(:title) }
it { is_expected.to validate_presence_of(:key) } it { is_expected.to validate_presence_of(:key) }
it { is_expected.to ensure_length_of(:title).is_within(0..255) } it { is_expected.to validate_length_of(:title).is_within(0..255) }
it { is_expected.to ensure_length_of(:key).is_within(0..5000) } it { is_expected.to validate_length_of(:key).is_within(0..5000) }
end end
describe "Methods" do describe "Methods" do
......
...@@ -69,14 +69,14 @@ describe Project do ...@@ -69,14 +69,14 @@ describe Project do
it { is_expected.to validate_presence_of(:name) } it { is_expected.to validate_presence_of(:name) }
it { is_expected.to validate_uniqueness_of(:name).scoped_to(:namespace_id) } it { is_expected.to validate_uniqueness_of(:name).scoped_to(:namespace_id) }
it { is_expected.to ensure_length_of(:name).is_within(0..255) } it { is_expected.to validate_length_of(:name).is_within(0..255) }
it { is_expected.to validate_presence_of(:path) } it { is_expected.to validate_presence_of(:path) }
it { is_expected.to validate_uniqueness_of(:path).scoped_to(:namespace_id) } it { is_expected.to validate_uniqueness_of(:path).scoped_to(:namespace_id) }
it { is_expected.to ensure_length_of(:path).is_within(0..255) } it { is_expected.to validate_length_of(:path).is_within(0..255) }
it { is_expected.to ensure_length_of(:description).is_within(0..2000) } it { is_expected.to validate_length_of(:description).is_within(0..2000) }
it { is_expected.to validate_presence_of(:creator) } it { is_expected.to validate_presence_of(:creator) }
it { is_expected.to ensure_length_of(:issues_tracker_id).is_within(0..255) } it { is_expected.to validate_length_of(:issues_tracker_id).is_within(0..255) }
it { is_expected.to validate_presence_of(:namespace) } it { is_expected.to validate_presence_of(:namespace) }
it 'should not allow new projects beyond user limits' do it 'should not allow new projects beyond user limits' do
......
...@@ -38,10 +38,10 @@ describe Snippet do ...@@ -38,10 +38,10 @@ describe Snippet do
it { is_expected.to validate_presence_of(:author) } it { is_expected.to validate_presence_of(:author) }
it { is_expected.to validate_presence_of(:title) } it { is_expected.to validate_presence_of(:title) }
it { is_expected.to ensure_length_of(:title).is_within(0..255) } it { is_expected.to validate_length_of(:title).is_within(0..255) }
it { is_expected.to validate_presence_of(:file_name) } it { is_expected.to validate_presence_of(:file_name) }
it { is_expected.to ensure_length_of(:file_name).is_within(0..255) } it { is_expected.to validate_length_of(:file_name).is_within(0..255) }
it { is_expected.to validate_presence_of(:content) } it { is_expected.to validate_presence_of(:content) }
......
...@@ -96,7 +96,7 @@ describe User do ...@@ -96,7 +96,7 @@ describe User do
it { is_expected.to allow_value(0).for(:projects_limit) } it { is_expected.to allow_value(0).for(:projects_limit) }
it { is_expected.not_to allow_value(-1).for(:projects_limit) } it { is_expected.not_to allow_value(-1).for(:projects_limit) }
it { is_expected.to ensure_length_of(:bio).is_within(0..255) } it { is_expected.to validate_length_of(:bio).is_within(0..255) }
describe 'email' do describe 'email' do
it 'accepts info@example.com' do it 'accepts info@example.com' do
......
if ENV['SIMPLECOV']
require 'simplecov'
end
if ENV['COVERALLS']
require 'coveralls'
Coveralls.wear_merged!
end
ENV["RAILS_ENV"] ||= 'test' ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__) require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails' require 'rspec/rails'
require 'webmock/rspec' require 'shoulda/matchers'
require 'email_spec' require 'email_spec'
require 'sidekiq/testing/inline' require 'sidekiq/testing/inline'
...@@ -18,8 +9,6 @@ require 'sidekiq/testing/inline' ...@@ -18,8 +9,6 @@ require 'sidekiq/testing/inline'
# in spec/support/ and its subdirectories. # in spec/support/ and its subdirectories.
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f } Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
WebMock.disable_net_connect!(allow_localhost: true)
RSpec.configure do |config| RSpec.configure do |config|
config.use_transactional_fixtures = false config.use_transactional_fixtures = false
config.use_instantiated_fixtures = false config.use_instantiated_fixtures = false
......
...@@ -29,6 +29,6 @@ module ApiHelpers ...@@ -29,6 +29,6 @@ module ApiHelpers
end end
def json_response def json_response
JSON.parse(response.body) @_json_response ||= JSON.parse(response.body)
end end
end end
if ENV['SIMPLECOV']
require 'simplecov'
end
if ENV['COVERALLS']
require 'coveralls'
Coveralls.wear_merged!
end
...@@ -70,7 +70,7 @@ end ...@@ -70,7 +70,7 @@ end
# Extend shoulda-matchers # Extend shoulda-matchers
module Shoulda::Matchers::ActiveModel module Shoulda::Matchers::ActiveModel
class EnsureLengthOfMatcher class ValidateLengthOfMatcher
# Shortcut for is_at_least and is_at_most # Shortcut for is_at_least and is_at_most
def is_within(range) def is_within(range)
is_at_least(range.min) && is_at_most(range.max) is_at_least(range.min) && is_at_most(range.max)
......
require 'webmock'
require 'webmock/rspec'
WebMock.disable_net_connect!(allow_localhost: true)
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