diff options
30 files changed, 209 insertions, 98 deletions
diff --git a/CHANGELOG b/CHANGELOG index f5e37725077..9c92935dc24 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -8,6 +8,7 @@ v 7.3.0 - Better search with filtering, pagination etc - Added a checkbox to toggle line wrapping in diff (Yuriy Glukhov) - Prevent project stars duplication when fork project + - Use the default Unicorn socket backlog value of 1024 - Support Unix domain sockets for Redis - Store session Redis keys in 'session:gitlab:' namespace - Deprecate LDAP account takeover based on partial LDAP email / GitLab username match @@ -28,6 +29,7 @@ v 7.3.0 - Project wiki search (Ralf Seidler) - Enabled Shibboleth authentication support (Matus Banas) - Zen mode (fullscreen) for issues/MR/notes (Robert Schilling) + - Add ability to configure webhook timeout via gitlab.yml (Wes Gurney) v 7.2.1 - Delete orphaned labels during label migration (James Brooks) diff --git a/app/assets/stylesheets/sections/notes.scss b/app/assets/stylesheets/sections/notes.scss index 4e13e30bac8..8df25f53762 100644 --- a/app/assets/stylesheets/sections/notes.scss +++ b/app/assets/stylesheets/sections/notes.scss @@ -90,6 +90,9 @@ ul.notes { border-width: 1px 0; padding-top: 0; vertical-align: top; + &.parallel{ + border-width: 1px; + } } } } diff --git a/app/controllers/projects/tags_controller.rb b/app/controllers/projects/tags_controller.rb index 86788b9963b..c80ad8355d5 100644 --- a/app/controllers/projects/tags_controller.rb +++ b/app/controllers/projects/tags_controller.rb @@ -34,7 +34,7 @@ class Projects::TagsController < Projects::ApplicationController respond_to do |format| format.html { redirect_to project_tags_path } - format.js { render nothing: true } + format.js end end end diff --git a/app/helpers/diff_helper.rb b/app/helpers/diff_helper.rb index afe7447d4e2..cb50d89cba8 100644 --- a/app/helpers/diff_helper.rb +++ b/app/helpers/diff_helper.rb @@ -36,7 +36,10 @@ module DiffHelper # Building array of lines # - # [left_type, left_line_number, left_line_content, line_code, right_line_type, right_line_number, right_line_content] + # [ + # left_type, left_line_number, left_line_content, left_line_code, + # right_line_type, right_line_number, right_line_content, right_line_code + # ] # diff_file.diff_lines.each do |line| @@ -49,26 +52,25 @@ module DiffHelper next_line = diff_file.next_line(line.index) if next_line + next_line_code = generate_line_code(diff_file.file_path, next_line) next_type = next_line.type next_line = next_line.text end - line = [type, line_old, full_line, line_code, next_type, line_new] if type == 'match' || type.nil? # line in the right panel is the same as in the left one - line = [type, line_old, full_line, line_code, type, line_new, full_line] + line = [type, line_old, full_line, line_code, type, line_new, full_line, line_code] lines.push(line) elsif type == 'old' if next_type == 'new' # Left side has text removed, right side has text added - line.push(next_line) + line = [type, line_old, full_line, line_code, next_type, line_new, next_line, next_line_code] lines.push(line) skip_next = true elsif next_type == 'old' || next_type.nil? # Left side has text removed, right side doesn't have any change - line.pop # remove the newline - line.push(nil) # no line number on the right panel - line.push(" ") # empty line on the right panel + # No next line code, no new line number, no new line text + line = [type, line_old, full_line, line_code, next_type, nil, " ", nil] lines.push(line) end elsif type == 'new' @@ -78,7 +80,7 @@ module DiffHelper next else # Change is only on the right side, left side has no change - line = [nil, nil, " ", line_code, type, line_new, full_line] + line = [nil, nil, " ", line_code, type, line_new, full_line, line_code] lines.push(line) end end @@ -97,4 +99,22 @@ module DiffHelper line end end + + def line_comments + @line_comments ||= @line_notes.group_by(&:line_code) + end + + def organize_comments(type_left, type_right, line_code_left, line_code_right) + comments_left = comments_right = nil + + unless type_left.nil? && type_right == 'new' + comments_left = line_comments[line_code_left] + end + + unless type_left.nil? && type_right.nil? + comments_right = line_comments[line_code_right] + end + + [comments_left, comments_right] + end end diff --git a/app/models/web_hook.rb b/app/models/web_hook.rb index 6cf0c1f683e..752eb8074ac 100644 --- a/app/models/web_hook.rb +++ b/app/models/web_hook.rb @@ -23,7 +23,7 @@ class WebHook < ActiveRecord::Base default_value_for :merge_requests_events, false # HTTParty timeout - default_timeout 10 + default_timeout Gitlab.config.gitlab.webhook_timeout validates :url, presence: true, format: { with: URI::regexp(%w(http https)), message: "should be a valid url" } diff --git a/app/views/projects/blob/_remove.html.haml b/app/views/projects/blob/_remove.html.haml index 692248dd233..93ffd4463b1 100644 --- a/app/views/projects/blob/_remove.html.haml +++ b/app/views/projects/blob/_remove.html.haml @@ -19,5 +19,8 @@ .form-group .col-sm-2 .col-sm-10 - = submit_tag 'Remove file', class: 'btn btn-remove' + = submit_tag 'Remove file', class: 'btn btn-remove btn-remove-file' = link_to "Cancel", '#', class: "btn btn-cancel", "data-dismiss" => "modal" + +:javascript + disableButtonIfEmptyField('#commit_message', '.btn-remove-file') diff --git a/app/views/projects/commits/_head.html.haml b/app/views/projects/commits/_head.html.haml index b636e8ffe16..2dcd84af010 100644 --- a/app/views/projects/commits/_head.html.haml +++ b/app/views/projects/commits/_head.html.haml @@ -12,7 +12,7 @@ = nav_link(controller: :tags) do = link_to project_tags_path(@project) do Tags - %span.badge= @repository.tags.length + %span.badge.js-totaltags-count= @repository.tags.length = nav_link(controller: :repositories, action: :stats) do = link_to stats_project_repository_path(@project) do diff --git a/app/views/projects/diffs/_parallel_view.html.haml b/app/views/projects/diffs/_parallel_view.html.haml index 3ec769e0b83..75f3a80f0d7 100644 --- a/app/views/projects/diffs/_parallel_view.html.haml +++ b/app/views/projects/diffs/_parallel_view.html.haml @@ -5,22 +5,36 @@ - type_left = line[0] - line_number_left = line[1] - line_content_left = line[2] - - line_code = line[3] + - line_code_left = line[3] - type_right = line[4] - line_number_right = line[5] - line_content_right = line[6] + - line_code_right = line[7] - %tr.line_holder.parallel{id: line_code} + %tr.line_holder.parallel - if type_left == 'match' = render "projects/diffs/match_line_parallel", { line: line_content_left, line_old: line_number_left, line_new: line_number_right } - elsif type_left == 'old' || type_left.nil? - %td.old_line{class: "#{type_left}"} - = link_to raw(line_number_left), "##{line_code}", id: line_code - %td.line_content{class: "parallel noteable_line #{type_left} #{line_code}", "line_code" => line_code }= raw line_content_left - %td.new_line{ class: "#{type_right == 'new' ? 'new' : nil}", data: { linenumber: line_number_right }} - = link_to raw(line_number_right), "##{line_code}", id: line_code - %td.line_content.parallel{class: "noteable_line #{type_right == 'new' ? 'new' : nil} #{line_code}", "line_code" => line_code}= raw line_content_right + %td.old_line{id: line_code_left, class: "#{type_left}"} + = link_to raw(line_number_left), "##{line_code_left}", id: line_code_left + %td.line_content{class: "parallel noteable_line #{type_left} #{line_code_left}", "line_code" => line_code_left }= raw line_content_left + + - if type_right == 'new' + - new_line_class = 'new' + - new_line_code = line_code_right + - else + - new_line_class = nil + - new_line_code = line_code_left + + %td.new_line{id: new_line_code, class: "#{new_line_class}", data: { linenumber: line_number_right }} + = link_to raw(line_number_right), "##{new_line_code}", id: new_line_code + %td.line_content.parallel{class: "noteable_line #{new_line_class} #{new_line_code}", "line_code" => new_line_code}= raw line_content_right + + - if @reply_allowed + - comments_left, comments_right = organize_comments(type_left, type_right, line_code_left, line_code_right) + - if comments_left.present? || comments_right.present? + = render "projects/notes/diff_notes_with_reply_parallel", notes1: comments_left, notes2: comments_right - if diff_file.diff.diff.blank? && diff_file.mode_changed? .file-mode-changed diff --git a/app/views/projects/merge_requests/show/_state_widget.html.haml b/app/views/projects/merge_requests/show/_state_widget.html.haml index c30310f1258..a5f8af89d1a 100644 --- a/app/views/projects/merge_requests/show/_state_widget.html.haml +++ b/app/views/projects/merge_requests/show/_state_widget.html.haml @@ -13,7 +13,7 @@ %h4 Closed by #{link_to_member(@project, @merge_request.closed_event.author, avatar: false)} #{time_ago_with_tooltip(@merge_request.closed_event.created_at)} - %p Changes was not merged into target branch + %p Changes were not merged into target branch - if @merge_request.merged? %h4 diff --git a/app/views/projects/network/show.html.haml b/app/views/projects/network/show.html.haml index 8356bef28b0..f8206936e6e 100644 --- a/app/views/projects/network/show.html.haml +++ b/app/views/projects/network/show.html.haml @@ -2,8 +2,8 @@ .project-network .controls = form_tag project_network_path(@project, @id), method: :get, class: 'form-inline network-form' do |f| - = text_field_tag :extended_sha1, @options[:extended_sha1], placeholder: "Input an extended SHA1 syntax", class: "search-input form-control input-mx-250" - = button_tag type: 'submit', class: 'btn btn-success' do + = text_field_tag :extended_sha1, @options[:extended_sha1], placeholder: "Input an extended SHA1 syntax", class: 'search-input form-control input-mx-250 search-sha' + = button_tag type: 'submit', class: 'btn btn-success btn-search-sha' do %i.icon-search .inline.prepend-left-20 .checkbox.light @@ -15,6 +15,8 @@ = spinner nil, true :javascript + disableButtonIfEmptyField('#extended_sha1', '.btn-search-sha') + network_graph = new Network({ url: '#{project_network_path(@project, @ref, @options.merge(format: :json))}', commit_url: '#{project_commit_path(@project, 'ae45ca32').gsub("ae45ca32", "%s")}', diff --git a/app/views/projects/new_tree/show.html.haml b/app/views/projects/new_tree/show.html.haml index 9ecbbe7508e..2f89bba5b06 100644 --- a/app/views/projects/new_tree/show.html.haml +++ b/app/views/projects/new_tree/show.html.haml @@ -1,9 +1,9 @@ %h3.page-title New file %hr .file-editor - = form_tag(project_new_tree_path(@project, @id), method: :put, class: "form-horizontal") do + = form_tag(project_new_tree_path(@project, @id), method: :put, class: 'form-horizontal form-new-file') do .form-group.commit_message-group - = label_tag 'file_name', class: "control-label" do + = label_tag 'file_name', class: 'control-label' do File name .col-sm-10 .input-group @@ -24,7 +24,7 @@ = label_tag 'commit_message', class: "control-label" do Commit message .col-sm-10 - = render 'shared/commit_message_container', {textarea: text_area_tag('commit_message', + = render 'shared/commit_message_container', {textarea: text_area_tag('commit_message form-control', params[:commit_message], placeholder: "Added new file", required: true, rows: 3, class: 'form-control')} .file-holder @@ -46,7 +46,7 @@ ace.config.set("modePath", gon.relative_url_root + "#{Gitlab::Application.config.assets.prefix}/ace-src-noconflict") var editor = ace.edit("editor"); - disableButtonIfEmptyField("#commit_message", ".js-commit-button"); + disableButtonIfAnyEmptyField($('.form-new-file'), '.form-control', '.btn-create') $(".js-commit-button").click(function(){ $("#file-content").val(editor.getValue()); diff --git a/app/views/projects/notes/_diff_notes_with_reply_parallel.html.haml b/app/views/projects/notes/_diff_notes_with_reply_parallel.html.haml index 8adf903a9a1..506d1fff008 100644 --- a/app/views/projects/notes/_diff_notes_with_reply_parallel.html.haml +++ b/app/views/projects/notes/_diff_notes_with_reply_parallel.html.haml @@ -1,14 +1,13 @@ -- note1 = notes1.first # example note -- note2 = notes2.first # example note --# Check if line want not changed since comment was left -/- if !defined?(line) || line == note.diff_line +- note1 = notes1.present? ? notes1.first : nil +- note2 = notes2.present? ? notes2.first : nil + %tr.notes_holder - if note1 %td.notes_line %span.btn.disabled %i.icon-comment = notes1.count - %td.notes_content + %td.notes_content.parallel %ul.notes{ rel: note1.discussion_id } = render notes1 @@ -23,7 +22,7 @@ %span.btn.disabled %i.icon-comment = notes2.count - %td.notes_content + %td.notes_content.parallel %ul.notes{ rel: note2.discussion_id } = render notes2 diff --git a/app/views/projects/tags/destroy.js.haml b/app/views/projects/tags/destroy.js.haml new file mode 100644 index 00000000000..ada6710f940 --- /dev/null +++ b/app/views/projects/tags/destroy.js.haml @@ -0,0 +1,3 @@ +$('.js-totaltags-count').html("#{@repository.tags.size}") +- if @repository.tags.size == 0 + $('.tags').load(document.URL + ' .nothing-here-block').hide().fadeIn(1000) diff --git a/app/views/projects/tags/index.html.haml b/app/views/projects/tags/index.html.haml index dc3188d43b8..6cbf99239ee 100644 --- a/app/views/projects/tags/index.html.haml +++ b/app/views/projects/tags/index.html.haml @@ -12,18 +12,19 @@ Tags give the ability to mark specific points in history as being important %hr -- unless @tags.empty? - %ul.bordered-list - - @tags.each do |tag| - = render 'tag', tag: @repository.find_tag(tag) +.tags + - unless @tags.empty? + %ul.bordered-list + - @tags.each do |tag| + = render 'tag', tag: @repository.find_tag(tag) - = paginate @tags, theme: 'gitlab' + = paginate @tags, theme: 'gitlab' -- else - .nothing-here-block - Repository has no tags yet. - %br - %small - Use git tag command to add a new one: + - else + .nothing-here-block + Repository has no tags yet. %br - %span.monospace git tag -a v1.4 -m 'version 1.4' + %small + Use git tag command to add a new one: + %br + %span.monospace git tag -a v1.4 -m 'version 1.4' diff --git a/app/views/shared/_promo.html.haml b/app/views/shared/_promo.html.haml index 7dec48e6585..5675e43b05f 100644 --- a/app/views/shared/_promo.html.haml +++ b/app/views/shared/_promo.html.haml @@ -2,3 +2,4 @@ = link_to "Homepage", "https://www.gitlab.com/" = link_to "Blog", "https://www.gitlab.com/blog/" = link_to "@gitlabhq", "https://twitter.com/gitlabhq" + = link_to "Requests", "http://feedback.gitlab.com/" diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index 8e85634d054..f041d692f10 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -80,6 +80,10 @@ production: &base snippets: false visibility_level: "private" # can be "private" | "internal" | "public" + ## Webhook settings + # Number of seconds to wait for HTTP response after sending webhook HTTP POST request (default: 10) + # webhook_timeout: 10 + ## Repository downloads directory # When a user clicks e.g. 'Download zip' on a project, a temporary zip file is created in the following directory. # The default is 'tmp/repositories' relative to the root of the Rails app. @@ -263,9 +267,9 @@ test: port: 80 # When you run tests we clone and setup gitlab-shell - # In order to setup it correctly you need to specify + # In order to setup it correctly you need to specify # your system username you use to run GitLab - # user: YOUR_USERNAME + # user: YOUR_USERNAME satellites: path: tmp/tests/gitlab-satellites/ gitlab_shell: diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 136622c65a2..5b7e69fbc6a 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -92,6 +92,7 @@ Settings.gitlab['restricted_visibility_levels'] = Settings.send(:verify_constant Settings.gitlab['username_changing_enabled'] = true if Settings.gitlab['username_changing_enabled'].nil? Settings.gitlab['issue_closing_pattern'] = '([Cc]lose[sd]|[Ff]ixe[sd]) #(\d+)' if Settings.gitlab['issue_closing_pattern'].nil? Settings.gitlab['default_projects_features'] ||= {} +Settings.gitlab['webhook_timeout'] ||= 10 Settings.gitlab.default_projects_features['issues'] = true if Settings.gitlab.default_projects_features['issues'].nil? Settings.gitlab.default_projects_features['merge_requests'] = true if Settings.gitlab.default_projects_features['merge_requests'].nil? Settings.gitlab.default_projects_features['wiki'] = true if Settings.gitlab.default_projects_features['wiki'].nil? diff --git a/config/unicorn.rb.example b/config/unicorn.rb.example index e88a4522338..c19a37ed062 100644 --- a/config/unicorn.rb.example +++ b/config/unicorn.rb.example @@ -28,9 +28,10 @@ worker_processes 2 # "current" directory that Capistrano sets up. working_directory "/home/git/gitlab" # available in 0.94.0+ -# listen on both a Unix domain socket and a TCP port, -# we use a shorter backlog for quicker failover when busy -listen "/home/git/gitlab/tmp/sockets/gitlab.socket", :backlog => 64 +# Listen on both a Unix domain socket and a TCP port. +# If you are load-balancing multiple Unicorn masters, lower the backlog +# setting to e.g. 64 for faster failover. +listen "/home/git/gitlab/tmp/sockets/gitlab.socket", :backlog => 1024 listen "127.0.0.1:8080", :tcp_nopush => true # nuke workers after 30 seconds instead of 60 seconds (the default) diff --git a/doc/install/database_mysql.md b/doc/install/database_mysql.md index 5e9bfff5653..362c492d0ac 100644 --- a/doc/install/database_mysql.md +++ b/doc/install/database_mysql.md @@ -28,14 +28,14 @@ We do not recommend using MySQL due to various issues. For example, case [(in)se # change $password in the command below to a real password you pick mysql> CREATE USER 'git'@'localhost' IDENTIFIED BY '$password'; - # Ensure you can use the InnoDB engine which is necessary to support long indexes. + # Ensure you can use the InnoDB engine which is necessary to support long indexes # If this fails, check your MySQL config files (e.g. `/etc/mysql/*.cnf`, `/etc/mysql/conf.d/*`) for the setting "innodb = off" mysql> SET storage_engine=INNODB; # Create the GitLab production database mysql> CREATE DATABASE IF NOT EXISTS `gitlabhq_production` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`; - # Grant the GitLab user necessary permissions on the table. + # Grant the GitLab user necessary permissions on the database mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, LOCK TABLES ON `gitlabhq_production`.* TO 'git'@'localhost'; # Quit the database session diff --git a/doc/install/installation.md b/doc/install/installation.md index 826eaec7d14..ce9d45526d0 100644 --- a/doc/install/installation.md +++ b/doc/install/installation.md @@ -190,8 +190,12 @@ We recommend using a PostgreSQL database. For MySQL check [MySQL setup guide](da # Copy the example Unicorn config sudo -u git -H cp config/unicorn.rb.example config/unicorn.rb + # Find number of cores + nproc + # Enable cluster mode if you expect to have a high load instance # Ex. change amount of workers to 3 for 2GB RAM server + # Set the number of workers to at least the number of cores sudo -u git -H editor config/unicorn.rb # Copy the example Rack attack config diff --git a/doc/raketasks/user_management.md b/doc/raketasks/user_management.md index eb9eebb4b4a..3c67753ad28 100644 --- a/doc/raketasks/user_management.md +++ b/doc/raketasks/user_management.md @@ -7,7 +7,7 @@ sudo gitlab-rake gitlab:import:user_to_projects[username@domain.tld] # installation from source or cookbook -bundle exec rake gitlab:import:user_to_projects[username@domain.tld] +bundle exec rake gitlab:import:user_to_projects[username@domain.tld] RAILS_ENV=production ``` ## Add all users to all projects @@ -21,7 +21,7 @@ Notes: sudo gitlab-rake gitlab:import:all_users_to_all_projects # installation from source or cookbook -bundle exec rake gitlab:import:all_users_to_all_projects +bundle exec rake gitlab:import:all_users_to_all_projects RAILS_ENV=production ``` ## Add user as a developer to all groups @@ -31,7 +31,7 @@ bundle exec rake gitlab:import:all_users_to_all_projects sudo gitlab-rake gitlab:import:user_to_groups[username@domain.tld] # installation from source or cookbook -bundle exec rake gitlab:import:user_to_groups[username@domain.tld] +bundle exec rake gitlab:import:user_to_groups[username@domain.tld] RAILS_ENV=production ``` ## Add all users to all groups @@ -45,5 +45,5 @@ Notes: sudo gitlab-rake gitlab:import:all_users_to_all_groups # installation from source or cookbook -bundle exec rake gitlab:import:all_users_to_all_groups +bundle exec rake gitlab:import:all_users_to_all_groups RAILS_ENV=production ``` diff --git a/features/project/commits/tags.feature b/features/project/commits/tags.feature index 36c7a6492ff..bea463cb786 100644 --- a/features/project/commits/tags.feature +++ b/features/project/commits/tags.feature @@ -27,5 +27,15 @@ Feature: Project Browse tags And I submit new tag form with tag that already exists Then I should see new an error that tag already exists + @javascript + Scenario: I delete a tag + Given I delete tag 'v1.1.0' + Then I should not see tag 'v1.1.0' + + @javascript + Scenario: I delete all tags and see info message + Given I delete all tags + Then I should see tags info message + # @wip # Scenario: I can download project by tag diff --git a/features/project/issues/labels.feature b/features/project/issues/labels.feature index bdc1646ff12..a9fe1595fc5 100644 --- a/features/project/issues/labels.feature +++ b/features/project/issues/labels.feature @@ -6,8 +6,8 @@ Feature: Project Labels Given I visit project "Shop" labels page Scenario: I should see labels list - Then I should see label "bug" - And I should see label "feature" + Then I should see label 'bug' + And I should see label 'feature' Scenario: I create new label Given I visit project "Shop" new label page diff --git a/features/project/merge_requests.feature b/features/project/merge_requests.feature index 8b6c296dfe6..f8dccc15c0e 100644 --- a/features/project/merge_requests.feature +++ b/features/project/merge_requests.feature @@ -147,3 +147,13 @@ Feature: Project Merge Requests And I switch to the diff tab And I unfold diff Then I should see additional file lines + + @javascript + Scenario: I show comments on a merge request side-by-side diff with comments in multiple files + Given project "Shop" have "Bug NS-05" open merge request with diffs inside + And I visit merge request page "Bug NS-05" + And I switch to the diff tab + And I leave a comment like "Line is correct" on line 12 of the first file + And I leave a comment like "Line is wrong" on line 39 of the second file + And I click Side-by-side Diff tab + Then I should see comments on the side-by-side diff page diff --git a/features/steps/project/browse_tags.rb b/features/steps/project/browse_tags.rb index 64c0c284f6c..6ccf5a87927 100644 --- a/features/steps/project/browse_tags.rb +++ b/features/steps/project/browse_tags.rb @@ -51,4 +51,32 @@ class ProjectBrowseTags < Spinach::FeatureSteps step 'I should see new an error that tag already exists' do page.should have_content 'Tag already exists' end + + step "I delete tag 'v1.1.0'" do + within '.tags' do + first('.btn-remove').click + sleep 0.05 + end + end + + step "I should not see tag 'v1.1.0'" do + within '.tags' do + page.all(visible: true).should_not have_content 'v1.1.0' + end + end + + step 'I delete all tags' do + within '.tags' do + all('.btn-remove').each do |remove| + remove.click + sleep 0.05 + end + end + end + + step 'I should see tags info message' do + within '.tags' do + page.should have_content 'Repository has no tags yet.' + end + end end diff --git a/features/steps/project/labels.rb b/features/steps/project/labels.rb index 6dd4df8a1ad..62c1d74c718 100644 --- a/features/steps/project/labels.rb +++ b/features/steps/project/labels.rb @@ -3,18 +3,6 @@ class ProjectLabels < Spinach::FeatureSteps include SharedProject include SharedPaths - step 'I should see label "bug"' do - within ".manage-labels-list" do - page.should have_content "bug" - end - end - - step 'I should see label "feature"' do - within ".manage-labels-list" do - page.should have_content "feature" - end - end - step 'I visit \'bug\' label edit page' do visit edit_project_label_path(project, bug_label) end @@ -71,6 +59,12 @@ class ProjectLabels < Spinach::FeatureSteps end end + step 'I should see label \'feature\'' do + within '.manage-labels-list' do + page.should have_content 'feature' + end + end + step 'I should see label \'bug\'' do within '.manage-labels-list' do page.should have_content 'bug' diff --git a/features/steps/project/merge_requests.rb b/features/steps/project/merge_requests.rb index 05d3e5067c5..3ffa3622f4b 100644 --- a/features/steps/project/merge_requests.rb +++ b/features/steps/project/merge_requests.rb @@ -250,6 +250,16 @@ class ProjectMergeRequests < Spinach::FeatureSteps expect(first('.text-file')).to have_content('.bundle') end + step 'I click Side-by-side Diff tab' do + click_link 'Side-by-side Diff' + end + + step 'I should see comments on the side-by-side diff page' do + within '.files [id^=diff]:nth-child(1) .note-text' do + page.should have_visible_content "Line is correct" + end + end + def project @project ||= Project.find_by!(name: "Shop") end diff --git a/lib/support/nginx/gitlab b/lib/support/nginx/gitlab index 16b06fe006e..49a68c62293 100644 --- a/lib/support/nginx/gitlab +++ b/lib/support/nginx/gitlab @@ -28,7 +28,7 @@ ## upstream gitlab { - server unix:/home/git/gitlab/tmp/sockets/gitlab.socket; + server unix:/home/git/gitlab/tmp/sockets/gitlab.socket fail_timeout=0; } ## Normal HTTP host diff --git a/lib/support/nginx/gitlab-ssl b/lib/support/nginx/gitlab-ssl index d2aa06fe7f6..19409e41f40 100644 --- a/lib/support/nginx/gitlab-ssl +++ b/lib/support/nginx/gitlab-ssl @@ -34,7 +34,7 @@ ## See installation.md#using-https for additional HTTPS configuration details. upstream gitlab { - server unix:/home/git/gitlab/tmp/sockets/gitlab.socket; + server unix:/home/git/gitlab/tmp/sockets/gitlab.socket fail_timeout=0; } ## Normal HTTP host diff --git a/spec/helpers/diff_helper_spec.rb b/spec/helpers/diff_helper_spec.rb index 4ab415b4ef3..b07742a6ee2 100644 --- a/spec/helpers/diff_helper_spec.rb +++ b/spec/helpers/diff_helper_spec.rb @@ -67,32 +67,33 @@ describe DiffHelper do def parallel_diff_result_array [ - ["match", 6, "@@ -6,12 +6,18 @@ module Popen", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_6_6", "match", 6, "@@ -6,12 +6,18 @@ module Popen"], - [nil, 6, " ", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_6_6", nil, 6, " "], - [nil, 7, " def popen(cmd, path=nil)", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_7_7", nil, 7, " def popen(cmd, path=nil)"], - [nil, 8, " unless cmd.is_a?(Array)", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_8_8", nil, 8, " unless cmd.is_a?(Array)"], - ["old", 9, "- raise <span class='idiff'></span>"System commands must be given as an array of strings"", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_9_9", "new", 9, "+ raise <span class='idiff'>RuntimeError, </span>"System commands must be given as an array of strings""], - [nil, 10, " end", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_10_10", nil, 10, " end"], [nil, 11, " ", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_11_11", nil, 11, " "], - [nil, 12, " path ||= Dir.pwd", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_12_12", nil, 12, " path ||= Dir.pwd"], - ["old", 13, "- vars = { "PWD" => path }", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_13_13", "old", nil, " "], - ["old", 14, "- options = { chdir: path }", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_14_13", "new", 13, "+"], - [nil, nil, " ", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_14", "new", 14, "+ vars = {"], - [nil, nil, " ", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_15", "new", 15, "+ "PWD" => path"], - [nil, nil, " ", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_16", "new", 16, "+ }"], - [nil, nil, " ", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_17", "new", 17, "+"], - [nil, nil, " ", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_18", "new", 18, "+ options = {"], - [nil, nil, " ", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_19", "new", 19, "+ chdir: path"], - [nil, nil, " ", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_20", "new", 20, "+ }"], - [nil, 15, " ", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_21", nil, 21, " "], - [nil, 16, " unless File.directory?(path)", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_16_22", nil, 22, " unless File.directory?(path)"], - [nil, 17, " FileUtils.mkdir_p(path)", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_17_23", nil, 23, " FileUtils.mkdir_p(path)"], - ["match", 19, "@@ -19,6 +25,7 @@ module Popen", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_19_25", "match", 25, "@@ -19,6 +25,7 @@ module Popen"], - [nil, 19, " ", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_19_25", nil, 25, " "], [nil, 20, " @cmd_output = """, "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_20_26", nil, 26, " @cmd_output = """], - [nil, 21, " @cmd_status = 0", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_21_27", nil, 27, " @cmd_status = 0"], - [nil, nil, " ", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_22_28", "new", 28, "+"], - [nil, 22, " Open3.popen3(vars, *cmd, options) do |stdin, stdout, stderr, wait_thr|", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_22_29", nil, 29, " Open3.popen3(vars, *cmd, options) do |stdin, stdout, stderr, wait_thr|"], - [nil, 23, " @cmd_output << stdout.read", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_23_30", nil, 30, " @cmd_output << stdout.read"], - [nil, 24, " @cmd_output << stderr.read", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_24_31", nil, 31, " @cmd_output << stderr.read"] + ["match", 6, "@@ -6,12 +6,18 @@ module Popen", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_6_6", "match", 6, "@@ -6,12 +6,18 @@ module Popen", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_6_6"], + [nil, 6, " ", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_6_6", nil, 6, " ", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_6_6"], [nil, 7, " def popen(cmd, path=nil)", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_7_7", nil, 7, " def popen(cmd, path=nil)", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_7_7"], + [nil, 8, " unless cmd.is_a?(Array)", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_8_8", nil, 8, " unless cmd.is_a?(Array)", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_8_8"], + ["old", 9, "- raise <span class='idiff'></span>"System commands must be given as an array of strings"", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_9_9", "new", 9, "+ raise <span class='idiff'>RuntimeError, </span>"System commands must be given as an array of strings"", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_10_9"], + [nil, 10, " end", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_10_10", nil, 10, " end", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_10_10"], + [nil, 11, " ", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_11_11", nil, 11, " ", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_11_11"], + [nil, 12, " path ||= Dir.pwd", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_12_12", nil, 12, " path ||= Dir.pwd", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_12_12"], + ["old", 13, "- vars = { "PWD" => path }", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_13_13", "old", nil, " ", nil], + ["old", 14, "- options = { chdir: path }", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_14_13", "new", 13, "+", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_13"], + [nil, nil, " ", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_14", "new", 14, "+ vars = {", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_14"], + [nil, nil, " ", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_15", "new", 15, "+ "PWD" => path", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_15"], + [nil, nil, " ", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_16", "new", 16, "+ }", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_16"], + [nil, nil, " ", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_17", "new", 17, "+", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_17"], + [nil, nil, " ", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_18", "new", 18, "+ options = {", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_18"], + [nil, nil, " ", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_19", "new", 19, "+ chdir: path", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_19"], + [nil, nil, " ", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_20", "new", 20, "+ }", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_20"], + [nil, 15, " ", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_21", nil, 21, " ", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_21"], + [nil, 16, " unless File.directory?(path)", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_16_22", nil, 22, " unless File.directory?(path)", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_16_22"], + [nil, 17, " FileUtils.mkdir_p(path)", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_17_23", nil, 23, " FileUtils.mkdir_p(path)", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_17_23"], + ["match", 19, "@@ -19,6 +25,7 @@ module Popen", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_19_25", "match", 25, "@@ -19,6 +25,7 @@ module Popen", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_19_25"], + [nil, 19, " ", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_19_25", nil, 25, " ", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_19_25"], + [nil, 20, " @cmd_output = """, "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_20_26", nil, 26, " @cmd_output = """, "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_20_26"], + [nil, 21, " @cmd_status = 0", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_21_27", nil, 27, " @cmd_status = 0", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_21_27"], + [nil, nil, " ", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_22_28", "new", 28, "+", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_22_28"], + [nil, 22, " Open3.popen3(vars, *cmd, options) do |stdin, stdout, stderr, wait_thr|", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_22_29", nil, 29, " Open3.popen3(vars, *cmd, options) do |stdin, stdout, stderr, wait_thr|", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_22_29"], + [nil, 23, " @cmd_output << stdout.read", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_23_30", nil, 30, " @cmd_output << stdout.read", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_23_30"], + [nil, 24, " @cmd_output << stderr.read", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_24_31", nil, 31, " @cmd_output << stderr.read", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_24_31"] ] end end |