From 32499e8276c936ddc0a3c951413b6f73cbdae00c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Ab=C3=A9lard?= Date: Sat, 11 Jan 2014 09:54:05 +0000 Subject: [PATCH 001/135] allow using the user's email address as a http parameter in gravatar urls for custom avatar systems. For example: plain_url: "http://avatar.company.com/avatar/?mail=%{email}&size=%{size}" --- app/helpers/application_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 0db43fa180..354bdd8e42 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -66,7 +66,7 @@ module ApplicationHelper else gravatar_url = request.ssl? || gitlab_config.https ? Gitlab.config.gravatar.ssl_url : Gitlab.config.gravatar.plain_url user_email.strip! - sprintf gravatar_url, hash: Digest::MD5.hexdigest(user_email.downcase), size: size + sprintf gravatar_url, hash: Digest::MD5.hexdigest(user_email.downcase), size: size, email: user_email end end @@ -221,4 +221,4 @@ module ApplicationHelper def render_markup(file_name, file_content) GitHub::Markup.render(file_name, file_content).html_safe end -end +end \ No newline at end of file From 301c4068e13c838368fa2f5d9e2e9af2b2124c23 Mon Sep 17 00:00:00 2001 From: Cyril Rohr Date: Sat, 5 Apr 2014 20:31:07 +0100 Subject: [PATCH 002/135] Add rake task to install or upgrade gitlab-shell installation. --- lib/tasks/gitlab/shell.rake | 58 +++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/lib/tasks/gitlab/shell.rake b/lib/tasks/gitlab/shell.rake index 08de0f2dd5..2fcc889d88 100644 --- a/lib/tasks/gitlab/shell.rake +++ b/lib/tasks/gitlab/shell.rake @@ -1,5 +1,63 @@ namespace :gitlab do namespace :shell do + desc "GITLAB | Install or upgrade gitlab-shell" + task :install, [:tag, :repo] => :environment do |t, args| + warn_user_is_not_gitlab + + args.with_defaults(tag: "v1.9.1", repo: "https://gitlab.com/gitlab-org/gitlab-shell.git") + + user = Settings.gitlab.user + home_dir = Settings.gitlab.user_home + gitlab_url = Settings.gitlab.url + # gitlab-shell requires a / at the end of the url + gitlab_url += "/" unless gitlab_url.match(/\/$/) + target_dir = File.join(home_dir, "gitlab-shell") + + # Clone if needed + unless File.directory?(target_dir) + sh "git clone '#{args.repo}' '#{target_dir}'" + end + + # Make sure we're on the right tag + Dir.chdir(target_dir) do + sh "git fetch origin && git reset --hard $(git describe #{args.tag} || git describe origin/#{args.tag})" + + redis_url = URI.parse(ENV['REDIS_URL'] || "redis://localhost:6379") + + config = { + user: user, + gitlab_url: gitlab_url, + http_settings: {self_signed_cert: false}, + repos_path: File.join(home_dir, "repositories"), + auth_file: File.join(home_dir, ".ssh", "authorized_keys"), + redis: { + bin: %x{which redis-cli}.chomp, + host: redis_url.host, + port: redis_url.port, + namespace: "resque:gitlab" + }, + log_level: "INFO", + audit_usernames: false + } + + # Generate config.yml based on existing gitlab settings + File.open("config.yml", "w+") {|f| f.puts config.to_yaml} + + # Launch installation process + sh "bin/install" + end + + # Required for debian packaging with PKGR: Setup .ssh/environment with + # the current PATH, so that the correct ruby version gets loaded + # Requires to set "PermitUserEnvironment yes" in sshd config (should not + # be an issue since it is more than likely that there are no "normal" + # user accounts on a gitlab server). The alternative is for the admin to + # install a ruby (1.9.3+) in the global path. + File.open(File.join(home_dir, ".ssh", "environment"), "w+") do |f| + f.puts "PATH=#{ENV['PATH']}" + end + end + desc "GITLAB | Setup gitlab-shell" task setup: :environment do setup From 8af8bee4538baa703085ccc2f44df2c967618ca4 Mon Sep 17 00:00:00 2001 From: Cyril Rohr Date: Tue, 8 Apr 2014 15:43:21 +0100 Subject: [PATCH 003/135] Add documentation for new rake task to install gitlab-shell. --- doc/install/installation.md | 41 ++++++++++++++----------------------- 1 file changed, 15 insertions(+), 26 deletions(-) diff --git a/doc/install/installation.md b/doc/install/installation.md index e1fa822f7d..54527a8950 100644 --- a/doc/install/installation.md +++ b/doc/install/installation.md @@ -119,30 +119,7 @@ Create a `git` user for Gitlab: sudo adduser --disabled-login --gecos 'GitLab' git - -# 4. GitLab shell - -GitLab Shell is an ssh access and repository management software developed specially for GitLab. - - # Go to home directory - cd /home/git - - # Clone gitlab shell - sudo -u git -H git clone https://gitlab.com/gitlab-org/gitlab-shell.git -b v1.9.1 - - cd gitlab-shell - - sudo -u git -H cp config.yml.example config.yml - - # Edit config and replace gitlab_url - # with something like 'http://domain.com/' - sudo -u git -H editor config.yml - - # Do setup - sudo -u git -H ./bin/install - - -# 5. Database +# 4. Database We recommend using a PostgreSQL database. For MySQL check [MySQL setup guide](database_mysql.md). @@ -165,7 +142,7 @@ We recommend using a PostgreSQL database. For MySQL check [MySQL setup guide](da sudo -u git -H psql -d gitlabhq_production -# 6. GitLab +# 5. GitLab # We'll install GitLab into home directory of the user "git" cd /home/git @@ -275,6 +252,18 @@ that were [fixed](https://github.com/bundler/bundler/pull/2817) in 1.5.2. # When done you see 'Administrator account created:' +## Install GitLab shell + +GitLab Shell is an ssh access and repository management software developed specially for GitLab. + + # Go to the Gitlab installation folder: + cd /home/git/gitlab + + # Run the installation task for gitlab-shell (replace `REDIS_URL` if needed): + sudo -u git -H bundle exec rake gitlab:shell:setup[v1.9.1] REDIS_URL=redis://localhost:6379 + + # By default, the gitlab-shell config is generated from your main gitlab config. You can review (and modify) it as follows: + sudo -u git -H editor /home/git/gitlab-shell/config.yml ## Install Init Script @@ -314,7 +303,7 @@ Check if GitLab and its environment are configured correctly: sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production -# 7. Nginx +# 6. Nginx **Note:** Nginx is the officially supported web server for GitLab. If you cannot or do not want to use Nginx as your web server, have a look at the From 8419a2a4ebf79631f712f3066b8a9d4594fe9666 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Ab=C3=A9lard?= Date: Thu, 10 Apr 2014 14:17:25 +0000 Subject: [PATCH 004/135] add mentions of the different placeholders possible for gravatar urls, mentionning the new %{email} --- config/gitlab.yml.example | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index 2bc984c929..d5a7c1cadc 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -108,6 +108,7 @@ production: &base ## Gravatar gravatar: enabled: true # Use user avatar image from Gravatar.com (default: true) + # gravatar urls: possible placeholders: %{hash} %{size} %{email} # plain_url: "http://..." # default: http://www.gravatar.com/avatar/%{hash}?s=%{size}&d=mm # ssl_url: "https://..." # default: https://secure.gravatar.com/avatar/%{hash}?s=%{size}&d=mm @@ -224,4 +225,4 @@ test: new_issue_url: "http://redmine/projects/:issues_tracker_id/issues/new" staging: - <<: *base + <<: *base \ No newline at end of file From 5d7bdf76426488f3229bb1f97aaa54a676cbf166 Mon Sep 17 00:00:00 2001 From: Arnaud ABELARD Date: Sat, 12 Apr 2014 23:10:45 +0200 Subject: [PATCH 005/135] allow using the user's email address as a http parameter in gravatar urls for custom avatar systems. For example: plain_url: "http://avatar.company.com/avatar/?mail=%{email}&size=%{size}" add mention of the different placeholders possible for gravatar urls, mentionning the new %{email} --- app/helpers/application_helper.rb | 2 +- config/gitlab.yml.example | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index faecde299c..5f07cdf448 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -75,7 +75,7 @@ module ApplicationHelper else gravatar_url = request.ssl? || gitlab_config.https ? Gitlab.config.gravatar.ssl_url : Gitlab.config.gravatar.plain_url user_email.strip! - sprintf gravatar_url, hash: Digest::MD5.hexdigest(user_email.downcase), size: size + sprintf gravatar_url, hash: Digest::MD5.hexdigest(user_email.downcase), size: size, email: user_email end end diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index f30ef528c9..11df7a5ff1 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -117,6 +117,7 @@ production: &base ## Gravatar gravatar: enabled: true # Use user avatar image from Gravatar.com (default: true) + # gravatar urls: possible placeholders: %{hash} %{size} %{email} # plain_url: "http://..." # default: http://www.gravatar.com/avatar/%{hash}?s=%{size}&d=mm # ssl_url: "https://..." # default: https://secure.gravatar.com/avatar/%{hash}?s=%{size}&d=mm From 6b068dccbb441127fd33319f6c56c43e59026182 Mon Sep 17 00:00:00 2001 From: Ciro Santilli Date: Mon, 14 Apr 2014 23:49:16 +0200 Subject: [PATCH 006/135] Include SASS in subdirectories with glob. --- app/assets/stylesheets/application.scss | 55 +++---------------------- 1 file changed, 5 insertions(+), 50 deletions(-) diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index ce36c1132e..c53873f95a 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -12,10 +12,7 @@ *= require nprogress-bootstrap */ -@import "main/variables.scss"; -@import "main/mixins.scss"; -@import "main/fonts.scss"; -@import "main/layout.scss"; +@import "main/*"; /** * Customized Twitter bootstrap @@ -31,64 +28,22 @@ /** * Generic css (forms, nav etc): */ -@import "generic/avatar.scss"; -@import "generic/common.scss"; -@import "generic/typography.scss"; -@import "generic/buttons.scss"; -@import "generic/blocks.scss"; -@import "generic/ui_box.scss"; -@import "generic/issue_box.scss"; -@import "generic/files.scss"; -@import "generic/lists.scss"; -@import "generic/flash.scss"; -@import "generic/forms.scss"; -@import "generic/selects.scss"; -@import "generic/highlight.scss"; -@import "generic/jquery.scss"; +@import "generic/*"; /** * Page specific styles (issues, projects etc): */ -@import "sections/header.scss"; -@import "sections/nav.scss"; -@import "sections/commits.scss"; -@import "sections/diff.scss"; -@import "sections/issues.scss"; -@import "sections/projects.scss"; -@import "sections/snippets.scss"; -@import "sections/votes.scss"; -@import "sections/merge_requests.scss"; -@import "sections/graph.scss"; -@import "sections/events.scss"; -@import "sections/themes.scss"; -@import "sections/tree.scss"; -@import "sections/notes.scss"; -@import "sections/profile.scss"; -@import "sections/login.scss"; -@import "sections/editor.scss"; -@import "sections/admin.scss"; -@import "sections/wiki.scss"; -@import "sections/wall.scss"; -@import "sections/dashboard.scss"; -@import "sections/stat_graph.scss"; -@import "sections/groups.scss"; +@import "sections/*"; /** * Code highlight */ -@import "highlight/white.scss"; -@import "highlight/dark.scss"; -@import "highlight/solarized_dark.scss"; -@import "highlight/monokai.scss"; +@import "highlight/*"; /** * UI themes: */ -@import "themes/ui_basic.scss"; -@import "themes/ui_mars.scss"; -@import "themes/ui_modern.scss"; -@import "themes/ui_gray.scss"; -@import "themes/ui_color.scss"; +@import "themes/*"; /** * Styles for JS behaviors. From 8d78662e69a11dc82916793d97aba36dacae1440 Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Tue, 15 Apr 2014 12:11:13 +0200 Subject: [PATCH 007/135] Give the Rails cache its own Redis namespace Before this change, Rails cache data was stored in a global Redis namespace. As a consequence, clearing the Rails cache (`rake cache:clear`) would also delete all Sidekiq queue data and session storage. This change puts all Rails cache data in a `cache:gitlab` namespace, making `rake cache:clear` safe again. --- CHANGELOG | 1 + config/environments/production.rb | 2 +- config/initializers/session_store.rb | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 3ef46f4484..25067d3abe 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -17,6 +17,7 @@ v 6.8.0 - Fix download link for huge MR diffs - Expose event and mergerequest timestamps in API - Fix emails on push service when only one commit is pushed + - Store Rails cache data in the Redis `cache:gitlab` namespace v 6.7.3 - Fix the merge notification email not being sent (Pierre de La Morinerie) diff --git a/config/environments/production.rb b/config/environments/production.rb index ad3c03d8fc..47f7e17aeb 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -53,7 +53,7 @@ Gitlab::Application.configure do else "redis://localhost:6379" end - config.cache_store = :redis_store, resque_url + config.cache_store = :redis_store, resque_url, {namespace: 'cache:gitlab'} # Enable serving of images, stylesheets, and JavaScripts from an asset server # config.action_controller.asset_host = "http://assets.example.com" diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb index f80b67a554..5fe5270236 100644 --- a/config/initializers/session_store.rb +++ b/config/initializers/session_store.rb @@ -2,7 +2,7 @@ Gitlab::Application.config.session_store( :redis_store, # Using the cookie_store would enable session replay attacks. - servers: Gitlab::Application.config.cache_store.last, # re-use the Redis config from the Rails cache store + servers: Gitlab::Application.config.cache_store[1], # re-use the Redis config from the Rails cache store key: '_gitlab_session', secure: Gitlab.config.gitlab.https, httponly: true, From d859d080942175082c1a0cf34d89c0eefd1a3c39 Mon Sep 17 00:00:00 2001 From: skv-headless Date: Tue, 15 Apr 2014 19:02:02 +0400 Subject: [PATCH 008/135] Editing preview --- Gemfile | 3 ++ Gemfile.lock | 6 ++-- app/assets/stylesheets/generic/files.scss | 4 +++ .../projects/edit_tree_controller.rb | 12 +++++++ app/helpers/commits_helper.rb | 7 ++-- app/helpers/tree_helper.rb | 8 +++++ app/models/note.rb | 7 ++-- app/views/projects/edit_tree/_diff.html.haml | 13 ++++++++ .../projects/edit_tree/preview.html.haml | 26 +++++++++++++++ app/views/projects/edit_tree/show.html.haml | 33 +++++++++++++++++-- config/routes.rb | 4 ++- db/schema.rb | 2 +- features/project/source/browse_files.feature | 10 ++++++ features/steps/project/browse_files.rb | 12 +++++++ lib/gitlab/diff_parser.rb | 20 +++++++---- 15 files changed, 148 insertions(+), 19 deletions(-) create mode 100644 app/views/projects/edit_tree/_diff.html.haml create mode 100644 app/views/projects/edit_tree/preview.html.haml diff --git a/Gemfile b/Gemfile index 4ab1ab50eb..2f1347879c 100644 --- a/Gemfile +++ b/Gemfile @@ -82,6 +82,9 @@ gem "seed-fu" gem "redcarpet", "~> 2.2.2" gem "github-markup" +# Diffs +gem 'diffy', '~> 3.0.3' + # Asciidoc to HTML gem "asciidoctor" diff --git a/Gemfile.lock b/Gemfile.lock index 7682540eba..60329b40a6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -101,6 +101,7 @@ GEM devise-async (0.8.0) devise (>= 2.2, < 3.2) diff-lcs (1.2.5) + diffy (3.0.3) docile (1.1.1) dotenv (0.9.0) email_spec (1.5.0) @@ -574,6 +575,7 @@ DEPENDENCIES default_value_for (~> 3.0.0) devise (= 3.0.4) devise-async (= 0.8.0) + diffy (~> 3.0.3) email_spec email_validator (~> 1.4.0) enumerize @@ -644,7 +646,7 @@ DEPENDENCIES simplecov sinatra six - slack-notifier (~> 0.2.0) + slack-notifier (~> 0.3.2) slim spinach-rails spring (= 1.1.1) @@ -662,4 +664,4 @@ DEPENDENCIES unicorn (~> 4.6.3) unicorn-worker-killer version_sorter - webmock \ No newline at end of file + webmock diff --git a/app/assets/stylesheets/generic/files.scss b/app/assets/stylesheets/generic/files.scss index 12559f7605..6418f24d97 100644 --- a/app/assets/stylesheets/generic/files.scss +++ b/app/assets/stylesheets/generic/files.scss @@ -26,6 +26,10 @@ margin-top: -5px; } + .left-options { + margin-top: -3px; + } + .file_name { color: $style_color; font-size: 14px; diff --git a/app/controllers/projects/edit_tree_controller.rb b/app/controllers/projects/edit_tree_controller.rb index ff5206b6fa..be611892bb 100644 --- a/app/controllers/projects/edit_tree_controller.rb +++ b/app/controllers/projects/edit_tree_controller.rb @@ -26,6 +26,18 @@ class Projects::EditTreeController < Projects::BaseTreeController end end + def preview + @content = params[:content] + #FIXME workaround https://github.com/gitlabhq/gitlabhq/issues/5936 + @content += "\n" if @blob.data.end_with?("\n") + + diffy = Diffy::Diff.new(@blob.data, @content, diff: '-U 3', + include_diff_info: true) + @diff = Gitlab::DiffParser.new(diffy.diff.scan(/.*\n/)) + + render layout: false + end + private def blob diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb index c6e4f574b6..de081acc2b 100644 --- a/app/helpers/commits_helper.rb +++ b/app/helpers/commits_helper.rb @@ -16,9 +16,10 @@ module CommitsHelper end def each_diff_line(diff, index) - Gitlab::DiffParser.new(diff).each do |full_line, type, line_code, line_new, line_old| - yield(full_line, type, line_code, line_new, line_old) - end + Gitlab::DiffParser.new(diff.diff.lines.to_a, diff.new_path) + .each do |full_line, type, line_code, line_new, line_old| + yield(full_line, type, line_code, line_new, line_old) + end end def each_diff_line_near(diff, index, expected_line_code) diff --git a/app/helpers/tree_helper.rb b/app/helpers/tree_helper.rb index 50501dffef..f39d0081dc 100644 --- a/app/helpers/tree_helper.rb +++ b/app/helpers/tree_helper.rb @@ -91,4 +91,12 @@ module TreeHelper def leave_edit_message "Leave edit mode?\nAll unsaved changes will be lost." end + + def editing_preview_title(filename) + if gitlab_markdown?(filename) || markup?(filename) + 'Preview' + else + 'Diff' + end + end end diff --git a/app/models/note.rb b/app/models/note.rb index 6f7afcd1f9..cee10ec90d 100644 --- a/app/models/note.rb +++ b/app/models/note.rb @@ -184,9 +184,10 @@ class Note < ActiveRecord::Base return @diff_line if @diff_line if diff - Gitlab::DiffParser.new(diff).each do |full_line, type, line_code, line_new, line_old| - @diff_line = full_line if line_code == self.line_code - end + Gitlab::DiffParser.new(diff.diff.lines.to_a, diff.new_path) + .each do |full_line, type, line_code, line_new, line_old| + @diff_line = full_line if line_code == self.line_code + end end @diff_line diff --git a/app/views/projects/edit_tree/_diff.html.haml b/app/views/projects/edit_tree/_diff.html.haml new file mode 100644 index 0000000000..cf044feb9a --- /dev/null +++ b/app/views/projects/edit_tree/_diff.html.haml @@ -0,0 +1,13 @@ +%table.text-file + - each_diff_line(diff, 1) do |line, type, line_code, line_new, line_old, raw_line| + %tr.line_holder{ id: line_code, class: "#{type}" } + - if type == "match" + %td.old_line= "..." + %td.new_line= "..." + %td.line_content.matched= line + - else + %td.old_line + = link_to raw(type == "new" ? " " : line_old), "##{line_code}", id: line_code + %td.new_line= link_to raw(type == "old" ? " " : line_new) , "##{line_code}", id: line_code + %td.line_content{class: "noteable_line #{type} #{line_code}", "line_code" => line_code}= raw diff_line_content(line) + diff --git a/app/views/projects/edit_tree/preview.html.haml b/app/views/projects/edit_tree/preview.html.haml new file mode 100644 index 0000000000..fc6d3bfbc2 --- /dev/null +++ b/app/views/projects/edit_tree/preview.html.haml @@ -0,0 +1,26 @@ +.diff-file + .diff-content + - if gitlab_markdown?(@blob.name) + .file-content.wiki + = preserve do + = markdown(@content) + - elsif markup?(@blob.name) + .file-content.wiki + = raw GitHub::Markup.render(@blob.name, @content) + - else + .file-content.code + - unless @diff.empty? + %table.text-file + - @diff.each do |line, type, line_code, line_new, line_old, raw_line| + %tr.line_holder{ id: line_code, class: "#{type}" } + - if type == "match" + %td.old_line= "..." + %td.new_line= "..." + %td.line_content.matched= line + - else + %td.old_line + = link_to raw(type == "new" ? " " : line_old), "##{line_code}", id: line_code + %td.new_line= link_to raw(type == "old" ? " " : line_new) , "##{line_code}", id: line_code + %td.line_content{class: "noteable_line #{type} #{line_code}", "line_code" => line_code}= raw diff_line_content(line) + - else + %p.nothing_here_message No changes. diff --git a/app/views/projects/edit_tree/show.html.haml b/app/views/projects/edit_tree/show.html.haml index 3f2e98f3a7..48babb43aa 100644 --- a/app/views/projects/edit_tree/show.html.haml +++ b/app/views/projects/edit_tree/show.html.haml @@ -1,8 +1,11 @@ %h3.page-title Edit mode .file-editor = form_tag(project_edit_tree_path(@project, @id), method: :put, class: "form-horizontal") do - .file-holder + .file-holder.file .file-title + .btn-group.js-edit-mode.left-options + = link_to 'Edit', '#editor', class: 'active hover btn btn-tiny' + = link_to editing_preview_title(@blob.name), '#preview', class: 'btn btn-tiny', 'data-preview-url' => preview_project_edit_tree_path(@project, @id) %i.icon-file %span.file_name = @path @@ -13,7 +16,8 @@ .btn-group.tree-btn-group = link_to "Cancel", @after_edit_path, class: "btn btn-tiny btn-cancel", data: { confirm: leave_edit_message } .file-content.code - %pre#editor= @blob.data + %pre.js-edit-mode-pane#editor= @blob.data + .js-edit-mode-pane#preview.hide .form-group.commit_message-group = label_tag 'commit_message', class: "control-label" do @@ -45,3 +49,28 @@ $("#file-content").val(editor.getValue()); $(".file-editor form").submit(); }); + + var editModePanes = $('.js-edit-mode-pane'), + editModeLinks = $('.js-edit-mode a'); + + editModeLinks.click(function(event) { + event.preventDefault(); + + var currentLink = $(this), + paneId = currentLink.attr('href'), + currentPane = editModePanes.filter(paneId); + + editModeLinks.removeClass('active hover'); + currentLink.addClass('active hover'); + editModePanes.hide(); + + if (paneId == '#preview') { + $.post(currentLink.data('preview-url'), { content: editor.getValue() }, function(response) { + currentPane.empty().append(response); + currentPane.fadeIn(200); + }) + } else { + currentPane.fadeIn(200); + editor.focus() + } + }) diff --git a/config/routes.rb b/config/routes.rb index f23542cc89..910c9ec239 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -187,7 +187,9 @@ Gitlab::Application.routes.draw do resources :blob, only: [:show, :destroy], constraints: {id: /.+/} resources :raw, only: [:show], constraints: {id: /.+/} resources :tree, only: [:show], constraints: {id: /.+/, format: /(html|js)/ } - resources :edit_tree, only: [:show, :update], constraints: {id: /.+/}, path: 'edit' + resources :edit_tree, only: [:show, :update], constraints: { id: /.+/ }, path: 'edit' do + post :preview, on: :member + end resources :new_tree, only: [:show, :update], constraints: {id: /.+/}, path: 'new' resources :commit, only: [:show], constraints: {id: /[[:alnum:]]{6,40}/} resources :commits, only: [:show], constraints: {id: /(?:[^.]|\.(?!atom$))+/, format: /atom/} diff --git a/db/schema.rb b/db/schema.rb index 265d556bd2..dbd489335d 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -319,7 +319,6 @@ ActiveRecord::Schema.define(version: 20140414131055) do t.integer "notification_level", default: 1, null: false t.datetime "password_expires_at" t.integer "created_by_id" - t.datetime "last_credential_check_at" t.string "avatar" t.string "confirmation_token" t.datetime "confirmed_at" @@ -327,6 +326,7 @@ ActiveRecord::Schema.define(version: 20140414131055) do t.string "unconfirmed_email" t.boolean "hide_no_ssh_key", default: false t.string "website_url", default: "", null: false + t.datetime "last_credential_check_at" end add_index "users", ["admin"], name: "index_users_on_admin", using: :btree diff --git a/features/project/source/browse_files.feature b/features/project/source/browse_files.feature index fd9a2f01a2..a204c3e10c 100644 --- a/features/project/source/browse_files.feature +++ b/features/project/source/browse_files.feature @@ -29,3 +29,13 @@ Feature: Project Browse files Given I click on "Gemfile.lock" file in repo And I click button "edit" Then I can edit code + + @javascript + Scenario: I can see editing preview + Given I click on "Gemfile.lock" file in repo + And I click button "edit" + And I edit code + And I click link "Diff" + Then I see diff + + diff --git a/features/steps/project/browse_files.rb b/features/steps/project/browse_files.rb index 069086d5ea..7cdd1101ac 100644 --- a/features/steps/project/browse_files.rb +++ b/features/steps/project/browse_files.rb @@ -41,6 +41,18 @@ class ProjectBrowseFiles < Spinach::FeatureSteps page.evaluate_script('editor.getValue()').should == "GitlabFileEditor" end + step 'I edit code' do + page.execute_script('editor.setValue("GitlabFileEditor")') + end + + step 'I click link "Diff"' do + click_link 'Diff' + end + + step 'I see diff' do + page.should have_css '.line_holder.new' + end + step 'I click on "new file" link in repo' do click_link 'new-file-link' end diff --git a/lib/gitlab/diff_parser.rb b/lib/gitlab/diff_parser.rb index fb27280c4a..14bbb32863 100644 --- a/lib/gitlab/diff_parser.rb +++ b/lib/gitlab/diff_parser.rb @@ -4,9 +4,9 @@ module Gitlab attr_reader :lines, :new_path - def initialize(diff) - @lines = diff.diff.lines.to_a - @new_path = diff.new_path + def initialize(lines, new_path = '') + @lines = lines + @new_path = new_path end def each @@ -18,10 +18,7 @@ module Gitlab lines_arr.each do |line| raw_line = line.dup - next if line.match(/^\-\-\- \/dev\/null/) - next if line.match(/^\+\+\+ \/dev\/null/) - next if line.match(/^\-\-\- a/) - next if line.match(/^\+\+\+ b/) + next if filename?(line) full_line = html_escape(line.gsub(/\n/, '')) full_line = ::Gitlab::InlineDiff.replace_markers full_line @@ -53,8 +50,17 @@ module Gitlab end end + def empty? + @lines.empty? + end + private + def filename?(line) + line.start_with?('--- /dev/null', '+++ /dev/null', '--- a', '+++ b', + '--- /tmp/diffy', '+++ /tmp/diffy') + end + def identification_type(line) if line[0] == "+" "new" From 7f13afdc0aa67de5da7c5ba9bb73dcd786ca284b Mon Sep 17 00:00:00 2001 From: Ricardo Melo Date: Wed, 16 Apr 2014 19:07:26 +0100 Subject: [PATCH 009/135] Fix typo in documentation --- doc/permissions/permissions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/permissions/permissions.md b/doc/permissions/permissions.md index ac4bdefddd..9be6423f66 100644 --- a/doc/permissions/permissions.md +++ b/doc/permissions/permissions.md @@ -27,7 +27,7 @@ If a user is a GitLab administrator they receive all permissions. |Remove protected branches| |||✓|✓| |Edit project| |||✓|✓| |Add Deploy Keys to project| |||✓|✓| -|Confiure Project Hooks| |||✓|✓| +|Configure Project Hooks| |||✓|✓| |Switch visibility level| ||||✓| |Transfer project to another namespace| ||||✓| |Remove project| ||||✓| From cf43bf3620f7b2600f5af168f7bf56c0129924f2 Mon Sep 17 00:00:00 2001 From: GitLab Date: Wed, 16 Apr 2014 21:03:54 +0200 Subject: [PATCH 010/135] Add db index for active user display. --- CHANGELOG | 3 +++ db/migrate/20140416185734_index_on_current_sign_in_at.rb | 5 +++++ db/schema.rb | 1 + 3 files changed, 9 insertions(+) create mode 100644 db/migrate/20140416185734_index_on_current_sign_in_at.rb diff --git a/CHANGELOG b/CHANGELOG index 3ef46f4484..fa8aba81a3 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +v 6.9.0 + - View active users in the admin dashboard + v 6.8.0 - Ability to at mention users that are participating in issue and merge req. discussion - Enabled GZip Compression for assets in example Nginx, make sure that Nginx is compiled with --with-http_gzip_static_module flag (this is default in Ubuntu) diff --git a/db/migrate/20140416185734_index_on_current_sign_in_at.rb b/db/migrate/20140416185734_index_on_current_sign_in_at.rb new file mode 100644 index 0000000000..0bf80ce154 --- /dev/null +++ b/db/migrate/20140416185734_index_on_current_sign_in_at.rb @@ -0,0 +1,5 @@ +class IndexOnCurrentSignInAt < ActiveRecord::Migration + def change + add_index :users, :current_sign_in_at + end +end diff --git a/db/schema.rb b/db/schema.rb index 265d556bd2..0d3923b35c 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -332,6 +332,7 @@ ActiveRecord::Schema.define(version: 20140414131055) do add_index "users", ["admin"], name: "index_users_on_admin", using: :btree add_index "users", ["authentication_token"], name: "index_users_on_authentication_token", unique: true, using: :btree add_index "users", ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true, using: :btree + add_index "users", ["current_sign_in_at"], name: "index_users_on_current_sign_in_at", using: :btree add_index "users", ["email"], name: "index_users_on_email", unique: true, using: :btree add_index "users", ["extern_uid", "provider"], name: "index_users_on_extern_uid_and_provider", unique: true, using: :btree add_index "users", ["name"], name: "index_users_on_name", using: :btree From 7ee0a94e8bd4da8862fab0ec2e8b7ccc0a2581f9 Mon Sep 17 00:00:00 2001 From: GitLab Date: Wed, 16 Apr 2014 21:14:40 +0200 Subject: [PATCH 011/135] Don't update the changelog since the feature landed in 6.8. --- CHANGELOG | 3 --- 1 file changed, 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index fa8aba81a3..3ef46f4484 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,3 @@ -v 6.9.0 - - View active users in the admin dashboard - v 6.8.0 - Ability to at mention users that are participating in issue and merge req. discussion - Enabled GZip Compression for assets in example Nginx, make sure that Nginx is compiled with --with-http_gzip_static_module flag (this is default in Ubuntu) From 5ef7fdbd54ef41de01b64b4df58529d4bf3c62a3 Mon Sep 17 00:00:00 2001 From: George Dewar Date: Thu, 17 Apr 2014 14:36:43 +1200 Subject: [PATCH 012/135] Fix bug in which a line count without empty lines was incorrectly used --- app/helpers/commits_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb index c6e4f574b6..b02be4623f 100644 --- a/app/helpers/commits_helper.rb +++ b/app/helpers/commits_helper.rb @@ -116,7 +116,7 @@ module CommitsHelper added_lines[line_new] = { line_code: line_code, type: type, line: line } end end - max_length = old_file ? old_file.sloc + added_lines.length : file.sloc + max_length = old_file ? [old_file.loc, file.loc].max : file.loc offset1 = 0 offset2 = 0 From 556ddbcad49be5d59cd6275639ac149f5b2ee7ac Mon Sep 17 00:00:00 2001 From: GitLab Date: Fri, 18 Apr 2014 12:05:00 +0200 Subject: [PATCH 013/135] Add schema number change. --- db/schema.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/schema.rb b/db/schema.rb index 0d3923b35c..e53a637af6 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20140414131055) do +ActiveRecord::Schema.define(version: 20140416185734) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" From 05e792b4c492e04aaa7e301432f71e01d63c02bc Mon Sep 17 00:00:00 2001 From: Timm Friebe Date: Tue, 15 Apr 2014 16:39:46 +0200 Subject: [PATCH 014/135] Implement GET /users/:uid/keys for admin users Complements POST operation added in gitlabhq/gitlabhq#3146 Implement DELETE /users/:uid/keys/:id for admin users Fix "Line is too long. [83/80]" Use single quotes as advised Use single quotes as advised Use single quotes as advised Fix missing space around { and } Fix typo in documentation Only catch ActiveRecord::RecordNotFound, let other exceptions propagate Raise a "404 Not found" if key to be deleted cannot be found As requested by @jvanbaarsen in https://github.com/gitlabhq/gitlabhq/pull/6781#discussion_r11735114 Remove tab Unconfigured vim on this box, grrrr./ --- Gemfile.lock | 4 +-- doc/api/users.md | 27 +++++++++++++++ lib/api/users.rb | 39 +++++++++++++++++++++ spec/requests/api/users_spec.rb | 61 +++++++++++++++++++++++++++++++++ 4 files changed, 129 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 7682540eba..155e03e545 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -644,7 +644,7 @@ DEPENDENCIES simplecov sinatra six - slack-notifier (~> 0.2.0) + slack-notifier (~> 0.3.2) slim spinach-rails spring (= 1.1.1) @@ -662,4 +662,4 @@ DEPENDENCIES unicorn (~> 4.6.3) unicorn-worker-killer version_sorter - webmock \ No newline at end of file + webmock diff --git a/doc/api/users.md b/doc/api/users.md index 2d5dedb3a3..2b927c3077 100644 --- a/doc/api/users.md +++ b/doc/api/users.md @@ -220,6 +220,18 @@ Parameters: + **none** +## List SSH keys for user + +Get a list of a specified user's SSH keys. Available only for admin + +``` +GET /users/:uid/keys +``` + +Parameters: + ++ `uid` (required) - id of specified user + ## Single SSH key @@ -286,3 +298,18 @@ Parameters: + `id` (required) - SSH key ID +## Delete SSH key + +Deletes key owned by a specified user. Available only for admin. + +``` +DELETE /users/:uid/keys/:id +``` + +Parameters: + ++ `uid` (required) - id of specified user ++ `id` (required) - SSH key ID + +Will return `200 Ok` on success, or `404 Not found` if either user or key cannot be found. + diff --git a/lib/api/users.rb b/lib/api/users.rb index ae808b6272..6ed2740c33 100644 --- a/lib/api/users.rb +++ b/lib/api/users.rb @@ -113,6 +113,45 @@ module API end end + # Get ssh keys of a specified user. Only available to admin users. + # + # Parameters: + # uid (required) - The ID of a user + # Example Request: + # GET /users/:uid/keys + get ':uid/keys' do + authenticated_as_admin! + user = User.find_by(id: params[:uid]) + if user + present user.keys, with: Entities::SSHKey + else + not_found! + end + end + + # Delete existing ssh key of a specified user. Only available to admin + # users. + # + # Parameters: + # uid (required) - The ID of a user + # id (required) - SSH Key ID + # Example Request: + # DELETE /users/:uid/keys/:id + delete ':uid/keys/:id' do + authenticated_as_admin! + user = User.find_by(id: params[:uid]) + if user + begin + key = user.keys.find params[:id] + key.destroy + rescue ActiveRecord::RecordNotFound + not_found! + end + else + not_found! + end + end + # Delete user. Available only for admin # # Example Request: diff --git a/spec/requests/api/users_spec.rb b/spec/requests/api/users_spec.rb index 86610c4751..a6d300b099 100644 --- a/spec/requests/api/users_spec.rb +++ b/spec/requests/api/users_spec.rb @@ -242,6 +242,67 @@ describe API::API, api: true do end end + describe 'GET /user/:uid/keys' do + before { admin } + + context 'when unauthenticated' do + it 'should return authentication error' do + get api("/users/#{user.id}/keys") + response.status.should == 401 + end + end + + context 'when authenticated' do + it 'should return 404 for non-existing user' do + get api('/users/999999/keys', admin) + response.status.should == 404 + end + + it 'should return array of ssh keys' do + user.keys << key + user.save + get api("/users/#{user.id}/keys", admin) + response.status.should == 200 + json_response.should be_an Array + json_response.first['title'].should == key.title + end + end + end + + describe 'DELETE /user/:uid/keys/:id' do + before { admin } + + context 'when unauthenticated' do + it 'should return authentication error' do + delete api("/users/#{user.id}/keys/42") + response.status.should == 401 + end + end + + context 'when authenticated' do + it 'should delete existing key' do + user.keys << key + user.save + expect { + delete api("/users/#{user.id}/keys/#{key.id}", admin) + }.to change { user.keys.count }.by(-1) + response.status.should == 200 + end + + it 'should return 404 error if user not found' do + user.keys << key + user.save + delete api("/users/999999/keys/#{key.id}", admin) + response.status.should == 404 + end + + it 'should return 404 error if key not foud' do + delete api("/users/#{user.id}/keys/42", admin) + response.status.should == 404 + end + end + end + describe "DELETE /users/:id" do before { admin } From db86fe47ce42f8f5aa72cc52d07c7e6eb312dcf9 Mon Sep 17 00:00:00 2001 From: Dmitri Moore Date: Fri, 18 Apr 2014 20:13:53 -0700 Subject: [PATCH 015/135] Add ability to set different ssh host, if different from http/https --- config/gitlab.yml.example | 5 +++++ config/initializers/1_settings.rb | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index 64fc02fe8c..19805aaae4 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -19,6 +19,11 @@ production: &base port: 80 https: false + # Uncommment this line below if your ssh host is different from HTTP/HTTPS one + # (you'd obviously need to replace ssh.host_example.com with your own host). + # Otherwise, ssh host will be set to the `host:` value above + # ssh_host: ssh.host_example.com + # Uncomment and customize the last line to run in a non-root path # WARNING: We recommend creating a FQDN to host GitLab in a root path instead of this. # Note that four settings need to be changed for this to work. diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 59564d9ea3..82a08241e0 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -117,7 +117,7 @@ Settings.gitlab_shell['hooks_path'] ||= Settings.gitlab['user_home'] + '/gitla Settings.gitlab_shell['receive_pack'] = true if Settings.gitlab_shell['receive_pack'].nil? Settings.gitlab_shell['upload_pack'] = true if Settings.gitlab_shell['upload_pack'].nil? Settings.gitlab_shell['repos_path'] ||= Settings.gitlab['user_home'] + '/repositories/' -Settings.gitlab_shell['ssh_host'] ||= (Settings.gitlab.host || 'localhost') +Settings.gitlab_shell['ssh_host'] ||= (Settings.gitlab.ssh_host || Settings.gitlab.host || 'localhost') Settings.gitlab_shell['ssh_port'] ||= 22 Settings.gitlab_shell['ssh_user'] ||= Settings.gitlab.user Settings.gitlab_shell['owner_group'] ||= Settings.gitlab.user From e365cd84526bb84732ffdfc86060019f5c184030 Mon Sep 17 00:00:00 2001 From: Ciro Santilli Date: Wed, 16 Apr 2014 16:36:45 +0200 Subject: [PATCH 016/135] Add markdown styleguide. --- CONTRIBUTING.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 290804e618..780db547f8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -107,9 +107,10 @@ For examples of feedback on merge requests please look at already [closed merge ## Style guides 1. [Ruby](https://github.com/bbatsov/ruby-style-guide) -2. [Rails](https://github.com/bbatsov/rails-style-guide) -3. [Formatting](https://github.com/thoughtbot/guides/tree/master/style#formatting) -4. [Naming](https://github.com/thoughtbot/guides/tree/master/style#naming) -8. [Testing](https://github.com/thoughtbot/guides/tree/master/style#testing) -7. [CoffeeScript](https://github.com/thoughtbot/guides/tree/master/style#coffeescript) -9. [Shell commands](doc/development/shell_commands.md) +1. [Rails](https://github.com/bbatsov/rails-style-guide) +1. [Formatting](https://github.com/thoughtbot/guides/tree/master/style#formatting) +1. [Naming](https://github.com/thoughtbot/guides/tree/master/style#naming) +1. [Testing](https://github.com/thoughtbot/guides/tree/master/style#testing) +1. [CoffeeScript](https://github.com/thoughtbot/guides/tree/master/style#coffeescript) +1. [Shell commands](doc/development/shell_commands.md) +1. [Markdown](http://www.cirosantilli.com/markdown-styleguide) From e9d4587ff11c8510f01dfa184414f73d75b4550b Mon Sep 17 00:00:00 2001 From: Travis Odom Date: Mon, 21 Apr 2014 15:48:42 +0000 Subject: [PATCH 017/135] Actually use the 'user_filter' configuration option --- config/initializers/devise.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index 50669ece7a..d5cb110e88 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -223,6 +223,7 @@ Devise.setup do |config| method: Gitlab.config.ldap['method'], bind_dn: Gitlab.config.ldap['bind_dn'], password: Gitlab.config.ldap['password'], + filter: Gitlab.config.ldap['user_filter'], name_proc: email_stripping_proc end @@ -244,4 +245,4 @@ Devise.setup do |config| config.omniauth provider['name'].to_sym, *provider_arguments end -end +end \ No newline at end of file From 03b56b9446f851a621480e697e33328d51e75751 Mon Sep 17 00:00:00 2001 From: Terry Wang Date: Tue, 22 Apr 2014 14:22:55 +1000 Subject: [PATCH 018/135] Break the one liner & add markdown syntax highlighting for Bash --- doc/update/upgrader.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/update/upgrader.md b/doc/update/upgrader.md index fd45154ac8..72a94f67b3 100644 --- a/doc/update/upgrader.md +++ b/doc/update/upgrader.md @@ -46,4 +46,8 @@ If all items are green, then congratulations upgrade is complete! You've read through the entire guide, and probably did all the steps manually. Here is a one liner for convenience, the next time you upgrade: - cd /home/git/gitlab; sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production; sudo service gitlab stop; sudo -u git -H ruby script/upgrade.rb -y; sudo service gitlab start; sudo service nginx restart; sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production +```bash +cd /home/git/gitlab; sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production; \ + sudo service gitlab stop; sudo -u git -H ruby script/upgrade.rb -y; sudo service gitlab start; \ + sudo service nginx restart; sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production +``` From 2a944b1d9f7a20899363e5cd90cacc83dec0954f Mon Sep 17 00:00:00 2001 From: Hidde Boomsma Date: Tue, 22 Apr 2014 15:35:09 +0200 Subject: [PATCH 019/135] added target_project_id to merge_requests.md Added description about optional field target_project_id for merge requests. --- doc/api/merge_requests.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/api/merge_requests.md b/doc/api/merge_requests.md index 4e864ae107..2996f609d4 100644 --- a/doc/api/merge_requests.md +++ b/doc/api/merge_requests.md @@ -105,10 +105,11 @@ POST /projects/:id/merge_requests Parameters: + `id` (required) - The ID of a project -+ `source_branch` (required) - The source branch -+ `target_branch` (required) - The target branch -+ `assignee_id` (optional) - Assignee user ID -+ `title` (required) - Title of MR ++ `source_branch` (required) - The source branch ++ `target_branch` (required) - The target branch ++ `assignee_id` (optional) - Assignee user ID ++ `title` (required) - Title of MR ++ `target_project_id` (optional) - The target project (numeric id) ```json { From 5a521e56cbdb4fe12af3648dccec9a25938b7c37 Mon Sep 17 00:00:00 2001 From: Achilleas Pipinellis Date: Tue, 22 Apr 2014 18:21:32 +0300 Subject: [PATCH 020/135] Newline between sentence and code block --- doc/integration/omniauth.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/integration/omniauth.md b/doc/integration/omniauth.md index a4491432ca..84a5a8e8c2 100644 --- a/doc/integration/omniauth.md +++ b/doc/integration/omniauth.md @@ -21,6 +21,7 @@ Before configuring individual OmniAuth providers there are a few global settings ``` 2. Find the section dealing with OmniAuth. The section will look similar to the following.
+ ``` ## OmniAuth settings omniauth: @@ -50,6 +51,7 @@ Before configuring individual OmniAuth providers there are a few global settings # app_secret: 'YOUR APP SECRET', # args: { scope: 'user:email' } } ``` + 3. Change `enabled` to `true`. 4. Consider the next two configuration options: `allow_single_sign_on` and `block_auto_created_users`. * `allow_single_sign_on` defaults to `false`. If `false` users must be created manually or they will not be able to From 4134b38a8487bf28ac0a79f073e8136eabf7708c Mon Sep 17 00:00:00 2001 From: Evan Lucas Date: Tue, 22 Apr 2014 17:06:16 -0500 Subject: [PATCH 021/135] Fix syntax highlighting Don't break highlighting on multi-line spans (multi-line comments for example) --- app/assets/javascripts/dispatcher.js.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/dispatcher.js.coffee b/app/assets/javascripts/dispatcher.js.coffee index 46d6db0f05..b61d9875e0 100644 --- a/app/assets/javascripts/dispatcher.js.coffee +++ b/app/assets/javascripts/dispatcher.js.coffee @@ -59,7 +59,7 @@ class Dispatcher initHighlight: -> $('.highlight pre code').each (i, e) -> - hljs.highlightBlock(e) $(e).html($.map($(e).html().split("\n"), (line, i) -> - "
" + line + "
" + "" + line + "" ).join("\n")) + hljs.highlightBlock(e) From baec3f9bd76f4780e66b1055433948427e30cc6d Mon Sep 17 00:00:00 2001 From: Philzen Date: Wed, 23 Apr 2014 08:57:54 +0200 Subject: [PATCH 022/135] # Fix description Typo --- config/gitlab.yml.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index 64fc02fe8c..f60e34fcb7 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -102,7 +102,7 @@ production: &base # ## :id - Issue id (from commit messages) # issues_url: "http://redmine.sample/issues/:id" # - # ## If not nil, linkis to creating new issues will be replaced with this + # ## If not nil, links to creating new issues will be replaced with this # ## Use placeholders: # ## :project_id - GitLab project identifier # ## :issues_tracker_id - Project Name or Id in external issue tracker From 43e77099d86960401013a45f56e29bfb83368d2c Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Tue, 15 Apr 2014 16:26:15 +0200 Subject: [PATCH 023/135] Adjust MySQL limits for existing installations --- CHANGELOG | 1 + db/migrate/20140415124820_limits_to_mysql.rb | 1 + db/migrate/limits_to_mysql.rb | 10 ++++++++++ lib/tasks/migrate/add_limits_mysql.rake | 11 ++--------- 4 files changed, 14 insertions(+), 9 deletions(-) create mode 100644 db/migrate/20140415124820_limits_to_mysql.rb create mode 100644 db/migrate/limits_to_mysql.rb diff --git a/CHANGELOG b/CHANGELOG index 25067d3abe..7c177b3139 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -18,6 +18,7 @@ v 6.8.0 - Expose event and mergerequest timestamps in API - Fix emails on push service when only one commit is pushed - Store Rails cache data in the Redis `cache:gitlab` namespace + - Adjust MySQL limits for existing installations v 6.7.3 - Fix the merge notification email not being sent (Pierre de La Morinerie) diff --git a/db/migrate/20140415124820_limits_to_mysql.rb b/db/migrate/20140415124820_limits_to_mysql.rb new file mode 100644 index 0000000000..3f6e62617c --- /dev/null +++ b/db/migrate/20140415124820_limits_to_mysql.rb @@ -0,0 +1 @@ +require_relative 'limits_to_mysql' diff --git a/db/migrate/limits_to_mysql.rb b/db/migrate/limits_to_mysql.rb new file mode 100644 index 0000000000..4dc3b830bc --- /dev/null +++ b/db/migrate/limits_to_mysql.rb @@ -0,0 +1,10 @@ +class LimitsToMysql < ActiveRecord::Migration + def up + return unless ActiveRecord::Base.configurations[Rails.env]['adapter'] == 'mysql2' + + change_column :merge_request_diffs, :st_commits, :text, limit: 2147483647 + change_column :merge_request_diffs, :st_diffs, :text, limit: 2147483647 + change_column :snippets, :content, :text, limit: 2147483647 + change_column :notes, :st_diff, :text, limit: 2147483647 + end +end diff --git a/lib/tasks/migrate/add_limits_mysql.rake b/lib/tasks/migrate/add_limits_mysql.rake index 46b6451752..a1972a682d 100644 --- a/lib/tasks/migrate/add_limits_mysql.rake +++ b/lib/tasks/migrate/add_limits_mysql.rake @@ -1,14 +1,7 @@ +require Rails.root.join('db/migrate/limits_to_mysql') + desc "GITLAB | Add limits to strings in mysql database" task add_limits_mysql: :environment do puts "Adding limits to schema.rb for mysql" LimitsToMysql.new.up end - -class LimitsToMysql < ActiveRecord::Migration - def up - change_column :merge_request_diffs, :st_commits, :text, limit: 2147483647 - change_column :merge_request_diffs, :st_diffs, :text, limit: 2147483647 - change_column :snippets, :content, :text, limit: 2147483647 - change_column :notes, :st_diff, :text, limit: 2147483647 - end -end From cd61239540c00279563cc0e4ae763a569be0bef5 Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Wed, 16 Apr 2014 11:26:02 +0200 Subject: [PATCH 024/135] Move the adapter check to the migration --- db/migrate/limits_to_mysql.rb | 2 +- lib/tasks/gitlab/setup.rake | 9 +-------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/db/migrate/limits_to_mysql.rb b/db/migrate/limits_to_mysql.rb index 4dc3b830bc..2b7afae6d7 100644 --- a/db/migrate/limits_to_mysql.rb +++ b/db/migrate/limits_to_mysql.rb @@ -1,6 +1,6 @@ class LimitsToMysql < ActiveRecord::Migration def up - return unless ActiveRecord::Base.configurations[Rails.env]['adapter'] == 'mysql2' + return unless ActiveRecord::Base.configurations[Rails.env]['adapter'] =~ /^mysql/ change_column :merge_request_diffs, :st_commits, :text, limit: 2147483647 change_column :merge_request_diffs, :st_diffs, :text, limit: 2147483647 diff --git a/lib/tasks/gitlab/setup.rake b/lib/tasks/gitlab/setup.rake index 853994dd67..8b4ccdfc3f 100644 --- a/lib/tasks/gitlab/setup.rake +++ b/lib/tasks/gitlab/setup.rake @@ -15,14 +15,7 @@ namespace :gitlab do end Rake::Task["db:setup"].invoke - - config = YAML.load_file(File.join(Rails.root,'config','database.yml'))[Rails.env] - success = case config["adapter"] - when /^mysql/ then - Rake::Task["add_limits_mysql"].invoke - when "postgresql" then - end - + Rake::Task["add_limits_mysql"].invoke Rake::Task["db:seed_fu"].invoke rescue Gitlab::TaskAbortedByUserError puts "Quitting...".red From acebfdc7b12a849bef055fa53d0f278318bdad72 Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Wed, 23 Apr 2014 11:09:38 +0200 Subject: [PATCH 025/135] Move changelog entries to 6.9.0 --- CHANGELOG | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 7c177b3139..5137c87a5f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,7 @@ +v 6.9.0 + - Store Rails cache data in the Redis `cache:gitlab` namespace + - Adjust MySQL limits for existing installations + v 6.8.0 - Ability to at mention users that are participating in issue and merge req. discussion - Enabled GZip Compression for assets in example Nginx, make sure that Nginx is compiled with --with-http_gzip_static_module flag (this is default in Ubuntu) @@ -17,8 +21,6 @@ v 6.8.0 - Fix download link for huge MR diffs - Expose event and mergerequest timestamps in API - Fix emails on push service when only one commit is pushed - - Store Rails cache data in the Redis `cache:gitlab` namespace - - Adjust MySQL limits for existing installations v 6.7.3 - Fix the merge notification email not being sent (Pierre de La Morinerie) From 77e565d347b2b7b56769977dacc4eb1d4a741ed3 Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Wed, 23 Apr 2014 11:13:21 +0200 Subject: [PATCH 026/135] Bump the required gitlab-shell version to 1.9.3 --- lib/tasks/gitlab/check.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/gitlab/check.rake b/lib/tasks/gitlab/check.rake index e9258cc626..bf015a1fe1 100644 --- a/lib/tasks/gitlab/check.rake +++ b/lib/tasks/gitlab/check.rake @@ -779,7 +779,7 @@ namespace :gitlab do end def check_gitlab_shell - required_version = Gitlab::VersionInfo.new(1, 9, 1) + required_version = Gitlab::VersionInfo.new(1, 9, 3) current_version = Gitlab::VersionInfo.parse(gitlab_shell_version) print "GitLab Shell version >= #{required_version} ? ... " From 7c5b61224a040ed6489633ab5efd033c26bd2469 Mon Sep 17 00:00:00 2001 From: Marin Jankovski Date: Wed, 23 Apr 2014 15:50:05 +0200 Subject: [PATCH 027/135] We are at 6.9.0.pre. --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index e029aa99b7..c0ad52beda 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -6.8.0 +6.9.0.pre From 2134e18ec64222e60aa0d8947a5d9e265c6e4975 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 23 Apr 2014 16:19:59 +0200 Subject: [PATCH 028/135] Fix default ssh_host setting --- config/initializers/1_settings.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index ee1b7ebf3f..c4e1c352e5 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -73,6 +73,7 @@ Settings.gitlab['default_projects_limit'] ||= 10 Settings.gitlab['default_can_create_group'] = true if Settings.gitlab['default_can_create_group'].nil? Settings.gitlab['default_theme'] = Gitlab::Theme::MARS if Settings.gitlab['default_theme'].nil? Settings.gitlab['host'] ||= 'localhost' +Settings.gitlab['ssh_host'] ||= 'localhost' Settings.gitlab['https'] = false if Settings.gitlab['https'].nil? Settings.gitlab['port'] ||= Settings.gitlab.https ? 443 : 80 Settings.gitlab['relative_url_root'] ||= ENV['RAILS_RELATIVE_URL_ROOT'] || '' From e54b457ea31eff54d031b7092a2a78dc81c69a63 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 23 Apr 2014 16:22:49 +0200 Subject: [PATCH 029/135] Improve ssh_host settings --- config/initializers/1_settings.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index c4e1c352e5..97f2954640 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -73,7 +73,7 @@ Settings.gitlab['default_projects_limit'] ||= 10 Settings.gitlab['default_can_create_group'] = true if Settings.gitlab['default_can_create_group'].nil? Settings.gitlab['default_theme'] = Gitlab::Theme::MARS if Settings.gitlab['default_theme'].nil? Settings.gitlab['host'] ||= 'localhost' -Settings.gitlab['ssh_host'] ||= 'localhost' +Settings.gitlab['ssh_host'] ||= Settings.gitlab.host Settings.gitlab['https'] = false if Settings.gitlab['https'].nil? Settings.gitlab['port'] ||= Settings.gitlab.https ? 443 : 80 Settings.gitlab['relative_url_root'] ||= ENV['RAILS_RELATIVE_URL_ROOT'] || '' @@ -118,7 +118,7 @@ Settings.gitlab_shell['hooks_path'] ||= Settings.gitlab['user_home'] + '/gitla Settings.gitlab_shell['receive_pack'] = true if Settings.gitlab_shell['receive_pack'].nil? Settings.gitlab_shell['upload_pack'] = true if Settings.gitlab_shell['upload_pack'].nil? Settings.gitlab_shell['repos_path'] ||= Settings.gitlab['user_home'] + '/repositories/' -Settings.gitlab_shell['ssh_host'] ||= (Settings.gitlab.ssh_host || Settings.gitlab.host || 'localhost') +Settings.gitlab_shell['ssh_host'] ||= Settings.gitlab.ssh_host Settings.gitlab_shell['ssh_port'] ||= 22 Settings.gitlab_shell['ssh_user'] ||= Settings.gitlab.user Settings.gitlab_shell['owner_group'] ||= Settings.gitlab.user From 7dd0860e5a9d0a1758732742999190890ac33d48 Mon Sep 17 00:00:00 2001 From: Chenguang Zhang Date: Wed, 23 Apr 2014 15:01:43 +0800 Subject: [PATCH 030/135] Remove fixed height for diff table --- app/assets/stylesheets/sections/diff.scss | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/assets/stylesheets/sections/diff.scss b/app/assets/stylesheets/sections/diff.scss index eb272f20f4..fe285f94bd 100644 --- a/app/assets/stylesheets/sections/diff.scss +++ b/app/assets/stylesheets/sections/diff.scss @@ -70,18 +70,15 @@ .diff-side { overflow-x: scroll; width: 508px; - height: 700px; } .diff-side.diff-side-left{ overflow-y:hidden; } .diff-side table, td.diff-middle table { - height: 700px; } .diff-middle { width: 114px; vertical-align: top; - height: 700px; overflow: hidden } From d1648a6a2150c26c12a4f108040676a49627b8a0 Mon Sep 17 00:00:00 2001 From: Achilleas Pipinellis Date: Wed, 23 Apr 2014 21:58:58 +0300 Subject: [PATCH 031/135] Ensure git user can create the database. Fix #175 --- doc/install/installation.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/install/installation.md b/doc/install/installation.md index 579656eda2..5924033c95 100644 --- a/doc/install/installation.md +++ b/doc/install/installation.md @@ -145,6 +145,7 @@ GitLab Shell is an ssh access and repository management software developed speci # 5. Database We recommend using a PostgreSQL database. For MySQL check [MySQL setup guide](database_mysql.md). +NOTE: because we need to make use of extensions you need at least pgsql 9.1. # Install the database packages sudo apt-get install -y postgresql-9.1 postgresql-client libpq-dev @@ -153,7 +154,7 @@ We recommend using a PostgreSQL database. For MySQL check [MySQL setup guide](da sudo -u postgres psql -d template1 # Create a user for GitLab. - template1=# CREATE USER git; + template1=# CREATE USER git CREATEDB; # Create the GitLab production database & grant all privileges on database template1=# CREATE DATABASE gitlabhq_production OWNER git; From a4bf8037fbd18a27d83a8ee1943978ad241257ce Mon Sep 17 00:00:00 2001 From: Philipp Hansch Date: Wed, 23 Apr 2014 21:00:26 +0200 Subject: [PATCH 032/135] Multiple grammar/typo fixes in web hooks help --- doc/web_hooks/web_hooks.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/web_hooks/web_hooks.md b/doc/web_hooks/web_hooks.md index f80891e264..5ad0c8a138 100644 --- a/doc/web_hooks/web_hooks.md +++ b/doc/web_hooks/web_hooks.md @@ -2,16 +2,16 @@ Project web hooks allow you to trigger an URL if new code is pushed or a new iss --- -You can configure web hook to listen for specific events like pushes, issues, merge requests. -GitLab will send POST request with data to web hook URL. -Web Hooks can be used to update an external issue tracker, trigger CI builds, update a backup mirror, or even deploy to your production server. +You can configure web hooks to listen for specific events like pushes, issues or merge requests. +GitLab will send a POST request with data to the web hook URL. +Web hooks can be used to update an external issue tracker, trigger CI builds, update a backup mirror, or even deploy to your production server. If you send a web hook to an SSL endpoint [the certificate will not be verified](https://gitlab.com/gitlab-org/gitlab-ce/blob/ccd617e58ea71c42b6b073e692447d0fe3c00be6/app/models/web_hook.rb#L35) since many people use self-signed certificates. --- #### Push events -Triggered when you push to the repository except pushing tags. +Triggered when you push to the repository except when pushing tags. **Request body:** @@ -84,7 +84,7 @@ Triggered when a new issue is created or an existing issue was updated/closed/re #### Merge request events -Triggered when a new merge request is created or an existing merge request was updated/merges/closed. +Triggered when a new merge request is created or an existing merge request was updated/merged/closed. **Request body:** From de794b6a77dba50a76e79538797ce2873c1e8700 Mon Sep 17 00:00:00 2001 From: Ben Bytheway Date: Wed, 23 Apr 2014 21:00:56 -0600 Subject: [PATCH 033/135] Add scoping to ldap lookup when only dn given --- lib/gitlab/ldap/adapter.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/gitlab/ldap/adapter.rb b/lib/gitlab/ldap/adapter.rb index 983a2956a3..0777558d64 100644 --- a/lib/gitlab/ldap/adapter.rb +++ b/lib/gitlab/ldap/adapter.rb @@ -44,7 +44,8 @@ module Gitlab def users(field, value) if field.to_sym == :dn options = { - base: value + base: value, + scope: Net::LDAP::SearchScope_BaseObject } else options = { From fe1ca616017633a243017ad265c4713aca773ea3 Mon Sep 17 00:00:00 2001 From: Marin Jankovski Date: Thu, 24 Apr 2014 13:23:17 +0200 Subject: [PATCH 034/135] Make sure that tests pass when aws group is used. --- Gemfile | 3 ++- Gemfile.lock | 4 ++++ config/initializers/carrierwave.rb | 12 ++++++++++++ spec/helpers/application_helper_spec.rb | 4 ++-- 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 4ab1ab50eb..7372d24472 100644 --- a/Gemfile +++ b/Gemfile @@ -71,6 +71,7 @@ gem "carrierwave" # for aws storage gem "fog", "~> 1.14", group: :aws +gem "unf", group: :aws # Authorization gem "six" @@ -232,4 +233,4 @@ end group :production do gem "gitlab_meta", '6.0' -end \ No newline at end of file +end diff --git a/Gemfile.lock b/Gemfile.lock index 155e03e545..0556b870be 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -531,6 +531,9 @@ GEM execjs (>= 0.3.0) json (>= 1.8.0) underscore-rails (1.4.4) + unf (0.1.4) + unf_ext + unf_ext (0.0.6) unicorn (4.6.3) kgio (~> 2.6) rack @@ -659,6 +662,7 @@ DEPENDENCIES turbolinks uglifier underscore-rails (~> 1.4.4) + unf unicorn (~> 4.6.3) unicorn-worker-killer version_sorter diff --git a/config/initializers/carrierwave.rb b/config/initializers/carrierwave.rb index 6875fa74ed..d0065b63e5 100644 --- a/config/initializers/carrierwave.rb +++ b/config/initializers/carrierwave.rb @@ -18,4 +18,16 @@ if File.exists?(aws_file) config.fog_authenticated_url_expiration = 1 << 29 # optional time (in seconds) that authenticated urls will be valid. # when fog_public is false and provider is AWS or Google, defaults to 600 end + + # Mocking Fog requests, based on: https://github.com/carrierwaveuploader/carrierwave/wiki/How-to%3A-Test-Fog-based-uploaders + if Rails.env.test? + Fog.mock! + connection = ::Fog::Storage.new( + :aws_access_key_id => AWS_CONFIG['access_key_id'], + :aws_secret_access_key => AWS_CONFIG['secret_access_key'], + :provider => 'AWS', + :region => AWS_CONFIG['region'] + ) + connection.directories.create(:key => AWS_CONFIG['bucket']) + end end diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index 61c561335e..0376e0aadf 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -46,7 +46,7 @@ describe ApplicationHelper do group = create(:group) group.avatar = File.open(avatar_file_path) group.save! - group_icon(group.path).to_s.should == "/uploads/group/avatar/#{ group.id }/gitlab_logo.png" + group_icon(group.path).to_s.should match("/uploads/group/avatar/#{ group.id }/gitlab_logo.png") end it "should give default avatar_icon when no avatar is present" do @@ -63,7 +63,7 @@ describe ApplicationHelper do user = create(:user) user.avatar = File.open(avatar_file_path) user.save! - avatar_icon(user.email).to_s.should == "/uploads/user/avatar/#{ user.id }/gitlab_logo.png" + avatar_icon(user.email).to_s.should match("/uploads/user/avatar/#{ user.id }/gitlab_logo.png") end it "should call gravatar_icon when no avatar is present" do From 0050c07fdda59f36ca2959e08d422ff5d6479e10 Mon Sep 17 00:00:00 2001 From: Marin Jankovski Date: Thu, 24 Apr 2014 15:00:18 +0200 Subject: [PATCH 035/135] Serve a file if in wiki. --- app/controllers/projects/wikis_controller.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/controllers/projects/wikis_controller.rb b/app/controllers/projects/wikis_controller.rb index bcd9e0d521..0eb9364eaa 100644 --- a/app/controllers/projects/wikis_controller.rb +++ b/app/controllers/projects/wikis_controller.rb @@ -15,6 +15,17 @@ class Projects::WikisController < Projects::ApplicationController if @page render 'show' + elsif file = @project_wiki.wiki.file(params[:id], @project_wiki.wiki.ref, true) + if file.on_disk? + send_file file.on_disk_path, :disposition => 'inline' + else + send_data( + file.raw_data, + type: file.mime_type, + disposition: 'inline', + filename: file.name + ) + end else return render('empty') unless can?(current_user, :write_wiki, @project) @page = WikiPage.new(@project_wiki) From 84870438f95092957c2ad5ca4581e2b95f98033d Mon Sep 17 00:00:00 2001 From: Chenguang Zhang Date: Thu, 24 Apr 2014 16:49:01 +0800 Subject: [PATCH 036/135] Add support for side-by-side inline comments --- app/assets/stylesheets/sections/diff.scss | 25 ++---- app/assets/stylesheets/sections/notes.scss | 1 + .../projects/commits/_parallel_view.html.haml | 79 ++++++++----------- .../_diff_notes_with_reply_parallel.html.haml | 21 +++-- 4 files changed, 50 insertions(+), 76 deletions(-) diff --git a/app/assets/stylesheets/sections/diff.scss b/app/assets/stylesheets/sections/diff.scss index fe285f94bd..64e669ac2b 100644 --- a/app/assets/stylesheets/sections/diff.scss +++ b/app/assets/stylesheets/sections/diff.scss @@ -63,23 +63,14 @@ } } - .text-file-parallel div { - display: inline-block; - padding-bottom: 16px; - } - .diff-side { - overflow-x: scroll; - width: 508px; - } - .diff-side.diff-side-left{ - overflow-y:hidden; - } - .diff-side table, td.diff-middle table { - } - .diff-middle { - width: 114px; - vertical-align: top; - overflow: hidden + tr.line_holder.parallel{ + .old_line, .new_line, .diff_line { + min-width: 50px; + } + + td.line_content.parallel{ + width: 50%; + } } .old_line, .new_line, .diff_line { diff --git a/app/assets/stylesheets/sections/notes.scss b/app/assets/stylesheets/sections/notes.scss index c9c7b6ecce..7e56781f56 100644 --- a/app/assets/stylesheets/sections/notes.scss +++ b/app/assets/stylesheets/sections/notes.scss @@ -139,6 +139,7 @@ ul.notes { background-color: #fff; border-width: 1px 0; padding-top: 0; + vertical-align: top; li { padding: 5px; diff --git a/app/views/projects/commits/_parallel_view.html.haml b/app/views/projects/commits/_parallel_view.html.haml index 5b60ab80ba..80f5be98f2 100644 --- a/app/views/projects/commits/_parallel_view.html.haml +++ b/app/views/projects/commits/_parallel_view.html.haml @@ -2,54 +2,37 @@ - old_lines, new_lines = parallel_diff_lines(project, @commit, diff, file) - num_lines = old_lines.length -%div.text-file-parallel - %div.diff-side.diff-side-left - %table - - old_lines.each do |line| +%div.text-file + %table + - num_lines.times do |index| + - new_line = new_lines[index] + - old_line = old_lines[index] + %tr.line_holder.parallel + -# For old line + - if old_line.type == :file_created + %td.old_line= old_line.num + %td.line_content.parallel= "File was created" + - elsif old_line.type == :deleted + %td.old_line.old= old_line.num + %td.line_content{class: "parallel noteable_line old #{old_line.code}", "line_code" => old_line.code}= old_line.content + - else old_line.type == :no_change + %td.old_line= old_line.num + %td.line_content.parallel= old_line.content - %tr.line_holder.parallel - - if line.type == :file_created - %td.line_content.parallel= "File was created" - - elsif line.type == :deleted - %td.line_content{class: "parallel noteable_line old #{line.code}", "line_code" => line.code }= line.content - - else line.type == :no_change - %td.line_content.parallel= line.content + -# For new line + - if new_line.type == :file_deleted + %td.new_line= new_line.num + %td.line_content.parallel= "File was deleted" + - elsif new_line.type == :added + %td.new_line.new= new_line.num + %td.line_content{class: "parallel noteable_line new #{new_line.code}", "line_code" => new_line.code}= new_line.content + - else new_line.type == :no_change + %td.new_line= new_line.num + %td.line_content.parallel= new_line.content - %div.diff-middle - %table - - num_lines.times do |index| - %tr - - if old_lines[index].type == :deleted - %td.old_line.old= old_lines[index].num - - else - %td.old_line= old_lines[index].num + - if @reply_allowed + - comments1 = @line_notes.select { |n| n.line_code == old_line.code }.sort_by(&:created_at) + - comments2 = @line_notes.select { |n| n.line_code == new_line.code }.sort_by(&:created_at) + - unless comments1.empty? and comments2.empty? + = render "projects/notes/diff_notes_with_reply_parallel", notes1: comments1, notes2: comments2 - %td.diff_line="" - - - if new_lines[index].type == :added - %td.new_line.new= new_lines[index].num - - else - %td.new_line= new_lines[index].num - - %div.diff-side.diff-side-right - %table - - new_lines.each do |line| - - %tr.line_holder.parallel - - if line.type == :file_deleted - %td.line_content.parallel= "File was deleted" - - elsif line.type == :added - %td.line_content{class: "parallel noteable_line new #{line.code}", "line_code" => line.code }= line.content - - else line.type == :no_change - %td.line_content.parallel= line.content - -:javascript - $('.diff-side-right').on('scroll', function(){ - $('.diff-side-left, .diff-middle').scrollTop($(this).scrollTop()); - $('.diff-side-left').scrollLeft($(this).scrollLeft()); - }); - - $('.diff-side-left').on('scroll', function(){ - $('.diff-side-right, .diff-middle').scrollTop($(this).scrollTop()); // might never be relevant - $('.diff-side-right').scrollLeft($(this).scrollLeft()); - }); 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 2012aa021b..399ce30d1a 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,34 +1,33 @@ - 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 %tr.notes_holder.js-toggle-content - -# Check if line want not changed since comment was left - /- if !defined?(line1) || line1 == note1.diff_line - if note1 + %td.notes_line + %span.btn.disabled + %i.icon-comment + = notes1.count %td.notes_content %ul.notes{ rel: note1.discussion_id } = render notes1 + = render "projects/notes/discussion_reply_button", note: note1 - %td.notes_line2 - %span.btn.disabled.parallel-comment - %i.icon-comment - = notes1.count - else %td= "" %td= "" - %td= "" - - -# Check if line want not changed since comment was left - /- if !defined?(line2) || line2 == note2.diff_line - if note2 %td.notes_line - %span.btn.disabled.parallel-comment + %span.btn.disabled %i.icon-comment = notes2.count %td.notes_content %ul.notes{ rel: note2.discussion_id } = render notes2 + = render "projects/notes/discussion_reply_button", note: note2 - else %td= "" %td= "" + From c46a0612706a2570342178fe8f61222034675c38 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 16 Apr 2014 11:02:42 +0300 Subject: [PATCH 037/135] Add uniq db index on project_id+iid --- db/migrate/20140416074002_add_index_on_iid.rb | 7 +++++++ db/schema.rb | 3 +++ 2 files changed, 10 insertions(+) create mode 100644 db/migrate/20140416074002_add_index_on_iid.rb diff --git a/db/migrate/20140416074002_add_index_on_iid.rb b/db/migrate/20140416074002_add_index_on_iid.rb new file mode 100644 index 0000000000..cbd0908278 --- /dev/null +++ b/db/migrate/20140416074002_add_index_on_iid.rb @@ -0,0 +1,7 @@ +class AddIndexOnIid < ActiveRecord::Migration + def change + add_index :issues, [:project_id, :iid], unique: true + add_index :merge_requests, [:target_project_id, :iid], unique: true + add_index :milestones, [:project_id, :iid], unique: true + end +end diff --git a/db/schema.rb b/db/schema.rb index e53a637af6..17ca752db7 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -93,6 +93,7 @@ ActiveRecord::Schema.define(version: 20140416185734) do add_index "issues", ["author_id"], name: "index_issues_on_author_id", using: :btree add_index "issues", ["created_at"], name: "index_issues_on_created_at", using: :btree add_index "issues", ["milestone_id"], name: "index_issues_on_milestone_id", using: :btree + add_index "issues", ["project_id", "iid"], name: "index_issues_on_project_id_and_iid", unique: true, using: :btree add_index "issues", ["project_id"], name: "index_issues_on_project_id", using: :btree add_index "issues", ["title"], name: "index_issues_on_title", using: :btree @@ -143,6 +144,7 @@ ActiveRecord::Schema.define(version: 20140416185734) do add_index "merge_requests", ["source_branch"], name: "index_merge_requests_on_source_branch", using: :btree add_index "merge_requests", ["source_project_id"], name: "index_merge_requests_on_source_project_id", using: :btree add_index "merge_requests", ["target_branch"], name: "index_merge_requests_on_target_branch", using: :btree + add_index "merge_requests", ["target_project_id", "iid"], name: "index_merge_requests_on_target_project_id_and_iid", unique: true, using: :btree add_index "merge_requests", ["title"], name: "index_merge_requests_on_title", using: :btree create_table "milestones", force: true do |t| @@ -157,6 +159,7 @@ ActiveRecord::Schema.define(version: 20140416185734) do end add_index "milestones", ["due_date"], name: "index_milestones_on_due_date", using: :btree + add_index "milestones", ["project_id", "iid"], name: "index_milestones_on_project_id_and_iid", unique: true, using: :btree add_index "milestones", ["project_id"], name: "index_milestones_on_project_id", using: :btree create_table "namespaces", force: true do |t| From 3bf1cff4215c8b60c4133c3e822495f046638583 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 23 Apr 2014 16:15:50 +0200 Subject: [PATCH 038/135] Add iids changelog entry --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index 5137c87a5f..a5671948a6 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ v 6.9.0 - Store Rails cache data in the Redis `cache:gitlab` namespace - Adjust MySQL limits for existing installations + - Add db index on project_id+iid column. This prevents duplicate on iid. v 6.8.0 - Ability to at mention users that are participating in issue and merge req. discussion From ae7bd9f7c0d78a4c039a8511d8d045eebd9706e4 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 24 Apr 2014 19:35:06 +0200 Subject: [PATCH 039/135] Migrate invalid rows with missing iids or duplicates --- app/models/milestone.rb | 1 + db/migrate/20140416074002_add_index_on_iid.rb | 25 +++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/app/models/milestone.rb b/app/models/milestone.rb index 6a2ca76703..39ab0b536a 100644 --- a/app/models/milestone.rb +++ b/app/models/milestone.rb @@ -25,6 +25,7 @@ class Milestone < ActiveRecord::Base scope :active, -> { with_state(:active) } scope :closed, -> { with_state(:closed) } + scope :of_projects, ->(ids) { where(project_id: ids) } validates :title, presence: true validates :project, presence: true diff --git a/db/migrate/20140416074002_add_index_on_iid.rb b/db/migrate/20140416074002_add_index_on_iid.rb index cbd0908278..85269e2a03 100644 --- a/db/migrate/20140416074002_add_index_on_iid.rb +++ b/db/migrate/20140416074002_add_index_on_iid.rb @@ -1,7 +1,32 @@ class AddIndexOnIid < ActiveRecord::Migration def change + RemoveDuplicateIid.clean(Issue) + RemoveDuplicateIid.clean(MergeRequest, 'target_project_id') + RemoveDuplicateIid.clean(Milestone) + add_index :issues, [:project_id, :iid], unique: true add_index :merge_requests, [:target_project_id, :iid], unique: true add_index :milestones, [:project_id, :iid], unique: true end end + +class RemoveDuplicateIid + def self.clean(klass, project_field = 'project_id') + duplicates = klass.find_by_sql("SELECT iid, #{project_field} FROM #{klass.table_name} GROUP BY #{project_field}, iid HAVING COUNT(*) > 1") + + duplicates.each do |duplicate| + project_id = duplicate.send(project_field) + iid = duplicate.iid + items = klass.of_projects(project_id).where(iid: iid) + + if items.size > 1 + puts "Remove #{klass.name} duplicates for iid: #{iid} and project_id: #{project_id}" + items.shift + items.each do |item| + item.destroy + puts '.' + end + end + end + end +end From 2eaca5453654f4c5e773067f303d6002268cd06e Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 24 Apr 2014 19:53:00 +0200 Subject: [PATCH 040/135] Add rake setup alias for gitlab:setup --- lib/tasks/setup.rake | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 lib/tasks/setup.rake diff --git a/lib/tasks/setup.rake b/lib/tasks/setup.rake new file mode 100644 index 0000000000..93701de8f6 --- /dev/null +++ b/lib/tasks/setup.rake @@ -0,0 +1,4 @@ +desc "GITLAB | Setup gitlab db" +task :setup do + Rake::Task["gitlab:setup"].invoke +end From 7e10d1017819ea0be41887803e9b4d6edd92bf49 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 24 Apr 2014 19:53:18 +0200 Subject: [PATCH 041/135] Add doc file for dev rake tasks --- doc/development/README.md | 7 +++++-- doc/development/rake_tasks.md | 25 +++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 doc/development/rake_tasks.md diff --git a/doc/development/README.md b/doc/development/README.md index aa59eb2c3e..eb88b6c860 100644 --- a/doc/development/README.md +++ b/doc/development/README.md @@ -1,2 +1,5 @@ -+ [Architecture](architecture.md) -+ [Shell commands](shell_commands.md) +## Development + ++ [Architecture](architecture.md) of GitLab ++ [Shell commands](shell_commands.md) in the GitLab codebase ++ [Rake tasks](rake_tasks.md) for development diff --git a/doc/development/rake_tasks.md b/doc/development/rake_tasks.md new file mode 100644 index 0000000000..9e75b3a627 --- /dev/null +++ b/doc/development/rake_tasks.md @@ -0,0 +1,25 @@ +# Rake tasks for developers + +## Setup db with developer seeds: + +Note that if your db user does not have advanced privilegies you must create db manually before run this command + +``` +bundle exec rake setup +``` + +## Run tests + +This runs all test suite present in GitLab + +``` +bundle exec rake test +``` + +## Generate searchable docs for source code + +You can find results under `doc/code` directory + +``` +bundle exec rake gitlab:generate_docs +``` From ccdf7a329a3eb483a6ec2f9c68d77f5697844f0d Mon Sep 17 00:00:00 2001 From: Adam Engebretson Date: Fri, 25 Apr 2014 03:38:54 +0000 Subject: [PATCH 042/135] Added Laravel API Wrapper --- doc/api/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/api/README.md b/doc/api/README.md index b1740f3579..5f848e0f4b 100644 --- a/doc/api/README.md +++ b/doc/api/README.md @@ -21,6 +21,7 @@ ## Clients + [php-gitlab-api](https://github.com/m4tthumphrey/php-gitlab-api) - PHP ++ [Laravel API Wrapper for GitLab CE](https://github.com/adamgoose/gitlab) - PHP / [Laravel](http://laravel.com) + [Ruby Wrapper](https://github.com/NARKOZ/gitlab) - Ruby + [python-gitlab](https://github.com/Itxaka/python-gitlab) - Python + [java-gitlab-api](https://github.com/timols/java-gitlab-api) - Java @@ -147,4 +148,4 @@ Issue * iid - is uniq only in scope of single project. When you browse issues or merge requests with Web UI - you see iid. So if you want to get issue with api you use `http://host/api/v3/.../issues/:id.json` -But when you want to create a link to web page - use `http:://host/project/issues/:iid.json` +But when you want to create a link to web page - use `http:://host/project/issues/:iid.json` \ No newline at end of file From 1eed8965783786b1ec07286e78f30750d48734a4 Mon Sep 17 00:00:00 2001 From: Cho Cheuk Ping Date: Fri, 25 Apr 2014 18:49:21 +0800 Subject: [PATCH 043/135] Fix typo: Confiure -> Configure --- doc/permissions/permissions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/permissions/permissions.md b/doc/permissions/permissions.md index ac4bdefddd..9be6423f66 100644 --- a/doc/permissions/permissions.md +++ b/doc/permissions/permissions.md @@ -27,7 +27,7 @@ If a user is a GitLab administrator they receive all permissions. |Remove protected branches| |||✓|✓| |Edit project| |||✓|✓| |Add Deploy Keys to project| |||✓|✓| -|Confiure Project Hooks| |||✓|✓| +|Configure Project Hooks| |||✓|✓| |Switch visibility level| ||||✓| |Transfer project to another namespace| ||||✓| |Remove project| ||||✓| From 95ef25a57a872f6cc03416b4c88ca3b17a90f740 Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Fri, 25 Apr 2014 15:01:46 +0200 Subject: [PATCH 044/135] Replace 6.0-to-6.7.md with 6.0-to-6.8.md --- doc/update/{6.0-to-6.7.md => 6.0-to-6.8.md} | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) rename doc/update/{6.0-to-6.7.md => 6.0-to-6.8.md} (85%) diff --git a/doc/update/6.0-to-6.7.md b/doc/update/6.0-to-6.8.md similarity index 85% rename from doc/update/6.0-to-6.7.md rename to doc/update/6.0-to-6.8.md index aa1b388fa9..97f12d694f 100644 --- a/doc/update/6.0-to-6.7.md +++ b/doc/update/6.0-to-6.8.md @@ -1,4 +1,4 @@ -# From 6.0 to 6.7 +# From 6.0 to 6.8 # In 6.1 we remove a lot of deprecated code. # You should update to 6.0 before installing 6.1 or higher so all the necessary conversions are run. @@ -33,7 +33,7 @@ sudo -u git -H git fetch --all For Gitlab Community Edition: ```bash -sudo -u git -H git checkout 6-7-stable +sudo -u git -H git checkout 6-8-stable ``` OR @@ -41,7 +41,7 @@ OR For GitLab Enterprise Edition: ```bash -sudo -u git -H git checkout 6-7-stable-ee +sudo -u git -H git checkout 6-8-stable-ee ``` @@ -90,11 +90,12 @@ sudo chmod u+rwx,g+rx,o-rwx /home/git/gitlab-satellites TIP: to see what changed in gitlab.yml.example in this release use next command: ``` -git diff 6-0-stable:config/gitlab.yml.example 6-7-stable:config/gitlab.yml.example +git diff 6-0-stable:config/gitlab.yml.example 6-8-stable:config/gitlab.yml.example ``` -* Make `/home/git/gitlab/config/gitlab.yml` same as https://gitlab.com/gitlab-org/gitlab-ce/blob/6-7-stable/config/gitlab.yml.example but with your settings. -* Make `/home/git/gitlab/config/unicorn.rb` same as https://gitlab.com/gitlab-org/gitlab-ce/blob/6-7-stable/config/unicorn.rb.example but with your settings. +* Make `/home/git/gitlab/config/gitlab.yml` the same as https://gitlab.com/gitlab-org/gitlab-ce/blob/6-8-stable/config/gitlab.yml.example but with your settings. +* Make `/home/git/gitlab/config/unicorn.rb` the same as https://gitlab.com/gitlab-org/gitlab-ce/blob/6-8-stable/config/unicorn.rb.example but with your settings. +* Make `/etc/nginx/sites-available/nginx` the same as https://gitlab.com/gitlab-org/gitlab-ce/blob/6-8-stable/lib/support/nginx/gitlab but with your settings. * Copy rack attack middleware config ```bash From bdd392bd13fc19371bb09fd90e291959bc0fb4e7 Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Fri, 25 Apr 2014 15:03:32 +0200 Subject: [PATCH 045/135] Use gitlab-shell 1.9.3 --- doc/update/6.0-to-6.8.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/update/6.0-to-6.8.md b/doc/update/6.0-to-6.8.md index 97f12d694f..5c71e99aa5 100644 --- a/doc/update/6.0-to-6.8.md +++ b/doc/update/6.0-to-6.8.md @@ -57,7 +57,7 @@ sudo apt-get install logrotate ```bash cd /home/git/gitlab-shell sudo -u git -H git fetch -sudo -u git -H git checkout v1.9.1 # Addresses multiple critical security vulnerabilities +sudo -u git -H git checkout v1.9.3 # Addresses multiple critical security vulnerabilities ``` ### 5. Install libs, migrations, etc. From 4618ec8791b10a9a98587e9a22b647581ac25543 Mon Sep 17 00:00:00 2001 From: Drew Blessing Date: Fri, 25 Apr 2014 15:31:30 -0500 Subject: [PATCH 046/135] Fix unclear text in broadcast message view. --- app/views/admin/broadcast_messages/index.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/admin/broadcast_messages/index.html.haml b/app/views/admin/broadcast_messages/index.html.haml index f28dadfb65..c58ca2c9a3 100644 --- a/app/views/admin/broadcast_messages/index.html.haml +++ b/app/views/admin/broadcast_messages/index.html.haml @@ -22,12 +22,12 @@ = f.label :color, "Background Color", class: 'control-label' .col-sm-10 = f.text_field :color, placeholder: "#AA33EE", class: "form-control" - .light Hex values as 3 double digit numbers, starting with a # sign. + .light 6 character hex values starting with a # sign. .form-group.js-toggle-colors-container.hide = f.label :font, "Font Color", class: 'control-label' .col-sm-10 = f.text_field :font, placeholder: "#224466", class: "form-control" - .light Hex values as 3 double digit numbers, starting with a # sign. + .light 6 character hex values starting with a # sign. .form-group = f.label :starts_at, class: 'control-label' .col-sm-10.datetime-controls From 25cc5fbf78196ba0629f72b4c37ed7f9d3b5eb53 Mon Sep 17 00:00:00 2001 From: Nico Suhl Date: Sat, 26 Apr 2014 03:43:24 +0200 Subject: [PATCH 047/135] do not html encode plaintext part of emails for push notifications Also-by: Andrew Karpow --- app/views/notify/repository_push_email.text.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/notify/repository_push_email.text.haml b/app/views/notify/repository_push_email.text.haml index b8d7fbeb04..a15b8efe1f 100644 --- a/app/views/notify/repository_push_email.text.haml +++ b/app/views/notify/repository_push_email.text.haml @@ -17,7 +17,7 @@ Changes: - else = diff.new_path || diff.old_path \===================================== - = diff.diff + != diff.diff \ - if @compare.timeout Huge diff. To prevent performance issues it was hidden From 292c3c210b0b1fd932e8fad079e0d990e3d87039 Mon Sep 17 00:00:00 2001 From: arantir Date: Sun, 27 Apr 2014 00:16:50 +0300 Subject: [PATCH 048/135] Typo fix --- public/static.css | 1 - 1 file changed, 1 deletion(-) diff --git a/public/static.css b/public/static.css index aa834553a1..c6f92ac01d 100644 --- a/public/static.css +++ b/public/static.css @@ -2,7 +2,6 @@ body { color: #666; text-align: center; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; - sans-serif; margin:0; width: 800px; margin: auto; From 5ac015664d6bc06fec5c3d16b9c5a08c8957d453 Mon Sep 17 00:00:00 2001 From: Xiaoyu Tai Date: Sun, 27 Apr 2014 20:25:35 +0800 Subject: [PATCH 049/135] init.d script copy duplication Copy init.d script twice in the guide. Deleted the second one. --- doc/update/6.7-to-6.8.md | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/doc/update/6.7-to-6.8.md b/doc/update/6.7-to-6.8.md index 63023fd384..457433c648 100644 --- a/doc/update/6.7-to-6.8.md +++ b/doc/update/6.7-to-6.8.md @@ -62,6 +62,7 @@ sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS # Update init.d script sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab +sudo chmod +x /etc/init.d/gitlab # Update the logrotate configuration (keep logs for 90 days instead of 52 weeks) sudo cp lib/support/logrotate/gitlab /etc/logrotate.d/gitlab @@ -92,19 +93,12 @@ If you are using HTTPS, disable gzip as in [this commit](https://gitlab.com/gitl To improve performance, enable gzip asset compression as seen [in this commit](https://gitlab.com/gitlab-org/gitlab-ce/commit/8af94ed75505f0253823b9b2d44320fecea5b5fb). -### 6. Update Init script - -```bash -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -sudo chmod +x /etc/init.d/gitlab -``` - -### 7. Start application +### 6. Start application sudo service gitlab start sudo service nginx restart -### 8. Check application status +### 7. Check application status Check if GitLab and its environment are configured correctly: From 410790a355a6389bfa372e0834c31541b8ac8e4f Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Mon, 28 Apr 2014 11:48:18 +0200 Subject: [PATCH 050/135] Add NotesFinder spec --- spec/finders/notes_finder_spec.rb | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 spec/finders/notes_finder_spec.rb diff --git a/spec/finders/notes_finder_spec.rb b/spec/finders/notes_finder_spec.rb new file mode 100644 index 0000000000..f0588f56b4 --- /dev/null +++ b/spec/finders/notes_finder_spec.rb @@ -0,0 +1,26 @@ +require 'spec_helper' + +describe NotesFinder do + let(:user) { create :user } + let(:project) { create :project } + let(:note1) { create :note_on_commit, project: project } + let(:note2) { create :note_on_commit, project: project } + let(:commit) { note1.commit } + + before do + project.team << [user, :master] + end + + describe :execute do + before do + note1 + note2 + end + + it 'should find all notes' do + params = { target_id: commit.id, target_type: 'commit' } + notes = NotesFinder.new.execute(project, user, params) + notes.size.should eq(2) + end + end +end From e5cf5f4f98464543ec2f06415e071b8110368cc7 Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Mon, 28 Apr 2014 11:50:05 +0200 Subject: [PATCH 051/135] Notes have noteables but no commits --- spec/finders/notes_finder_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/finders/notes_finder_spec.rb b/spec/finders/notes_finder_spec.rb index f0588f56b4..3b28070ffa 100644 --- a/spec/finders/notes_finder_spec.rb +++ b/spec/finders/notes_finder_spec.rb @@ -5,7 +5,7 @@ describe NotesFinder do let(:project) { create :project } let(:note1) { create :note_on_commit, project: project } let(:note2) { create :note_on_commit, project: project } - let(:commit) { note1.commit } + let(:commit) { note1.noteable } before do project.team << [user, :master] From 7339464e7701c0778cca12c12ace83ebd8ffe2f7 Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Mon, 28 Apr 2014 11:53:37 +0200 Subject: [PATCH 052/135] Fail faster on an invalid target_type --- app/finders/notes_finder.rb | 2 ++ spec/finders/notes_finder_spec.rb | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/app/finders/notes_finder.rb b/app/finders/notes_finder.rb index 384316e14b..4e80bd8175 100644 --- a/app/finders/notes_finder.rb +++ b/app/finders/notes_finder.rb @@ -12,6 +12,8 @@ class NotesFinder project.merge_requests.find(target_id).mr_and_commit_notes.inc_author.fresh when "snippet" project.snippets.find(target_id).notes.fresh + else + raise 'invalid target_type' end end end diff --git a/spec/finders/notes_finder_spec.rb b/spec/finders/notes_finder_spec.rb index 3b28070ffa..27eaba8dfa 100644 --- a/spec/finders/notes_finder_spec.rb +++ b/spec/finders/notes_finder_spec.rb @@ -22,5 +22,10 @@ describe NotesFinder do notes = NotesFinder.new.execute(project, user, params) notes.size.should eq(2) end + + it 'should raise an exception for an invalid target_type' do + params = { target_id: commit.id, target_type: 'invalid' } + expect { NotesFinder.new.execute(project, user, params) }.to raise_error('invalid target_type') + end end end From 0b615eb0e2b5cca7685360c0cae72484741d672e Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Mon, 28 Apr 2014 12:13:29 +0200 Subject: [PATCH 053/135] Filter out old notes in NotesFinder --- app/finders/notes_finder.rb | 8 +++++++- spec/finders/notes_finder_spec.rb | 7 +++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/app/finders/notes_finder.rb b/app/finders/notes_finder.rb index 4e80bd8175..38d78f3a2d 100644 --- a/app/finders/notes_finder.rb +++ b/app/finders/notes_finder.rb @@ -1,9 +1,12 @@ class NotesFinder + FETCH_OVERLAP = 5.seconds + def execute(project, current_user, params) target_type = params[:target_type] target_id = params[:target_id] + last_fetched_at = params.fetch(:last_fetched_at) - case target_type + notes = case target_type when "commit" project.notes.for_commit_id(target_id).not_inline.fresh when "issue" @@ -15,5 +18,8 @@ class NotesFinder else raise 'invalid target_type' end + + # Use overlapping intervals to avoid worrying about race conditions + notes.where('updated_at > ?', last_fetched_at - FETCH_OVERLAP) end end diff --git a/spec/finders/notes_finder_spec.rb b/spec/finders/notes_finder_spec.rb index 27eaba8dfa..ffd3f5db81 100644 --- a/spec/finders/notes_finder_spec.rb +++ b/spec/finders/notes_finder_spec.rb @@ -27,5 +27,12 @@ describe NotesFinder do params = { target_id: commit.id, target_type: 'invalid' } expect { NotesFinder.new.execute(project, user, params) }.to raise_error('invalid target_type') end + + it 'filters out old notes' do + note2.update_attribute(:updated_at, 2.hours.ago) + params = { target_id: commit.id, target_type: 'commit', last_fetched_at: 1.hour.ago } + notes = NotesFinder.new.execute(project, user, params) + notes.should eq([note1]) + end end end From bbfa4a771ab8ca4745419b8d660af89249e088f4 Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Mon, 28 Apr 2014 12:16:34 +0200 Subject: [PATCH 054/135] Always set last_fetched_at in NotesFinder spec --- spec/finders/notes_finder_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/finders/notes_finder_spec.rb b/spec/finders/notes_finder_spec.rb index ffd3f5db81..80d6a36c31 100644 --- a/spec/finders/notes_finder_spec.rb +++ b/spec/finders/notes_finder_spec.rb @@ -12,25 +12,25 @@ describe NotesFinder do end describe :execute do + let(:params) { { target_id: commit.id, target_type: 'commit', last_fetched_at: 1.hour.ago } } + before do note1 note2 end it 'should find all notes' do - params = { target_id: commit.id, target_type: 'commit' } notes = NotesFinder.new.execute(project, user, params) notes.size.should eq(2) end it 'should raise an exception for an invalid target_type' do - params = { target_id: commit.id, target_type: 'invalid' } + params.merge!(target_type: 'invalid') expect { NotesFinder.new.execute(project, user, params) }.to raise_error('invalid target_type') end it 'filters out old notes' do note2.update_attribute(:updated_at, 2.hours.ago) - params = { target_id: commit.id, target_type: 'commit', last_fetched_at: 1.hour.ago } notes = NotesFinder.new.execute(project, user, params) notes.should eq([note1]) end From 7ec5ff4dbae71d147f413da5cea64116e7eb305d Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Mon, 28 Apr 2014 12:21:49 +0200 Subject: [PATCH 055/135] Pass last_fetched_at for notes to javascript --- app/assets/javascripts/notes.js.coffee | 5 ++++- app/controllers/projects/notes_controller.rb | 3 ++- app/views/projects/notes/_notes_with_form.html.haml | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/notes.js.coffee b/app/assets/javascripts/notes.js.coffee index d200d962ca..043e4f6266 100644 --- a/app/assets/javascripts/notes.js.coffee +++ b/app/assets/javascripts/notes.js.coffee @@ -1,10 +1,11 @@ class Notes @interval: null - constructor: (notes_url, note_ids) -> + constructor: (notes_url, note_ids, last_fetched_at) -> @notes_url = notes_url @notes_url = gon.relative_url_root + @notes_url if gon.relative_url_root? @note_ids = note_ids + @last_fetched_at = last_fetched_at @initRefresh() @setupMainTargetNoteForm() @cleanBinding() @@ -76,9 +77,11 @@ class Notes getContent: -> $.ajax url: @notes_url + data: "last_fetched_at=" + @last_fetched_at dataType: "json" success: (data) => notes = data.notes + @last_fetched_at = data.last_fetched_at $.each notes, (i, note) => @renderNote(note) diff --git a/app/controllers/projects/notes_controller.rb b/app/controllers/projects/notes_controller.rb index 85d042a89b..3826515d22 100644 --- a/app/controllers/projects/notes_controller.rb +++ b/app/controllers/projects/notes_controller.rb @@ -5,9 +5,10 @@ class Projects::NotesController < Projects::ApplicationController before_filter :authorize_admin_note!, only: [:update, :destroy] def index + current_fetched_at = Time.now @notes = NotesFinder.new.execute(project, current_user, params) - notes_json = { notes: [] } + notes_json = { notes: [], last_fetched_at: current_fetched_at } @notes.each do |note| notes_json[:notes] << { diff --git a/app/views/projects/notes/_notes_with_form.html.haml b/app/views/projects/notes/_notes_with_form.html.haml index 3bd592e398..bdcecd8a39 100644 --- a/app/views/projects/notes/_notes_with_form.html.haml +++ b/app/views/projects/notes/_notes_with_form.html.haml @@ -7,4 +7,4 @@ = render "projects/notes/form" :javascript - new Notes("#{project_notes_path(target_id: @noteable.id, target_type: @noteable.class.name.underscore)}", #{@notes.map(&:id).to_json}) + new Notes("#{project_notes_path(target_id: @noteable.id, target_type: @noteable.class.name.underscore)}", #{@notes.map(&:id).to_json}, Time.now) From 285926918b95f1d771bf4e9c84972d4e55b41ea9 Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Mon, 28 Apr 2014 12:42:01 +0200 Subject: [PATCH 056/135] Serialize last_fetched_at as a string with seconds --- app/controllers/projects/notes_controller.rb | 2 +- app/finders/notes_finder.rb | 2 +- app/views/projects/notes/_notes_with_form.html.haml | 2 +- spec/finders/notes_finder_spec.rb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/projects/notes_controller.rb b/app/controllers/projects/notes_controller.rb index 3826515d22..b5b0446b43 100644 --- a/app/controllers/projects/notes_controller.rb +++ b/app/controllers/projects/notes_controller.rb @@ -5,7 +5,7 @@ class Projects::NotesController < Projects::ApplicationController before_filter :authorize_admin_note!, only: [:update, :destroy] def index - current_fetched_at = Time.now + current_fetched_at = Time.now.to_i @notes = NotesFinder.new.execute(project, current_user, params) notes_json = { notes: [], last_fetched_at: current_fetched_at } diff --git a/app/finders/notes_finder.rb b/app/finders/notes_finder.rb index 38d78f3a2d..0b9affb716 100644 --- a/app/finders/notes_finder.rb +++ b/app/finders/notes_finder.rb @@ -4,7 +4,7 @@ class NotesFinder def execute(project, current_user, params) target_type = params[:target_type] target_id = params[:target_id] - last_fetched_at = params.fetch(:last_fetched_at) + last_fetched_at = Time.at(params.fetch(:last_fetched_at).to_i) notes = case target_type when "commit" diff --git a/app/views/projects/notes/_notes_with_form.html.haml b/app/views/projects/notes/_notes_with_form.html.haml index bdcecd8a39..052661962e 100644 --- a/app/views/projects/notes/_notes_with_form.html.haml +++ b/app/views/projects/notes/_notes_with_form.html.haml @@ -7,4 +7,4 @@ = render "projects/notes/form" :javascript - new Notes("#{project_notes_path(target_id: @noteable.id, target_type: @noteable.class.name.underscore)}", #{@notes.map(&:id).to_json}, Time.now) + new Notes("#{project_notes_path(target_id: @noteable.id, target_type: @noteable.class.name.underscore)}", #{@notes.map(&:id).to_json}, #{Time.now.to_i}) diff --git a/spec/finders/notes_finder_spec.rb b/spec/finders/notes_finder_spec.rb index 80d6a36c31..4f8a5f909d 100644 --- a/spec/finders/notes_finder_spec.rb +++ b/spec/finders/notes_finder_spec.rb @@ -12,7 +12,7 @@ describe NotesFinder do end describe :execute do - let(:params) { { target_id: commit.id, target_type: 'commit', last_fetched_at: 1.hour.ago } } + let(:params) { { target_id: commit.id, target_type: 'commit', last_fetched_at: 1.hour.ago.to_i } } before do note1 From c685024951b8fed73ab05039baa170859ddf7b12 Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Mon, 28 Apr 2014 13:02:05 +0200 Subject: [PATCH 057/135] Add an index for Note#updated_at --- db/migrate/20140428105831_add_notes_index_updated_at.rb | 5 +++++ db/schema.rb | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20140428105831_add_notes_index_updated_at.rb diff --git a/db/migrate/20140428105831_add_notes_index_updated_at.rb b/db/migrate/20140428105831_add_notes_index_updated_at.rb new file mode 100644 index 0000000000..6c25570f12 --- /dev/null +++ b/db/migrate/20140428105831_add_notes_index_updated_at.rb @@ -0,0 +1,5 @@ +class AddNotesIndexUpdatedAt < ActiveRecord::Migration + def change + add_index :notes, :updated_at + end +end diff --git a/db/schema.rb b/db/schema.rb index 17ca752db7..0a31eb7e3c 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20140416185734) do +ActiveRecord::Schema.define(version: 20140428105831) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -200,6 +200,7 @@ ActiveRecord::Schema.define(version: 20140416185734) do add_index "notes", ["noteable_type"], name: "index_notes_on_noteable_type", using: :btree add_index "notes", ["project_id", "noteable_type"], name: "index_notes_on_project_id_and_noteable_type", using: :btree add_index "notes", ["project_id"], name: "index_notes_on_project_id", using: :btree + add_index "notes", ["updated_at"], name: "index_notes_on_updated_at", using: :btree create_table "projects", force: true do |t| t.string "name" From c4b1a5f5ea338d9be6b24f29a562b567b3c2598b Mon Sep 17 00:00:00 2001 From: Marin Jankovski Date: Mon, 28 Apr 2014 16:22:31 +0200 Subject: [PATCH 058/135] Allow nested files in wiki. --- app/models/project_wiki.rb | 9 ++++++++- app/models/wiki_page.rb | 11 ++++++++++- app/views/projects/wikis/_new.html.haml | 2 +- config/routes.rb | 2 +- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/app/models/project_wiki.rb b/app/models/project_wiki.rb index 163302a18f..08a5278247 100644 --- a/app/models/project_wiki.rb +++ b/app/models/project_wiki.rb @@ -64,7 +64,8 @@ class ProjectWiki # # Returns an initialized WikiPage instance or nil def find_page(title, version = nil) - if page = wiki.page(title, version) + page_title, page_dir = page_title_and_dir(title) + if page = wiki.page(page_title, version, page_dir) WikiPage.new(self, page, true) else nil @@ -90,6 +91,12 @@ class ProjectWiki wiki.delete_page(page, commit_details(:deleted, message, page.title)) end + def page_title_and_dir(title) + title_array = title.split("/") + title = title_array.pop + [title.gsub(/\.[^.]*$/, ""), title_array.join("/")] + end + private def create_repo! diff --git a/app/models/wiki_page.rb b/app/models/wiki_page.rb index 76f311ed0b..c95b82734a 100644 --- a/app/models/wiki_page.rb +++ b/app/models/wiki_page.rb @@ -175,8 +175,17 @@ class WikiPage end def save(method, *args) + if valid? && wiki.send(method, *args) - @page = wiki.wiki.paged(title) + + page_details = if method == :update_page + @page.path + else + title + end + + page_title, page_dir = wiki.page_title_and_dir(page_details) + @page = wiki.wiki.paged(page_title, page_dir) set_attributes diff --git a/app/views/projects/wikis/_new.html.haml b/app/views/projects/wikis/_new.html.haml index 8cb7fa8aa0..1ce292a02d 100644 --- a/app/views/projects/wikis/_new.html.haml +++ b/app/views/projects/wikis/_new.html.haml @@ -9,6 +9,6 @@ %span Page slug = text_field_tag :new_wiki_path, nil, placeholder: 'how-to-setup', class: 'form-control', required: true, :'data-wikis-path' => project_wikis_path(@project) %p.hint - Please don't use spaces and slashes + Please don't use spaces. .modal-footer = link_to 'Build', '#', class: 'build-new-wiki btn btn-create' diff --git a/config/routes.rb b/config/routes.rb index f23542cc89..3e32068d8f 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -204,7 +204,7 @@ Gitlab::Application.routes.draw do end end - resources :wikis, only: [:show, :edit, :destroy, :create], constraints: {id: /[a-zA-Z.0-9_\-]+/} do + resources :wikis, only: [:show, :edit, :destroy, :create], constraints: {id: /[a-zA-Z.0-9_\-\/]+/} do collection do get :pages put ':id' => 'wikis#update' From bd8b2b7fd98faf3308cb1f722426ff8f7c39f1d5 Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Mon, 28 Apr 2014 16:37:19 +0200 Subject: [PATCH 059/135] Default last_fetched_at to 0 for old clients Users who have not refreshed their browser tab will poll GitLab using outdated JS. This change makes the server fall back to the old behavior (send all comments) for old clients, instead of throwing an exception for old clients. --- app/finders/notes_finder.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/finders/notes_finder.rb b/app/finders/notes_finder.rb index 0b9affb716..ea055694cd 100644 --- a/app/finders/notes_finder.rb +++ b/app/finders/notes_finder.rb @@ -4,7 +4,8 @@ class NotesFinder def execute(project, current_user, params) target_type = params[:target_type] target_id = params[:target_id] - last_fetched_at = Time.at(params.fetch(:last_fetched_at).to_i) + # Default to 0 to remain compatible with old clients + last_fetched_at = Time.at(params.fetch(:last_fetched_at, 0).to_i) notes = case target_type when "commit" From 17b3da07ce90c0651303b4605a2ef634359b42b3 Mon Sep 17 00:00:00 2001 From: Drew Blessing Date: Mon, 28 Apr 2014 14:33:17 -0500 Subject: [PATCH 060/135] Remove markdown notation from notification emails --- app/mailers/emails/merge_requests.rb | 8 ++++---- app/mailers/emails/notes.rb | 2 +- app/views/notify/closed_merge_request_email.html.haml | 2 +- app/views/notify/closed_merge_request_email.text.haml | 2 +- app/views/notify/merged_merge_request_email.html.haml | 2 +- app/views/notify/merged_merge_request_email.text.haml | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/mailers/emails/merge_requests.rb b/app/mailers/emails/merge_requests.rb index a97d55f1b5..1130969a26 100644 --- a/app/mailers/emails/merge_requests.rb +++ b/app/mailers/emails/merge_requests.rb @@ -6,7 +6,7 @@ module Emails @target_url = project_merge_request_url(@project, @merge_request) mail(from: sender(@merge_request.author_id), to: recipient(recipient_id), - subject: subject("#{@merge_request.title} (!#{@merge_request.iid})")) + subject: subject("#{@merge_request.title} (##{@merge_request.iid})")) end def reassigned_merge_request_email(recipient_id, merge_request_id, previous_assignee_id, updated_by_user_id) @@ -16,7 +16,7 @@ module Emails @target_url = project_merge_request_url(@project, @merge_request) mail(from: sender(updated_by_user_id), to: recipient(recipient_id), - subject: subject("#{@merge_request.title} (!#{@merge_request.iid})")) + subject: subject("#{@merge_request.title} (##{@merge_request.iid})")) end def closed_merge_request_email(recipient_id, merge_request_id, updated_by_user_id) @@ -26,7 +26,7 @@ module Emails @target_url = project_merge_request_url(@project, @merge_request) mail(from: sender(updated_by_user_id), to: recipient(recipient_id), - subject: subject("#{@merge_request.title} (!#{@merge_request.iid})")) + subject: subject("#{@merge_request.title} (##{@merge_request.iid})")) end def merged_merge_request_email(recipient_id, merge_request_id, updated_by_user_id) @@ -35,7 +35,7 @@ module Emails @target_url = project_merge_request_url(@project, @merge_request) mail(from: sender(updated_by_user_id), to: recipient(recipient_id), - subject: subject("#{@merge_request.title} (!#{@merge_request.iid})")) + subject: subject("#{@merge_request.title} (##{@merge_request.iid})")) end end diff --git a/app/mailers/emails/notes.rb b/app/mailers/emails/notes.rb index ccbdadf010..2a877bc159 100644 --- a/app/mailers/emails/notes.rb +++ b/app/mailers/emails/notes.rb @@ -27,7 +27,7 @@ module Emails @target_url = project_merge_request_url(@project, @merge_request, anchor: "note_#{@note.id}") mail(from: sender(@note.author_id), to: recipient(recipient_id), - subject: subject("#{@merge_request.title} (!#{@merge_request.iid})")) + subject: subject("#{@merge_request.title} (##{@merge_request.iid})")) end def note_wall_email(recipient_id, note_id) diff --git a/app/views/notify/closed_merge_request_email.html.haml b/app/views/notify/closed_merge_request_email.html.haml index 809d46f31b..574e8bfef2 100644 --- a/app/views/notify/closed_merge_request_email.html.haml +++ b/app/views/notify/closed_merge_request_email.html.haml @@ -1,2 +1,2 @@ %p - = "Merge Request !#{@merge_request.iid} was closed by #{@updated_by.name}" + = "Merge Request ##{@merge_request.iid} was closed by #{@updated_by.name}" diff --git a/app/views/notify/closed_merge_request_email.text.haml b/app/views/notify/closed_merge_request_email.text.haml index ee434ec8cb..d6b76e906c 100644 --- a/app/views/notify/closed_merge_request_email.text.haml +++ b/app/views/notify/closed_merge_request_email.text.haml @@ -1,4 +1,4 @@ -= "Merge Request #{@merge_request.iid} was closed by #{@updated_by.name}" += "Merge Request ##{@merge_request.iid} was closed by #{@updated_by.name}" Merge Request url: #{project_merge_request_url(@merge_request.target_project, @merge_request)} diff --git a/app/views/notify/merged_merge_request_email.html.haml b/app/views/notify/merged_merge_request_email.html.haml index 0c62d439ae..6762fae7f6 100644 --- a/app/views/notify/merged_merge_request_email.html.haml +++ b/app/views/notify/merged_merge_request_email.html.haml @@ -1,2 +1,2 @@ %p - = "Merge Request !#{@merge_request.iid} was merged" + = "Merge Request ##{@merge_request.iid} was merged" diff --git a/app/views/notify/merged_merge_request_email.text.haml b/app/views/notify/merged_merge_request_email.text.haml index 550f677fed..360da60bc3 100644 --- a/app/views/notify/merged_merge_request_email.text.haml +++ b/app/views/notify/merged_merge_request_email.text.haml @@ -1,4 +1,4 @@ -= "Merge Request #{@merge_request.iid} was merged" += "Merge Request ##{@merge_request.iid} was merged" Merge Request Url: #{project_merge_request_url(@merge_request.target_project, @merge_request)} From 274d6db18749f4fbcceabd3529b5bcdad9e5b5a4 Mon Sep 17 00:00:00 2001 From: Manfred Touron Date: Mon, 28 Apr 2014 22:20:33 +0200 Subject: [PATCH 061/135] Added Node.js library link --- doc/api/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/api/README.md b/doc/api/README.md index b1740f3579..09c52350f3 100644 --- a/doc/api/README.md +++ b/doc/api/README.md @@ -24,6 +24,7 @@ + [Ruby Wrapper](https://github.com/NARKOZ/gitlab) - Ruby + [python-gitlab](https://github.com/Itxaka/python-gitlab) - Python + [java-gitlab-api](https://github.com/timols/java-gitlab-api) - Java ++ [node-gitlab](https://github.com/moul/node-gitlab) - Node.js ## Introduction From c8c9c365a06f2cea7d68ea56b4c584ef7afab0e4 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 29 Apr 2014 08:28:03 +0200 Subject: [PATCH 062/135] Add apple-touch-icon-precomposed.png because of 404 on iOS devices --- public/apple-touch-icon-precomposed.png | Bin 0 -> 11979 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 public/apple-touch-icon-precomposed.png diff --git a/public/apple-touch-icon-precomposed.png b/public/apple-touch-icon-precomposed.png new file mode 100644 index 0000000000000000000000000000000000000000..6f2e0dd090ff597a7261de7b8b7d403a92691a51 GIT binary patch literal 11979 zcmZ9Sb8sd>w};YN+qR93oxHKRNjB!j_Qtlev6K6L_p7>p+^Xs6s+pRa z={`NDpWitrT1i0?0Tve)001CJONps~`po|{=x?BNMnS6wsDp8m(sl&^;86e5z~(mt z-T?quMQc$}B_%6IH%C`1M<-%wQBh(i7e@*yRK0YW8Lzxaf26hGNfTSosv^Xke z{B75_*mkMw>1gV+d0F7N<__321Jwr&pDx9!%pL?^DME;{6FM?DynDbP6bwt|1VDyv zG9z*QAO!yVFWKr@xq$k$HBEgq~3P45h)smVY{H7$)ri_T&E%{W_#q2D_Thb5Q| zY3FVd04PYp0FCzU!)qF`ZhD#{z6H^c{;U`B>xYTS{^#LLwUZD4uzPG}Cy%Q|_7?d_?*P=n+ zS4MS?7t4;jV=4U+Es{(Z5N(68Qx z$nS*oY7CwChpHTy!ugrV|Z6YT&DfaerylfOkee zn9ekKLZAkV_rY*Lc#04k6ADXd$!RI9NL3Kyld++!!EnNWhbi|{{z$2i{Y}w<@-m2R z!onP>B}GTNgqncHi0m6BI>5pphhR^6jg8Ml$aIYd5WJA^dPWD!;`&Q{s1 zC{#mXPtXymEo@P#SB|VeV{^~uo(jd3mMyIK-o+qRLGdsoS!(A zJjpl#zxRYkh`vs5DUZuai(`Ro$~|cMTK6nc_5g(UI69R7bc6vky`g z5Ol`!S5+2ri?YhFYBs6drCJC=?Poea=ejAt98;BN+y%sJp)BSN zXQXRYOI0gZOP+Ug)LoVX%euuowcmmfg-2v4^(ZAR6Q;idk5yMyH_KtmG3EJr9_kpX zY)kP9JH-*4roBw;#42E~bE_Afb?zKa;=8 zR*`Qnqb}o>wXK`1ofabP&H>k(h|$E-8J+sDmGd+WP%|>fFTEOcyqM-K*sICS%24O{sEZNl+%A% zv0i`0abWk^z;DCtXM`N`Wi&pD;2_1!f%iEt)5JJgj#=LBHh>#yO6;s1;E?8bXCzDH?g7 z68|_AtuI#4b4mxy>A&Jj`qlVtW>To^IyQ+Vrq3B4sCPI#kOvP>q)6nijoN(c|3d)p@j2my=E7 z>xrDX*ZE(UsQswB$t|T3vYPY+T1VYAHr$PT&fe>=`xxJ8BQzju_}XGxXzc$gR$ppn z)CF`?_{iG^8~hm$`O^$$dk&`#dl>G2zOj6%uc*bSz1?j58Ue%;z=)2iLtn?rzzAHS z+VDEWi*y|C&Du!)U0FTYZZ=~vZ*h9GMW3gOm|m4}l!54gu)6jeVO!((<-?=+I%CEZ z)p}=Wi)edsFJD`idHLA%6tAFKiQ2u|s~X4E{ARQ9^0UL-6`pU`BiqH_b=|I~4}r0s zb#*Xx`M(x_&EKTonw|vfqN`4y)8Fj%YZdIBFGs-V!9So#5nGnq7ylB>^Q);OEYY4z zB90LCd;+gM=@B>()PLpL^ zrqkOtNRHPX$Zosy;$N}Hyj{H0dbe$Ew~gzEXqs)B+4Vez_GfNqe4i-`iX)x5o!NEm zdbaIXKHbf}7Eh;md7RUm_ubw%m|shO^SJppyYGA)pN5_uwlOyYTqr-LCpuR>DX(g~ z6uS)Xg)W6xMK>e=3hI7ttXyvd+VpuA+|6xBK0$_u&U_|4Bp``?PsmD`h(L%q&*Ku{ z=H3%@`8a(q7o9Pip~%DfEc%?N!@^_?c>a67JUy2=SD0~|k7!%JS?~Xv>1b@>MRGz% zDoi0Lot(56_(+!i&r#ZWt`coTJ@tTYN}iQvz8B7ml$4Z65K|8tk&T@h9py+?Q5NW) z7DZm!)wOszE9|bG*;K4Q+{s11@w)KyoDV%v=`_u4)}_^%fZZ0bAn>hx2zT-%Q z_&pQfE=HUFe0X3`fO2tdgl5E(rF|1ELzR<}(PLtNINhj>71%2GZuf{V=m`=|KnDMK z_q({LvD9p+8fUrmx9JbbRYtl}#kX8k(=6eW<=fv!amy?8H+$d5mh^>VgLUUVcqhSv zigEs>b)Pni?95yU{#MJgwr&aB6SjncVGeHa2NR|lmks;gZqStp6mapvK0WuB5sP{% zIc65qq{NUl8E`Ndp9=7NnSbd67)pf5$@$sY+Q*ITuj}NPmxwj7uvR>**V0dMq*H`^ z<3sv!J^f>dwh)Va@Hr=&$}{ZgDx%?X?eSK89NsqV_v(}Q1kz$Epb>es|O^A=qWEuk$@OFbbkBB7^-p*|T^0>eM355m(y%}dz z7ygNZ&`!)LEUjFdU4Z~lF?@~=G_!J32keo!dvf+Kt%)Tj+&Mh|JjIDE>geo*yJaQf z@3=npoge>JS5;M0L0nr~Nk%g6dp0=dh}gMR(yi6JhXfYjV0fLvJckqm+X#AS&Wde7 z-T&z^EjJEZ&Y-BK<{(F>d&bN5+j3of{da(tuI>f`oH^O((h{aRMrq?bqfcg^JNu$h z%8T*Ahm*n8CI?5lzP>&iyww=>m#b6`}7k^2RPRQU1!9{0?)M_!hs<@b6^jiS7C zmfYi-ZVuh#PQOSO&h;H7CXscn@k%#v}GQNv00 z*?i`S6eScd201r7hIL!gW4qATp5k}aA2KCcs;Z@hb##oBS^4?=V{yH{ITZ9Hw>PFF zfP&h?riR^~xH!)^h-k4NK;R`IzmE|7YI!9CHA%>bDdnuA-E()8ZtewdS2rJ^Pq8Pc zwY3@Y^^JyRlxl#imj0)x2!ont+RSW-w)tuJ4l$lBD~7oBckjxbf+hlj+7!mXq^GNY zPM17qS3IS#_VCNiO-&^4z>Ew_Q*#}a+vp@>FhD?0d6$AO@|SitALrCAahNukUzwvS6hvZOayq1 zn)+G!8ED}m3O!#!g-Vos39v9uVjBp>qm8ZQZz@v1BC@~93G>WucXo8x#n;g9+&ou} z&jSJ-vE?L02|Qlr!?(8b8h)Nyy#$bxlbFCR+uGV^opA}tt6SH1{9t~s$-mweoetwj zNFrw4>SmqaUJifeS@=>*{W?$nu34{_U8Ss|ng?^^+D7C;hbhbZWolufuL)R zUs`S}Q??PWzTWLE_Ika;BgccOS|-j`3b(~?o4dOa-jV0$wg^wIC;qfxgb=qC zdITCikvVU*dAPqcmXa6Svj7S@t7Sd&hZhb8PrtzcxQs0Q^J+-C2|WBC#=rh9smaTs zMC0=WET*|n1yFfM^hRE?@HPK#F)T@xoLpPeK@sp{4Q8gpd^|{ zC`k;xcf4^gDT(z-&2JbSOAqV4r55+@WBG3d6WhKHAScVi@84xoL0zPB4sRhf%f zg!Lted)tgRhHbuCL%;yq0@w%pC!s@0^wS<6Z^Q6x5`cZEc}2>kM@JOM5Y)6|e>F7U z|3ODnRMt>!HQSCX(c_(;*-$-Zv@9LrU+{uxp&@}Up0KgCY0$V~0kN^R);zyV#t;8A z*Wb(x!lB~fU3;$$6C;5&0#5|ltf1G?3mYbY1qb^C4GY6$v!%VUF(k}fTzs{onKl`9 zq*?K=`r++-QN7`ui%)PmEjY=a<9oM7Wl~bI-FEJ*az(<^>ub`8%$zJCWHSegC}E_~ z{0kvglBUr@Ve(9LtmF9jIga#yi%N#FnwlvGl$3mk>snd!7UViYkB<*lSLz6z?!foC z&ilpw5XL(+UR_z}5JV!6LgV=N;$MT{03}i>SyxgLu)3=`Q69&674J3=c6NV4O$3)F z^1-lJLI09VeKvzV?@u~uz0~@S#yB~5e8^BpKwBrbDDr{xJM?pVxRxLNWL(&H?j+F< z0Ki`U5Gn~}A9wfD071QdEZ@W&TME!eg5?YDPao4fHFC@bA6XI+e@cimi)|cFw)1v98Yp2W<670|k*@kL%f|@@=yYDx|HQ zcjvdUfHyY~05(o`*nf?0ueoJ{+ELR#Kr`S!5{b-CT(jH9pl3k zNa*%qQ&AXPHge;bzmfZhEA8j0r-x5FQMR2vDG2(v#;jTPoceG>3WAz?;&74XFGY>q zFm7C=f=V)Xm|UV(*%iv}kr404rDBIhhFHe+;+!GpmKW$r=@qo{O+|7`$OOIVNGKM! zmnRYzPrgeRcswT-S4M-mE^!Spz&P5K_}`BTN2CToE{<+&*a-*3N4(ll6jsXU+mj0t z=>`a2T`Wt{VcJ^QxD7AIN{4gYJPMc_Lyqh^HNoHd59?CH%w5$fP@t}rR9CC&sIcAn z57UMIZs0)r_XIqvmwHp)kdo9@l~wh3^nA;0WXV&B6kLh4vVGZDn&)EK;8ZT7pb!4+ zSwtM4L>}!A;X_c@68EOIM~{q5Lb}?Hz&n+ZzS!Mc8EWx`B4R8rDhdh5c@G%8TuP^i z$c!eL-`-A1MZP?+DlaShLDe@k-I5Y&UtSRvlwS6lHk-&G2E{J}a`@F$V}7q%T(-ms zMDDKqUO^l&^@gReaB$Q4P|B$Hl@W$d|QCZdS7S*39o(?s74e;4vbXvcJL=n=nliBW? zf0dMsJ{0WV3VuS#E5sA=%H4G)qwfD^PvhlTvjj6+nL4kcfeq7-rS8Z)}c#tJMAc{JOfj zIz6uqTH|f1Z7nRst~xDPSeRz(Yb){5K8%ip2wmJ8n;V3Rt(BLj{#t(%IbW(pLq|u) zz(`9@-a9@vY&3&u&g}GPJUBLIuHqJVYdJf!lGpRGv$yy4_0`qY&B@7`7$2X`<-S{Y z>`jtXRaQPdJuQ^a2T9D=4qQ=Da8@uDp0l3RHYIP+ViL8-!h*6%S5a0To0%cP#uoaK zM1@Yn%jrurzAy^YiU`X=w>G5VEsBMoh`g(%#CA3nqCngXH65_E62;`CV zpZ%>Sz{ejP8tPTpX|bCe8!L%4=PZ&J*0`NGaR2o4_y0&uMF#}+^azZtw>oYsw2_GS zZ7(lVl9Gz%!SVAGkR?Adya$MJ$q6@hcbn@7p{hAr+s`R!_IQ7=@Uw0YKCh6=VyZ&m z;NWmO?9wnL;veL2Iz~i9Ty1qvOiwF7Z#0CKmQ}@Z_)A1Yva_ecoYv^Iv#_uvXF|h6 zl6vzpGG5QlF5BOoot>#yYa|_q>|8}19f5`8GP5taJM%E9lPb1IU}9jvLf_)zSwGzq zSJ8~W`C4B2j(UzA-{6K?86 z`TTP_Ik$E$tqVK(l@*V+b{<58$GMuibK&uQ0%hg7;9#(#GmuTlP?l=6RW%+T?08|r ze>|$xK@pTyN!U$-n~d8o*V)_H{IFiZV$kCf4lOJ!6wdputqroR0}qJ7XlP>6j8zy_ z^O@SL39wJSVVxIgpffnGD4wqpHl*nd)kCaB!fXol|xH`sH-00voIP zbUoK;Ft@dqiT*^)%PKD_?=V*6ttl!R5t)=ynL2wAD{a)Lo!Mn(J7M|SO8Ra3RjDQw zWXJt9(eZpyE^=5aoNe##jw8dvlg!%7$}BF|noXfh z2IfAu+ zUi>^FoTb03vJEO_Xze z+B{0j%bA^+YigU55;9V9OM`;?v@T;~V>N4azDEv>sX`+lkiXP6Ccp3Ov|26@jv%Vq zA?fK+Z2%@GC&^x^z5`NIQxh4_YxG`5Vi%8toO8;!@W+)jH&^H4ll;lP%~8|zV+Fju zuE_1(JR2YMX_a5INr6VVesy^O+1!YGd|1@jn9RhAXIq9uBv516n|Bb|`+gg^t#^fk zdx3(wQ^=9g+}fINgsG*W(c;fr*&j&vX6V9V>am&_`cbhRD}!8AD*EwHf^Tw_2qYzo8;iu0wBim*l9D6Q6vffeUms6I;;4lgp}l`Q zy7X=*_F&TYAijUU-e?!SlHsPKyOK&nsd%$1uQ@;f<%tr?_}cIOTFr@V4x0+ZzA zqRiL3LkCr4)9I8|RCv5^OUld3D=Vq-@YajOV<{ksY5D~laD%~m?j3t;48Ihe5(NSG zdB*teB4NJC*y?JD^5%d0wQUBA zN(exg_Wg-pyRRkbizh7b_kTmmxXK5e zEx9?nv4M|9^vLfqm~~dio;G+qli%uo2icZnFbLE|c!*ntBG);6SqN*(d|S*jVXBzO z2;umAYK>{6!wfYZ<-29U8i~(5iA1+XKzuZWe`LhIeu+^yy*#a|uAZ3iej_6}k~XnZ z5xKZKc)pli_SUxc=5{pf_48QVbl=P`>3m7v>qnzSc4G*-@LT3wLQ+D|r*EK}*5Y@3%1U)rEkFr$AG;1OM4)% ziA?ALK3Ri&k#h4GUcbCMtuX${OtjTI)#Do5n~&vy&Kga`w$|DJ065MYIQ?qii|P_h zG9T_-HlW;uf!k)Kc)H#+xDPahYVf??$mR+#P#C^7??v0^#sBrKi6jl9G;aiP>92t9(yNhD(?)?@USUpeO)R1?r0kw+xvAKaXc^j>Q} z=0QUPjjk-2%6DaI3$qfqTi22}!fR5T$~`A7e*1?M%6R63pK)N(Vu;kV;|3k*e8QA& z7g0G?MRY|?`;?VQLqkO3PyfXEyA*3#5qUfz%ZTNjpIL1|pVrPz%+yLk`-AH#YPdn32k( z_jZhWlSAT)yV(&Xy}OaaMWU~EO9M;By%GnD>@BJs&5c=vbIZykV3>DR^WqHqs%t9` zjyBlGet!O?{mMv6;vhhmjDUJ@XWx~0l{$-O*_Gf)$8;K=4kRA70OyWF-yHCKgg>MR zFL1NAX6783mc^Q3^>dnAowFz?e~^zc@r5`Ql#`Q3yx`18L&d>=fKd2^C1ONUM#(dV zbpN^V9TlLYum7jTcYR=vUp59)Q6|dVd^IyOlZim}ZGU8wvY?{AHNlD8i-*d`7kIF@ zqHORPt@HYH9o}%gwWOpu@K2K!n@sp^ad8pI+oGnau3&Wa?-$;BivtL#O$y|rPxU%c zZ`bS5>uU1_4x>j3aTJmgwX{|cG}5QS5;|1mdP~}@MjjEuO1UDiimkyw@ZX*}G%ZA?Bj%DQ3jUx?_9h7QzkWOBK$T69|+Dj8hqU1Feob)^gx_xHc7 z1L_VqL@1;n#yRRl@42t3Y9)5oHp3`+I-A*=4v*gw6^@vAdE403gi?fj8Z`(r{^{&HnwuJ zdG}9G($X=uwwFWuJvod|$dSeTo6v}lz?LPeOnv|ksemz#e&=7#4p{}Ie_PbW(?v_g@zL@LT_BZ``1ApwlOEiZ4D$B2-W^BT^& z9peCk@Nrc_q;)d~Mhp~5lIHh9+-);DJGteyy}}x@`U{kGeAS=5xg(N7(Mfl1yj)q^ z8k6yT-Z^!9XUZO`HM0rHzf;@93P4E9Md^0iylnFBx@M6p(?a?3rqkz~+1OTy|6=0= zDXX)~%dD&}A=Y$nG09F?xnYkDb=mm~{urNMW;b2sifG3avPA+0<@`%E1{zvgQcDM* zaz4b!=0-MUx%k43o9)$xg8GSparsCAn4taQVDi4?bY&k3p zf9dFEAEOT)&m?QsK9lmjV-EQ>H*vVqCnrVK_A@*>J%viajGO=GY9%6J%v$x_n-8 zaosYz!ib3^Eq&pp>Q62uez&%^w6;Dxc+3^s2nQ^62x{WHI2Sy#v9oLIsH`kcxMKc< znQ~z6MR!rqO1#^xC?-t~+1Os6nwcnsPRaIjC&D3gaQMW3;#ym{%VgFw)RPkn%GV6a zS5z@csEiKI&sTI%@GvyIPPLH(NtpE7b5Kf@dTHqG$>AEs_@Bqu6BH^SF%z3{aK=Av z+>;ge?0jX_Q(HSz(M9C;_0Y8~35=F@f+&#Au)*Z8in$S_q%dedkufpbTn@iEpl)MP zc2)QG8j6W2sfxN^P>x00=yhO|k@cnJ^1Tr?0Ob=0o9o`Y?5Lgp6iXuh=(Vd!Xwoz_ z9cZ!7As~1ROd%&saI|&+W&B?5E8ALHTH@uZs;XRFU1@1)owzQ{s1Qk$=97!&Rf@t~ z@eB#U003-!e6EWlGJ0w~wM?WQci?k*MN+YX%=u##?djQteN8<%rM{lt{Y=MU-U!l6 zi40)puiC+jm&emXGT}pgef83u#_~q>2AieA*|dOEk(;}F2fkZkI`Z_))Q@^UM}zXZ zFI#h?pzF9(Q+xB_7GK?kV;)rVM!~KOWHc9d=Zn1D?csbxGGPb3-tmcM+l!?9`cJDo zGP|{Zo{IycI7<6bIdHt|(`$33YDI{k>@6tRxZUCGUbkvL9Si{|DdPj}kX$~4XY=+Wi;S@39u{&vZFOTOB@+AF3A{g4zG3ozcL8@El~ZA=y=B!fE_A4qwPAS zp9tZN?(Vo8UmILZ^piZEa&r@(oLp>eeI1+23gq37_Et~`J?!lYwsGn=d0Pj?B&VH4 zr`!_(LCJeRzI#jC)BkO0Y2X~XiHE9TUqlDxgTP30-~3;-MkfY5NS>>Gqsopb=;h7H zGv%~TN7@}rxe=11EUhZGhgJ;|^Jx!Pm)X(jFikCNj4Wy-t!}JLrJvPZT~lgOM^`3P zZ=C1eyYM6R@S`cYkDjHA+6_oYvadh8*DpF-z41LsBj6DbaB!_UJ60Ar1I16Qs)6@> zGVnKiN8{7Oum6N0#Mv{6tu3X0o4UJW$QiiQcbJHak5NT1=<83p1_%5m7vN$tvNZKr z{2<=lj%hSOV9)#^*U?gz{eCHz7*~_6MfaE(8wwCS2L8(lOFT-q(6?vbvwo)@GuHIQ zt7b$bciirv>6^H^Iug5oekIsU{&EmXmJ-=8H70SOmF3zkrU!w_-?UQH{o*n;3I@nG zZC%`N011f*`l+8{VP2?cgn{LdFP}oF%x=G1u?HR=q3=q1yX67ZyxDJI6!cBF*diG?h!i*45WdZQk4GQ4rP}ADXLCwHW zG#rY3d$F2gDv8+A%#rtSw|BJReW**6WfYPNQ(03pyH*XKl2K7bS6y4@!=_Gvu2qm)Jyc{Otq8?S|bhB#g%&FF~rCn?R#3+nhN(2LwqZ z?UmI&5@A8P$3T40swgTFVaM=BL;J8TJidz17b}jCK0+e6tR03t>%ylyDuX17 zjR`2}`ceYH8aDjve5nx#Lvfs^C$NU)8P090haRCF)?cqfN8hNj1y-jaxEEBk68D|@ zd?w0z`QrVxA!E8cbx|lxZA{c&`RQ_5gh5hjMXQ1T{iy6!1Jj8+i(gq8DR5` Date: Tue, 29 Apr 2014 09:11:02 +0200 Subject: [PATCH 063/135] Add new entries to CHANGELOG --- CHANGELOG | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index a5671948a6..1922abe572 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,7 +1,12 @@ v 6.9.0 - Store Rails cache data in the Redis `cache:gitlab` namespace - Adjust MySQL limits for existing installations - - Add db index on project_id+iid column. This prevents duplicate on iid. + - Add db index on project_id+iid column. This prevents duplicate on iid (During migration duplicates will be removed) + - Markdown preview or diff during editing via web editor (Evgeniy Sokovikov) + - Give the Rails cache its own Redis namespace + - Add ability to set different ssh host, if different from http/https + - Fix syntax highlighting for code comments blocks + - Improve comments loading logic v 6.8.0 - Ability to at mention users that are participating in issue and merge req. discussion From 513dbdbff31bd81243ccf349e3932aa02f29f05f Mon Sep 17 00:00:00 2001 From: Ciro Santilli Date: Tue, 29 Apr 2014 11:49:42 +0200 Subject: [PATCH 064/135] Remove redundant signin link from signin page. --- app/views/layouts/devise.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/devise.html.haml b/app/views/layouts/devise.html.haml index c5041dd71b..5d93ffa50a 100644 --- a/app/views/layouts/devise.html.haml +++ b/app/views/layouts/devise.html.haml @@ -10,7 +10,7 @@ %p.light GitLab is open source software to collaborate on code. %br - #{link_to "Sign in", new_user_session_path} or browse for #{link_to "public projects", public_projects_path}. + Sign in or browse for #{link_to "public projects", public_projects_path}. %hr .container .content From e52f50c22fa0ca855ad75208b511bf27967e92ab Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Tue, 29 Apr 2014 11:54:09 +0200 Subject: [PATCH 065/135] Do not refresh notes on hidden tabs --- app/assets/javascripts/notes.js.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/notes.js.coffee b/app/assets/javascripts/notes.js.coffee index 043e4f6266..2599a0ea4f 100644 --- a/app/assets/javascripts/notes.js.coffee +++ b/app/assets/javascripts/notes.js.coffee @@ -72,7 +72,7 @@ class Notes , 15000 refresh: -> - @getContent() + @getContent() unless document.hidden getContent: -> $.ajax From 0b914e7ceb28c67a50d19c7fac10a95b3ea4a1fa Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Tue, 29 Apr 2014 17:06:56 +0200 Subject: [PATCH 066/135] Refresh notes when the page becomes visible --- app/assets/javascripts/notes.js.coffee | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/assets/javascripts/notes.js.coffee b/app/assets/javascripts/notes.js.coffee index 2599a0ea4f..8b15200563 100644 --- a/app/assets/javascripts/notes.js.coffee +++ b/app/assets/javascripts/notes.js.coffee @@ -50,6 +50,9 @@ class Notes # hide diff note form $(document).on "click", ".js-close-discussion-note-form", @cancelDiscussionForm + # fetch notes when tab becomes visible + $(document).on "visibilitychange", @visibilityChange + cleanBinding: -> $(document).off "ajax:success", ".js-main-target-form" $(document).off "ajax:success", ".js-discussion-note-form" @@ -63,6 +66,7 @@ class Notes $(document).off "click", ".js-choose-note-attachment-button" $(document).off "click", ".js-discussion-reply-button" $(document).off "click", ".js-add-diff-note-button" + $(document).off "visibilitychange" initRefresh: -> @@ -453,4 +457,10 @@ class Notes filename = $(this).val().replace(/^.*[\\\/]/, "") form.find(".js-attachment-filename").text filename + ### + Called when the tab visibility changes + ### + visibilityChange: => + @refresh() + @Notes = Notes From c8cf90d28655b49d10e6d7b9b82ce3cda41089a9 Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Tue, 29 Apr 2014 17:23:29 +0200 Subject: [PATCH 067/135] Add document.hidden improvement to CHANGELOG --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index 1922abe572..1e9aeefd19 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -7,6 +7,7 @@ v 6.9.0 - Add ability to set different ssh host, if different from http/https - Fix syntax highlighting for code comments blocks - Improve comments loading logic + - Stop refreshing comments when the tab is hidden v 6.8.0 - Ability to at mention users that are participating in issue and merge req. discussion From cb69baedd335b0609503502080fc684520b3794c Mon Sep 17 00:00:00 2001 From: Marin Jankovski Date: Wed, 30 Apr 2014 11:48:46 +0200 Subject: [PATCH 068/135] Remove empty line. --- app/models/wiki_page.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/app/models/wiki_page.rb b/app/models/wiki_page.rb index c95b82734a..535bfb5b28 100644 --- a/app/models/wiki_page.rb +++ b/app/models/wiki_page.rb @@ -175,7 +175,6 @@ class WikiPage end def save(method, *args) - if valid? && wiki.send(method, *args) page_details = if method == :update_page From 193a9e7d4c7b516fa1ed1c23eeb89ab71c316019 Mon Sep 17 00:00:00 2001 From: dosire Date: Wed, 30 Apr 2014 13:35:35 +0200 Subject: [PATCH 069/135] Add link to slack docs. --- doc/integration/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/integration/README.md b/doc/integration/README.md index 3e8d329d55..8318113ce9 100644 --- a/doc/integration/README.md +++ b/doc/integration/README.md @@ -6,3 +6,4 @@ See the documentation below for details on how to configure these services. + [External issue tracker](external-issue-tracker.md) Redmine, JIRA, etc. + [LDAP](ldap.md) Set up sign in via LDAP + [OmniAuth](omniauth.md) Sign in via Twitter, GitHub, and Google via OAuth. ++ [Slack](slack.md) Integrate with the Slack chat service From af2a39470f6c7e548355d5f839a9251620a870ec Mon Sep 17 00:00:00 2001 From: dosire Date: Wed, 30 Apr 2014 15:00:49 +0200 Subject: [PATCH 070/135] Make import docs more prominent. --- doc/raketasks/README.md | 3 ++- doc/raketasks/maintenance.md | 29 ----------------------------- 2 files changed, 2 insertions(+), 30 deletions(-) diff --git a/doc/raketasks/README.md b/doc/raketasks/README.md index 9aa80af12c..6be24f0102 100644 --- a/doc/raketasks/README.md +++ b/doc/raketasks/README.md @@ -1,6 +1,7 @@ + [Backup restore](backup_restore.md) + [Cleanup](cleanup.md) + [Features](features.md) -+ [Maintenance](maintenance.md) ++ [Maintenance](maintenance.md) and self-checks + [User management](user_management.md) + [Web hooks](web_hooks.md) ++ [Import](import.md) of git repositories in bulk diff --git a/doc/raketasks/maintenance.md b/doc/raketasks/maintenance.md index 3033d8c46b..2783c4153c 100644 --- a/doc/raketasks/maintenance.md +++ b/doc/raketasks/maintenance.md @@ -110,32 +110,3 @@ If necessary, remove the `tmp/repo_satellites` directory and rerun the command b ``` bundle exec rake gitlab:satellites:create RAILS_ENV=production ``` - -### Import bare repositories into GitLab project instance - -Notes: - -* project owner will be a first admin -* groups will be created as needed -* group owner will be the first admin -* existing projects will be skipped - -How to use: - -1. copy your bare repos under git repos_path (see `config/gitlab.yml` gitlab_shell -> repos_path) -2. run the command below - -``` -bundle exec rake gitlab:import:repos RAILS_ENV=production -``` - -Example output: - -``` -Processing abcd.git - * Created abcd (abcd.git) -Processing group/xyz.git - * Created Group group (2) - * Created xyz (group/xyz.git) -[...] -``` From 9571743d8f46e583a4edb465b831f495d642bf32 Mon Sep 17 00:00:00 2001 From: dosire Date: Wed, 30 Apr 2014 15:02:37 +0200 Subject: [PATCH 071/135] Import rake task documentation in separate file. --- doc/raketasks/import.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 doc/raketasks/import.md diff --git a/doc/raketasks/import.md b/doc/raketasks/import.md new file mode 100644 index 0000000000..e11328dc5c --- /dev/null +++ b/doc/raketasks/import.md @@ -0,0 +1,28 @@ +### Import bare repositories into GitLab project instance + +Notes: + +* project owner will be a first admin +* groups will be created as needed +* group owner will be the first admin +* existing projects will be skipped + +How to use: + +1. copy your bare repos under git repos_path (see `config/gitlab.yml` gitlab_shell -> repos_path) +2. run the command below + +``` +bundle exec rake gitlab:import:repos RAILS_ENV=production +``` + +Example output: + +``` +Processing abcd.git + * Created abcd (abcd.git) +Processing group/xyz.git + * Created Group group (2) + * Created xyz (group/xyz.git) +[...] +``` From 5bf12bbb1d05e0f4fc2661ccd68e0c208499ba57 Mon Sep 17 00:00:00 2001 From: dosire Date: Wed, 30 Apr 2014 17:28:05 +0200 Subject: [PATCH 072/135] Make clear that notes also serve as comments. --- doc/api/README.md | 2 +- doc/api/issues.md | 4 ++++ doc/api/merge_requests.md | 4 ++++ doc/api/notes.md | 2 ++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/doc/api/README.md b/doc/api/README.md index 09c52350f3..4ef4c031bc 100644 --- a/doc/api/README.md +++ b/doc/api/README.md @@ -13,7 +13,7 @@ + [Merge Requests](merge_requests.md) + [Issues](issues.md) + [Milestones](milestones.md) -+ [Notes](notes.md) ++ [Notes](notes.md) (comments) + [Deploy Keys](deploy_keys.md) + [System Hooks](system_hooks.md) + [Groups](groups.md) diff --git a/doc/api/issues.md b/doc/api/issues.md index 823b72f5b0..d18506f9ce 100644 --- a/doc/api/issues.md +++ b/doc/api/issues.md @@ -193,3 +193,7 @@ Parameters: + `id` (required) - The project ID + `issue_id` (required) - The ID of the issue + +## Comments on issues + +Comments are done via the notes resource. diff --git a/doc/api/merge_requests.md b/doc/api/merge_requests.md index 2996f609d4..d5b106729c 100644 --- a/doc/api/merge_requests.md +++ b/doc/api/merge_requests.md @@ -258,3 +258,7 @@ Parameters: } ] ``` + +## Comments on issues + +Comments are done via the notes resource. diff --git a/doc/api/notes.md b/doc/api/notes.md index b15ebdd2ba..e9ad6e00c7 100644 --- a/doc/api/notes.md +++ b/doc/api/notes.md @@ -1,3 +1,5 @@ +Notes can be wall notes or comments on snippets, issues or merge requests. + ## Wall ### List project wall notes From 469077e55dab70dd392eb7a62d6a8c6764d6d784 Mon Sep 17 00:00:00 2001 From: Ciro Santilli Date: Wed, 30 Apr 2014 12:04:11 +0200 Subject: [PATCH 073/135] Add help link to header. --- app/views/layouts/_head_panel.html.haml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/views/layouts/_head_panel.html.haml b/app/views/layouts/_head_panel.html.haml index d8001fd76d..f1545c6d08 100644 --- a/app/views/layouts/_head_panel.html.haml +++ b/app/views/layouts/_head_panel.html.haml @@ -19,6 +19,10 @@ %li.visible-sm.visible-xs = link_to search_path, title: "Search", class: 'has_bottom_tooltip', 'data-original-title' => 'Search area' do %i.icon-search + %li + = link_to help_path, title: 'Help', class: 'has_bottom_tooltip', + 'data-original-title' => 'Help' do + %i.icon-question %li = link_to public_root_path, title: "Public area", class: 'has_bottom_tooltip', 'data-original-title' => 'Public area' do %i.icon-globe From cc9b7cba3833293fcb25779f1c901e043c4c17d8 Mon Sep 17 00:00:00 2001 From: Alexander Mills Date: Thu, 1 May 2014 15:42:28 +0100 Subject: [PATCH 074/135] Updated CI error message so that it makes more sense --- app/views/projects/merge_requests/show/_mr_ci.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/projects/merge_requests/show/_mr_ci.html.haml b/app/views/projects/merge_requests/show/_mr_ci.html.haml index c175d2f6b4..507a9e507f 100644 --- a/app/views/projects/merge_requests/show/_mr_ci.html.haml +++ b/app/views/projects/merge_requests/show/_mr_ci.html.haml @@ -26,4 +26,4 @@ .ci_widget.ci-error{style: "display:none"} %i.icon-remove - %strong Cannot connect to CI server. Please check your setting + %strong Cannot connect to the CI server. Please check your settings and try again. From b2a258722bc8afbcca4af6e90cf00e4200cfbf7c Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Fri, 2 May 2014 13:23:12 +0300 Subject: [PATCH 075/135] Modify release dates for EE and CI Signed-off-by: Dmitriy Zaporozhets --- doc/release/monthly.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/release/monthly.md b/doc/release/monthly.md index 284e4e1659..e47117c7a0 100644 --- a/doc/release/monthly.md +++ b/doc/release/monthly.md @@ -84,8 +84,9 @@ After making the release branch new commits are cherry-picked from master. When - Push VERSION + Tag to master, merge into x-x-stable - Publish blog for new release - Tweet to blog (see below) +* 22th: release GitLab EE * 23nd: optional patch releases (x.x.1, x.x.2, etc., only if there are serious problems) -* 24-end of month: release GitLab EE and GitLab CI +* 25th: release GitLab CI # Write a blog post From c883660a3e754b5a3b14ef4a1be69503d345e3b5 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Fri, 2 May 2014 13:46:15 +0300 Subject: [PATCH 076/135] Fix install docs for gitlab-shell setup rake task Signed-off-by: Dmitriy Zaporozhets --- doc/install/installation.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/doc/install/installation.md b/doc/install/installation.md index 821ea067e2..90d6f0e17e 100644 --- a/doc/install/installation.md +++ b/doc/install/installation.md @@ -27,10 +27,9 @@ The GitLab installation consists of setting up the following components: 1. Packages / Dependencies 2. Ruby 3. System Users -4. GitLab shell -5. Database -6. GitLab -7. Nginx +4. Database +5. GitLab +6. Nginx # 1. Packages / Dependencies @@ -261,7 +260,7 @@ GitLab Shell is an ssh access and repository management software developed speci cd /home/git/gitlab # Run the installation task for gitlab-shell (replace `REDIS_URL` if needed): - sudo -u git -H bundle exec rake gitlab:shell:setup[v1.9.3] REDIS_URL=redis://localhost:6379 + sudo -u git -H bundle exec rake gitlab:shell:install[v1.9.3] REDIS_URL=redis://localhost:6379 # By default, the gitlab-shell config is generated from your main gitlab config. You can review (and modify) it as follows: sudo -u git -H editor /home/git/gitlab-shell/config.yml From dd47f9532ff8015e3d981ba4fd7341b7514ae109 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Fri, 2 May 2014 13:46:32 +0300 Subject: [PATCH 077/135] Fix gitlab-shell setup rake task Signed-off-by: Dmitriy Zaporozhets --- lib/tasks/gitlab/shell.rake | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/tasks/gitlab/shell.rake b/lib/tasks/gitlab/shell.rake index 2fcc889d88..00901a89fb 100644 --- a/lib/tasks/gitlab/shell.rake +++ b/lib/tasks/gitlab/shell.rake @@ -11,7 +11,8 @@ namespace :gitlab do gitlab_url = Settings.gitlab.url # gitlab-shell requires a / at the end of the url gitlab_url += "/" unless gitlab_url.match(/\/$/) - target_dir = File.join(home_dir, "gitlab-shell") + repos_path = Gitlab.config.gitlab_shell.repos_path + target_dir = Gitlab.config.gitlab_shell.path # Clone if needed unless File.directory?(target_dir) @@ -28,7 +29,7 @@ namespace :gitlab do user: user, gitlab_url: gitlab_url, http_settings: {self_signed_cert: false}, - repos_path: File.join(home_dir, "repositories"), + repos_path: repos_path, auth_file: File.join(home_dir, ".ssh", "authorized_keys"), redis: { bin: %x{which redis-cli}.chomp, @@ -38,7 +39,7 @@ namespace :gitlab do }, log_level: "INFO", audit_usernames: false - } + }.stringify_keys # Generate config.yml based on existing gitlab settings File.open("config.yml", "w+") {|f| f.puts config.to_yaml} From 87c397f5774c4c11ba2e4c55098920c081e53670 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Fri, 2 May 2014 14:13:45 +0300 Subject: [PATCH 078/135] More fixes to gitlab:shell:install Signed-off-by: Dmitriy Zaporozhets --- lib/tasks/gitlab/shell.rake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/tasks/gitlab/shell.rake b/lib/tasks/gitlab/shell.rake index 00901a89fb..dfc90bb333 100644 --- a/lib/tasks/gitlab/shell.rake +++ b/lib/tasks/gitlab/shell.rake @@ -4,7 +4,7 @@ namespace :gitlab do task :install, [:tag, :repo] => :environment do |t, args| warn_user_is_not_gitlab - args.with_defaults(tag: "v1.9.1", repo: "https://gitlab.com/gitlab-org/gitlab-shell.git") + args.with_defaults(tag: "v1.9.3", repo: "https://gitlab.com/gitlab-org/gitlab-shell.git") user = Settings.gitlab.user home_dir = Settings.gitlab.user_home @@ -28,7 +28,7 @@ namespace :gitlab do config = { user: user, gitlab_url: gitlab_url, - http_settings: {self_signed_cert: false}, + http_settings: {self_signed_cert: false}.stringify_keys, repos_path: repos_path, auth_file: File.join(home_dir, ".ssh", "authorized_keys"), redis: { @@ -36,7 +36,7 @@ namespace :gitlab do host: redis_url.host, port: redis_url.port, namespace: "resque:gitlab" - }, + }.stringify_keys, log_level: "INFO", audit_usernames: false }.stringify_keys From 02421245256a145a2b29a81f210585b15d1f2b67 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Fri, 2 May 2014 14:48:32 +0300 Subject: [PATCH 079/135] Fix 404 on jquery ui images Signed-off-by: Dmitriy Zaporozhets --- Gemfile | 4 +-- Gemfile.lock | 25 ++++++++---------- app/assets/images/ui-icons_222222_256x240.png | Bin 4193 -> 0 bytes app/assets/images/ui-icons_454545_256x240.png | Bin 4193 -> 0 bytes 4 files changed, 13 insertions(+), 16 deletions(-) delete mode 100644 app/assets/images/ui-icons_222222_256x240.png delete mode 100644 app/assets/images/ui-icons_454545_256x240.png diff --git a/Gemfile b/Gemfile index f42d8e2e98..3563dc88e3 100644 --- a/Gemfile +++ b/Gemfile @@ -161,8 +161,8 @@ gem 'jquery-turbolinks' gem 'select2-rails' gem 'jquery-atwho-rails', "~> 0.3.3" -gem "jquery-rails", "2.1.3" -gem "jquery-ui-rails", "2.0.2" +gem "jquery-rails" +gem "jquery-ui-rails" gem "raphael-rails", "~> 2.1.2" gem 'bootstrap-sass', '~> 3.0' gem "font-awesome-rails", '~> 3.2' diff --git a/Gemfile.lock b/Gemfile.lock index dac1844b04..3564566326 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -34,7 +34,6 @@ GEM rake (>= 0.8.7) arel (4.0.2) asciidoctor (0.1.4) - atomic (1.1.16) awesome_print (1.2.0) axiom-types (0.0.5) descendants_tracker (~> 0.0.1) @@ -248,15 +247,14 @@ GEM rake jasmine-core (2.0.0.rc5) jquery-atwho-rails (0.3.3) - jquery-rails (2.1.3) - railties (>= 3.1.0, < 5.0) - thor (~> 0.14) + jquery-rails (3.1.0) + railties (>= 3.0, < 5.0) + thor (>= 0.14, < 2.0) jquery-turbolinks (2.0.1) railties (>= 3.1.0) turbolinks - jquery-ui-rails (2.0.2) - jquery-rails - railties (>= 3.1.0) + jquery-ui-rails (4.2.1) + railties (>= 3.2.16) json (1.8.1) jwt (0.1.8) multi_json (>= 1.5) @@ -281,7 +279,7 @@ GEM mime-types (1.25.1) mini_portile (0.5.3) minitest (4.7.5) - multi_json (1.9.2) + multi_json (1.9.3) multi_xml (0.5.5) multipart-post (1.2.0) mysql2 (0.3.11) @@ -376,7 +374,7 @@ GEM rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) raindrops (0.12.0) - rake (10.1.1) + rake (10.3.1) raphael-rails (2.1.2) rb-fsevent (0.9.3) rb-inotify (0.9.2) @@ -503,9 +501,8 @@ GEM daemons (>= 1.0.9) eventmachine (>= 1.0.0) rack (>= 1.0.0) - thor (0.18.1) - thread_safe (0.3.1) - atomic (>= 1.1.7, < 2) + thor (0.19.1) + thread_safe (0.3.3) tilt (1.4.1) timers (1.1.0) tinder (1.9.3) @@ -608,9 +605,9 @@ DEPENDENCIES httparty jasmine (= 2.0.0.rc5) jquery-atwho-rails (~> 0.3.3) - jquery-rails (= 2.1.3) + jquery-rails jquery-turbolinks - jquery-ui-rails (= 2.0.2) + jquery-ui-rails kaminari (~> 0.15.1) launchy letter_opener diff --git a/app/assets/images/ui-icons_222222_256x240.png b/app/assets/images/ui-icons_222222_256x240.png deleted file mode 100644 index 8bc06cbf03b830a60f29857361df57214e172dfe..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4193 zcmd^?`9IX#AIInOnHgs6B3Z^R`x3H*7_#MNDMa=ydxNe*n#Jx?MyZsNLATX1c3DSs zaqSV=8WXZJ_AE2L?)`rMi|_Ms9_O4N&+B#GkN4}GKkRHQIN5~RAP@-WMN88w5D0L* zh0qbuN;!n1{k?=w z^l(TR2$)z}iMhz0xuTqOHYKh#xU;Wa*A&(G@$QGJKkvUQu8?Qs$*i%lfW$(d$N8n9 z)Le5z4DLZ-;1^2<1j6<8qN%Y%^w^3!yYF~4FH1*i@ch$F6V(=Hk+7Qbdjc<)XbiV^Cemh2BQGs)0QiCs7Rw+I&Pl9!2O z<_S$wl-Ls<|2UE{a%x+0w$9;)3ZyzMj-5QcWW=h4#KdU>4@XiSZR!W|Qn+i>yjGN1 z{V4C7U6arsdq@ajoW_3nN-r6x%h;X1t zQO4rdY+B8N+zEUV2`$s4mP|){)P3mZjC*MuC{-y1^jjo>CakM#k7f#Y-P!;&Is%lj z;YT!bVtqGjhcn+qRroJ^arlYO}e1xNi!TdMEnk?K&av0+gMFD4OIfDFE|ZJ;!Ms?KA6|8^~hIw&C+ zmXJzc(la2lJBC;3L?c1(+%p|{Q?4NgVoY`O~l851+ z)(wg-0}iV6nIU11-0wnQetO6qqbE`b4=OM9CR}PE1#MpN%=s+;Xw@y{+u6pTR7mTj zzkrWKM;S0mtU`r7lsNL>Jb}j^0uS7+1@TAVQcte@3DqxZDx37h> z4S#$_hC5MW*+&#v5P$X2R84CA=Mw}>b08s71F}^WEH0sN&NJgR@OF#SSO zh>Z$I7K%TbzAKVSIRM=DIP^SKhM(e2QZnFFnyVa%QwIyPOik?TU0Cw^7;;;Me+u)KCe}ckbig zD7wScHq3VQJv?&#NxobH2mHd>rY=$$gaS(zKS#*TDF$~pZn%|f$qfkgLz;r1XD9eV z^-%pwKW?W(2$r`hHJ(WiLzS{<_c_0HSnzIp;-@E54>ZqE;-W6D%n2MNIoRwrmM2P*IejpE6t*7QfL?cLTP}+l-{OEE} zpX7+-`tTmz>%oZf{#eI%G&nT)IN81+%*j{PRnwLA!$$RR;R$nTd5dmqD1OV|*8NI5 z=0}~+saKAUkF~rK?;(LypkG!G!~lc6S%z2U-GTyDC_2>17rigSVTIGvs53ytsPZ8! z84}KB19BnaNRAdF{E{d5zBpu_z!lIcAo38#ms1|w0720*`0f>PoDV|xrTAe64}ELF zJ|w2W(_cgva5?Hz2Zmmu7r3>}gscu)>^V!}sGzU;x*9QrhU%jX2p0FqC&VVe=4}q8 zBA^!8omdB742VK|;4v2o!$+M9b2w0DoK$TYBXb!6-Q1g?vQi%Spcjb9x6OLsq74sk z_-mq}euxfACwHo>rbi#av$M(nh@cjZ^U=T-;I0~iMHUWR!6f#Vd3g!ym%G4?!U8*^ zOMGvy8v%2iS4I4go8@k31tf585svr7lbfV%D5<=VHc;052m(wlG!?a6!kpc>hQ>Ka zvl2P#h$@82&hlmRxbjBaLKWmW!I_UTYc1}KOeehXAnpP5Yu((=zYB&gYUZDNI>9mN zrG#48di`r-hs6fngRZi+P|F+c2*b1etSfrlK1uqE)%B~9xVJ51_@ps^?QA` z14R}(98GUi-ks8&CipIQTD>IGm%VOWOEn_zJG4Yto4Lw`W(il9F=H@-f+1=f1;Q@?6g&%E?k zOG?^(i_^PUpvtSkB*}d(MyUYj#gStF*;v{Dqp3~A!iw$yen1LcCz{I{|EN6OmE!ax zWIZbDie7*~c(3x*i))leZDQ}?XLB7+QOlRGgO=3DlSK(JD1E{zv_E)H9#HFR(zO$> zVJg{*@?{$5-U^;AopRmYV|7tC9*b6)yJS9l>%dW$&eLxmC3Hh-2nRMA++$OhTbGiS z2;k6U)Su*i1d++ZG9nMR@~Fi#(xi(6PYwQz>cfCaLh0Gr=EK$0S^Zp?b0JC3LcsY; zZ`Op`)swh5BzaimX<}CJ>T;y_wKI$rh@o`Ium`rZuDNr!R1b7G=mXnb(`<@t9-aTu znswOCJrxutTmK!x_wbDy-jE~B|8llMNdWAn!>0gaj@b*5+wa8y!}Yj-<7X9s+gu89 z;_5Y%k!Zf~C|dZ_+|mSdOGx=^-)XTNHTqE7oE^W>A%vR0i25;o>J5G4^b6Hgxg7SF zn7~cW+-@EI?semRV)_qGZ_>yTb0zL-?g!HWS$UQx6C!yceM_FgN7^Ox<#uvUU0OK* zun}FdTW~8GwfLCvk?nT(jF-JvywZxG8jUmbK4c|0U%GO2TSp6WfihlW(tr(Fv`4&s z9qpgOhkkMooqNxOT})%(m7>OU$ef;d0wTJ2Zjlbp&bcKHJlNjaakz@Cv{ng;=}b7a z82h|)B>7^LEO6WYr{`2pkE5$E<W@OB0=OFI{Qk zjcmqb&*?!Uxxp;z@L(UEYp-f1S{KO|Uc@vQ_Pnufc7E^pQYZx@Bc((SwW$JqnuvS- z`VL}BfbOf}d4+L5ezyFt7h)KMea+U)Od=0@?9h#N30nr|{w++L>^#px&~MQ(Q~&NG z*Rf9!cfwNs?4&r#pxo#8dwXbI7i!TQ^L(O(m{RNSmHXJe*~N6B)EaL2jn6&+JAxx& zTnw&y%V&5fB?Z&fIU^ETW`(_;43IxXGUklyl;scdl{Z=-JiXYq3Z9xj~>WRP!kf%A9rytZ954 zP?2*qn#n>!^$f!d1wq4KD9LQ`%R*K~?^v7Sy3P#x?kh(#>$M=*o&bYtWaFy-w1}cF z|AVCGE==8h%YXnVH=5%Mbe?Db{72p5R+#NQt$pGjD^AhdWsQ+hIo4%3@vlUpU&`qD z6LwX*^&5P4WwPAik7?y;-Lm5_zc#p)%|j1xzT= zdON-fILqBLq&Fc5Vj2XzT&pZcJ+OeP?rY56ZDMKr`@`0c=)@{-=|mCK9k zq6naNLYA`qs#N6@88-Eq@`9kpD0}b62np>W5|O~PS91Fsbzbj4kfoAPg%JD(Ca*x< z6p~_Bpe$nW<-6_YiD2v+tIR(v>v)ys75>dsni{FNr>l4>cI%}Z1Ep~2l0PT(_hRle zkT$GCTQizhT0=dd8<`Q%AF{NReA9uY>l=G3Gn1MGB}rUy+ezHmopVmSD%hrBc?~_G zccqv;?HB#q%PuU6#I1nJ!qpp1E;@McRl9TW#xZ991vDf0Y>Z5O%}U&(I~SD17l<)O zFIAmfXLy&%aCtYHe#t@7X}fKGuqmYfS+s4;+?kSgih|2#LHq#tGbx2&Tf(Odl&F@3 z*HB+cE0PxRb-clQ9+P>ye_H;-Hw*e4)JMb9^sCcqY@_w8;IB3L_A7op0BzG^;{VfsW5t&RCAc1a5UA} zMDW@x>KvQ8*|MZY-{fiu6?8@QWcLm?mz1tAhlk?pC&s9k9@PK6zWnS!Cv!iQiaW6G z-ygD-Dg6zy*DAR*9NVL)EJ1E2^Run>AyS7~n+?C8Rug8_SWx&I6MBsaOHtxU1tU?; zmL1^MxVb=o0wJ2OKa9HQ`=d-2R0k8Rt!kCo)|vyiJc$tIT|%LKh<=Mmm>k?~C+dB# z%|p+;sPf8&*><@lZFF7~!h7C3bkMu96xH6J(fvBZ!Sh^3zWb=P`$E&re_nXUD5D^? znlZabQdmfOSDpmGBTHgtBJ?g1AnRnr+oSWYXn$CoMEbiMLZ;<}Ayxw!a0ko(uerze zYR|N;!wNn~NUk;aJC+}DR}Su4b=*fz?H))jG;^{~?HkH7-ob~u#+QgGkdY&i{)68c zMx%xjVaD6pPnb8ulu4sUw8iFkaD!-ujwsw~*Va+uA;BZmYBM*JJpIe4^XKoV UcyDyT@z)u0(agrQ#KbH9Kk7P;@&Et; diff --git a/app/assets/images/ui-icons_454545_256x240.png b/app/assets/images/ui-icons_454545_256x240.png deleted file mode 100644 index cfd1eaffaae0f5fe30d8e86d2e54b990d2a1ccd0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4193 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 V;=R!U$6sg2MKc@I5)-fZ{{Rh(twaC- From d10b34a685509eebbe52391ffce861cde45cc0ca Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Fri, 2 May 2014 16:05:08 +0300 Subject: [PATCH 080/135] Save repository size to projects table Signed-off-by: Dmitriy Zaporozhets --- app/helpers/projects_helper.rb | 2 +- app/models/project.rb | 4 ++++ app/services/git_push_service.rb | 1 + .../20140502115131_add_repo_size_to_db.rb | 5 +++++ .../20140502125220_migrate_repo_size.rb | 21 +++++++++++++++++++ db/schema.rb | 3 ++- 6 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20140502115131_add_repo_size_to_db.rb create mode 100644 db/migrate/20140502125220_migrate_repo_size.rb diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index 9bb3efc41d..ef0460f872 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -163,7 +163,7 @@ module ProjectsHelper end def repository_size(project = nil) - "#{(project || @project).repository.size} MB" + "#{(project || @project).repository_size} MB" rescue # In order to prevent 500 error # when application cannot allocate memory diff --git a/app/models/project.rb b/app/models/project.rb index 3ae47c1813..45aeaceef8 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -562,4 +562,8 @@ class Project < ActiveRecord::Base def forked_from?(project) forked? && project == forked_from_project end + + def update_repository_size + update_attribute(:repository_size, repository.size) + end end diff --git a/app/services/git_push_service.rb b/app/services/git_push_service.rb index 351b446457..715b569075 100644 --- a/app/services/git_push_service.rb +++ b/app/services/git_push_service.rb @@ -25,6 +25,7 @@ class GitPushService project.ensure_satellite_exists project.repository.expire_cache + project.update_repository_size if push_to_existing_branch?(ref, oldrev) project.update_merge_requests(oldrev, newrev, ref, @user) diff --git a/db/migrate/20140502115131_add_repo_size_to_db.rb b/db/migrate/20140502115131_add_repo_size_to_db.rb new file mode 100644 index 0000000000..7361d1a944 --- /dev/null +++ b/db/migrate/20140502115131_add_repo_size_to_db.rb @@ -0,0 +1,5 @@ +class AddRepoSizeToDb < ActiveRecord::Migration + def change + add_column :projects, :repository_size, :float, default: 0 + end +end diff --git a/db/migrate/20140502125220_migrate_repo_size.rb b/db/migrate/20140502125220_migrate_repo_size.rb new file mode 100644 index 0000000000..eed6d36681 --- /dev/null +++ b/db/migrate/20140502125220_migrate_repo_size.rb @@ -0,0 +1,21 @@ +class MigrateRepoSize < ActiveRecord::Migration + def up + Project.reset_column_information + Project.find_each(batch_size: 500) do |project| + begin + if project.empty_repo? + print '-' + else + project.update_repository_size + print '.' + end + rescue + print 'F' + end + end + puts 'Done' + end + + def down + end +end diff --git a/db/schema.rb b/db/schema.rb index a26c60874a..93837337af 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20140428105831) do +ActiveRecord::Schema.define(version: 20140502125220) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -222,6 +222,7 @@ ActiveRecord::Schema.define(version: 20140428105831) do t.integer "visibility_level", default: 0, null: false t.boolean "archived", default: false, null: false t.string "import_status" + t.float "repository_size", default: 0.0 end add_index "projects", ["creator_id"], name: "index_projects_on_creator_id", using: :btree From c608a5dceab0a5fa2df8286d5808091f2517d4ab Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Fri, 2 May 2014 17:02:57 +0300 Subject: [PATCH 081/135] Add sort dropdown for admin projects page Signed-off-by: Dmitriy Zaporozhets --- app/controllers/admin/projects_controller.rb | 1 + app/models/project.rb | 1 + app/views/admin/projects/index.html.haml | 23 ++++++++++++++++++++ 3 files changed, 25 insertions(+) diff --git a/app/controllers/admin/projects_controller.rb b/app/controllers/admin/projects_controller.rb index 13a7bdcf34..92ef596337 100644 --- a/app/controllers/admin/projects_controller.rb +++ b/app/controllers/admin/projects_controller.rb @@ -12,6 +12,7 @@ class Admin::ProjectsController < Admin::ApplicationController @projects = @projects.with_push if params[:with_push].present? @projects = @projects.abandoned if params[:abandoned].present? @projects = @projects.search(params[:name]) if params[:name].present? + @projects = @projects.sort(@sort = params[:sort]) @projects = @projects.includes(:namespace).order("namespaces.path, projects.name ASC").page(params[:page]).per(20) end diff --git a/app/models/project.rb b/app/models/project.rb index 45aeaceef8..7ddcc73cf2 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -203,6 +203,7 @@ class Project < ActiveRecord::Base when 'oldest' then reorder('projects.created_at ASC') when 'recently_updated' then reorder('projects.updated_at DESC') when 'last_updated' then reorder('projects.updated_at ASC') + when 'largest_repository' then reorder('projects.repository_size DESC') else reorder("namespaces.path, projects.name ASC") end end diff --git a/app/views/admin/projects/index.html.haml b/app/views/admin/projects/index.html.haml index 296094ab29..51ad702154 100644 --- a/app/views/admin/projects/index.html.haml +++ b/app/views/admin/projects/index.html.haml @@ -32,6 +32,7 @@ = visibility_level_icon(level) = label .form-actions + = hidden_field_tag :sort, params[:sort] = submit_tag "Search", class: "btn submit btn-primary" = link_to "Reset", admin_projects_path, class: "btn" @@ -40,6 +41,28 @@ .title Projects (#{@projects.total_count}) .pull-right + .dropdown.inline + %a.dropdown-toggle.btn{href: '#', "data-toggle" => "dropdown"} + %span.light sort: + - if @sort.present? + = @sort.humanize + - else + Name + %b.caret + %ul.dropdown-menu + %li + = link_to admin_projects_path(sort: nil) do + Name + = link_to admin_projects_path(sort: 'newest') do + Newest + = link_to admin_projects_path(sort: 'oldest') do + Oldest + = link_to admin_projects_path(sort: 'recently_updated') do + Recently updated + = link_to admin_projects_path(sort: 'last_updated') do + Last updated + = link_to admin_projects_path(sort: 'largest_repository') do + Largest repository = link_to 'New Project', new_project_path, class: "btn btn-new" %ul.well-list - @projects.each do |project| From 993fc8485518e53b7b868b47a622455b01d741a1 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Fri, 2 May 2014 22:00:23 +0300 Subject: [PATCH 082/135] Use sign icon style for help link Signed-off-by: Dmitriy Zaporozhets --- app/views/layouts/_head_panel.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/_head_panel.html.haml b/app/views/layouts/_head_panel.html.haml index f1545c6d08..bf37e70820 100644 --- a/app/views/layouts/_head_panel.html.haml +++ b/app/views/layouts/_head_panel.html.haml @@ -22,7 +22,7 @@ %li = link_to help_path, title: 'Help', class: 'has_bottom_tooltip', 'data-original-title' => 'Help' do - %i.icon-question + %i.icon-question-sign %li = link_to public_root_path, title: "Public area", class: 'has_bottom_tooltip', 'data-original-title' => 'Public area' do %i.icon-globe From d210484205c51e12e63ea0ad20cd10b7ef3f7057 Mon Sep 17 00:00:00 2001 From: Drew Blessing Date: Fri, 2 May 2014 17:14:58 -0500 Subject: [PATCH 083/135] Fix mobile menu after adding help link --- app/views/layouts/_head_panel.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/_head_panel.html.haml b/app/views/layouts/_head_panel.html.haml index bf37e70820..fba56b5dc3 100644 --- a/app/views/layouts/_head_panel.html.haml +++ b/app/views/layouts/_head_panel.html.haml @@ -43,6 +43,6 @@ %li = link_to destroy_user_session_path, class: "logout", method: :delete, title: "Logout", class: 'has_bottom_tooltip', 'data-original-title' => 'Logout' do %i.icon-signout - %li + %li.hidden-xs = link_to current_user, class: "profile-pic", id: 'profile-pic' do = image_tag avatar_icon(current_user.email, 26), alt: 'User activity' From cac61501fd5d21eb7e4d8e494c3ea9d7d4e35005 Mon Sep 17 00:00:00 2001 From: dosire Date: Sat, 3 May 2014 11:03:34 +0200 Subject: [PATCH 084/135] Add command line client information and fix link to ee. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3f3453a267..cb755a411e 100644 --- a/README.md +++ b/README.md @@ -29,11 +29,11 @@ * [GitLab.com](https://www.gitlab.com/) includes information about [subscriptions](https://www.gitlab.com/subscription/), [consultancy](https://www.gitlab.com/consultancy/), the [community](https://www.gitlab.com/community/) and the [hosted GitLab Cloud](https://www.gitlab.com/cloud/). -* [GitLab Enterprise Edition](https://www.gitlab.com/gitlab-ce/) offers additional features that are useful for larger organizations (100+ users). +* [GitLab Enterprise Edition](https://www.gitlab.com/gitlab-ee/) offers additional features aimed at larger organizations. * [GitLab CI](https://www.gitlab.com/gitlab-ci/) is a continuous integration (CI) server that is easy to integrate with GitLab. -* Unofficial third-party [iPhone app](http://gitlabcontrol.com/) and [Android app](https://play.google.com/store/apps/details?id=com.bd.gitlab&hl=en) for GitLab +* Unofficial third-party [iPhone app](http://gitlabcontrol.com/)m [Android app](https://play.google.com/store/apps/details?id=com.bd.gitlab&hl=en) and [command line client](https://github.com/drewblessing/gitlab-cli) for GitLab. ### Requirements From 73801a746362e4c284f323e415c1853eed77ba56 Mon Sep 17 00:00:00 2001 From: Marc Radulescu Date: Mon, 5 May 2014 10:04:52 +0200 Subject: [PATCH 085/135] added database requirements in documentation --- doc/install/requirements.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/install/requirements.md b/doc/install/requirements.md index 62e21dc72b..0fe015b2d3 100644 --- a/doc/install/requirements.md +++ b/doc/install/requirements.md @@ -74,6 +74,9 @@ Apart from a local hard drive you can also mount a volume that supports the netw If you have enough RAM memory and a recent CPU the speed of GitLab is mainly limited by hard drive seek times. Having a fast drive (7200 RPM and up) or a solid state drive (SSD) will improve the responsiveness of GitLab. +## Database + +If you want to run the database separately, the **recommended** database size is **1 MB per user** # Supported webbrowsers From 4146e885dde2338b25c1a176ede2f5a2d0946f96 Mon Sep 17 00:00:00 2001 From: Marin Jankovski Date: Mon, 5 May 2014 11:55:49 +0200 Subject: [PATCH 086/135] Fix styling issues. --- app/controllers/projects/wikis_controller.rb | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/app/controllers/projects/wikis_controller.rb b/app/controllers/projects/wikis_controller.rb index 0eb9364eaa..496064c9a6 100644 --- a/app/controllers/projects/wikis_controller.rb +++ b/app/controllers/projects/wikis_controller.rb @@ -12,19 +12,21 @@ class Projects::WikisController < Projects::ApplicationController def show @page = @project_wiki.find_page(params[:id], params[:version_id]) + gollum_wiki = @project_wiki.wiki + file = gollum_wiki.file(params[:id], gollum_wiki.ref, true) if @page render 'show' - elsif file = @project_wiki.wiki.file(params[:id], @project_wiki.wiki.ref, true) + elsif file if file.on_disk? - send_file file.on_disk_path, :disposition => 'inline' + send_file file.on_disk_path, disposition: 'inline' else - send_data( - file.raw_data, - type: file.mime_type, - disposition: 'inline', - filename: file.name - ) + send_data( + file.raw_data, + type: file.mime_type, + disposition: 'inline', + filename: file.name + ) end else return render('empty') unless can?(current_user, :write_wiki, @project) From ad0f5fdc2729ac26268c2638c064abbf14134688 Mon Sep 17 00:00:00 2001 From: Drew Blessing Date: Thu, 27 Mar 2014 17:05:15 -0500 Subject: [PATCH 087/135] Improve mobile UI for issues and merge requests --- CHANGELOG | 1 + app/assets/stylesheets/generic/issue_box.scss | 19 ++++++++- app/assets/stylesheets/sections/issues.scss | 33 +++++++++++++++ app/assets/stylesheets/sections/votes.scss | 6 +++ .../projects/issues/_issue_context.html.haml | 40 ++++++++++--------- app/views/projects/issues/show.html.haml | 31 +++++++------- .../merge_requests/show/_context.html.haml | 40 ++++++++++--------- .../merge_requests/show/_mr_box.html.haml | 6 +-- .../merge_requests/show/_mr_title.html.haml | 2 +- 9 files changed, 119 insertions(+), 59 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 1e9aeefd19..d3561d2efc 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -8,6 +8,7 @@ v 6.9.0 - Fix syntax highlighting for code comments blocks - Improve comments loading logic - Stop refreshing comments when the tab is hidden + - Improve issue and merge request mobile UI (Drew Blessing) v 6.8.0 - Ability to at mention users that are participating in issue and merge req. discussion diff --git a/app/assets/stylesheets/generic/issue_box.scss b/app/assets/stylesheets/generic/issue_box.scss index 3db4d908d9..ccdcc65794 100644 --- a/app/assets/stylesheets/generic/issue_box.scss +++ b/app/assets/stylesheets/generic/issue_box.scss @@ -70,7 +70,6 @@ } .state { - height: 34px; border-bottom: 1px solid #DDD; line-height: 32px; } @@ -89,6 +88,18 @@ border: none; border-top: 1px solid #eee; padding: 15px 25px; + + // Reset text align for children + .text-right > * { text-align: left; } + + @media (max-width: $screen-xs-max) { + // Don't right align on mobile + .text-right { text-align: left; } + + .row .col-md-6 { + padding-top: 5px; + } + } } .description { @@ -106,7 +117,11 @@ padding: 1px 25px; text-align: center; text-shadow: none; - margin-right: 20px; display: inline-block; + line-height: 34px; + } + + .creator { + padding: 2px 15px; } } diff --git a/app/assets/stylesheets/sections/issues.scss b/app/assets/stylesheets/sections/issues.scss index d4f8c8108a..3c48361b2e 100644 --- a/app/assets/stylesheets/sections/issues.scss +++ b/app/assets/stylesheets/sections/issues.scss @@ -143,3 +143,36 @@ form.edit-issue { border-color: #E5E5E5; } } + +@media (max-width: $screen-xs-max) { + .issue-btn-group { + width: 100%; + margin-top: 5px; + + .btn-group { + width: 100%; + + ul { + width: 100%; + text-align: center; + } + } + + .btn { + width: 100%; + margin-top: -1px; + + &:first-child:not(:last-child) { + border-radius: 4px 4px 0 0; + } + + &:not(:first-child):not(:last-child) { + border-radius: 0; + } + + &:last-child:not(:first-child) { + border-radius: 0 0 4px 4px; + } + } + } +} diff --git a/app/assets/stylesheets/sections/votes.scss b/app/assets/stylesheets/sections/votes.scss index 13f811e01a..d683e33e1f 100644 --- a/app/assets/stylesheets/sections/votes.scss +++ b/app/assets/stylesheets/sections/votes.scss @@ -40,4 +40,10 @@ .votes-holder { float: right; width: 250px; + + @media (max-width: $screen-xs-max) { + width: 100%; + margin-top: 5px; + margin-bottom: 10px; + } } diff --git a/app/views/projects/issues/_issue_context.html.haml b/app/views/projects/issues/_issue_context.html.haml index aae101cf40..425dcb45dd 100644 --- a/app/views/projects/issues/_issue_context.html.haml +++ b/app/views/projects/issues/_issue_context.html.haml @@ -1,22 +1,24 @@ = form_for [@project, @issue], remote: true, html: {class: 'edit-issue inline-update'} do |f| - %strong.append-right-10 - Assignee: + .row + .col-md-6 + %strong.append-right-10 + Assignee: - - if can?(current_user, :modify_issue, @issue) - = project_users_select_tag('issue[assignee_id]', placeholder: 'Select assignee', class: 'custom-form-control', selected: @issue.assignee_id) - - elsif issue.assignee - = link_to_member(@project, @issue.assignee) - - else - None + - if can?(current_user, :modify_issue, @issue) + = project_users_select_tag('issue[assignee_id]', placeholder: 'Select assignee', class: 'custom-form-control', selected: @issue.assignee_id) + - elsif issue.assignee + = link_to_member(@project, @issue.assignee) + - else + None - .pull-right - %strong.append-right-10 - Milestone: - - if can?(current_user, :modify_issue, @issue) - = f.select(:milestone_id, milestone_options(@issue), { include_blank: "Select milestone (none):" }, {class: 'select2 select2-compact'}) - = hidden_field_tag :issue_context - = f.submit class: 'btn' - - elsif issue.milestone - = link_to issue.milestone.title, project_milestone_path - - else - None + .col-md-6.text-right + %strong.append-right-10 + Milestone: + - if can?(current_user, :modify_issue, @issue) + = f.select(:milestone_id, milestone_options(@issue), { include_blank: "Select milestone" }, {class: 'select2 select2-compact'}) + = hidden_field_tag :issue_context + = f.submit class: 'btn' + - elsif issue.milestone + = link_to issue.milestone.title, project_milestone_path + - else + None diff --git a/app/views/projects/issues/show.html.haml b/app/views/projects/issues/show.html.haml index 124eb53571..b6d3a8edf4 100644 --- a/app/views/projects/issues/show.html.haml +++ b/app/views/projects/issues/show.html.haml @@ -1,7 +1,7 @@ %h3.page-title Issue ##{@issue.iid} - %span.pull-right + %span.pull-right.issue-btn-group - if can?(current_user, :write_issue, @project) = link_to new_project_issue_path(@project), class: "btn btn-grouped", title: "New Issue", id: "new_issue_link" do %i.icon-plus @@ -16,28 +16,29 @@ %i.icon-edit Edit -.votes-holder - #votes= render 'votes/votes_block', votable: @issue +.clearfix + .votes-holder + #votes= render 'votes/votes_block', votable: @issue -.back-link - = link_to project_issues_path(@project) do - ← To issues list - %span.milestone-nav-link - - if @issue.milestone - | - %span.light Milestone - = link_to project_milestone_path(@project, @issue.milestone) do - = @issue.milestone.title + .back-link + = link_to project_issues_path(@project) do + ← To issues list + %span.milestone-nav-link + - if @issue.milestone + | + %span.light Milestone + = link_to project_milestone_path(@project, @issue.milestone) do + = @issue.milestone.title .issue-box{ class: issue_box_class(@issue) } - .state - %span.state-label + .state.clearfix + .state-label.col-sm-2.col-xs-12 - if @issue.closed? Closed - else Open - %span.creator + %span.creator.col-sm-9.col-xs-12 Created by #{link_to_member(@project, @issue.author)} #{time_ago_with_tooltip(@issue.created_at)} %h4.title diff --git a/app/views/projects/merge_requests/show/_context.html.haml b/app/views/projects/merge_requests/show/_context.html.haml index 2bd850426a..5c6734fd24 100644 --- a/app/views/projects/merge_requests/show/_context.html.haml +++ b/app/views/projects/merge_requests/show/_context.html.haml @@ -1,22 +1,24 @@ = form_for [@project, @merge_request], remote: true, html: {class: 'edit-merge_request inline-update'} do |f| - %strong.append-right-10 - Assignee: + .row + .col-md-6 + %strong.append-right-10 + Assignee: - - if can?(current_user, :modify_merge_request, @merge_request) - = project_users_select_tag('merge_request[assignee_id]', placeholder: 'Select assignee', class: 'custom-form-control', selected: @merge_request.assignee_id) - - elsif merge_request.assignee - = link_to_member(@project, @merge_request.assignee) - - else - None + - if can?(current_user, :modify_merge_request, @merge_request) + = project_users_select_tag('merge_request[assignee_id]', placeholder: 'Select assignee', class: 'custom-form-control', selected: @merge_request.assignee_id) + - elsif merge_request.assignee + = link_to_member(@project, @merge_request.assignee) + - else + None - .pull-right - %strong.append-right-10 - Milestone: - - if can?(current_user, :modify_merge_request, @merge_request) - = f.select(:milestone_id, milestone_options(@merge_request), { include_blank: "Select milestone (none):" }, {class: 'select2 select2-compact'}) - = hidden_field_tag :merge_request_context - = f.submit class: 'btn' - - elsif merge_request.milestone - = link_to merge_request.milestone.title, project_milestone_path - - else - None + .col-md-6.text-right + %strong.append-right-10 + Milestone: + - if can?(current_user, :modify_merge_request, @merge_request) + = f.select(:milestone_id, milestone_options(@merge_request), { include_blank: "Select milestone" }, {class: 'select2 select2-compact'}) + = hidden_field_tag :merge_request_context + = f.submit class: 'btn' + - elsif merge_request.milestone + = link_to merge_request.milestone.title, project_milestone_path + - else + None diff --git a/app/views/projects/merge_requests/show/_mr_box.html.haml b/app/views/projects/merge_requests/show/_mr_box.html.haml index 8855982a2e..435e916c6d 100644 --- a/app/views/projects/merge_requests/show/_mr_box.html.haml +++ b/app/views/projects/merge_requests/show/_mr_box.html.haml @@ -1,6 +1,6 @@ .issue-box{ class: issue_box_class(@merge_request) } - .state - %span.state-label + .state.clearfix + %span.state-label.col-sm-2.col-xs-12 - if @merge_request.merged? Merged - elsif @merge_request.closed? @@ -8,7 +8,7 @@ - else Open - %span.creator + %span.creator.col-sm-9.col-xs-12 Created by #{link_to_member(@project, @merge_request.author)} #{time_ago_with_tooltip(@merge_request.created_at)} %h4.title diff --git a/app/views/projects/merge_requests/show/_mr_title.html.haml b/app/views/projects/merge_requests/show/_mr_title.html.haml index 7676fc137c..8f78e93df4 100644 --- a/app/views/projects/merge_requests/show/_mr_title.html.haml +++ b/app/views/projects/merge_requests/show/_mr_title.html.haml @@ -1,7 +1,7 @@ %h3.page-title = "Merge Request ##{@merge_request.iid}" - %span.pull-right + %span.pull-right.issue-btn-group - if can?(current_user, :modify_merge_request, @merge_request) - if @merge_request.open? .btn-group.pull-left From cac916d974cf12083002d01488dfd3ca8ac2a89a Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 5 May 2014 14:21:00 +0300 Subject: [PATCH 088/135] Clean working directory in satellite Signed-off-by: Dmitriy Zaporozhets --- lib/gitlab/satellite/satellite.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/gitlab/satellite/satellite.rb b/lib/gitlab/satellite/satellite.rb index c6e4d3351c..05123ad9c4 100644 --- a/lib/gitlab/satellite/satellite.rb +++ b/lib/gitlab/satellite/satellite.rb @@ -84,6 +84,7 @@ module Gitlab # Clear the working directory def clear_working_dir! repo.git.reset(hard: true) + repo.git.clean(f: true, d: true, x: true) end # Deletes all branches except the parking branch From 4f670fbe9c83bdf20e1a58d3166848ab6d453b6c Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 5 May 2014 14:30:50 +0300 Subject: [PATCH 089/135] Create seed projects with different visibility Signed-off-by: Dmitriy Zaporozhets --- db/fixtures/development/04_project.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/db/fixtures/development/04_project.rb b/db/fixtures/development/04_project.rb index 9303ab9330..164bb63780 100644 --- a/db/fixtures/development/04_project.rb +++ b/db/fixtures/development/04_project.rb @@ -40,7 +40,8 @@ Gitlab::Seeder.quiet do import_url: url, namespace_id: group.id, name: project_path.titleize, - description: Faker::Lorem.sentence + description: Faker::Lorem.sentence, + visibility_level: Gitlab::VisibilityLevel.values.sample } project = Projects::CreateService.new(User.first, params).execute From 5a949e609512cdabd7885712a37e04095d1f4600 Mon Sep 17 00:00:00 2001 From: Marin Jankovski Date: Mon, 5 May 2014 13:47:47 +0200 Subject: [PATCH 090/135] Add tests for wiki files showing. --- features/project/wiki.feature | 17 +++++++++++++++ features/steps/project/wiki.rb | 38 ++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) diff --git a/features/project/wiki.feature b/features/project/wiki.feature index 90eb2b79c6..41c51f2c42 100644 --- a/features/project/wiki.feature +++ b/features/project/wiki.feature @@ -45,3 +45,20 @@ Feature: Project Wiki And I browse to that Wiki page And I click on the "Pages" button Then I should see the existing page in the pages list + + Scenario: Image in wiki repo shown on the page + Given I have an existing Wiki page with images linked on page + And I browse to wiki page with images + Then Image should be shown on the page + + Scenario: File does not exist in wiki repo + Given I have an existing Wiki page with images linked on page + And I browse to wiki page with images + And I click on image link + Then I should see the new wiki page form + + Scenario: File exists in wiki repo + Given I have an existing Wiki page with images linked on page + And I browse to wiki page with images + And I click on existing image link + Then I should see the image from wiki repo diff --git a/features/steps/project/wiki.rb b/features/steps/project/wiki.rb index a819ee37d7..4195ce5b28 100644 --- a/features/steps/project/wiki.rb +++ b/features/steps/project/wiki.rb @@ -86,6 +86,44 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps page.should have_content @page.title end + Given 'I have an existing Wiki page with images linked on page' do + wiki.create_page("pictures", "Look at this [image](image.jpg)\n\n ![image](image.jpg)", :markdown, "first commit") + @wiki_page = wiki.find_page("pictures") + end + + And 'I browse to wiki page with images' do + visit project_wiki_path(project, @wiki_page) + end + + And 'I click on existing image link' do + Gollum::Wiki.any_instance.should_receive(:file).with("image.jpg", "master", true).and_return(Gollum::File.new(wiki.wiki)) + Gollum::File.any_instance.should_receive(:mime_type).and_return("image/jpeg") + page.should have_link('image', href: "image.jpg") + click_on "image" + end + + Then 'I should see the image from wiki repo' do + url = URI.parse(current_url) + url.path.should match("wikis/image.jpg") + page.should_not have_xpath('/html') # Page should render the image which means there is no html involved + end + + Then 'Image should be shown on the page' do + page.should have_xpath("//img[@src=\"image.jpg\"]") + end + + And 'I click on image link' do + page.should have_link('image', href: "image.jpg") + click_on "image" + end + + Then 'I should see the new wiki page form' do + url = URI.parse(current_url) + url.path.should match("wikis/image.jpg") + page.should have_content('New Wiki Page') + page.should have_content('Editing - image.jpg') + end + def wiki @project_wiki = ProjectWiki.new(project, current_user) end From fac225780cf5579a566977ee78e320ad3f40fd0e Mon Sep 17 00:00:00 2001 From: Marin Jankovski Date: Mon, 5 May 2014 14:01:48 +0200 Subject: [PATCH 091/135] A bit clearer naming for gollum_wiki. --- app/models/wiki_page.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/models/wiki_page.rb b/app/models/wiki_page.rb index 535bfb5b28..b8a0a9eb58 100644 --- a/app/models/wiki_page.rb +++ b/app/models/wiki_page.rb @@ -175,7 +175,8 @@ class WikiPage end def save(method, *args) - if valid? && wiki.send(method, *args) + project_wiki = wiki + if valid? && project_wiki.send(method, *args) page_details = if method == :update_page @page.path @@ -183,14 +184,15 @@ class WikiPage title end - page_title, page_dir = wiki.page_title_and_dir(page_details) - @page = wiki.wiki.paged(page_title, page_dir) + page_title, page_dir = project_wiki.page_title_and_dir(page_details) + gollum_wiki = project_wiki.wiki + @page = gollum_wiki.paged(page_title, page_dir) set_attributes @persisted = true else - errors.add(:base, wiki.error_message) if wiki.error_message + errors.add(:base, project_wiki.error_message) if project_wiki.error_message @persisted = false end @persisted From f5c4bda8fe53549f2ba63484359543f272954a61 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 5 May 2014 15:07:19 +0300 Subject: [PATCH 092/135] Improve MR seeds Signed-off-by: Dmitriy Zaporozhets --- db/fixtures/development/10_merge_requests.rb | 60 ++++++++------------ 1 file changed, 24 insertions(+), 36 deletions(-) diff --git a/db/fixtures/development/10_merge_requests.rb b/db/fixtures/development/10_merge_requests.rb index cb08a7c253..62fd0d84ea 100644 --- a/db/fixtures/development/10_merge_requests.rb +++ b/db/fixtures/development/10_merge_requests.rb @@ -1,45 +1,33 @@ Gitlab::Seeder.quiet do - (1..100).each do |i| - # Random Project - project = Project.all.sample + Project.all.reject(&:empty_repo?).each do |project| + branches = project.repository.branch_names - # Random user - user = project.team.users.sample + branches.each do |branch_name| + break if branches.size < 2 + source_branch = branches.pop + target_branch = branches.pop - next unless user + # Random user + user = project.team.users.sample + next unless user - next if project.empty_repo? + params = { + source_branch: source_branch, + target_branch: target_branch, + title: Faker::Lorem.sentence(6), + description: Faker::Lorem.sentences(3).join(" ") + } - branches = project.repository.branch_names.sample(2) + merge_request = MergeRequests::CreateService.new(project, user, params).execute - next if branches.uniq.size < 2 - - user_id = user.id - - Gitlab::Seeder.by_user(user) do - MergeRequest.seed(:id, [{ - id: i, - source_branch: branches.first, - target_branch: branches.last, - source_project_id: project.id, - target_project_id: project.id, - author_id: user_id, - assignee_id: user_id, - milestone: project.milestones.sample, - title: Faker::Lorem.sentence(6) - }]) + if merge_request.valid? + merge_request.assignee = user + merge_request.milestone = project.milestones.sample + merge_request.save + print '.' + else + print 'F' + end end - print('.') end end - -MergeRequest.all.map do |mr| - mr.set_iid - mr.save -end - -puts 'Load diffs for Merge Requests (it will take some time)...' -MergeRequest.all.each do |mr| - mr.reload_code - print '.' -end From de576be52e6a05b6db95d2559a53b71c249be5c4 Mon Sep 17 00:00:00 2001 From: maiki Date: Mon, 5 May 2014 15:47:56 -0700 Subject: [PATCH 093/135] Fixed misspelling Change one letter, change the world! --- doc/public_access/public_access.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/public_access/public_access.md b/doc/public_access/public_access.md index bf9d2784af..76d83e6f3b 100644 --- a/doc/public_access/public_access.md +++ b/doc/public_access/public_access.md @@ -4,7 +4,7 @@ Internal projects will only be available to authenticated users. #### Public projects Public projects can be cloned **without any** authentication. -It will also be listen on the [public access directory](/public). +It will also be listed on the [public access directory](/public). **Any logged in user** will have [Guest](/help/permissions) permissions on the repository. #### Internal projects From fd7a221cca9d5ac5338b265fb66b280e205b6330 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 6 May 2014 09:07:15 +0300 Subject: [PATCH 094/135] Change gitlab:test task Signed-off-by: Dmitriy Zaporozhets --- lib/tasks/gitlab/test.rake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/tasks/gitlab/test.rake b/lib/tasks/gitlab/test.rake index 2c9b997893..9516210e20 100644 --- a/lib/tasks/gitlab/test.rake +++ b/lib/tasks/gitlab/test.rake @@ -8,9 +8,9 @@ namespace :gitlab do ] cmds.each do |cmd| - system({'RAILS_ENV' => 'test', 'force' => 'yes'}, *cmd) + result = system({'RAILS_ENV' => 'test', 'force' => 'yes'}, *cmd) - raise "#{cmd} failed!" unless $?.exitstatus.zero? + raise "#{cmd} failed!" unless result end end end From b96ad52e10151fed49f63b107ce6871c8d25647e Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 6 May 2014 09:07:15 +0300 Subject: [PATCH 095/135] Change gitlab:test task Signed-off-by: Dmitriy Zaporozhets --- lib/tasks/gitlab/test.rake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/tasks/gitlab/test.rake b/lib/tasks/gitlab/test.rake index 2c9b997893..9516210e20 100644 --- a/lib/tasks/gitlab/test.rake +++ b/lib/tasks/gitlab/test.rake @@ -8,9 +8,9 @@ namespace :gitlab do ] cmds.each do |cmd| - system({'RAILS_ENV' => 'test', 'force' => 'yes'}, *cmd) + result = system({'RAILS_ENV' => 'test', 'force' => 'yes'}, *cmd) - raise "#{cmd} failed!" unless $?.exitstatus.zero? + raise "#{cmd} failed!" unless result end end end From 00cd3ecc44a6c6d29565c95cd5173c8e5de35537 Mon Sep 17 00:00:00 2001 From: Marin Jankovski Date: Tue, 6 May 2014 09:57:08 +0200 Subject: [PATCH 096/135] Use stub in testing. --- features/steps/project/wiki.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/features/steps/project/wiki.rb b/features/steps/project/wiki.rb index 4195ce5b28..3244a5a05a 100644 --- a/features/steps/project/wiki.rb +++ b/features/steps/project/wiki.rb @@ -96,8 +96,9 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps end And 'I click on existing image link' do - Gollum::Wiki.any_instance.should_receive(:file).with("image.jpg", "master", true).and_return(Gollum::File.new(wiki.wiki)) - Gollum::File.any_instance.should_receive(:mime_type).and_return("image/jpeg") + file = Gollum::File.new(wiki.wiki) + Gollum::Wiki.any_instance.stub(:file).with("image.jpg", "master", true).and_return(file) + Gollum::File.any_instance.stub(:mime_type).and_return("image/jpeg") page.should have_link('image', href: "image.jpg") click_on "image" end From b1d68b6e9bd837b3b685b76ceca1b6a44cf2dc17 Mon Sep 17 00:00:00 2001 From: Cyril Rohr Date: Tue, 1 Apr 2014 15:39:26 +0100 Subject: [PATCH 097/135] Add .pkgr.yml file for automated packaging on https://pkgr.io --- .pkgr.yml | 19 +++++++++++++++++++ bin/pkgr_before_precompile.sh | 16 ++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 .pkgr.yml create mode 100755 bin/pkgr_before_precompile.sh diff --git a/.pkgr.yml b/.pkgr.yml new file mode 100644 index 0000000000..09cb83783d --- /dev/null +++ b/.pkgr.yml @@ -0,0 +1,19 @@ +user: git +group: git +before_precompile: ./bin/pkgr_before_precompile.sh +targets: + debian-7: &wheezy + build_dependencies: + - libicu-dev + dependencies: + - libicu48 + - libpcre3 + - git + ubuntu-12.04: *wheezy + ubuntu-14.04: + build_dependencies: + - libicu-dev + dependencies: + - libicu52 + - libpcre3 + - git diff --git a/bin/pkgr_before_precompile.sh b/bin/pkgr_before_precompile.sh new file mode 100755 index 0000000000..126f9fda72 --- /dev/null +++ b/bin/pkgr_before_precompile.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +set -ex + +for file in config/*.yml.example; do + cp ${file} config/$(basename ${file} .example) +done + +# No need for config file. Will be taken care of by REDIS_URL env variable +rm config/resque.yml + +# Set default unicorn.rb file +echo "" > config/unicorn.rb + +# Required for assets precompilation +sudo service postgresql start From 402361afff4a4eb8c19ea7ab4f4c6ec5daf64221 Mon Sep 17 00:00:00 2001 From: Cyril Rohr Date: Tue, 15 Apr 2014 17:58:12 +0100 Subject: [PATCH 098/135] Setup default gitlab.yml with possibility to override default url via environment variable. This only applies to packaging with https://pkgr.io. --- bin/pkgr_before_precompile.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bin/pkgr_before_precompile.sh b/bin/pkgr_before_precompile.sh index 126f9fda72..283abb6a0c 100755 --- a/bin/pkgr_before_precompile.sh +++ b/bin/pkgr_before_precompile.sh @@ -1,11 +1,18 @@ #!/bin/sh -set -ex +set -e for file in config/*.yml.example; do cp ${file} config/$(basename ${file} .example) done +# Allow to override the Gitlab URL from an environment variable, as this will avoid having to change the configuration file for simple deployments. +config=$(echo '<% gitlab_url = URI(ENV["GITLAB_URL"] || "http://localhost:80") %>' | cat - config/gitlab.yml) +echo "$config" > config/gitlab.yml +sed -i "s/host: localhost/host: <%= gitlab_url.host %>/" config/gitlab.yml +sed -i "s/port: 80/port: <%= gitlab_url.port %>/" config/gitlab.yml +sed -i "s/https: false/https: <%= gitlab_url.scheme == 'https' %>/" config/gitlab.yml + # No need for config file. Will be taken care of by REDIS_URL env variable rm config/resque.yml From 536b2f2f75d384446e4d3d103903a6ff909bd4da Mon Sep 17 00:00:00 2001 From: Ahmed Shafeeq Date: Tue, 6 May 2014 22:02:21 +0800 Subject: [PATCH 099/135] Use production for Gitlab shell installation --- doc/install/installation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/install/installation.md b/doc/install/installation.md index 90d6f0e17e..a441d2b65a 100644 --- a/doc/install/installation.md +++ b/doc/install/installation.md @@ -260,7 +260,7 @@ GitLab Shell is an ssh access and repository management software developed speci cd /home/git/gitlab # Run the installation task for gitlab-shell (replace `REDIS_URL` if needed): - sudo -u git -H bundle exec rake gitlab:shell:install[v1.9.3] REDIS_URL=redis://localhost:6379 + sudo -u git -H bundle exec rake gitlab:shell:install[v1.9.3] REDIS_URL=redis://localhost:6379 RAILS_ENV=production # By default, the gitlab-shell config is generated from your main gitlab config. You can review (and modify) it as follows: sudo -u git -H editor /home/git/gitlab-shell/config.yml From 14102fd2112dba60795421726bbf6d59dac273da Mon Sep 17 00:00:00 2001 From: Ahmed Shafeeq Date: Wed, 7 May 2014 01:14:00 +0800 Subject: [PATCH 100/135] Remove extra "Compile assets" section --- doc/install/installation.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/doc/install/installation.md b/doc/install/installation.md index a441d2b65a..28758197f3 100644 --- a/doc/install/installation.md +++ b/doc/install/installation.md @@ -302,11 +302,6 @@ Check if GitLab and its environment are configured correctly: sudo /etc/init.d/gitlab restart -## Compile assets - - sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production - - # 6. Nginx **Note:** From fa7d0e3ae0bcc1f2aa4a46b0ca3b80e78d3c3c46 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 7 May 2014 12:21:02 +0300 Subject: [PATCH 101/135] Fix MR widget UI Signed-off-by: Dmitriy Zaporozhets --- .../merge_requests/show/_state_widget.html.haml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) 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 c9ecbceaf5..80fe540489 100644 --- a/app/views/projects/merge_requests/show/_state_widget.html.haml +++ b/app/views/projects/merge_requests/show/_state_widget.html.haml @@ -21,14 +21,6 @@ #{time_ago_with_tooltip(@merge_request.merge_event.created_at)} = render "projects/merge_requests/show/remove_source_branch" - - if !@closes_issues.empty? && @merge_request.open? - .alert.alert-info.alert-info - %span - %i.icon-ok - Accepting this merge request will close #{@closes_issues.size == 1 ? 'issue' : 'issues'} - = succeed '.' do - != gfm(@closes_issues.map { |i| "##{i.iid}" }.to_sentence) - - unless @commits.any? %h4 Nothing to merge %p @@ -38,3 +30,12 @@ %span.label-branch #{@merge_request.target_branch} %br Try to use different branches or push new code. + + - if !@closes_issues.empty? && @merge_request.open? + .panel-footer + %span + %i.icon-ok + Accepting this merge request will close #{@closes_issues.size == 1 ? 'issue' : 'issues'} + = succeed '.' do + != gfm(@closes_issues.map { |i| "##{i.iid}" }.to_sentence) + From 99e0d0dd6f9d1a6b66c5322f142e6dd008f62ebd Mon Sep 17 00:00:00 2001 From: Marin Jankovski Date: Wed, 7 May 2014 11:52:07 +0200 Subject: [PATCH 102/135] Unstub after the test is done. --- features/project/wiki.feature | 12 ++++++------ features/steps/project/wiki.rb | 2 ++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/features/project/wiki.feature b/features/project/wiki.feature index 41c51f2c42..4a8c771dda 100644 --- a/features/project/wiki.feature +++ b/features/project/wiki.feature @@ -46,6 +46,12 @@ Feature: Project Wiki And I click on the "Pages" button Then I should see the existing page in the pages list + Scenario: File exists in wiki repo + Given I have an existing Wiki page with images linked on page + And I browse to wiki page with images + And I click on existing image link + Then I should see the image from wiki repo + Scenario: Image in wiki repo shown on the page Given I have an existing Wiki page with images linked on page And I browse to wiki page with images @@ -56,9 +62,3 @@ Feature: Project Wiki And I browse to wiki page with images And I click on image link Then I should see the new wiki page form - - Scenario: File exists in wiki repo - Given I have an existing Wiki page with images linked on page - And I browse to wiki page with images - And I click on existing image link - Then I should see the image from wiki repo diff --git a/features/steps/project/wiki.rb b/features/steps/project/wiki.rb index 3244a5a05a..96f2505d24 100644 --- a/features/steps/project/wiki.rb +++ b/features/steps/project/wiki.rb @@ -107,6 +107,8 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps url = URI.parse(current_url) url.path.should match("wikis/image.jpg") page.should_not have_xpath('/html') # Page should render the image which means there is no html involved + Gollum::Wiki.any_instance.unstub(:file) + Gollum::File.any_instance.unstub(:mime_type) end Then 'Image should be shown on the page' do From c9104fa6e435a713dcdeb6de9db15079b4851aa7 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 7 May 2014 14:26:49 +0300 Subject: [PATCH 103/135] Fix search dropdown css. Improve jquery styles Signed-off-by: Dmitriy Zaporozhets --- app/assets/stylesheets/generic/jquery.scss | 39 ++++++++++++++++------ 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/app/assets/stylesheets/generic/jquery.scss b/app/assets/stylesheets/generic/jquery.scss index 4a9341e8f5..6b29accb31 100644 --- a/app/assets/stylesheets/generic/jquery.scss +++ b/app/assets/stylesheets/generic/jquery.scss @@ -8,7 +8,7 @@ width: 270px; .ui-datepicker-header { - background: #EEE; + background: #FFF; border-color: #DDD; } @@ -19,20 +19,37 @@ } &.ui-autocomplete { - @include border-radius(0px); border-color: #DDD; padding: 0; + margin-top: 2px; + z-index: 1001; .ui-menu-item a { - color: #777; - - &:hover { - background: $hover; - border-color: $primary_color; - @include border-radius(0px); - color: #333; - } + padding: 4px 10px; } } -} + .ui-state-default { + border: 1px solid #FFF; + background: #FFF; + color: #777; + } + + .ui-state-highlight { + border: 1px solid #EEE; + background: #EEE; + } + + .ui-state-active { + border: 1px solid $bg_style_color; + background: $bg_style_color; + color: #FFF; + } + + .ui-state-hover, + .ui-state-focus { + border: 1px solid $hover; + background: $hover; + color: #333; + } +} From 18529269c6adf102d2e521bd5241794ea2347b55 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 7 May 2014 14:43:07 +0300 Subject: [PATCH 104/135] truncate long branch names on MR index Signed-off-by: Dmitriy Zaporozhets --- .../projects/merge_requests/_merge_request.html.haml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/app/views/projects/merge_requests/_merge_request.html.haml b/app/views/projects/merge_requests/_merge_request.html.haml index 980ac12674..d1cab89a35 100644 --- a/app/views/projects/merge_requests/_merge_request.html.haml +++ b/app/views/projects/merge_requests/_merge_request.html.haml @@ -11,13 +11,9 @@ - if merge_request.for_fork? %span.light #{merge_request.source_project_namespace}: - = merge_request.source_branch - %i.icon-angle-right.light - = merge_request.target_branch - - else - = merge_request.source_branch - %i.icon-angle-right.light - = merge_request.target_branch + = truncate merge_request.source_branch, length: 25 + %i.icon-angle-right.light + = merge_request.target_branch .merge-request-info - if merge_request.author authored by #{link_to_member(merge_request.source_project, merge_request.author)} From 97eb2240b1e401bf75408b9cc6b1560bc52ab849 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 7 May 2014 14:52:43 +0300 Subject: [PATCH 105/135] Fix check-all issues checkbox position Signed-off-by: Dmitriy Zaporozhets --- app/assets/stylesheets/sections/issues.scss | 8 -------- 1 file changed, 8 deletions(-) diff --git a/app/assets/stylesheets/sections/issues.scss b/app/assets/stylesheets/sections/issues.scss index 3c48361b2e..02c9123178 100644 --- a/app/assets/stylesheets/sections/issues.scss +++ b/app/assets/stylesheets/sections/issues.scss @@ -45,14 +45,6 @@ padding: 6px 10px; border: 1px solid #ccc; @include border-radius(4px); - - - input.check_all_issues { - padding: 0; - margin: 0; - position: relative; - top: 3px; - } } .issues_content { From 4fea8afc4bc507bf94d93c1ef04a9575add900ab Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 7 May 2014 16:14:24 +0300 Subject: [PATCH 106/135] Add CompareAction class for collecting commits and diffs using satellites Signed-off-by: Dmitriy Zaporozhets --- app/models/merge_request_diff.rb | 16 +++++++- lib/gitlab/satellite/compare_action.rb | 53 ++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 2 deletions(-) create mode 100644 lib/gitlab/satellite/compare_action.rb diff --git a/app/models/merge_request_diff.rb b/app/models/merge_request_diff.rb index 0684461add..7dce71a677 100644 --- a/app/models/merge_request_diff.rb +++ b/app/models/merge_request_diff.rb @@ -86,7 +86,7 @@ class MergeRequestDiff < ActiveRecord::Base # between target and source branches def unmerged_commits commits = if merge_request.for_fork? - Gitlab::Satellite::MergeAction.new(merge_request.author, merge_request).commits_between + compare_action.commits else repository.commits_between(target_branch, source_branch) end @@ -150,7 +150,7 @@ class MergeRequestDiff < ActiveRecord::Base # between target and source branches def unmerged_diffs diffs = if merge_request.for_fork? - Gitlab::Satellite::MergeAction.new(merge_request.author, merge_request).diffs_between_satellite + compare_action.diffs else Gitlab::Git::Diff.between(repository, source_branch, target_branch) end @@ -165,4 +165,16 @@ class MergeRequestDiff < ActiveRecord::Base def repository merge_request.target_project.repository end + + private + + def compare_action + Gitlab::Satellite::CompareAction.new( + merge_request.author, + merge_request.target_project, + merge_request.target_branch, + merge_request.source_project, + merge_request.source_branch + ) + end end diff --git a/lib/gitlab/satellite/compare_action.rb b/lib/gitlab/satellite/compare_action.rb new file mode 100644 index 0000000000..c923bb9c0f --- /dev/null +++ b/lib/gitlab/satellite/compare_action.rb @@ -0,0 +1,53 @@ +module Gitlab + module Satellite + class CompareAction < Action + def initialize(user, target_project, target_branch, source_project, source_branch) + super user, target_project + + @target_project, @target_branch = target_project, target_branch + @source_project, @source_branch = source_project, source_branch + end + + # Only show what is new in the source branch compared to the target branch, not the other way around. + # The line below with merge_base is equivalent to diff with three dots (git diff branch1...branch2) + # From the git documentation: "git diff A...B" is equivalent to "git diff $(git-merge-base A B) B" + def diffs + in_locked_and_timed_satellite do |target_repo| + prepare_satellite!(target_repo) + update_satellite_source_and_target!(target_repo) + common_commit = target_repo.git.native(:merge_base, default_options, ["origin/#{@target_branch}", "source/#{@source_branch}"]).strip + #this method doesn't take default options + diffs = target_repo.diff(common_commit, "source/#{@source_branch}") + diffs = diffs.map { |diff| Gitlab::Git::Diff.new(diff) } + diffs + end + rescue Grit::Git::CommandFailed => ex + handle_exception(ex) + end + + # Retrieve an array of commits between the source and the target + def commits + in_locked_and_timed_satellite do |target_repo| + prepare_satellite!(target_repo) + update_satellite_source_and_target!(target_repo) + commits = target_repo.commits_between("origin/#{@target_branch}", "source/#{@source_branch}") + commits = commits.map { |commit| Gitlab::Git::Commit.new(commit, nil) } + commits + end + rescue Grit::Git::CommandFailed => ex + handle_exception(ex) + end + + private + + # Assumes a satellite exists that is a fresh clone of the projects repo, prepares satellite for diffs + def update_satellite_source_and_target!(target_repo) + target_repo.remote_add('source', @source_project.repository.path_to_repo) + target_repo.remote_fetch('source') + target_repo.git.checkout(default_options({b: true}), @target_branch, "origin/#{@target_branch}") + rescue Grit::Git::CommandFailed => ex + handle_exception(ex) + end + end + end +end From a8624cbe5927ceed786b5aa68fe9e917b1d8cbee Mon Sep 17 00:00:00 2001 From: skv-headless Date: Wed, 7 May 2014 17:50:56 +0400 Subject: [PATCH 107/135] submit notes forms by pressing ctrl+enter --- app/assets/javascripts/notes.js.coffee | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/assets/javascripts/notes.js.coffee b/app/assets/javascripts/notes.js.coffee index 8b15200563..47989010d1 100644 --- a/app/assets/javascripts/notes.js.coffee +++ b/app/assets/javascripts/notes.js.coffee @@ -53,6 +53,12 @@ class Notes # fetch notes when tab becomes visible $(document).on "visibilitychange", @visibilityChange + @notes_forms = '.js-main-target-form textarea, .js-discussion-note-form textarea' + $(document).on('keypress', @notes_forms, (e)-> + if event.keyCode == 10 || (event.ctrlKey && event.keyCode == 13) + $(@).parents('form').submit() + ) + cleanBinding: -> $(document).off "ajax:success", ".js-main-target-form" $(document).off "ajax:success", ".js-discussion-note-form" @@ -67,6 +73,7 @@ class Notes $(document).off "click", ".js-discussion-reply-button" $(document).off "click", ".js-add-diff-note-button" $(document).off "visibilitychange" + $(document).off "keypress", @notes_forms initRefresh: -> From 9e805b77544df5be602d0c218d7be1047eb6729f Mon Sep 17 00:00:00 2001 From: "C. Morgan Hamill" Date: Wed, 7 May 2014 16:33:54 -0400 Subject: [PATCH 108/135] Provide fallback for missing `name` value. If `auth.info.name` is `nil`, then use `auth.info.first_name + auth.info.last_name` as the value of `name`. --- lib/gitlab/oauth/user.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/gitlab/oauth/user.rb b/lib/gitlab/oauth/user.rb index 1bac93378e..c6f56c141e 100644 --- a/lib/gitlab/oauth/user.rb +++ b/lib/gitlab/oauth/user.rb @@ -65,7 +65,11 @@ module Gitlab end def name - auth.info.name.to_s.force_encoding("utf-8") + unless auth.info.name.nil? + auth.info.name.to_s.force_encoding("utf-8") + else + "#{auth.info.first_name} #{auth.info.last_name}".force_encoding("utf-8") + end end def username From a45f7262f9a3e26361b6fde4f77d0d27437535cf Mon Sep 17 00:00:00 2001 From: "C. Morgan Hamill" Date: Wed, 7 May 2014 16:41:35 -0400 Subject: [PATCH 109/135] Clean up of `name` fallback code. Don't use `unless` for the conditional. Avoid double-quotes where possible. --- lib/gitlab/oauth/user.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/gitlab/oauth/user.rb b/lib/gitlab/oauth/user.rb index c6f56c141e..e9e57aa574 100644 --- a/lib/gitlab/oauth/user.rb +++ b/lib/gitlab/oauth/user.rb @@ -65,10 +65,10 @@ module Gitlab end def name - unless auth.info.name.nil? - auth.info.name.to_s.force_encoding("utf-8") + if !auth.info.name.nil? + auth.info.name.to_s.force_encoding('utf-8') else - "#{auth.info.first_name} #{auth.info.last_name}".force_encoding("utf-8") + "#{auth.info.first_name} #{auth.info.last_name}".force_encoding('utf-8') end end From 5f74f0511fbf75b719528d55f7d1f5d7c52f21b8 Mon Sep 17 00:00:00 2001 From: Marin Jankovski Date: Thu, 8 May 2014 09:13:41 +0200 Subject: [PATCH 110/135] Update gitlab-grit to 2.6.6. --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 3564566326..f4513af7a8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -162,7 +162,7 @@ GEM multi_json gitlab-grack (2.0.0.pre) rack (~> 1.5.1) - gitlab-grit (2.6.5) + gitlab-grit (2.6.6) charlock_holmes (~> 0.6) diff-lcs (~> 1.1) mime-types (~> 1.15) From c01efa0ed5a9dadd2daf8cc63c5612864c771f23 Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Thu, 8 May 2014 12:10:04 +0200 Subject: [PATCH 111/135] Document how to convert a backup to PostgreSQL --- CHANGELOG | 1 + doc/update/mysql_to_postgresql.md | 47 +++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index d3561d2efc..cc271f5e2c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -9,6 +9,7 @@ v 6.9.0 - Improve comments loading logic - Stop refreshing comments when the tab is hidden - Improve issue and merge request mobile UI (Drew Blessing) + - Document how to convert a backup to PostgreSQL v 6.8.0 - Ability to at mention users that are participating in issue and merge req. discussion diff --git a/doc/update/mysql_to_postgresql.md b/doc/update/mysql_to_postgresql.md index 9a324545eb..cdef7d71e3 100644 --- a/doc/update/mysql_to_postgresql.md +++ b/doc/update/mysql_to_postgresql.md @@ -1,5 +1,9 @@ # Use the shell commands below to convert a MySQL GitLab database to a PostgreSQL one. +## Export from MySQL and import into Postgres + +Use this if you are keeping GitLab on the same server. + ``` git clone https://github.com/lanyrd/mysql-postgresql-converter.git cd mysql-postgresql-converter @@ -7,3 +11,46 @@ mysqldump --compatible=postgresql --default-character-set=utf8 -r databasename.m python db_converter.py databasename.mysql databasename.psql psql -f databasename.psql -d gitlabhq_production ``` + +## Converting a GitLab backup file from MySQL to Postgres + +GitLab backup files (_gitlab_backup.tar) contain a SQL dump. Using +the lanyrd database converter we can replace a MySQL database dump inside the +tar file with a Postgres database dump. This can be useful if you are moving to +another server. + +``` +# Stop GitLab +sudo service gitlab stop + +# Create the backup +cd /home/git/gitlab +sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production + +# Note the filename of the backup that was created. We will call it +# TIMESTAMP_gitlab_backup.tar below. + +# Move the backup file we will convert to its own directory +sudo -u git -H mkdir -p tmp/backups/postgresql +sudo -u git -H mv tmp/backups/TIMESTAMP_gitlab_backup.tar tmp/backups/postgresql/ + +# Create a separate database dump with PostgreSQL compatibility +cd tmp/backups/postgresql +sudo -u git -H mysqldump --compatible=postgresql --default-character-set=utf8 -r gitlabhq_production.mysql -u root gitlabhq_production + +# Clone the database converter +sudo -u git -H git clone https://github.com/lanyrd/mysql-postgresql-converter.git + +# Convert gitlabhq_production.mysql +sudo -u git -H mkdir db +sudo -u git -H python mysql-postgresql-converter/db_converter.py gitlabhq_production.mysql db/database.sql + +# Replace the MySQL dump in TIMESTAMP_gitlab_backup.tar. + +# Warning: if you forget to replace TIMESTAMP below, tar will create a new file +# 'TIMESTAMP_gitlab_backup.tar' without giving an error. + +sudo -u git -H tar rf TIMESTAMP_gitlab_backup.tar db/database.sql + +# Done! TIMESTAMP_gitlab_backup.tar can now be restored into a Postgres GitLab installation. +``` From da9b009d31ee342d96da7b8796b937849de650cd Mon Sep 17 00:00:00 2001 From: Sean Edge Date: Tue, 6 May 2014 17:28:21 -0400 Subject: [PATCH 112/135] Add fix for API when branch names have periods in them. Relates to issue #6128 (https://github.com/gitlabhq/gitlabhq/issues/6128). --- lib/api/branches.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/api/branches.rb b/lib/api/branches.rb index 953c6100f8..d54f9371fb 100644 --- a/lib/api/branches.rb +++ b/lib/api/branches.rb @@ -24,7 +24,7 @@ module API # branch (required) - The name of the branch # Example Request: # GET /projects/:id/repository/branches/:branch - get ":id/repository/branches/:branch" do + get ':id/repository/branches/:branch', requirements: { branch: /.*/ } do @branch = user_project.repo.heads.find { |item| item.name == params[:branch] } not_found!("Branch does not exist") if @branch.nil? present @branch, with: Entities::RepoObject, project: user_project @@ -37,7 +37,9 @@ module API # branch (required) - The name of the branch # Example Request: # PUT /projects/:id/repository/branches/:branch/protect - put ":id/repository/branches/:branch/protect" do + put ':id/repository/branches/:branch/protect', + requirements: { branch: /.*/ } do + authorize_admin_project @branch = user_project.repository.find_branch(params[:branch]) @@ -55,7 +57,9 @@ module API # branch (required) - The name of the branch # Example Request: # PUT /projects/:id/repository/branches/:branch/unprotect - put ":id/repository/branches/:branch/unprotect" do + put ':id/repository/branches/:branch/unprotect', + requirements: { branch: /.*/ } do + authorize_admin_project @branch = user_project.repository.find_branch(params[:branch]) From 92591b63dcba5115537cd1e6da714540590975b8 Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Thu, 8 May 2014 13:18:12 +0200 Subject: [PATCH 113/135] Add an introcudtion to mysql_to_postgresql.md --- doc/update/mysql_to_postgresql.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/update/mysql_to_postgresql.md b/doc/update/mysql_to_postgresql.md index cdef7d71e3..661dcc02ba 100644 --- a/doc/update/mysql_to_postgresql.md +++ b/doc/update/mysql_to_postgresql.md @@ -1,4 +1,10 @@ -# Use the shell commands below to convert a MySQL GitLab database to a PostgreSQL one. +# Migrating GitLab from MySQL to Postgres + +If you are replacing MySQL with Postgres while keeping GitLab on the same +server all you need to do is to export from MySQL and import into Postgres as +described below. If you are also moving GitLab to another server, or if you are +switching to omnibus-gitlab, you may want to use a GitLab backup file. The +second part of this documents explains the procedure to do this. ## Export from MySQL and import into Postgres From 3bfbea37e9a0cca64bf67e0a8a8ce3ceb9b9db55 Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Thu, 8 May 2014 13:18:22 +0200 Subject: [PATCH 114/135] Indicate when to stop/start GitLab --- doc/update/mysql_to_postgresql.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/update/mysql_to_postgresql.md b/doc/update/mysql_to_postgresql.md index 661dcc02ba..5b9209d7df 100644 --- a/doc/update/mysql_to_postgresql.md +++ b/doc/update/mysql_to_postgresql.md @@ -11,11 +11,17 @@ second part of this documents explains the procedure to do this. Use this if you are keeping GitLab on the same server. ``` +sudo service gitlab stop + +# Update /home/git/gitlab/config/database.yml + git clone https://github.com/lanyrd/mysql-postgresql-converter.git cd mysql-postgresql-converter mysqldump --compatible=postgresql --default-character-set=utf8 -r databasename.mysql -u root gitlabhq_production python db_converter.py databasename.mysql databasename.psql psql -f databasename.psql -d gitlabhq_production + +sudo service gitlab start ``` ## Converting a GitLab backup file from MySQL to Postgres From 5014a5b7d51f329311b80f8c0770b11616812120 Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Thu, 8 May 2014 13:59:31 +0200 Subject: [PATCH 115/135] Update rails to 4.0.5 --- Gemfile.lock | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 3564566326..20fcc3964a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,26 +2,26 @@ GEM remote: https://rubygems.org/ specs: ace-rails-ap (2.0.1) - actionmailer (4.0.3) - actionpack (= 4.0.3) + actionmailer (4.0.5) + actionpack (= 4.0.5) mail (~> 2.5.4) - actionpack (4.0.3) - activesupport (= 4.0.3) + actionpack (4.0.5) + activesupport (= 4.0.5) builder (~> 3.1.0) erubis (~> 2.7.0) rack (~> 1.5.2) rack-test (~> 0.6.2) - activemodel (4.0.3) - activesupport (= 4.0.3) + activemodel (4.0.5) + activesupport (= 4.0.5) builder (~> 3.1.0) - activerecord (4.0.3) - activemodel (= 4.0.3) + activerecord (4.0.5) + activemodel (= 4.0.5) activerecord-deprecated_finders (~> 1.0.2) - activesupport (= 4.0.3) + activesupport (= 4.0.5) arel (~> 4.0.0) activerecord-deprecated_finders (1.0.3) - activesupport (4.0.3) - i18n (~> 0.6, >= 0.6.4) + activesupport (4.0.5) + i18n (~> 0.6, >= 0.6.9) minitest (~> 4.2) multi_json (~> 1.3) thread_safe (~> 0.1) @@ -279,7 +279,7 @@ GEM mime-types (1.25.1) mini_portile (0.5.3) minitest (4.7.5) - multi_json (1.9.3) + multi_json (1.10.0) multi_xml (0.5.5) multipart-post (1.2.0) mysql2 (0.3.11) @@ -349,13 +349,13 @@ GEM rack rack-test (0.6.2) rack (>= 1.0) - rails (4.0.3) - actionmailer (= 4.0.3) - actionpack (= 4.0.3) - activerecord (= 4.0.3) - activesupport (= 4.0.3) + rails (4.0.5) + actionmailer (= 4.0.5) + actionpack (= 4.0.5) + activerecord (= 4.0.5) + activesupport (= 4.0.5) bundler (>= 1.3.0, < 2.0) - railties (= 4.0.3) + railties (= 4.0.5) sprockets-rails (~> 2.0.0) rails-observers (0.1.2) activemodel (~> 4.0) @@ -368,9 +368,9 @@ GEM i18n require_all ruby-progressbar - railties (4.0.3) - actionpack (= 4.0.3) - activesupport (= 4.0.3) + railties (4.0.5) + actionpack (= 4.0.5) + activesupport (= 4.0.5) rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) raindrops (0.12.0) @@ -478,7 +478,7 @@ GEM spring (>= 0.9.1) spring-commands-spinach (1.0.0) spring (>= 0.9.1) - sprockets (2.10.1) + sprockets (2.12.1) hike (~> 1.2) multi_json (~> 1.0) rack (~> 1.0) From 23de3551ab1ece5a3782c07d3a88a092122431d0 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 8 May 2014 15:37:36 +0300 Subject: [PATCH 116/135] Add MergeRequest#target_project_namespace Signed-off-by: Dmitriy Zaporozhets --- app/models/merge_request.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index 8c885b70a4..134a8c8dd4 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -253,6 +253,14 @@ class MergeRequest < ActiveRecord::Base end end + def target_project_namespace + if target_project && target_project.namespace + target_project.namespace.path + else + "(removed)" + end + end + def source_branch_exists? return false unless self.source_project From 05e63fe09c8a44ed14d4282db81d18927ce1a5ad Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 8 May 2014 15:38:17 +0300 Subject: [PATCH 117/135] MergeRequest#new 2 step process Signed-off-by: Dmitriy Zaporozhets --- .../merge_requests/_new_compare.html.haml | 69 +++++++++++++++++++ .../merge_requests/_new_submit.html.haml | 60 ++++++++++++++++ .../projects/merge_requests/new.html.haml | 7 +- 3 files changed, 133 insertions(+), 3 deletions(-) create mode 100644 app/views/projects/merge_requests/_new_compare.html.haml create mode 100644 app/views/projects/merge_requests/_new_submit.html.haml diff --git a/app/views/projects/merge_requests/_new_compare.html.haml b/app/views/projects/merge_requests/_new_compare.html.haml new file mode 100644 index 0000000000..47b8e5c886 --- /dev/null +++ b/app/views/projects/merge_requests/_new_compare.html.haml @@ -0,0 +1,69 @@ +%h3.page-title Compare changes for new merge request +%hr + += form_for [@project, @merge_request], url: new_project_merge_request_path(@project), method: :get, html: { class: "merge-request-form form-inline" } do |f| + .merge-request-branches.row + .col-md-6 + .panel.panel-default + .panel-heading + From + .panel-body + = f.select(:source_project_id, [[@merge_request.source_project_path,@merge_request.source_project.id]] , {}, { class: 'source_project select2 span3', disabled: @merge_request.persisted? }) +   + = f.select(:source_branch, @merge_request.source_branches, { include_blank: "Select branch" }, {class: 'source_branch select2 span2'}) + .panel-footer + .mr_source_commit + + .col-md-6 + .panel.panel-default + .panel-heading + To + .panel-body + - projects = @project.forked_from_project.nil? ? [@project] : [@project, @project.forked_from_project] + = f.select(:target_project_id, options_from_collection_for_select(projects, 'id', 'path_with_namespace', f.object.target_project_id), {}, { class: 'target_project select2 span3', disabled: @merge_request.persisted? }) +   + = f.select(:target_branch, @merge_request.target_branches, { include_blank: "Select branch" }, {class: 'target_branch select2 span2'}) + .panel-footer + .mr_target_commit + + -if @merge_request.errors.any? + .alert.alert-danger + - @merge_request.errors.full_messages.each do |msg| + %div= msg + + - if @merge_request.source_branch.present? && @merge_request.target_branch.present? + .light-well + %center + %h4 + There isn't anything to merge. + %p.slead + - if @merge_request.source_branch == @merge_request.target_branch + You'll need to use different branch names to get a valid comparison. + - else + %span.label-branch #{@merge_request.source_branch} + and + %span.label-branch #{@merge_request.target_branch} + are the same. + + .form-actions + = f.submit 'Compare branches', class: "btn btn-primary" + +:javascript + var source_branch = $("#merge_request_source_branch") + , target_branch = $("#merge_request_target_branch") + , target_project = $("#merge_request_target_project_id"); + + $.get("#{branch_from_project_merge_requests_path(@source_project)}", {ref: source_branch.val() }); + $.get("#{branch_to_project_merge_requests_path(@source_project)}", {target_project_id: target_project.val(),ref: target_branch.val() }); + + target_project.on("change", function() { + $.get("#{update_branches_project_merge_requests_path(@source_project)}", {target_project_id: $(this).val() }); + }); + source_branch.on("change", function() { + $.get("#{branch_from_project_merge_requests_path(@source_project)}", {ref: $(this).val() }); + }); + target_branch.on("change", function() { + $.get("#{branch_to_project_merge_requests_path(@source_project)}", {target_project_id: target_project.val(),ref: $(this).val() }); + }); + + diff --git a/app/views/projects/merge_requests/_new_submit.html.haml b/app/views/projects/merge_requests/_new_submit.html.haml new file mode 100644 index 0000000000..ea79b78e76 --- /dev/null +++ b/app/views/projects/merge_requests/_new_submit.html.haml @@ -0,0 +1,60 @@ +%h3.page-title + New merge request +%p.slead + From + %strong.monospace + #{@merge_request.source_project_namespace}:#{@merge_request.source_branch} + into + %strong.monospace + #{@merge_request.target_project_namespace}:#{@merge_request.target_branch} + + %span.pull-right + = link_to 'Change branches', new_project_merge_request_path(@project) + += form_for [@project, @merge_request], html: { class: "merge-request-form" } do |f| + .panel.panel-default + + .panel-body + .form-group + .light + = f.label :title do + = "Title *" + = f.text_field :title, class: "form-control input-lg js-gfm-input", maxlength: 255, rows: 5, required: true + .form-group + .light + = f.label :description, "Description" + = f.text_area :description, class: "form-control js-gfm-input", rows: 10 + %p.hint Description is parsed with #{link_to "GitLab Flavored Markdown", help_markdown_path, target: '_blank'}. + .panel-footer + - if @target_repo.contribution_guide + - contribution_guide_url = project_blob_path(@target_project, tree_join(@target_repo.root_ref, @target_repo.contribution_guide.name)) + %p + Please review the + %strong #{link_to "guidelines for contribution", contribution_guide_url} + to this repository. + = f.hidden_field :source_project_id + = f.hidden_field :target_project_id + = f.hidden_field :target_branch + = f.hidden_field :source_branch + = f.submit 'Submit a merge request', class: "btn btn-create" + +.mr-compare + %div.ui-box + .title + Commits (#{@commits.count}) + - if @commits.size > MergeRequestDiff::COMMITS_SAFE_SIZE + %ul.well-list + - Commit.decorate(@commits.first(MergeRequestDiff::COMMITS_SAFE_SIZE)).each do |commit| + = render "projects/commits/inline_commit", commit: commit, project: @project + %li.warning-row.unstyled + other #{@commits.size - MergeRequestDiff::COMMITS_SAFE_SIZE} commits hidden to prevent performance issues. + - else + %ul.well-list= render Commit.decorate(@commits), project: @project + + %h4 Changes + - if @diffs.present? + = render "projects/commits/diffs", diffs: @diffs, project: @project + - elsif @commits.size > MergeRequestDiff::COMMITS_SAFE_SIZE + .bs-callout.bs-callout-danger + %h4 This comparison includes more than #{MergeRequestDiff::COMMITS_SAFE_SIZE} commits. + %p To preserve performance the line changes are not shown. diff --git a/app/views/projects/merge_requests/new.html.haml b/app/views/projects/merge_requests/new.html.haml index 8ee0e1a8d4..c24e591672 100644 --- a/app/views/projects/merge_requests/new.html.haml +++ b/app/views/projects/merge_requests/new.html.haml @@ -1,3 +1,4 @@ -%h3.page-title New Merge Request -%hr -= render 'form' +- if @commits.present? + = render 'new_submit' +- else + = render 'new_compare' From 8eae01ea58c505a3c132e3d4f09cf77e7c1fc574 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 8 May 2014 15:38:52 +0300 Subject: [PATCH 118/135] Compare branches in MergeRequestsController#new action Signed-off-by: Dmitriy Zaporozhets --- .../projects/merge_requests_controller.rb | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb index 745da9c49e..d8551db7b0 100644 --- a/app/controllers/projects/merge_requests_controller.rb +++ b/app/controllers/projects/merge_requests_controller.rb @@ -62,11 +62,27 @@ class Projects::MergeRequestsController < Projects::ApplicationController @merge_request.source_project = @project unless @merge_request.source_project @merge_request.target_project ||= (@project.forked_from_project || @project) @target_branches = @merge_request.target_project.nil? ? [] : @merge_request.target_project.repository.branch_names - @merge_request.target_branch ||= @merge_request.target_project.default_branch - @source_project = @merge_request.source_project - @merge_request + + if @merge_request.target_branch && @merge_request.source_branch + compare_action = Gitlab::Satellite::CompareAction.new( + current_user, + @merge_request.target_project, + @merge_request.target_branch, + @merge_request.source_project, + @merge_request.source_branch + ) + + @commits = compare_action.commits + @commits.map! { |commit| Commit.new(commit) } + @commit = @commits.first + + @diffs = compare_action.diffs + @merge_request.title = @merge_request.source_branch.titleize.humanize + @target_project = @merge_request.target_project + @target_repo = @target_project.repository + end end def edit @@ -80,7 +96,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController @merge_request = MergeRequests::CreateService.new(project, current_user, params[:merge_request]).execute if @merge_request.valid? - redirect_to [@merge_request.target_project, @merge_request], notice: 'Merge request was successfully created.' + redirect_to project_merge_request_path(@merge_request.target_project, @merge_request), notice: 'Merge request was successfully created.' else @source_project = @merge_request.source_project @target_project = @merge_request.target_project From 51e976d295edfefd5e2cb2dfc7967fb90c87ac40 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 8 May 2014 15:40:02 +0300 Subject: [PATCH 119/135] Add assignee/milestone block to merge request edit page. And remove branches selector from this page Signed-off-by: Dmitriy Zaporozhets --- .../projects/merge_requests/_form.html.haml | 61 ++++++------------- .../merge_requests/branch_from.js.haml | 5 -- .../merge_requests/show/_mr_title.html.haml | 2 +- 3 files changed, 18 insertions(+), 50 deletions(-) diff --git a/app/views/projects/merge_requests/_form.html.haml b/app/views/projects/merge_requests/_form.html.haml index 0fe2d1d980..58994e012f 100644 --- a/app/views/projects/merge_requests/_form.html.haml +++ b/app/views/projects/merge_requests/_form.html.haml @@ -14,33 +14,6 @@ - @merge_request.errors.full_messages.each do |msg| %div= msg - .merge-request-branches - .form-group - = label_tag nil, class: 'control-label' do - From - .col-sm-10 - .clearfix - .pull-left - = f.select(:source_project_id, [[@merge_request.source_project_path,@merge_request.source_project.id]] , {}, { class: 'source_project select2 span3', disabled: @merge_request.persisted? }) - .pull-left -   - = f.select(:source_branch, @merge_request.source_branches, { include_blank: "Select branch" }, {class: 'source_branch select2 span2'}) - .mr_source_commit - %br - .form-group - = label_tag nil, class: 'control-label' do - To - .col-sm-10 - .clearfix - .pull-left - - projects = @project.forked_from_project.nil? ? [@project] : [@project, @project.forked_from_project] - = f.select(:target_project_id, options_from_collection_for_select(projects, 'id', 'path_with_namespace', f.object.target_project_id), {}, { class: 'target_project select2 span3', disabled: @merge_request.persisted? }) - .pull-left -   - = f.select(:target_branch, @merge_request.target_branches, { include_blank: "Select branch" }, {class: 'target_branch select2 span2'}) - .mr_target_commit - - %hr .merge-request-form-info .form-group = f.label :title, class: 'control-label' do @@ -51,6 +24,23 @@ .col-sm-10 = f.text_area :description, class: "form-control js-gfm-input", rows: 14 %p.hint Description is parsed with #{link_to "GitLab Flavored Markdown", help_markdown_path, target: '_blank'}. + %hr + .form-group + .issue-assignee + = f.label :assignee_id, class: 'control-label' do + %i.icon-user + Assign to + .col-sm-10 + = project_users_select_tag('merge_request[assignee_id]', placeholder: 'Select a user', class: 'custom-form-control', selected: @merge_request.assignee_id) +   + = link_to 'Assign to me', '#', class: 'btn btn-small assign-to-me-link' + .form-group + .issue-milestone + = f.label :milestone_id, class: 'control-label' do + %i.icon-time + Milestone + .col-sm-10= f.select(:milestone_id, milestone_options(@merge_request), { include_blank: "Select milestone" }, {class: 'select2'}) + .form-actions - if @merge_request.new_record? @@ -66,20 +56,3 @@ :javascript disableButtonIfEmptyField("#merge_request_title", ".btn-save"); - - var source_branch = $("#merge_request_source_branch") - , target_branch = $("#merge_request_target_branch") - , target_project = $("#merge_request_target_project_id"); - - $.get("#{branch_from_project_merge_requests_path(@source_project)}", {ref: source_branch.val() }); - $.get("#{branch_to_project_merge_requests_path(@source_project)}", {target_project_id: target_project.val(),ref: target_branch.val() }); - - target_project.on("change", function() { - $.get("#{update_branches_project_merge_requests_path(@source_project)}", {target_project_id: $(this).val() }); - }); - source_branch.on("change", function() { - $.get("#{branch_from_project_merge_requests_path(@source_project)}", {ref: $(this).val() }); - }); - target_branch.on("change", function() { - $.get("#{branch_to_project_merge_requests_path(@source_project)}", {target_project_id: target_project.val(),ref: $(this).val() }); - }); diff --git a/app/views/projects/merge_requests/branch_from.js.haml b/app/views/projects/merge_requests/branch_from.js.haml index 693c2057a0..8372afa61b 100644 --- a/app/views/projects/merge_requests/branch_from.js.haml +++ b/app/views/projects/merge_requests/branch_from.js.haml @@ -1,7 +1,2 @@ :plain $(".mr_source_commit").html("#{commit_to_html(@commit, @source_project, false)}"); - var mrTitle = $('#merge_request_title'); - - if(mrTitle.val().length == 0) { - mrTitle.val("#{params[:ref].titleize.humanize}"); - } diff --git a/app/views/projects/merge_requests/show/_mr_title.html.haml b/app/views/projects/merge_requests/show/_mr_title.html.haml index 8f78e93df4..2c905413bc 100644 --- a/app/views/projects/merge_requests/show/_mr_title.html.haml +++ b/app/views/projects/merge_requests/show/_mr_title.html.haml @@ -39,4 +39,4 @@ - else %span= @merge_request.source_branch → - %spanh= @merge_request.target_branch + %span= @merge_request.target_branch From ee3cd06f4cdf0c150801b1268d806b8a252960f5 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 8 May 2014 15:40:19 +0300 Subject: [PATCH 120/135] Remove unnecessary css margin Signed-off-by: Dmitriy Zaporozhets --- app/assets/stylesheets/sections/merge_requests.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/app/assets/stylesheets/sections/merge_requests.scss b/app/assets/stylesheets/sections/merge_requests.scss index 790496a1a5..5dcfc449b4 100644 --- a/app/assets/stylesheets/sections/merge_requests.scss +++ b/app/assets/stylesheets/sections/merge_requests.scss @@ -31,7 +31,6 @@ .mr_source_commit, .mr_target_commit { - margin-top: 10px; .commit { margin: 0; padding: 2px 0; From 2da289cf22995d14e275b7c908b7e6014a11c7d9 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 8 May 2014 15:52:59 +0300 Subject: [PATCH 121/135] Add assignee and milestone to 2nd step Signed-off-by: Dmitriy Zaporozhets --- .../project_users_select.js.coffee | 2 +- app/helpers/issues_helper.rb | 2 +- app/helpers/selects_helper.rb | 4 ++-- .../projects/merge_requests/_form.html.haml | 4 ++++ .../merge_requests/_new_submit.html.haml | 22 +++++++++++++++++++ 5 files changed, 30 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/project_users_select.js.coffee b/app/assets/javascripts/project_users_select.js.coffee index 03fad41c49..b0e39610fe 100644 --- a/app/assets/javascripts/project_users_select.js.coffee +++ b/app/assets/javascripts/project_users_select.js.coffee @@ -1,7 +1,7 @@ @projectUsersSelect = init: -> $('.ajax-project-users-select').each (i, select) -> - project_id = $('body').data('project-id') + project_id = $(select).data('project-id') || $('body').data('project-id') $(select).select2 placeholder: $(select).data('placeholder') || "Search for a user" diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index 95f0eff58b..7c58908165 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -82,7 +82,7 @@ module IssuesHelper end def milestone_options object - options_from_collection_for_select(@project.milestones.active, 'id', 'title', object.milestone_id) + options_from_collection_for_select(object.project.milestones.active, 'id', 'title', object.milestone_id) end def issue_box_class(item) diff --git a/app/helpers/selects_helper.rb b/app/helpers/selects_helper.rb index a1fe4488ae..ab24367c45 100644 --- a/app/helpers/selects_helper.rb +++ b/app/helpers/selects_helper.rb @@ -14,7 +14,7 @@ module SelectsHelper css_class << (opts[:class] || '') value = opts[:selected] || '' placeholder = opts[:placeholder] || 'Select user' - - hidden_field_tag(id, value, class: css_class, 'data-placeholder' => placeholder) + project_id = opts[:project_id] || @project.id + hidden_field_tag(id, value, class: css_class, 'data-placeholder' => placeholder, 'data-project-id' => project_id) end end diff --git a/app/views/projects/merge_requests/_form.html.haml b/app/views/projects/merge_requests/_form.html.haml index 58994e012f..ddff3dbead 100644 --- a/app/views/projects/merge_requests/_form.html.haml +++ b/app/views/projects/merge_requests/_form.html.haml @@ -56,3 +56,7 @@ :javascript disableButtonIfEmptyField("#merge_request_title", ".btn-save"); + $('.assign-to-me-link').on('click', function(e){ + $('#merge_request_assignee_id').val("#{current_user.id}").trigger("change"); + e.preventDefault(); + }); diff --git a/app/views/projects/merge_requests/_new_submit.html.haml b/app/views/projects/merge_requests/_new_submit.html.haml index ea79b78e76..e6e0db55d9 100644 --- a/app/views/projects/merge_requests/_new_submit.html.haml +++ b/app/views/projects/merge_requests/_new_submit.html.haml @@ -25,6 +25,21 @@ = f.label :description, "Description" = f.text_area :description, class: "form-control js-gfm-input", rows: 10 %p.hint Description is parsed with #{link_to "GitLab Flavored Markdown", help_markdown_path, target: '_blank'}. + .form-group + .issue-assignee + = f.label :assignee_id do + %i.icon-user + Assign to + %div + = project_users_select_tag('merge_request[assignee_id]', placeholder: 'Select a user', class: 'custom-form-control', selected: @merge_request.assignee_id, project_id: @merge_request.target_project_id) +   + = link_to 'Assign to me', '#', class: 'btn btn-small assign-to-me-link' + .form-group + .issue-milestone + = f.label :milestone_id do + %i.icon-time + Milestone + %div= f.select(:milestone_id, milestone_options(@merge_request), { include_blank: "Select milestone" }, {class: 'select2'}) .panel-footer - if @target_repo.contribution_guide - contribution_guide_url = project_blob_path(@target_project, tree_join(@target_repo.root_ref, @target_repo.contribution_guide.name)) @@ -58,3 +73,10 @@ .bs-callout.bs-callout-danger %h4 This comparison includes more than #{MergeRequestDiff::COMMITS_SAFE_SIZE} commits. %p To preserve performance the line changes are not shown. + + +:javascript + $('.assign-to-me-link').on('click', function(e){ + $('#merge_request_assignee_id').val("#{current_user.id}").trigger("change"); + e.preventDefault(); + }); From 700b6366db9d4ee0bf8d6e9e0e47519ae46e40c6 Mon Sep 17 00:00:00 2001 From: Jeroen van Baarsen Date: Thu, 8 May 2014 14:57:42 +0200 Subject: [PATCH 122/135] Fix a minor typo in the README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cb755a411e..c7c979c0ca 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ * [GitLab CI](https://www.gitlab.com/gitlab-ci/) is a continuous integration (CI) server that is easy to integrate with GitLab. -* Unofficial third-party [iPhone app](http://gitlabcontrol.com/)m [Android app](https://play.google.com/store/apps/details?id=com.bd.gitlab&hl=en) and [command line client](https://github.com/drewblessing/gitlab-cli) for GitLab. +* Unofficial third-party [iPhone app](http://gitlabcontrol.com/), [Android app](https://play.google.com/store/apps/details?id=com.bd.gitlab&hl=en) and [command line client](https://github.com/drewblessing/gitlab-cli) for GitLab. ### Requirements From 04561011177f5323f4fe0e18e7a0137d72b314ea Mon Sep 17 00:00:00 2001 From: "C. Morgan Hamill" Date: Thu, 8 May 2014 09:23:17 -0400 Subject: [PATCH 123/135] Clean up conditional statement in `name` method. Reverse the conditional order to avoid awkward `if !` construction. --- lib/gitlab/oauth/user.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/gitlab/oauth/user.rb b/lib/gitlab/oauth/user.rb index e9e57aa574..7f1d1cd653 100644 --- a/lib/gitlab/oauth/user.rb +++ b/lib/gitlab/oauth/user.rb @@ -65,10 +65,10 @@ module Gitlab end def name - if !auth.info.name.nil? - auth.info.name.to_s.force_encoding('utf-8') - else + if auth.info.name.nil? "#{auth.info.first_name} #{auth.info.last_name}".force_encoding('utf-8') + else + auth.info.name.to_s.force_encoding('utf-8') end end From ad5a982d841f572e4e9207ae5ac6a0013648d30e Mon Sep 17 00:00:00 2001 From: Marin Jankovski Date: Thu, 8 May 2014 15:00:20 +0200 Subject: [PATCH 124/135] Update sass-rails with newer version of rails. --- Gemfile | 2 +- Gemfile.lock | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Gemfile b/Gemfile index 3563dc88e3..7ff7515143 100644 --- a/Gemfile +++ b/Gemfile @@ -152,7 +152,7 @@ gem "rack-attack" # Ace editor gem 'ace-rails-ap' -gem "sass-rails" +gem "sass-rails", '~> 4.0.2' gem "coffee-rails" gem "uglifier" gem "therubyracer" diff --git a/Gemfile.lock b/Gemfile.lock index 20fcc3964a..c04c1e2b56 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -427,11 +427,12 @@ GEM safe_yaml (0.9.7) sanitize (2.1.0) nokogiri (>= 1.4.4) - sass (3.2.12) - sass-rails (4.0.1) + sass (3.2.19) + sass-rails (4.0.3) railties (>= 4.0.0, < 5.0) - sass (>= 3.1.10) - sprockets-rails (~> 2.0.0) + sass (~> 3.2.0) + sprockets (~> 2.8, <= 2.11.0) + sprockets-rails (~> 2.0) sdoc (0.3.20) json (>= 1.1.3) rdoc (~> 3.10) @@ -478,7 +479,7 @@ GEM spring (>= 0.9.1) spring-commands-spinach (1.0.0) spring (>= 0.9.1) - sprockets (2.12.1) + sprockets (2.11.0) hike (~> 1.2) multi_json (~> 1.0) rack (~> 1.0) @@ -636,7 +637,7 @@ DEPENDENCIES redis-rails rspec-rails sanitize (~> 2.0) - sass-rails + sass-rails (~> 4.0.2) sdoc seed-fu select2-rails From 86bf684f5dc95e8bd2445f088f862d0a0539922a Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 8 May 2014 16:30:39 +0300 Subject: [PATCH 125/135] Minor UI improvements and fixed test Signed-off-by: Dmitriy Zaporozhets --- app/views/projects/merge_requests/_new_compare.html.haml | 6 +++--- app/views/projects/merge_requests/_new_submit.html.haml | 2 +- features/steps/project/merge_requests.rb | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/views/projects/merge_requests/_new_compare.html.haml b/app/views/projects/merge_requests/_new_compare.html.haml index 47b8e5c886..6f6f54ccec 100644 --- a/app/views/projects/merge_requests/_new_compare.html.haml +++ b/app/views/projects/merge_requests/_new_compare.html.haml @@ -1,4 +1,4 @@ -%h3.page-title Compare changes for new merge request +%h3.page-title Compare branches for new Merge Request %hr = form_for [@project, @merge_request], url: new_project_merge_request_path(@project), method: :get, html: { class: "merge-request-form form-inline" } do |f| @@ -45,8 +45,8 @@ %span.label-branch #{@merge_request.target_branch} are the same. - .form-actions - = f.submit 'Compare branches', class: "btn btn-primary" + %hr + = f.submit 'Compare branches', class: "btn btn-primary" :javascript var source_branch = $("#merge_request_source_branch") diff --git a/app/views/projects/merge_requests/_new_submit.html.haml b/app/views/projects/merge_requests/_new_submit.html.haml index e6e0db55d9..b5479be708 100644 --- a/app/views/projects/merge_requests/_new_submit.html.haml +++ b/app/views/projects/merge_requests/_new_submit.html.haml @@ -51,7 +51,7 @@ = f.hidden_field :target_project_id = f.hidden_field :target_branch = f.hidden_field :source_branch - = f.submit 'Submit a merge request', class: "btn btn-create" + = f.submit 'Submit merge request', class: "btn btn-create" .mr-compare %div.ui-box diff --git a/features/steps/project/merge_requests.rb b/features/steps/project/merge_requests.rb index f42eb6377c..e0aec699a5 100644 --- a/features/steps/project/merge_requests.rb +++ b/features/steps/project/merge_requests.rb @@ -61,9 +61,10 @@ class ProjectMergeRequests < Spinach::FeatureSteps end step 'I submit new merge request "Wiki Feature"' do - fill_in "merge_request_title", with: "Wiki Feature" select "master", from: "merge_request_source_branch" select "notes_refactoring", from: "merge_request_target_branch" + click_button "Compare branches" + fill_in "merge_request_title", with: "Wiki Feature" click_button "Submit merge request" end From 536373ad05b55c69442e7d7d6cb549791031cac2 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 8 May 2014 19:00:03 +0300 Subject: [PATCH 126/135] Dont allow mr compare with empty branches Signed-off-by: Dmitriy Zaporozhets --- .../merge_requests/_new_compare.html.haml | 21 ++++++++++++++++--- .../project/forked_merge_requests.feature | 3 +-- .../steps/project/forked_merge_requests.rb | 15 +++---------- 3 files changed, 22 insertions(+), 17 deletions(-) diff --git a/app/views/projects/merge_requests/_new_compare.html.haml b/app/views/projects/merge_requests/_new_compare.html.haml index 6f6f54ccec..a8b774a3cd 100644 --- a/app/views/projects/merge_requests/_new_compare.html.haml +++ b/app/views/projects/merge_requests/_new_compare.html.haml @@ -2,11 +2,12 @@ %hr = form_for [@project, @merge_request], url: new_project_merge_request_path(@project), method: :get, html: { class: "merge-request-form form-inline" } do |f| + .hide.alert.alert-danger.mr-compare-errors .merge-request-branches.row .col-md-6 .panel.panel-default .panel-heading - From + %strong Source branch .panel-body = f.select(:source_project_id, [[@merge_request.source_project_path,@merge_request.source_project.id]] , {}, { class: 'source_project select2 span3', disabled: @merge_request.persisted? })   @@ -17,7 +18,7 @@ .col-md-6 .panel.panel-default .panel-heading - To + %strong Target branch .panel-body - projects = @project.forked_from_project.nil? ? [@project] : [@project, @project.forked_from_project] = f.select(:target_project_id, options_from_collection_for_select(projects, 'id', 'path_with_namespace', f.object.target_project_id), {}, { class: 'target_project select2 span3', disabled: @merge_request.persisted? }) @@ -45,8 +46,9 @@ %span.label-branch #{@merge_request.target_branch} are the same. + %hr - = f.submit 'Compare branches', class: "btn btn-primary" + = f.submit 'Compare branches', class: "btn btn-primary mr-compare-btn" :javascript var source_branch = $("#merge_request_source_branch") @@ -61,9 +63,22 @@ }); source_branch.on("change", function() { $.get("#{branch_from_project_merge_requests_path(@source_project)}", {ref: $(this).val() }); + $(".mr-compare-errors").fadeOut(); + $(".mr-compare-btn").enable(); }); target_branch.on("change", function() { $.get("#{branch_to_project_merge_requests_path(@source_project)}", {target_project_id: target_project.val(),ref: $(this).val() }); + $(".mr-compare-errors").fadeOut(); + $(".mr-compare-btn").enable(); }); +:coffeescript + + $(".merge-request-form").on 'submit', -> + if $("#merge_request_source_branch").val() is "" or $('#merge_request_target_branch').val() is "" + $(".mr-compare-errors").html("You must select source and target branch to proceed") + $(".mr-compare-errors").fadeIn() + event.preventDefault() + return + diff --git a/features/project/forked_merge_requests.feature b/features/project/forked_merge_requests.feature index 2d94b98c90..5832b729de 100644 --- a/features/project/forked_merge_requests.feature +++ b/features/project/forked_merge_requests.feature @@ -30,11 +30,10 @@ Feature: Project Forked Merge Requests Given I visit project "Forked Shop" merge requests page And I click link "New Merge Request" And I fill out an invalid "Merge Request On Forked Project" merge request - And I submit the merge request Then I should see validation errors @javascript Scenario: Merge request should target fork repository by default Given I visit project "Forked Shop" merge requests page And I click link "New Merge Request" - Then the target repository should be the original repository \ No newline at end of file + Then the target repository should be the original repository diff --git a/features/steps/project/forked_merge_requests.rb b/features/steps/project/forked_merge_requests.rb index df69cb7543..3c497638d9 100644 --- a/features/steps/project/forked_merge_requests.rb +++ b/features/steps/project/forked_merge_requests.rb @@ -53,6 +53,7 @@ class ProjectForkedMergeRequests < Spinach::FeatureSteps find(:select, "merge_request_source_branch", {}).value.should == 'master' find(:select, "merge_request_target_branch", {}).value.should == 'stable' + click_button "Compare branches" fill_in "merge_request_title", with: "Merge Request On Forked Project" end @@ -148,29 +149,19 @@ class ProjectForkedMergeRequests < Spinach::FeatureSteps current_path.should == edit_project_merge_request_path(@project, @merge_request) page.should have_content "Edit merge request ##{@merge_request.id}" find("#merge_request_title").value.should == "Merge Request On Forked Project" - find("#merge_request_source_project_id").value.should == @forked_project.id.to_s - find("#merge_request_target_project_id").value.should == @project.id.to_s - find("#merge_request_source_branch").value.should have_content "master" - verify_commit_link(".mr_source_commit",@forked_project) - find("#merge_request_target_branch").value.should have_content "stable" - verify_commit_link(".mr_target_commit",@project) end step 'I fill out an invalid "Merge Request On Forked Project" merge request' do - #If this isn't filled in the rest of the validations won't be triggered - fill_in "merge_request_title", with: "Merge Request On Forked Project" - select "Select branch", from: "merge_request_target_branch" - find(:select, "merge_request_source_project_id", {}).value.should == @forked_project.id.to_s find(:select, "merge_request_target_project_id", {}).value.should == project.id.to_s find(:select, "merge_request_source_branch", {}).value.should == "" find(:select, "merge_request_target_branch", {}).value.should == "" + click_button "Compare branches" end step 'I should see validation errors' do - page.should have_content "Source branch can't be blank" - page.should have_content "Target branch can't be blank" + page.should have_content "You must select source and target branch" end step 'the target repository should be the original repository' do From 41231862baeb01dc6ed49f68488e863bca6dbfb2 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 8 May 2014 19:23:39 +0300 Subject: [PATCH 127/135] Fix tests Signed-off-by: Dmitriy Zaporozhets --- features/steps/dashboard/dashboard.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/features/steps/dashboard/dashboard.rb b/features/steps/dashboard/dashboard.rb index 394acd3fe8..706c9babce 100644 --- a/features/steps/dashboard/dashboard.rb +++ b/features/steps/dashboard/dashboard.rb @@ -25,7 +25,6 @@ class Dashboard < Spinach::FeatureSteps find("#merge_request_target_project_id").value.should == @project.id.to_s find("#merge_request_source_branch").value.should == "new_design" find("#merge_request_target_branch").value.should == "master" - find("#merge_request_title").value.should == "New design" end Given 'user with name "John Doe" joined project "Shop"' do From da347d1bb45ad3b08b2aa0b40041c67dac0df3c5 Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Thu, 8 May 2014 11:02:04 +0200 Subject: [PATCH 128/135] Apply the locale encoding to `tar --version` Fixes a bug with non-UTF8 locales introduced by 2b816075dc71dfe8f6f9e5349fdff7f03ad9dad0. --- CHANGELOG | 1 + lib/backup/manager.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index cc271f5e2c..61eb24f1c5 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -10,6 +10,7 @@ v 6.9.0 - Stop refreshing comments when the tab is hidden - Improve issue and merge request mobile UI (Drew Blessing) - Document how to convert a backup to PostgreSQL + - Fix locale bug in backup manager v 6.8.0 - Ability to at mention users that are participating in issue and merge req. discussion diff --git a/lib/backup/manager.rb b/lib/backup/manager.rb index 05814fc78f..28e323fe30 100644 --- a/lib/backup/manager.rb +++ b/lib/backup/manager.rb @@ -101,7 +101,7 @@ module Backup def tar_version tar_version, _ = Gitlab::Popen.popen(%W(tar --version)) - tar_version.split("\n").first + tar_version.force_encoding('locale').split("\n").first end end end From 20be9ef251ff0d1e865f1ec5090ee151a24135bb Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 8 May 2014 21:09:51 +0300 Subject: [PATCH 129/135] Remove old mixins Signed-off-by: Dmitriy Zaporozhets --- app/assets/stylesheets/main/mixins.scss | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/app/assets/stylesheets/main/mixins.scss b/app/assets/stylesheets/main/mixins.scss index fcc7374d0d..147c759ecb 100644 --- a/app/assets/stylesheets/main/mixins.scss +++ b/app/assets/stylesheets/main/mixins.scss @@ -41,31 +41,6 @@ * Prefilled mixins * Mixins with fixed values */ -@mixin bg-light-gray-gradient { - background: #f1f1f1; - background-image: -webkit-gradient(linear, 0 0, 0 30, color-stop(0.066, #f5f5f5), to(#e1e1e1)); - background-image: -webkit-linear-gradient(#f5f5f5 6.6%, #e1e1e1); - background-image: -moz-linear-gradient(#f5f5f5 6.6%, #e1e1e1); - background-image: -ms-linear-gradient(#f5f5f5 6.6%, #e1e1e1); - background-image: -o-linear-gradient(#f5f5f5 6.6%, #e1e1e1); -} - -@mixin bg-gray-gradient { - background: #eee; - background-image: -webkit-gradient(linear, 0 0, 0 30, color-stop(0.066, #eee), to(#dfdfdf)); - background-image: -webkit-linear-gradient(#eee 6.6%, #dfdfdf); - background-image: -moz-linear-gradient(#eee 6.6%, #dfdfdf); - background-image: -ms-linear-gradient(#eee 6.6%, #dfdfdf); - background-image: -o-linear-gradient(#eee 6.6%, #dfdfdf); -} - -@mixin bg-dark-gray-gradient { - background: #eee; - background-image: -webkit-linear-gradient(#e9e9e9, #d7d7d7); - background-image: -moz-linear-gradient(#e9e9e9, #d7d7d7); - background-image: -ms-linear-gradient(#e9e9e9, #d7d7d7); - background-image: -o-linear-gradient(#e9e9e9, #d7d7d7); -} @mixin shade { @include box-shadow(0 0 3px #ddd); From 2ec1a879f7cb96370a54f379c39a88b75b67f4c7 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 8 May 2014 21:10:07 +0300 Subject: [PATCH 130/135] Add box shadow to issue box Signed-off-by: Dmitriy Zaporozhets --- app/assets/stylesheets/generic/issue_box.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/app/assets/stylesheets/generic/issue_box.scss b/app/assets/stylesheets/generic/issue_box.scss index ccdcc65794..d4d3361bc7 100644 --- a/app/assets/stylesheets/generic/issue_box.scss +++ b/app/assets/stylesheets/generic/issue_box.scss @@ -12,6 +12,7 @@ margin:20px 0; background: #FFF; border: 1px solid #EEE; + @include box-shadow(0 1px 1px rgba(0, 0, 0, 0.05)); &.issue-box-closed { border-color: #DA4E49; From 211e975d8acbc046219fefbf95a12a8f0bbf980b Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 8 May 2014 21:10:20 +0300 Subject: [PATCH 131/135] Change header color in network page Signed-off-by: Dmitriy Zaporozhets --- app/assets/stylesheets/sections/graph.scss | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/assets/stylesheets/sections/graph.scss b/app/assets/stylesheets/sections/graph.scss index 1e22d161bf..8a337a5e20 100644 --- a/app/assets/stylesheets/sections/graph.scss +++ b/app/assets/stylesheets/sections/graph.scss @@ -1,17 +1,16 @@ .project-network { - border: 1px solid #aaa; - padding: 1px; + border: 1px solid #CCC; .tip { color: #888; font-size: 14px; padding: 10px; border-bottom: 1px solid #bbb; - @include bg-gray-gradient; + background: #EEE; } .network-graph { - background: #f1f1f1; + background: #FFF; height: 500px; overflow-y: scroll; overflow-x: hidden; From 0f29ccffd2b9805545db63d8266bb8367de1e35c Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Thu, 8 May 2014 22:49:27 +0200 Subject: [PATCH 132/135] Backup wiki repo even if the main repo is empty This fixes a bug where wiki repositories for projects with an empty main repository would not get backed up. --- CHANGELOG | 1 + lib/backup/repository.rb | 9 +++------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 61eb24f1c5..e43edc5d7a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -11,6 +11,7 @@ v 6.9.0 - Improve issue and merge request mobile UI (Drew Blessing) - Document how to convert a backup to PostgreSQL - Fix locale bug in backup manager + - Fix wiki backup skip bug v 6.8.0 - Ability to at mention users that are participating in issue and merge req. discussion diff --git a/lib/backup/repository.rb b/lib/backup/repository.rb index 214d9824ee..6f7c4f7c90 100644 --- a/lib/backup/repository.rb +++ b/lib/backup/repository.rb @@ -10,15 +10,12 @@ module Backup Project.find_each(batch_size: 1000) do |project| print " * #{project.path_with_namespace} ... " - if project.empty_repo? - puts "[SKIPPED]".cyan - next - end - # Create namespace dir if missing FileUtils.mkdir_p(File.join(backup_repos_path, project.namespace.path)) if project.namespace - if system(*%W(git --git-dir=#{path_to_repo(project)} bundle create #{path_to_bundle(project)} --all), silent) + if project.empty_repo? + puts "[SKIPPED]".cyan + elsif system(*%W(git --git-dir=#{path_to_repo(project)} bundle create #{path_to_bundle(project)} --all), silent) puts "[DONE]".green else puts "[FAILED]".red From 3b34084bdeadecdceb0a86e2820dd7c5985099f6 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Fri, 9 May 2014 09:46:23 +0300 Subject: [PATCH 133/135] Fix notify specs Signed-off-by: Dmitriy Zaporozhets --- spec/mailers/notify_spec.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/mailers/notify_spec.rb b/spec/mailers/notify_spec.rb index e86a60a42b..3b07504495 100644 --- a/spec/mailers/notify_spec.rb +++ b/spec/mailers/notify_spec.rb @@ -239,7 +239,7 @@ describe Notify do it_behaves_like 'an assignee email' it 'has the correct subject' do - should have_subject /#{merge_request.title} \(!#{merge_request.iid}\)/ + should have_subject /#{merge_request.title} \(##{merge_request.iid}\)/ end it 'contains a link to the new merge request' do @@ -275,7 +275,7 @@ describe Notify do end it 'has the correct subject' do - should have_subject /#{merge_request.title} \(!#{merge_request.iid}\)/ + should have_subject /#{merge_request.title} \(##{merge_request.iid}\)/ end it 'contains the name of the previous assignee' do @@ -303,7 +303,7 @@ describe Notify do end it 'has the correct subject' do - should have_subject /#{merge_request.title} \(!#{merge_request.iid}\)/ + should have_subject /#{merge_request.title} \(##{merge_request.iid}\)/ end it 'contains the new status' do @@ -426,7 +426,7 @@ describe Notify do it_behaves_like 'a note email' it 'has the correct subject' do - should have_subject /#{merge_request.title} \(!#{merge_request.iid}\)/ + should have_subject /#{merge_request.title} \(##{merge_request.iid}\)/ end it 'contains a link to the merge request note' do From ea696805a7a82ec6a70da1dd7d5bc010f035ea26 Mon Sep 17 00:00:00 2001 From: Gregoire Daussin Date: Fri, 9 May 2014 17:58:23 +0200 Subject: [PATCH 134/135] Fix css rules conflict between .dark & a.dark classes --- app/assets/stylesheets/generic/typography.scss | 2 +- app/views/projects/milestones/show.html.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/stylesheets/generic/typography.scss b/app/assets/stylesheets/generic/typography.scss index a441955173..8cc72d7f07 100644 --- a/app/assets/stylesheets/generic/typography.scss +++ b/app/assets/stylesheets/generic/typography.scss @@ -47,7 +47,7 @@ a { text-decoration: underline; } - &.dark { + &.darken { color: $style_color; } diff --git a/app/views/projects/milestones/show.html.haml b/app/views/projects/milestones/show.html.haml index 06cf994678..5c5df46d33 100644 --- a/app/views/projects/milestones/show.html.haml +++ b/app/views/projects/milestones/show.html.haml @@ -100,7 +100,7 @@ %ul.bordered-list - @users.each do |user| %li - = link_to user, title: user.name, class: "dark" do + = link_to user, title: user.name, class: "darken" do = image_tag avatar_icon(user.email, 32), class: "avatar s32" %strong= truncate(user.name, lenght: 40) %br From 049b63473f827e3d28b0128356b81b3208bf0b0c Mon Sep 17 00:00:00 2001 From: dosire Date: Fri, 9 May 2014 19:34:25 +0200 Subject: [PATCH 135/135] Link to the installation doc so people viewing on other locations can click the link. --- doc/install/installation.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/install/installation.md b/doc/install/installation.md index a2aa9add9a..eea5c763fc 100644 --- a/doc/install/installation.md +++ b/doc/install/installation.md @@ -1,10 +1,10 @@ # Select Version to Install -Make sure you view this installation guide from the branch (version) of GitLab you would like to install. In most cases +Make sure you view [this installation guide](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/install/installation.md) from the branch (version) of GitLab you would like to install. In most cases this should be the highest numbered stable branch (example shown below). ![capture](http://i.imgur.com/d2AlIVj.png) -If this is unclear check the [GitLab Blog](https://www.gitlab.com/blog/) for installation guide links by version. +If the highest number stable branch is unclear please check the [GitLab Blog](https://www.gitlab.com/blog/) for installation guide links by version. # Important notes