Commit 33dce2df authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'ce-to-ee' into 'master'

CE to EE

See merge request !419
parents 9b53b20a 89ac4f1d
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])
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
%li.pull-right %li.pull-right
= link_to dashboard_path(:atom, { private_token: current_user.private_token }), class: 'rss-btn' do = link_to dashboard_path(:atom, { private_token: current_user.private_token }), class: 'rss-btn' do
%i.fa.fa-rss %i.fa.fa-rss
Activity Feed
= render 'shared/event_filter' = render 'shared/event_filter'
%hr %hr
......
= 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"
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
%li %li
= link_to group_path(@group, { format: :atom, private_token: current_user.private_token }), title: "Feed", class: 'rss-btn' do = link_to group_path(@group, { format: :atom, private_token: current_user.private_token }), title: "Feed", class: 'rss-btn' do
%i.fa.fa-rss %i.fa.fa-rss
Activity Feed
= render 'shared/event_filter' = render 'shared/event_filter'
%hr %hr
......
...@@ -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
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
%li %li
= link_to namespace_project_path(@project.namespace, @project, format: :atom, private_token: current_user.private_token), title: "Feed", class: 'rss-btn' do = link_to namespace_project_path(@project.namespace, @project, format: :atom, private_token: current_user.private_token), title: "Feed", class: 'rss-btn' do
%i.fa.fa-rss %i.fa.fa-rss
Activity Feed
= render 'shared/event_filter' = render 'shared/event_filter'
%hr %hr
......
...@@ -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
......
...@@ -39,7 +39,7 @@ Xth: (6 working days before the 22nd) ...@@ -39,7 +39,7 @@ Xth: (6 working days before the 22nd)
- [ ] Merge CE master in to EE master via merge request (#LINK) - [ ] Merge CE master in to EE master via merge request (#LINK)
- [ ] Determine QA person and notify this person - [ ] Determine QA person and notify this person
- [ ] Check the tasks in [how to rc1 guide](howto_rc1.md) and delegate tasks if necessary - [ ] Check the tasks in [how to rc1 guide](https://dev.gitlab.org/gitlab/gitlabhq/blob/master/doc/release/howto_rc1.md) and delegate tasks if necessary
- [ ] Create CE, EE, CI RC1 versions (#LINK) - [ ] Create CE, EE, CI RC1 versions (#LINK)
Xth: (5 working days before the 22nd) Xth: (5 working days before the 22nd)
...@@ -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
......
...@@ -67,9 +67,10 @@ Feature: Project ...@@ -67,9 +67,10 @@ Feature: Project
Scenario: I should see audit events Scenario: I should see audit events
And gitlab user "Pete" And gitlab user "Pete"
And "Pete" is "Shop" developer And "Pete" is "Shop" developer
When I visit project "Shop" settings page When I visit project "Shop" page
And I go to "Members" And I go to "Members"
And I change "Pete" access level to master And I change "Pete" access level to master
And I visit project "Shop" settings page
And I go to "Audit Events" And I go to "Audit Events"
Then I should see the audit event listed Then I should see the audit event listed
......
...@@ -8,7 +8,7 @@ class Spinach::Features::AdminApplications < Spinach::FeatureSteps ...@@ -8,7 +8,7 @@ class Spinach::Features::AdminApplications < Spinach::FeatureSteps
end end
step 'I should see application form' do step 'I should see application form' do
page.should have_content "New application" expect(page).to have_content "New application"
end end
step 'I fill application form out and submit' do step 'I fill application form out and submit' do
...@@ -18,9 +18,9 @@ class Spinach::Features::AdminApplications < Spinach::FeatureSteps ...@@ -18,9 +18,9 @@ class Spinach::Features::AdminApplications < Spinach::FeatureSteps
end end
step 'I see application' do step 'I see application' do
page.should have_content "Application: test" expect(page).to have_content "Application: test"
page.should have_content "Application Id" expect(page).to have_content "Application Id"
page.should have_content "Secret" expect(page).to have_content "Secret"
end end
step 'I click edit' do step 'I click edit' do
...@@ -28,28 +28,28 @@ class Spinach::Features::AdminApplications < Spinach::FeatureSteps ...@@ -28,28 +28,28 @@ class Spinach::Features::AdminApplications < Spinach::FeatureSteps
end end
step 'I see edit application form' do step 'I see edit application form' do
page.should have_content "Edit application" expect(page).to have_content "Edit application"
end end
step 'I change name of application and submit' do step 'I change name of application and submit' do
page.should have_content "Edit application" expect(page).to have_content "Edit application"
fill_in :doorkeeper_application_name, with: 'test_changed' fill_in :doorkeeper_application_name, with: 'test_changed'
click_on "Submit" click_on "Submit"
end end
step 'I see that application was changed' do step 'I see that application was changed' do
page.should have_content "test_changed" expect(page).to have_content "test_changed"
page.should have_content "Application Id" expect(page).to have_content "Application Id"
page.should have_content "Secret" expect(page).to have_content "Secret"
end end
step 'I click to remove application' do step 'I click to remove application' do
within '.oauth-applications' do page.within '.oauth-applications' do
click_on "Destroy" click_on "Destroy"
end end
end end
step "I see that application is removed" do step "I see that application is removed" do
page.find(".oauth-applications").should_not have_content "test_changed" expect(page.find(".oauth-applications")).not_to have_content "test_changed"
end end
end end
...@@ -8,7 +8,7 @@ class Spinach::Features::AdminBroadcastMessages < Spinach::FeatureSteps ...@@ -8,7 +8,7 @@ class Spinach::Features::AdminBroadcastMessages < Spinach::FeatureSteps
end end
step 'I should be all broadcast messages' do step 'I should be all broadcast messages' do
page.should have_content "Migration to new server" expect(page).to have_content "Migration to new server"
end end
step 'submit form with new broadcast message' do step 'submit form with new broadcast message' do
...@@ -18,11 +18,11 @@ class Spinach::Features::AdminBroadcastMessages < Spinach::FeatureSteps ...@@ -18,11 +18,11 @@ class Spinach::Features::AdminBroadcastMessages < Spinach::FeatureSteps
end end
step 'I should be redirected to admin messages page' do step 'I should be redirected to admin messages page' do
current_path.should == admin_broadcast_messages_path expect(current_path).to eq admin_broadcast_messages_path
end end
step 'I should see newly created broadcast message' do step 'I should see newly created broadcast message' do
page.should have_content 'Application update from 4:00 CST to 5:00 CST' expect(page).to have_content 'Application update from 4:00 CST to 5:00 CST'
end end
step 'submit form with new customized broadcast message' do step 'submit form with new customized broadcast message' do
...@@ -35,7 +35,7 @@ class Spinach::Features::AdminBroadcastMessages < Spinach::FeatureSteps ...@@ -35,7 +35,7 @@ class Spinach::Features::AdminBroadcastMessages < Spinach::FeatureSteps
end end
step 'I should see a customized broadcast message' do step 'I should see a customized broadcast message' do
page.should have_content 'Application update from 4:00 CST to 5:00 CST' expect(page).to have_content 'Application update from 4:00 CST to 5:00 CST'
page.should have_selector %(div[style="background-color:#f2dede;color:#b94a48"]) expect(page).to have_selector %(div[style="background-color:#f2dede;color:#b94a48"])
end end
end end
...@@ -10,7 +10,7 @@ class Spinach::Features::AdminDeployKeys < Spinach::FeatureSteps ...@@ -10,7 +10,7 @@ class Spinach::Features::AdminDeployKeys < Spinach::FeatureSteps
step 'I should see all public deploy keys' do step 'I should see all public deploy keys' do
DeployKey.are_public.each do |p| DeployKey.are_public.each do |p|
page.should have_content p.title expect(page).to have_content p.title
end end
end end
...@@ -33,11 +33,11 @@ class Spinach::Features::AdminDeployKeys < Spinach::FeatureSteps ...@@ -33,11 +33,11 @@ class Spinach::Features::AdminDeployKeys < Spinach::FeatureSteps
end end
step 'I should be on admin deploy keys page' do step 'I should be on admin deploy keys page' do
current_path.should == admin_deploy_keys_path expect(current_path).to eq admin_deploy_keys_path
end end
step 'I should see newly created deploy key' do step 'I should see newly created deploy key' do
page.should have_content(deploy_key.title) expect(page).to have_content(deploy_key.title)
end end
def deploy_key def deploy_key
......
...@@ -28,32 +28,32 @@ class Spinach::Features::AdminGroups < Spinach::FeatureSteps ...@@ -28,32 +28,32 @@ class Spinach::Features::AdminGroups < Spinach::FeatureSteps
end end
step 'I should see newly created group' do step 'I should see newly created group' do
page.should have_content "Group: gitlab" expect(page).to have_content "Group: gitlab"
page.should have_content "Group description" expect(page).to have_content "Group description"
end end
step 'I should be redirected to group page' do step 'I should be redirected to group page' do
current_path.should == admin_group_path(Group.find_by(path: 'gitlab')) expect(current_path).to eq admin_group_path(Group.find_by(path: 'gitlab'))
end end
When 'I select user "John Doe" from user list as "Reporter"' do When 'I select user "John Doe" from user list as "Reporter"' do
select2(user_john.id, from: "#user_ids", multiple: true) select2(user_john.id, from: "#user_ids", multiple: true)
within "#new_project_member" do page.within "#new_project_member" do
select "Reporter", from: "access_level" select "Reporter", from: "access_level"
end end
click_button "Add users to group" click_button "Add users to group"
end end
step 'I should see "John Doe" in team list in every project as "Reporter"' do step 'I should see "John Doe" in team list in every project as "Reporter"' do
within ".group-users-list" do page.within ".group-users-list" do
page.should have_content "John Doe" expect(page).to have_content "John Doe"
page.should have_content "Reporter" expect(page).to have_content "Reporter"
end end
end end
step 'I should be all groups' do step 'I should be all groups' do
Group.all.each do |group| Group.all.each do |group|
page.should have_content group.name expect(page).to have_content group.name
end end
end end
...@@ -77,14 +77,14 @@ class Spinach::Features::AdminGroups < Spinach::FeatureSteps ...@@ -77,14 +77,14 @@ class Spinach::Features::AdminGroups < Spinach::FeatureSteps
end end
step 'I remove user "John Doe" from group' do step 'I remove user "John Doe" from group' do
within "#user_#{user_john.id}" do page.within "#user_#{user_john.id}" do
click_link 'Remove user from group' click_link 'Remove user from group'
end end
end end
step 'I should not see "John Doe" in team list' do step 'I should not see "John Doe" in team list' do
within ".group-users-list" do page.within ".group-users-list" do
page.should_not have_content "John Doe" expect(page).not_to have_content "John Doe"
end end
end end
......
...@@ -4,8 +4,8 @@ class Spinach::Features::AdminLogs < Spinach::FeatureSteps ...@@ -4,8 +4,8 @@ class Spinach::Features::AdminLogs < Spinach::FeatureSteps
include SharedAdmin include SharedAdmin
step 'I should see tabs with available logs' do step 'I should see tabs with available logs' do
page.should have_content 'production.log' expect(page).to have_content 'production.log'
page.should have_content 'githost.log' expect(page).to have_content 'githost.log'
page.should have_content 'application.log' expect(page).to have_content 'application.log'
end end
end end
...@@ -5,7 +5,7 @@ class Spinach::Features::AdminProjects < Spinach::FeatureSteps ...@@ -5,7 +5,7 @@ class Spinach::Features::AdminProjects < Spinach::FeatureSteps
step 'I should see all projects' do step 'I should see all projects' do
Project.all.each do |p| Project.all.each do |p|
page.should have_content p.name_with_namespace expect(page).to have_content p.name_with_namespace
end end
end end
...@@ -15,9 +15,9 @@ class Spinach::Features::AdminProjects < Spinach::FeatureSteps ...@@ -15,9 +15,9 @@ class Spinach::Features::AdminProjects < Spinach::FeatureSteps
step 'I should see project details' do step 'I should see project details' do
project = Project.first project = Project.first
current_path.should == admin_namespace_project_path(project.namespace, project) expect(current_path).to eq admin_namespace_project_path(project.namespace, project)
page.should have_content(project.name_with_namespace) expect(page).to have_content(project.name_with_namespace)
page.should have_content(project.creator.name) expect(page).to have_content(project.creator.name)
end end
step 'I visit admin project page' do step 'I visit admin project page' do
...@@ -34,8 +34,8 @@ class Spinach::Features::AdminProjects < Spinach::FeatureSteps ...@@ -34,8 +34,8 @@ class Spinach::Features::AdminProjects < Spinach::FeatureSteps
end end
step 'I should see project transfered' do step 'I should see project transfered' do
page.should have_content 'Web / ' + project.name expect(page).to have_content 'Web / ' + project.name
page.should have_content 'Namespace: Web' expect(page).to have_content 'Namespace: Web'
end end
def project def project
......
...@@ -11,9 +11,9 @@ class Spinach::Features::AdminSettings < Spinach::FeatureSteps ...@@ -11,9 +11,9 @@ class Spinach::Features::AdminSettings < Spinach::FeatureSteps
end end
step 'I should see application settings saved' do step 'I should see application settings saved' do
current_application_settings.gravatar_enabled.should be_false expect(current_application_settings.gravatar_enabled).to be_false
current_application_settings.home_page_url.should == 'https://about.gitlab.com/' expect(current_application_settings.home_page_url).to eq 'https://about.gitlab.com/'
page.should have_content 'Application settings saved successfully' expect(page).to have_content 'Application settings saved successfully'
end end
step 'I set the help text' do step 'I set the help text' do
...@@ -54,19 +54,19 @@ class Spinach::Features::AdminSettings < Spinach::FeatureSteps ...@@ -54,19 +54,19 @@ class Spinach::Features::AdminSettings < Spinach::FeatureSteps
end end
step 'I should see service template settings saved' do step 'I should see service template settings saved' do
page.should have_content 'Application settings saved successfully' expect(page).to have_content 'Application settings saved successfully'
end end
step 'I should see all checkboxes checked' do step 'I should see all checkboxes checked' do
all('input[type=checkbox]').each do |checkbox| page.all('input[type=checkbox]').each do |checkbox|
checkbox.should be_checked expect(checkbox).to be_checked
end end
end end
step 'I should see Slack settings saved' do step 'I should see Slack settings saved' do
find_field('Webhook').value.should eq 'http://localhost' expect(find_field('Webhook').value).to eq 'http://localhost'
find_field('Username').value.should eq 'test_user' expect(find_field('Username').value).to eq 'test_user'
find_field('Channel').value.should eq '#test_channel' expect(find_field('Channel').value).to eq '#test_channel'
end end
def help_text def help_text
......
...@@ -5,7 +5,7 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps ...@@ -5,7 +5,7 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps
step 'I should see all users' do step 'I should see all users' do
User.all.each do |user| User.all.each do |user|
page.should have_content user.name expect(page).to have_content user.name
end end
end end
...@@ -23,13 +23,13 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps ...@@ -23,13 +23,13 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps
end end
step 'See username error message' do step 'See username error message' do
within "#error_explanation" do page.within "#error_explanation" do
page.should have_content "Username" expect(page).to have_content "Username"
end end
end end
step 'Not changed form action url' do step 'Not changed form action url' do
page.should have_selector %(form[action="/admin/users/#{@user.username}"]) expect(page).to have_selector %(form[action="/admin/users/#{@user.username}"])
end end
step 'I submit modified user' do step 'I submit modified user' do
...@@ -38,7 +38,7 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps ...@@ -38,7 +38,7 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps
end end
step 'I see user attributes changed' do step 'I see user attributes changed' do
page.should have_content 'Can create groups: Yes' expect(page).to have_content 'Can create groups: Yes'
end end
step 'click edit on my user' do step 'click edit on my user' do
...@@ -53,7 +53,7 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps ...@@ -53,7 +53,7 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps
end end
step 'I see the secondary email' do step 'I see the secondary email' do
page.should have_content "Secondary email: #{@user_with_secondary_email.emails.last.email}" expect(page).to have_content "Secondary email: #{@user_with_secondary_email.emails.last.email}"
end end
step 'I click remove secondary email' do step 'I click remove secondary email' do
...@@ -61,7 +61,7 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps ...@@ -61,7 +61,7 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps
end end
step 'I should not see secondary email anymore' do step 'I should not see secondary email anymore' do
page.should_not have_content "Secondary email:" expect(page).not_to have_content "Secondary email:"
end end
step 'user "Mike" with groups and projects' do step 'user "Mike" with groups and projects' do
...@@ -79,8 +79,8 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps ...@@ -79,8 +79,8 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps
end end
step 'I should see user "Mike" details' do step 'I should see user "Mike" details' do
page.should have_content 'Account' expect(page).to have_content 'Account'
page.should have_content 'Personal projects limit' expect(page).to have_content 'Personal projects limit'
end end
step 'user "Pete" with ssh keys' do step 'user "Pete" with ssh keys' do
...@@ -94,8 +94,8 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps ...@@ -94,8 +94,8 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps
end end
step 'I should see key list' do step 'I should see key list' do
page.should have_content 'ssh-rsa Key2' expect(page).to have_content 'ssh-rsa Key2'
page.should have_content 'ssh-rsa Key1' expect(page).to have_content 'ssh-rsa Key1'
end end
step 'I click on the key title' do step 'I click on the key title' do
...@@ -103,8 +103,8 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps ...@@ -103,8 +103,8 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps
end end
step 'I should see key details' do step 'I should see key details' do
page.should have_content 'ssh-rsa Key2' expect(page).to have_content 'ssh-rsa Key2'
page.should have_content 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDQSTWXhJAX/He+nG78MiRRRn7m0Pb0XbcgTxE0etArgoFoh9WtvDf36HG6tOSg/0UUNcp0dICsNAmhBKdncp6cIyPaXJTURPRAGvhI0/VDk4bi27bRnccGbJ/hDaUxZMLhhrzY0r22mjVf8PF6dvv5QUIQVm1/LeaWYsHHvLgiIjwrXirUZPnFrZw6VLREoBKG8uWvfSXw1L5eapmstqfsME8099oi+vWLR8MgEysZQmD28M73fgW4zek6LDQzKQyJx9nB+hJkKUDvcuziZjGmRFlNgSA2mguERwL1OXonD8WYUrBDGKroIvBT39zS5d9tQDnidEJZ9Y8gv5ViYP7x Key2' expect(page).to have_content 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDQSTWXhJAX/He+nG78MiRRRn7m0Pb0XbcgTxE0etArgoFoh9WtvDf36HG6tOSg/0UUNcp0dICsNAmhBKdncp6cIyPaXJTURPRAGvhI0/VDk4bi27bRnccGbJ/hDaUxZMLhhrzY0r22mjVf8PF6dvv5QUIQVm1/LeaWYsHHvLgiIjwrXirUZPnFrZw6VLREoBKG8uWvfSXw1L5eapmstqfsME8099oi+vWLR8MgEysZQmD28M73fgW4zek6LDQzKQyJx9nB+hJkKUDvcuziZjGmRFlNgSA2mguERwL1OXonD8WYUrBDGKroIvBT39zS5d9tQDnidEJZ9Y8gv5ViYP7x Key2'
end end
step 'I click on remove key' do step 'I click on remove key' do
...@@ -112,6 +112,6 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps ...@@ -112,6 +112,6 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps
end end
step 'I should see the key removed' do step 'I should see the key removed' do
page.should_not have_content 'ssh-rsa Key2' expect(page).not_to have_content 'ssh-rsa Key2'
end end
end end
...@@ -9,14 +9,14 @@ class Spinach::Features::DashboardArchivedProjects < Spinach::FeatureSteps ...@@ -9,14 +9,14 @@ class Spinach::Features::DashboardArchivedProjects < Spinach::FeatureSteps
end end
step 'I should see "Shop" project link' do step 'I should see "Shop" project link' do
page.should have_link "Shop" expect(page).to have_link "Shop"
end end
step 'I should not see "Forum" project link' do step 'I should not see "Forum" project link' do
page.should_not have_link "Forum" expect(page).not_to have_link "Forum"
end end
step 'I should see "Forum" project link' do step 'I should see "Forum" project link' do
page.should have_link "Forum" expect(page).to have_link "Forum"
end end
end end
...@@ -4,16 +4,16 @@ class Spinach::Features::Dashboard < Spinach::FeatureSteps ...@@ -4,16 +4,16 @@ class Spinach::Features::Dashboard < Spinach::FeatureSteps
include SharedProject include SharedProject
step 'I should see "New Project" link' do step 'I should see "New Project" link' do
page.should have_link "New project" expect(page).to have_link "New project"
end end
step 'I should see "Shop" project link' do step 'I should see "Shop" project link' do
page.should have_link "Shop" expect(page).to have_link "Shop"
end end
step 'I should see last push widget' do step 'I should see last push widget' do
page.should have_content "You pushed to fix" expect(page).to have_content "You pushed to fix"
page.should have_link "Create Merge Request" expect(page).to have_link "Create Merge Request"
end end
step 'I click "Create Merge Request" link' do step 'I click "Create Merge Request" link' do
...@@ -21,10 +21,10 @@ class Spinach::Features::Dashboard < Spinach::FeatureSteps ...@@ -21,10 +21,10 @@ class Spinach::Features::Dashboard < Spinach::FeatureSteps
end end
step 'I see prefilled new Merge Request page' do step 'I see prefilled new Merge Request page' do
current_path.should == new_namespace_project_merge_request_path(@project.namespace, @project) expect(current_path).to eq new_namespace_project_merge_request_path(@project.namespace, @project)
find("#merge_request_target_project_id").value.should == @project.id.to_s expect(find("#merge_request_target_project_id").value).to eq @project.id.to_s
find("input#merge_request_source_branch").value.should == "fix" expect(find("input#merge_request_source_branch").value).to eq "fix"
find("input#merge_request_target_branch").value.should == "master" expect(find("input#merge_request_target_branch").value).to eq "master"
end end
step 'user with name "John Doe" joined project "Shop"' do step 'user with name "John Doe" joined project "Shop"' do
...@@ -38,7 +38,7 @@ class Spinach::Features::Dashboard < Spinach::FeatureSteps ...@@ -38,7 +38,7 @@ class Spinach::Features::Dashboard < Spinach::FeatureSteps
end end
step 'I should see "John Doe joined project Shop" event' do step 'I should see "John Doe joined project Shop" event' do
page.should have_content "John Doe joined project #{project.name_with_namespace}" expect(page).to have_content "John Doe joined project #{project.name_with_namespace}"
end end
step 'user with name "John Doe" left project "Shop"' do step 'user with name "John Doe" left project "Shop"' do
...@@ -51,7 +51,7 @@ class Spinach::Features::Dashboard < Spinach::FeatureSteps ...@@ -51,7 +51,7 @@ class Spinach::Features::Dashboard < Spinach::FeatureSteps
end end
step 'I should see "John Doe left project Shop" event' do step 'I should see "John Doe left project Shop" event' do
page.should have_content "John Doe left project #{project.name_with_namespace}" expect(page).to have_content "John Doe left project #{project.name_with_namespace}"
end end
step 'I have group with projects' do step 'I have group with projects' do
...@@ -64,13 +64,13 @@ class Spinach::Features::Dashboard < Spinach::FeatureSteps ...@@ -64,13 +64,13 @@ class Spinach::Features::Dashboard < Spinach::FeatureSteps
step 'I should see projects list' do step 'I should see projects list' do
@user.authorized_projects.all.each do |project| @user.authorized_projects.all.each do |project|
page.should have_link project.name_with_namespace expect(page).to have_link project.name_with_namespace
end end
end end
step 'I should see groups list' do step 'I should see groups list' do
Group.all.each do |group| Group.all.each do |group|
page.should have_link group.name expect(page).to have_link group.name
end end
end end
...@@ -80,6 +80,6 @@ class Spinach::Features::Dashboard < Spinach::FeatureSteps ...@@ -80,6 +80,6 @@ class Spinach::Features::Dashboard < Spinach::FeatureSteps
end end
step 'I should see 1 project at group list' do step 'I should see 1 project at group list' do
find('span.last_activity/span').should have_content('1') expect(find('span.last_activity/span')).to have_content('1')
end end
end end
...@@ -4,27 +4,27 @@ class Spinach::Features::EventFilters < Spinach::FeatureSteps ...@@ -4,27 +4,27 @@ class Spinach::Features::EventFilters < Spinach::FeatureSteps
include SharedProject include SharedProject
step 'I should see push event' do step 'I should see push event' do
page.should have_selector('span.pushed') expect(page).to have_selector('span.pushed')
end end
step 'I should not see push event' do step 'I should not see push event' do
page.should_not have_selector('span.pushed') expect(page).not_to have_selector('span.pushed')
end end
step 'I should see new member event' do step 'I should see new member event' do
page.should have_selector('span.joined') expect(page).to have_selector('span.joined')
end end
step 'I should not see new member event' do step 'I should not see new member event' do
page.should_not have_selector('span.joined') expect(page).not_to have_selector('span.joined')
end end
step 'I should see merge request event' do step 'I should see merge request event' do
page.should have_selector('span.accepted') expect(page).to have_selector('span.accepted')
end end
step 'I should not see merge request event' do step 'I should not see merge request event' do
page.should_not have_selector('span.accepted') expect(page).not_to have_selector('span.accepted')
end end
step 'this project has push event' do step 'this project has push event' do
......
...@@ -17,29 +17,29 @@ class Spinach::Features::DashboardGroup < Spinach::FeatureSteps ...@@ -17,29 +17,29 @@ class Spinach::Features::DashboardGroup < Spinach::FeatureSteps
end end
step 'I should not see the "Leave" button for group "Owned"' do step 'I should not see the "Leave" button for group "Owned"' do
find(:css, 'li', text: "Owner").should_not have_selector(:css, 'i.fa.fa-sign-out') expect(find(:css, 'li', text: "Owner")).not_to have_selector(:css, 'i.fa.fa-sign-out')
# poltergeist always confirms popups. # poltergeist always confirms popups.
end end
step 'I should not see the "Leave" button for groupr "Guest"' do step 'I should not see the "Leave" button for groupr "Guest"' do
find(:css, 'li', text: "Guest").should_not have_selector(:css, 'i.fa.fa-sign-out') expect(find(:css, 'li', text: "Guest")).not_to have_selector(:css, 'i.fa.fa-sign-out')
# poltergeist always confirms popups. # poltergeist always confirms popups.
end end
step 'I should see group "Owned" in group list' do step 'I should see group "Owned" in group list' do
page.should have_content("Owned") expect(page).to have_content("Owned")
end end
step 'I should not see group "Owned" in group list' do step 'I should not see group "Owned" in group list' do
page.should_not have_content("Owned") expect(page).not_to have_content("Owned")
end end
step 'I should see group "Guest" in group list' do step 'I should see group "Guest" in group list' do
page.should have_content("Guest") expect(page).to have_content("Guest")
end end
step 'I should not see group "Guest" in group list' do step 'I should not see group "Guest" in group list' do
page.should_not have_content("Guest") expect(page).not_to have_content("Guest")
end end
step 'I click new group link' do step 'I click new group link' do
...@@ -53,15 +53,15 @@ class Spinach::Features::DashboardGroup < Spinach::FeatureSteps ...@@ -53,15 +53,15 @@ class Spinach::Features::DashboardGroup < Spinach::FeatureSteps
end end
step 'I should be redirected to group "Samurai" page' do step 'I should be redirected to group "Samurai" page' do
current_path.should == group_path(Group.find_by(name: 'Samurai')) expect(current_path).to eq group_path(Group.find_by(name: 'Samurai'))
end end
step 'I should see newly created group "Samurai"' do step 'I should see newly created group "Samurai"' do
page.should have_content "Samurai" expect(page).to have_content "Samurai"
page.should have_content "Tokugawa Shogunate" expect(page).to have_content "Tokugawa Shogunate"
end end
step 'I should see the "Can not leave message"' do step 'I should see the "Can not leave message"' do
page.should have_content "You can not leave Owned group because you're the last owner" expect(page).to have_content "You can not leave Owned group because you're the last owner"
end end
end end
...@@ -12,7 +12,7 @@ class Spinach::Features::DashboardHelp < Spinach::FeatureSteps ...@@ -12,7 +12,7 @@ class Spinach::Features::DashboardHelp < Spinach::FeatureSteps
end end
step 'I should see "Rake Tasks" page markdown rendered' do step 'I should see "Rake Tasks" page markdown rendered' do
page.should have_content "Gather information about GitLab and the system it runs on" expect(page).to have_content "Gather information about GitLab and the system it runs on"
end end
step 'Header "Rebuild project satellites" should have correct ids and links' do step 'Header "Rebuild project satellites" should have correct ids and links' do
......
...@@ -46,11 +46,11 @@ class Spinach::Features::DashboardIssues < Spinach::FeatureSteps ...@@ -46,11 +46,11 @@ class Spinach::Features::DashboardIssues < Spinach::FeatureSteps
end end
def should_see(issue) def should_see(issue)
page.should have_content(issue.title[0..10]) expect(page).to have_content(issue.title[0..10])
end end
def should_not_see(issue) def should_not_see(issue)
page.should_not have_content(issue.title[0..10]) expect(page).not_to have_content(issue.title[0..10])
end end
def assigned_issue def assigned_issue
......
...@@ -50,11 +50,11 @@ class Spinach::Features::DashboardMergeRequests < Spinach::FeatureSteps ...@@ -50,11 +50,11 @@ class Spinach::Features::DashboardMergeRequests < Spinach::FeatureSteps
end end
def should_see(merge_request) def should_see(merge_request)
page.should have_content(merge_request.title[0..10]) expect(page).to have_content(merge_request.title[0..10])
end end
def should_not_see(merge_request) def should_not_see(merge_request)
page.should_not have_content(merge_request.title[0..10]) expect(page).not_to have_content(merge_request.title[0..10])
end end
def assigned_merge_request def assigned_merge_request
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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