diff options
122 files changed, 1802 insertions, 987 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index df3458b47dd..4e6fcab3808 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ -image: "dev.gitlab.org:5005/gitlab/gitlab-build-images:ruby-2.3.3-git-2.7-phantomjs-2.1-node-7.1" +image: "dev.gitlab.org:5005/gitlab/gitlab-build-images:ruby-2.3.3-golang-1.8-git-2.7-phantomjs-2.1-node-7.1" cache: key: "ruby-233" diff --git a/.gitlab/issue_templates/Bug.md b/.gitlab/issue_templates/Bug.md index 34c2e097ba8..6bb21e6a3af 100644 --- a/.gitlab/issue_templates/Bug.md +++ b/.gitlab/issue_templates/Bug.md @@ -25,14 +25,20 @@ logs, and code as it's very hard to read otherwise.) #### Results of GitLab environment info +<details> + (For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:env:info`) (For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`) +</details> + #### Results of GitLab application Check +<details> + (For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:check SANITIZE=true`) @@ -41,6 +47,8 @@ logs, and code as it's very hard to read otherwise.) (we will only investigate if the tests are passing) +</details> + ### Possible fixes (If you can, link to the line of code that might be responsible for the problem) diff --git a/Gemfile.lock b/Gemfile.lock index d7e3f7343d0..965c888ca79 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -330,7 +330,7 @@ GEM grape-entity (0.6.0) activesupport multi_json (>= 1.3.2) - grpc (1.1.2) + grpc (1.2.2) google-protobuf (~> 3.1) googleauth (~> 0.5.1) haml (4.0.7) diff --git a/app/assets/stylesheets/framework/calendar.scss b/app/assets/stylesheets/framework/calendar.scss index 9a0f7a14e57..759401a7806 100644 --- a/app/assets/stylesheets/framework/calendar.scss +++ b/app/assets/stylesheets/framework/calendar.scss @@ -5,7 +5,7 @@ direction: rtl; @media (min-width: $screen-sm-min) and (max-width: $screen-md-max) { - overflow-x: scroll; + overflow-x: auto; } } diff --git a/app/assets/stylesheets/pages/merge_requests.scss b/app/assets/stylesheets/pages/merge_requests.scss index 931f08c17f4..6a419384a34 100644 --- a/app/assets/stylesheets/pages/merge_requests.scss +++ b/app/assets/stylesheets/pages/merge_requests.scss @@ -527,6 +527,8 @@ } .comments-disabled-notif { + line-height: 28px; + .btn { margin-left: 5px; } diff --git a/app/controllers/projects/compare_controller.rb b/app/controllers/projects/compare_controller.rb index c6651254d70..008d2f5815f 100644 --- a/app/controllers/projects/compare_controller.rb +++ b/app/controllers/projects/compare_controller.rb @@ -61,7 +61,6 @@ class Projects::CompareController < Projects::ApplicationController @environment = EnvironmentsFinder.new(@project, current_user, environment_params).execute.last @diff_notes_disabled = true - @grouped_diff_discussions = {} end end diff --git a/app/controllers/projects/hooks_controller.rb b/app/controllers/projects/hooks_controller.rb index b668a9331e7..1e41f980f31 100644 --- a/app/controllers/projects/hooks_controller.rb +++ b/app/controllers/projects/hooks_controller.rb @@ -10,7 +10,7 @@ class Projects::HooksController < Projects::ApplicationController @hook = @project.hooks.new(hook_params) @hook.save - unless @hook.valid? + unless @hook.valid? @hooks = @project.hooks.select(&:persisted?) flash[:alert] = @hook.errors.full_messages.join.html_safe end @@ -49,7 +49,7 @@ class Projects::HooksController < Projects::ApplicationController def hook_params params.require(:hook).permit( - :build_events, + :job_events, :pipeline_events, :enable_ssl_verification, :issues_events, diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb index 5c1f7e69ee8..224b44db397 100755 --- a/app/controllers/projects/merge_requests_controller.rb +++ b/app/controllers/projects/merge_requests_controller.rb @@ -16,7 +16,6 @@ class Projects::MergeRequestsController < Projects::ApplicationController before_action :define_show_vars, only: [:show, :diffs, :commits, :conflicts, :conflict_for_path, :builds, :pipelines] before_action :define_widget_vars, only: [:merge, :cancel_merge_when_pipeline_succeeds, :merge_check] before_action :define_commit_vars, only: [:diffs] - before_action :define_diff_comment_vars, only: [:diffs] before_action :ensure_ref_fetched, only: [:show, :diffs, :commits, :builds, :conflicts, :conflict_for_path, :pipelines] before_action :close_merge_request_without_source_project, only: [:show, :diffs, :commits, :builds, :pipelines] before_action :apply_diff_view_cookie!, only: [:new_diffs] @@ -101,34 +100,11 @@ class Projects::MergeRequestsController < Projects::ApplicationController respond_to do |format| format.html { define_discussion_vars } format.json do - @merge_request_diff = - if params[:diff_id] - @merge_request.merge_request_diffs.viewable.find(params[:diff_id]) - else - @merge_request.merge_request_diff - end - - @merge_request_diffs = @merge_request.merge_request_diffs.viewable.select_without_diff - @comparable_diffs = @merge_request_diffs.select { |diff| diff.id < @merge_request_diff.id } - - if params[:start_sha].present? - @start_sha = params[:start_sha] - @start_version = @comparable_diffs.find { |diff| diff.head_commit_sha == @start_sha } - - unless @start_version - @start_sha = @merge_request_diff.head_commit_sha - @start_version = @merge_request_diff - end - end + define_diff_vars + define_diff_comment_vars @environment = @merge_request.environments_for(current_user).last - if @start_sha - compared_diff_version - else - original_diff_version - end - render json: { html: view_to_html_string("projects/merge_requests/show/_diffs") } end end @@ -140,16 +116,17 @@ class Projects::MergeRequestsController < Projects::ApplicationController def diff_for_path if params[:id] merge_request + define_diff_vars define_diff_comment_vars else build_merge_request + @diffs = @merge_request.diffs(diff_options) @diff_notes_disabled = true - @grouped_diff_discussions = {} end define_commit_vars - render_diff_for_path(@merge_request.diffs(diff_options)) + render_diff_for_path(@diffs) end def commits @@ -586,15 +563,46 @@ class Projects::MergeRequestsController < Projects::ApplicationController @base_commit = @merge_request.diff_base_commit || @merge_request.likely_diff_base_commit end + def define_diff_vars + @merge_request_diff = + if params[:diff_id] + @merge_request.merge_request_diffs.viewable.find(params[:diff_id]) + else + @merge_request.merge_request_diff + end + + @merge_request_diffs = @merge_request.merge_request_diffs.viewable.select_without_diff + @comparable_diffs = @merge_request_diffs.select { |diff| diff.id < @merge_request_diff.id } + + if params[:start_sha].present? + @start_sha = params[:start_sha] + @start_version = @comparable_diffs.find { |diff| diff.head_commit_sha == @start_sha } + + unless @start_version + @start_sha = @merge_request_diff.head_commit_sha + @start_version = @merge_request_diff + end + end + + @diffs = + if @start_sha + @merge_request_diff.compare_with(@start_sha).diffs(diff_options) + else + @merge_request_diff.diffs(diff_options) + end + end + def define_diff_comment_vars @new_diff_note_attrs = { noteable_type: 'MergeRequest', noteable_id: @merge_request.id } + @diff_notes_disabled = !@merge_request_diff.latest? || @start_sha + @use_legacy_diff_notes = !@merge_request.has_complete_diff_refs? - @grouped_diff_discussions = @merge_request.grouped_diff_discussions + @grouped_diff_discussions = @merge_request.grouped_diff_discussions(@merge_request_diff.diff_refs) @notes = prepare_notes_for_rendering(@grouped_diff_discussions.values.flatten.flat_map(&:notes)) end @@ -678,16 +686,6 @@ class Projects::MergeRequestsController < Projects::ApplicationController @merge_request = MergeRequests::BuildService.new(project, current_user, merge_request_params.merge(diff_options: diff_options)).execute end - def compared_diff_version - @diff_notes_disabled = true - @diffs = @merge_request_diff.compare_with(@start_sha).diffs(diff_options) - end - - def original_diff_version - @diff_notes_disabled = !@merge_request_diff.latest? - @diffs = @merge_request_diff.diffs(diff_options) - end - def close_merge_request_without_source_project if !@merge_request.source_project && @merge_request.open? @merge_request.close diff --git a/app/helpers/diff_helper.rb b/app/helpers/diff_helper.rb index 5e0886cc599..dc144906548 100644 --- a/app/helpers/diff_helper.rb +++ b/app/helpers/diff_helper.rb @@ -62,6 +62,8 @@ module DiffHelper end def parallel_diff_discussions(left, right, diff_file) + return unless @grouped_diff_discussions + discussions_left = discussions_right = nil if left && (left.unchanged? || left.removed?) diff --git a/app/helpers/notes_helper.rb b/app/helpers/notes_helper.rb index 5f3d89cf6cb..eab0738a368 100644 --- a/app/helpers/notes_helper.rb +++ b/app/helpers/notes_helper.rb @@ -61,12 +61,23 @@ module NotesHelper end def discussion_diff_path(discussion) - return unless discussion.diff_discussion? + if discussion.for_merge_request? && discussion.diff_discussion? + if discussion.active? + # Without a diff ID, the link always points to the latest diff version + diff_id = nil + elsif merge_request_diff = discussion.latest_merge_request_diff + diff_id = merge_request_diff.id + else + # If the discussion is not active, and we cannot find the latest + # merge request diff for this discussion, we return no path at all. + return + end - if discussion.for_merge_request? && discussion.active? - diffs_namespace_project_merge_request_path(discussion.project.namespace, discussion.project, discussion.noteable, anchor: discussion.line_code) + diffs_namespace_project_merge_request_path(discussion.project.namespace, discussion.project, discussion.noteable, diff_id: diff_id, anchor: discussion.line_code) elsif discussion.for_commit? - namespace_project_commit_path(discussion.project.namespace, discussion.project, discussion.noteable, anchor: discussion.line_code) + anchor = discussion.line_code if discussion.diff_discussion? + + namespace_project_commit_path(discussion.project.namespace, discussion.project, discussion.noteable, anchor: anchor) end end end diff --git a/app/models/commit.rb b/app/models/commit.rb index 5c452f78546..8b8b3f00202 100644 --- a/app/models/commit.rb +++ b/app/models/commit.rb @@ -326,14 +326,13 @@ class Commit end def raw_diffs(*args) - use_gitaly = Gitlab::GitalyClient.feature_enabled?(:commit_raw_diffs) - deltas_only = args.last.is_a?(Hash) && args.last[:deltas_only] - - if use_gitaly && !deltas_only - Gitlab::GitalyClient::Commit.diff_from_parent(self, *args) - else - raw.diffs(*args) - end + # NOTE: This feature is intentionally disabled until + # https://gitlab.com/gitlab-org/gitaly/issues/178 is resolved + # if Gitlab::GitalyClient.feature_enabled?(:commit_raw_diffs) + # Gitlab::GitalyClient::Commit.diff_from_parent(self, *args) + # else + raw.diffs(*args) + # end end def diffs(diff_options = nil) diff --git a/app/models/concerns/discussion_on_diff.rb b/app/models/concerns/discussion_on_diff.rb index 87db0c810c3..67b1cace3eb 100644 --- a/app/models/concerns/discussion_on_diff.rb +++ b/app/models/concerns/discussion_on_diff.rb @@ -5,8 +5,6 @@ module DiscussionOnDiff included do NUMBER_OF_TRUNCATED_DIFF_LINES = 16 - memoized_values << :active - delegate :line_code, :original_line_code, :diff_file, @@ -29,12 +27,6 @@ module DiscussionOnDiff true end - def active? - return @active if @active.present? - - @active = first_note.active? - end - # Returns an array of at most 16 highlighted lines above a diff note def truncated_diff_lines(highlight: true) lines = highlight ? highlighted_diff_lines : diff_lines diff --git a/app/models/concerns/note_on_diff.rb b/app/models/concerns/note_on_diff.rb index 1a5a7007a2b..6c27dd5aa5c 100644 --- a/app/models/concerns/note_on_diff.rb +++ b/app/models/concerns/note_on_diff.rb @@ -25,4 +25,18 @@ module NoteOnDiff def diff_attributes raise NotImplementedError end + + def active?(diff_refs = nil) + raise NotImplementedError + end + + private + + def noteable_diff_refs + if noteable.respond_to?(:diff_sha_refs) + noteable.diff_sha_refs + else + noteable.diff_refs + end + end end diff --git a/app/models/concerns/noteable.rb b/app/models/concerns/noteable.rb index 772ff6a6d2f..dd1e6630642 100644 --- a/app/models/concerns/noteable.rb +++ b/app/models/concerns/noteable.rb @@ -36,10 +36,10 @@ module Noteable .discussions(self) end - def grouped_diff_discussions + def grouped_diff_discussions(*args) # Doesn't use `discussion_notes`, because this may include commit diff notes # besides MR diff notes, that we do no want to display on the MR Changes tab. - notes.inc_relations_for_view.grouped_diff_discussions + notes.inc_relations_for_view.grouped_diff_discussions(*args) end def resolvable_discussions diff --git a/app/models/diff_discussion.rb b/app/models/diff_discussion.rb index d9b7e484e0f..6a6466b493b 100644 --- a/app/models/diff_discussion.rb +++ b/app/models/diff_discussion.rb @@ -10,6 +10,7 @@ class DiffDiscussion < Discussion delegate :position, :original_position, + :latest_merge_request_diff, to: :first_note diff --git a/app/models/diff_note.rb b/app/models/diff_note.rb index 1523244f8a8..abe4518d62a 100644 --- a/app/models/diff_note.rb +++ b/app/models/diff_note.rb @@ -65,20 +65,18 @@ class DiffNote < Note self.position.diff_refs == diff_refs end + def latest_merge_request_diff + return unless for_merge_request? + + self.noteable.merge_request_diff_for(self.position.diff_refs) + end + private def supported? for_commit? || self.noteable.has_complete_diff_refs? end - def noteable_diff_refs - if noteable.respond_to?(:diff_sha_refs) - noteable.diff_sha_refs - else - noteable.diff_refs - end - end - def set_original_position self.original_position = self.position.dup unless self.original_position&.complete? end diff --git a/app/models/label.rb b/app/models/label.rb index 568fa6d44f5..d8b0e250732 100644 --- a/app/models/label.rb +++ b/app/models/label.rb @@ -21,6 +21,8 @@ class Label < ActiveRecord::Base has_many :issues, through: :label_links, source: :target, source_type: 'Issue' has_many :merge_requests, through: :label_links, source: :target, source_type: 'MergeRequest' + before_validation :strip_whitespace_from_title_and_color + validates :color, color: true, allow_blank: false # Don't allow ',' for label titles @@ -193,4 +195,8 @@ class Label < ActiveRecord::Base def sanitize_title(value) CGI.unescapeHTML(Sanitize.clean(value.to_s)) end + + def strip_whitespace_from_title_and_color + %w(color title).each { |attr| self[attr] = self[attr]&.strip } + end end diff --git a/app/models/legacy_diff_discussion.rb b/app/models/legacy_diff_discussion.rb index cb2651a03f8..e617ce36f56 100644 --- a/app/models/legacy_diff_discussion.rb +++ b/app/models/legacy_diff_discussion.rb @@ -7,6 +7,8 @@ class LegacyDiffDiscussion < Discussion include DiscussionOnDiff + memoized_values << :active + def legacy_diff_discussion? true end @@ -15,6 +17,12 @@ class LegacyDiffDiscussion < Discussion LegacyDiffNote end + def active?(*args) + return @active if @active.present? + + @active = first_note.active?(*args) + end + def collapsed? !active? end diff --git a/app/models/legacy_diff_note.rb b/app/models/legacy_diff_note.rb index 9a77557ebcd..d7c627432d2 100644 --- a/app/models/legacy_diff_note.rb +++ b/app/models/legacy_diff_note.rb @@ -56,11 +56,12 @@ class LegacyDiffNote < Note # # If the note's current diff cannot be matched in the MergeRequest's current # diff, it's considered inactive. - def active? + def active?(diff_refs = nil) return @active if defined?(@active) return true if for_commit? return true unless diff_line return false unless noteable + return false if diff_refs && diff_refs != noteable_diff_refs noteable_diff = find_noteable_diff diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index d02fa308b9f..1d4827375d7 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -366,6 +366,14 @@ class MergeRequest < ActiveRecord::Base merge_request_diff(true) end + def merge_request_diff_for(diff_refs) + @merge_request_diffs_by_diff_refs ||= Hash.new do |h, diff_refs| + h[diff_refs] = merge_request_diffs.viewable.select_without_diff.find_by_diff_refs(diff_refs) + end + + @merge_request_diffs_by_diff_refs[diff_refs] + end + def reload_diff_if_branch_changed if source_branch_changed? || target_branch_changed? reload_diff diff --git a/app/models/merge_request_diff.rb b/app/models/merge_request_diff.rb index 6ad56b842b2..6604af2b47e 100644 --- a/app/models/merge_request_diff.rb +++ b/app/models/merge_request_diff.rb @@ -31,6 +31,10 @@ class MergeRequestDiff < ActiveRecord::Base # It allows you to override variables like head_commit_sha before getting diff. after_create :save_git_content, unless: :importing? + def self.find_by_diff_refs(diff_refs) + find_by(start_commit_sha: diff_refs.start_sha, head_commit_sha: diff_refs.head_sha, base_commit_sha: diff_refs.base_sha) + end + def self.select_without_diff select(column_names - ['st_diffs']) end @@ -130,6 +134,12 @@ class MergeRequestDiff < ActiveRecord::Base st_commits.map { |commit| commit[:id] } end + def diff_refs=(new_diff_refs) + self.base_commit_sha = new_diff_refs&.base_sha + self.start_commit_sha = new_diff_refs&.start_sha + self.head_commit_sha = new_diff_refs&.head_sha + end + def diff_refs return unless start_commit_sha || base_commit_sha diff --git a/app/models/note.rb b/app/models/note.rb index 1ea7b946061..630d0adbece 100644 --- a/app/models/note.rb +++ b/app/models/note.rb @@ -96,6 +96,7 @@ class Note < ActiveRecord::Base before_validation :set_discussion_id, on: :create after_save :keep_around_commit, unless: :for_personal_snippet? after_save :expire_etag_cache + after_destroy :expire_etag_cache class << self def model_name @@ -113,11 +114,11 @@ class Note < ActiveRecord::Base Discussion.build(notes) end - def grouped_diff_discussions + def grouped_diff_discussions(diff_refs = nil) diff_notes. fresh. discussions. - select(&:active?). + select { |n| n.active?(diff_refs) }. group_by(&:line_code) end @@ -140,6 +141,10 @@ class Note < ActiveRecord::Base true end + def latest_merge_request_diff + nil + end + def max_attachment_size current_application_settings.max_attachment_size.megabytes.to_i end diff --git a/app/models/repository.rb b/app/models/repository.rb index 526ab1e77a7..2b11ed6128e 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -963,13 +963,15 @@ class Repository end def is_ancestor?(ancestor_id, descendant_id) - Gitlab::GitalyClient.migrate(:is_ancestor) do |is_enabled| - if is_enabled - raw_repository.is_ancestor?(ancestor_id, descendant_id) - else - merge_base_commit(ancestor_id, descendant_id) == ancestor_id - end - end + # NOTE: This feature is intentionally disabled until + # https://gitlab.com/gitlab-org/gitlab-ce/issues/30586 is resolved + # Gitlab::GitalyClient.migrate(:is_ancestor) do |is_enabled| + # if is_enabled + # raw_repository.is_ancestor?(ancestor_id, descendant_id) + # else + merge_base_commit(ancestor_id, descendant_id) == ancestor_id + # end + # end end def empty_repo? diff --git a/app/policies/group_policy.rb b/app/policies/group_policy.rb index cb58c115d54..87398303c68 100644 --- a/app/policies/group_policy.rb +++ b/app/policies/group_policy.rb @@ -28,6 +28,7 @@ class GroupPolicy < BasePolicy can! :admin_namespace can! :admin_group_member can! :change_visibility_level + can! :create_subgroup if @user.can_create_group end if globally_viewable && @subject.request_access_enabled && !member diff --git a/app/views/discussions/_discussion.html.haml b/app/views/discussions/_discussion.html.haml index e04958817e4..8440fb3d785 100644 --- a/app/views/discussions/_discussion.html.haml +++ b/app/views/discussions/_discussion.html.haml @@ -20,21 +20,22 @@ = discussion.author.to_reference started a discussion + - url = discussion_diff_path(discussion) - if discussion.for_commit? && @noteable != discussion.noteable on - commit = discussion.noteable - if commit commit - - anchor = discussion.line_code if discussion.diff_discussion? - = link_to commit.short_id, namespace_project_commit_path(discussion.project.namespace, discussion.project, discussion.noteable, anchor: anchor), class: 'monospace' + = link_to commit.short_id, url, class: 'monospace' - else a deleted commit - elsif discussion.diff_discussion? on - - if discussion.active? - = link_to 'the diff', discussion_diff_path(discussion) - - else - an outdated diff + = conditional_link_to url.present?, url do + - if discussion.active? + the diff + - else + an outdated diff = time_ago_with_tooltip(discussion.created_at, placement: "bottom", html_class: "note-created-ago") = render "discussions/headline", discussion: discussion diff --git a/app/views/groups/subgroups.html.haml b/app/views/groups/subgroups.html.haml index be809083139..8f0724c0677 100644 --- a/app/views/groups/subgroups.html.haml +++ b/app/views/groups/subgroups.html.haml @@ -9,7 +9,7 @@ .nav-controls = form_tag request.path, method: :get do |f| = search_field_tag :filter_groups, params[:filter_groups], placeholder: 'Filter by name', class: 'form-control', spellcheck: false - - if can? current_user, :admin_group, @group + - if can?(current_user, :create_subgroup, @group) = link_to new_group_path(parent_id: @group.id), class: 'btn btn-new pull-right' do New Subgroup diff --git a/app/views/projects/blob/_blob.html.haml b/app/views/projects/blob/_blob.html.haml index fd0ae42571e..9aafff343f0 100644 --- a/app/views/projects/blob/_blob.html.haml +++ b/app/views/projects/blob/_blob.html.haml @@ -25,13 +25,6 @@ #blob-content-holder.blob-content-holder %article.file-holder = render "projects/blob/header", blob: blob - - if current_user - .js-file-fork-suggestion-section.file-fork-suggestion.hidden - %span.file-fork-suggestion-note - You don't have permission to edit this file. Try forking this project to edit the file. - = link_to 'Fork', fork_path, method: :post, class: 'btn btn-grouped btn-inverted btn-new' - %button.js-cancel-fork-suggestion.btn.btn-grouped{ type: 'button' } - Cancel - if blob.empty? .file-content.code diff --git a/app/views/projects/blob/_header.html.haml b/app/views/projects/blob/_header.html.haml index c42bf3c324a..7a4a293548c 100644 --- a/app/views/projects/blob/_header.html.haml +++ b/app/views/projects/blob/_header.html.haml @@ -38,3 +38,10 @@ - if current_user = replace_blob_link = delete_blob_link +- if current_user + .js-file-fork-suggestion-section.file-fork-suggestion.hidden + %span.file-fork-suggestion-note + You don't have permission to edit this file. Try forking this project to edit the file. + = link_to 'Fork', fork_path, method: :post, class: 'btn btn-grouped btn-inverted btn-new' + %button.js-cancel-fork-suggestion.btn.btn-grouped{ type: 'button' } + Cancel diff --git a/app/views/projects/diffs/_parallel_view.html.haml b/app/views/projects/diffs/_parallel_view.html.haml index f920f359de2..45c95f7ab6a 100644 --- a/app/views/projects/diffs/_parallel_view.html.haml +++ b/app/views/projects/diffs/_parallel_view.html.haml @@ -5,8 +5,7 @@ - left = line[:left] - right = line[:right] - last_line = right.new_pos if right - - unless @diff_notes_disabled - - discussions_left, discussions_right = parallel_diff_discussions(left, right, diff_file) + - discussions_left, discussions_right = parallel_diff_discussions(left, right, diff_file) %tr.line_holder.parallel - if left - case left.type diff --git a/app/views/projects/diffs/_text_file.html.haml b/app/views/projects/diffs/_text_file.html.haml index ebd1a914ee7..5f3968b6709 100644 --- a/app/views/projects/diffs/_text_file.html.haml +++ b/app/views/projects/diffs/_text_file.html.haml @@ -4,11 +4,10 @@ %a.show-suppressed-diff.js-show-suppressed-diff Changes suppressed. Click to show. %table.text-file.code.js-syntax-highlight{ data: diff_view_data, class: too_big ? 'hide' : '' } - - discussions = @grouped_diff_discussions unless @diff_notes_disabled = render partial: "projects/diffs/line", collection: diff_file.highlighted_diff_lines, as: :line, - locals: { diff_file: diff_file, discussions: discussions } + locals: { diff_file: diff_file, discussions: @grouped_diff_discussions } - if !diff_file.new_file && !diff_file.deleted_file && diff_file.highlighted_diff_lines.any? - last_line = diff_file.highlighted_diff_lines.last diff --git a/app/views/projects/merge_requests/show/_versions.html.haml b/app/views/projects/merge_requests/show/_versions.html.haml index 74a7b1dc498..547be78992e 100644 --- a/app/views/projects/merge_requests/show/_versions.html.haml +++ b/app/views/projects/merge_requests/show/_versions.html.haml @@ -72,13 +72,16 @@ = link_to namespace_project_compare_path(@project.namespace, @project, from: @start_version.base_commit_sha, to: @merge_request_diff.base_commit_sha) do new commits from - %code= @merge_request.target_branch + = succeed '.' do + %code= @merge_request.target_branch - - unless @merge_request_diff.latest? && !@start_sha + - if @diff_notes_disabled .comments-disabled-notif.content-block = icon('info-circle') - if @start_sha Comments are disabled because you're comparing two versions of this merge request. - else - Comments are disabled because you're viewing an old version of this merge request. - = link_to 'Show latest version', diffs_namespace_project_merge_request_path(@project.namespace, @project, @merge_request), class: 'btn btn-sm' + Discussions on this version of the merge request are displayed but comment creation is disabled. + + .pull-right + = link_to 'Show latest version', diffs_namespace_project_merge_request_path(@project.namespace, @project, @merge_request), class: 'btn btn-sm' diff --git a/app/workers/build_coverage_worker.rb b/app/workers/build_coverage_worker.rb index def0ab1dde1..f7ae996bb17 100644 --- a/app/workers/build_coverage_worker.rb +++ b/app/workers/build_coverage_worker.rb @@ -3,7 +3,6 @@ class BuildCoverageWorker include BuildQueue def perform(build_id) - Ci::Build.find_by(id: build_id) - .try(:update_coverage) + Ci::Build.find_by(id: build_id)&.update_coverage end end diff --git a/changelogs/unreleased/28017-separate-ce-params-on-api.yml b/changelogs/unreleased/28017-separate-ce-params-on-api.yml new file mode 100644 index 00000000000..039a8d207b0 --- /dev/null +++ b/changelogs/unreleased/28017-separate-ce-params-on-api.yml @@ -0,0 +1,4 @@ +--- +title: Separate CE params on Grape API +merge_request: +author: diff --git a/changelogs/unreleased/29056-backport-ee-cleanup-database-file.yml b/changelogs/unreleased/29056-backport-ee-cleanup-database-file.yml new file mode 100644 index 00000000000..0ebb9d57611 --- /dev/null +++ b/changelogs/unreleased/29056-backport-ee-cleanup-database-file.yml @@ -0,0 +1,4 @@ +--- +title: Turns true value and false value database methods from instance to class methods +merge_request: 10583 +author: diff --git a/changelogs/unreleased/30457-expire-note-destroy.yml b/changelogs/unreleased/30457-expire-note-destroy.yml new file mode 100644 index 00000000000..f5c89da68a9 --- /dev/null +++ b/changelogs/unreleased/30457-expire-note-destroy.yml @@ -0,0 +1,4 @@ +--- +title: Fix issue's note cache expiration after delete +merge_request: +author: mhasbini diff --git a/changelogs/unreleased/bb_save_trace.yml b/changelogs/unreleased/bb_save_trace.yml new file mode 100644 index 00000000000..6ff31f4f111 --- /dev/null +++ b/changelogs/unreleased/bb_save_trace.yml @@ -0,0 +1,5 @@ +--- +title: "[BB Importer] Save the error trace and the whole raw document to debug problems + easier" +merge_request: +author: diff --git a/changelogs/unreleased/dm-link-discussion-to-outdated-diff.yml b/changelogs/unreleased/dm-link-discussion-to-outdated-diff.yml new file mode 100644 index 00000000000..d489bada7ea --- /dev/null +++ b/changelogs/unreleased/dm-link-discussion-to-outdated-diff.yml @@ -0,0 +1,4 @@ +--- +title: Link to outdated diff in older MR version from outdated diff discussion +merge_request: +author: diff --git a/changelogs/unreleased/fix_spaces_in_label_title.yml b/changelogs/unreleased/fix_spaces_in_label_title.yml new file mode 100644 index 00000000000..51f07438edb --- /dev/null +++ b/changelogs/unreleased/fix_spaces_in_label_title.yml @@ -0,0 +1,4 @@ +--- +title: Remove heading and trailing spaces from label's color and title +merge_request: 10603 +author: blackst0ne diff --git a/changelogs/unreleased/siemens-gitlab-ce-fix-subgroup-hide-button.yml b/changelogs/unreleased/siemens-gitlab-ce-fix-subgroup-hide-button.yml new file mode 100644 index 00000000000..716311c7582 --- /dev/null +++ b/changelogs/unreleased/siemens-gitlab-ce-fix-subgroup-hide-button.yml @@ -0,0 +1,4 @@ +--- +title: Hide new subgroup button if user has no permission to create one +merge_request: 10627 +author: diff --git a/changelogs/unreleased/user-activity-scroll-bar.yml b/changelogs/unreleased/user-activity-scroll-bar.yml new file mode 100644 index 00000000000..97cccee42cb --- /dev/null +++ b/changelogs/unreleased/user-activity-scroll-bar.yml @@ -0,0 +1,4 @@ +--- +title: Fix preemptive scroll bar on user activity calendar. +merge_request: !10636 +author: diff --git a/changelogs/unreleased/zj-api-fix-build-events.yml b/changelogs/unreleased/zj-api-fix-build-events.yml new file mode 100644 index 00000000000..7700d8dcd22 --- /dev/null +++ b/changelogs/unreleased/zj-api-fix-build-events.yml @@ -0,0 +1,4 @@ +--- +title: "Bugfix: POST /projects/:id/hooks and PUT /projects/:id/hook/:hook_id no longer ignore the the job_events param in the V4 API" +merge_request: 10586 +author: diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index 3c70f35b9d0..06c9f734c2a 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -579,9 +579,9 @@ test: storages: default: path: tmp/tests/repositories/ - gitaly_address: unix:<%= Rails.root.join('tmp/sockets/private/gitaly.socket') %> + gitaly_address: unix:tmp/tests/gitaly/gitaly.socket gitaly: - enabled: false + enabled: true backup: path: tmp/tests/backups gitlab_shell: diff --git a/db/migrate/20130218141258_convert_closed_to_state_in_issue.rb b/db/migrate/20130218141258_convert_closed_to_state_in_issue.rb index 94c0a6845d5..67a0d3b53eb 100644 --- a/db/migrate/20130218141258_convert_closed_to_state_in_issue.rb +++ b/db/migrate/20130218141258_convert_closed_to_state_in_issue.rb @@ -1,6 +1,6 @@ # rubocop:disable all class ConvertClosedToStateInIssue < ActiveRecord::Migration - include Gitlab::Database + include Gitlab::Database::MigrationHelpers def up execute "UPDATE #{table_name} SET state = 'closed' WHERE closed = #{true_value}" diff --git a/db/migrate/20130218141327_convert_closed_to_state_in_merge_request.rb b/db/migrate/20130218141327_convert_closed_to_state_in_merge_request.rb index 64a9c761352..307fc6a023d 100644 --- a/db/migrate/20130218141327_convert_closed_to_state_in_merge_request.rb +++ b/db/migrate/20130218141327_convert_closed_to_state_in_merge_request.rb @@ -1,6 +1,6 @@ # rubocop:disable all class ConvertClosedToStateInMergeRequest < ActiveRecord::Migration - include Gitlab::Database + include Gitlab::Database::MigrationHelpers def up execute "UPDATE #{table_name} SET state = 'merged' WHERE closed = #{true_value} AND merged = #{true_value}" diff --git a/db/migrate/20130218141344_convert_closed_to_state_in_milestone.rb b/db/migrate/20130218141344_convert_closed_to_state_in_milestone.rb index 41508c2dc95..d12703cf3b2 100644 --- a/db/migrate/20130218141344_convert_closed_to_state_in_milestone.rb +++ b/db/migrate/20130218141344_convert_closed_to_state_in_milestone.rb @@ -1,6 +1,6 @@ # rubocop:disable all class ConvertClosedToStateInMilestone < ActiveRecord::Migration - include Gitlab::Database + include Gitlab::Database::MigrationHelpers def up execute "UPDATE #{table_name} SET state = 'closed' WHERE closed = #{true_value}" diff --git a/db/migrate/20130315124931_user_color_scheme.rb b/db/migrate/20130315124931_user_color_scheme.rb index 06e28a49d9d..09af928fde7 100644 --- a/db/migrate/20130315124931_user_color_scheme.rb +++ b/db/migrate/20130315124931_user_color_scheme.rb @@ -1,6 +1,6 @@ # rubocop:disable all class UserColorScheme < ActiveRecord::Migration - include Gitlab::Database + include Gitlab::Database::MigrationHelpers def up add_column :users, :color_scheme_id, :integer, null: false, default: 1 diff --git a/db/migrate/20131112220935_add_visibility_level_to_projects.rb b/db/migrate/20131112220935_add_visibility_level_to_projects.rb index 5efc17b228e..86d73753adc 100644 --- a/db/migrate/20131112220935_add_visibility_level_to_projects.rb +++ b/db/migrate/20131112220935_add_visibility_level_to_projects.rb @@ -1,6 +1,6 @@ # rubocop:disable all class AddVisibilityLevelToProjects < ActiveRecord::Migration - include Gitlab::Database + include Gitlab::Database::MigrationHelpers def self.up add_column :projects, :visibility_level, :integer, :default => 0, :null => false diff --git a/db/migrate/20140313092127_migrate_already_imported_projects.rb b/db/migrate/20140313092127_migrate_already_imported_projects.rb index f2e91fe1b40..0afc26b8764 100644 --- a/db/migrate/20140313092127_migrate_already_imported_projects.rb +++ b/db/migrate/20140313092127_migrate_already_imported_projects.rb @@ -1,6 +1,6 @@ # rubocop:disable all class MigrateAlreadyImportedProjects < ActiveRecord::Migration - include Gitlab::Database + include Gitlab::Database::MigrationHelpers def up execute("UPDATE projects SET import_status = 'finished' WHERE imported = #{true_value}") diff --git a/db/migrate/20141007100818_add_visibility_level_to_snippet.rb b/db/migrate/20141007100818_add_visibility_level_to_snippet.rb index 688d8578478..0c14f75c154 100644 --- a/db/migrate/20141007100818_add_visibility_level_to_snippet.rb +++ b/db/migrate/20141007100818_add_visibility_level_to_snippet.rb @@ -1,6 +1,6 @@ # rubocop:disable all class AddVisibilityLevelToSnippet < ActiveRecord::Migration - include Gitlab::Database + include Gitlab::Database::MigrationHelpers def up add_column :snippets, :visibility_level, :integer, :default => 0, :null => false diff --git a/db/migrate/20151209144329_migrate_ci_web_hooks.rb b/db/migrate/20151209144329_migrate_ci_web_hooks.rb index cb1e556623a..62a6d334f04 100644 --- a/db/migrate/20151209144329_migrate_ci_web_hooks.rb +++ b/db/migrate/20151209144329_migrate_ci_web_hooks.rb @@ -1,6 +1,6 @@ # rubocop:disable all class MigrateCiWebHooks < ActiveRecord::Migration - include Gitlab::Database + include Gitlab::Database::MigrationHelpers def up execute( diff --git a/db/migrate/20151209145909_migrate_ci_emails.rb b/db/migrate/20151209145909_migrate_ci_emails.rb index 6b7a106814d..5de7b205fb1 100644 --- a/db/migrate/20151209145909_migrate_ci_emails.rb +++ b/db/migrate/20151209145909_migrate_ci_emails.rb @@ -1,6 +1,6 @@ # rubocop:disable all class MigrateCiEmails < ActiveRecord::Migration - include Gitlab::Database + include Gitlab::Database::MigrationHelpers def up # This inserts a new service: BuildsEmailService diff --git a/db/migrate/20151210125232_migrate_ci_slack_service.rb b/db/migrate/20151210125232_migrate_ci_slack_service.rb index 633d5148d97..fff130b7b10 100644 --- a/db/migrate/20151210125232_migrate_ci_slack_service.rb +++ b/db/migrate/20151210125232_migrate_ci_slack_service.rb @@ -1,6 +1,6 @@ # rubocop:disable all class MigrateCiSlackService < ActiveRecord::Migration - include Gitlab::Database + include Gitlab::Database::MigrationHelpers def up properties_query = 'SELECT properties FROM ci_services ' \ diff --git a/db/migrate/20151210125927_migrate_ci_hip_chat_service.rb b/db/migrate/20151210125927_migrate_ci_hip_chat_service.rb index dae084ce180..824f6f84195 100644 --- a/db/migrate/20151210125927_migrate_ci_hip_chat_service.rb +++ b/db/migrate/20151210125927_migrate_ci_hip_chat_service.rb @@ -1,6 +1,6 @@ # rubocop:disable all class MigrateCiHipChatService < ActiveRecord::Migration - include Gitlab::Database + include Gitlab::Database::MigrationHelpers def up # From properties strip `hipchat_` key diff --git a/db/post_migrate/20170301205640_migrate_build_events_to_pipeline_events.rb b/db/post_migrate/20170301205640_migrate_build_events_to_pipeline_events.rb index 2dd14ee5a78..04bf89c9687 100644 --- a/db/post_migrate/20170301205640_migrate_build_events_to_pipeline_events.rb +++ b/db/post_migrate/20170301205640_migrate_build_events_to_pipeline_events.rb @@ -1,6 +1,5 @@ class MigrateBuildEventsToPipelineEvents < ActiveRecord::Migration include Gitlab::Database::MigrationHelpers - include Gitlab::Database DOWNTIME = false diff --git a/doc/ci/img/pipelines.png b/doc/ci/img/pipelines.png Binary files differindex 5937e9d99c8..a604fcb2587 100644 --- a/doc/ci/img/pipelines.png +++ b/doc/ci/img/pipelines.png diff --git a/doc/development/fe_guide/testing.md b/doc/development/fe_guide/testing.md index 8d3513d3566..a4631fd0073 100644 --- a/doc/development/fe_guide/testing.md +++ b/doc/development/fe_guide/testing.md @@ -13,10 +13,19 @@ for more information on general testing practices at GitLab. ## Karma test suite GitLab uses the [Karma][karma] test runner with [Jasmine][jasmine] as its test -framework for our JavaScript unit tests. For tests that rely on DOM +framework for our JavaScript unit tests. For tests that rely on DOM manipulation we use fixtures which are pre-compiled from HAML source files and served during testing by the [jasmine-jquery][jasmine-jquery] plugin. +JavaScript tests live in `spec/javascripts/`, matching the folder structure +of `app/assets/javascripts/`: `app/assets/javascripts/behaviors/autosize.js` +has a corresponding `spec/javascripts/behaviors/autosize_spec.js` file. + +Keep in mind that in a CI environment, these tests are run in a headless +browser and you will not have access to certain APIs, such as +[`Notification`](https://developer.mozilla.org/en-US/docs/Web/API/notification), +which will have to be stubbed. + ### Running frontend tests `rake karma` runs the frontend-only (JavaScript) tests. @@ -80,24 +89,23 @@ If an integration test depends on JavaScript to run correctly, you need to make sure the spec is configured to enable JavaScript when the tests are run. If you don't do this you'll see vague error messages from the spec runner. -To enable a JavaScript driver in an `rspec` test, add `js: true` to the +To enable a JavaScript driver in an `rspec` test, add `:js` to the individual spec or the context block containing multiple specs that need JavaScript enabled: ```ruby - # For one spec -it 'presents information about abuse report', js: true do - # assertions... +it 'presents information about abuse report', :js do + # assertions... end -describe "Admin::AbuseReports", js: true do - it 'presents information about abuse report' do - # assertions... - end - it 'shows buttons for adding to abuse report' do - # assertions... - end +describe "Admin::AbuseReports", :js do + it 'presents information about abuse report' do + # assertions... + end + it 'shows buttons for adding to abuse report' do + # assertions... + end end ``` @@ -113,13 +121,12 @@ file for the failing spec, add the `@javascript` flag above the Scenario: ``` @javascript Scenario: Developer can approve merge request - Given I am a "Shop" developer - And I visit project "Shop" merge requests page - And merge request 'Bug NS-04' must be approved - And I click link "Bug NS-04" - When I click link "Approve" - Then I should see approved merge request "Bug NS-04" - + Given I am a "Shop" developer + And I visit project "Shop" merge requests page + And merge request 'Bug NS-04' must be approved + And I click link "Bug NS-04" + When I click link "Approve" + Then I should see approved merge request "Bug NS-04" ``` [capybara]: http://teamcapybara.github.io/capybara/ diff --git a/doc/development/testing.md b/doc/development/testing.md index 5bc958f5a96..ad540ec13db 100644 --- a/doc/development/testing.md +++ b/doc/development/testing.md @@ -9,52 +9,179 @@ this guide defines a rule that contradicts the thoughtbot guide, this guide takes precedence. Some guidelines may be repeated verbatim to stress their importance. -## Factories +## Definitions + +### Unit tests + +Formal definition: https://en.wikipedia.org/wiki/Unit_testing + +These kind of tests ensure that a single unit of code (a method) works as +expected (given an input, it has a predictable output). These tests should be +isolated as much as possible. For example, model methods that don't do anything +with the database shouldn't need a DB record. Classes that don't need database +records should use stubs/doubles as much as possible. + +| Code path | Tests path | Testing engine | Notes | +| --------- | ---------- | -------------- | ----- | +| `app/finders/` | `spec/finders/` | RSpec | | +| `app/helpers/` | `spec/helpers/` | RSpec | | +| `app/db/{post_,}migrate/` | `spec/migrations/` | RSpec | | +| `app/policies/` | `spec/policies/` | RSpec | | +| `app/presenters/` | `spec/presenters/` | RSpec | | +| `app/routing/` | `spec/routing/` | RSpec | | +| `app/serializers/` | `spec/serializers/` | RSpec | | +| `app/services/` | `spec/services/` | RSpec | | +| `app/tasks/` | `spec/tasks/` | RSpec | | +| `app/uploaders/` | `spec/uploaders/` | RSpec | | +| `app/views/` | `spec/views/` | RSpec | | +| `app/workers/` | `spec/workers/` | RSpec | | +| `app/assets/javascripts/` | `spec/javascripts/` | Karma | More details in the [JavaScript](#javascript) section. | + +### Integration tests + +Formal definition: https://en.wikipedia.org/wiki/Integration_testing + +These kind of tests ensure that individual parts of the application work well together, without the overhead of the actual app environment (i.e. the browser). These tests should assert at the request/response level: status code, headers, body. They're useful to test permissions, redirections, what view is rendered etc. + +| Code path | Tests path | Testing engine | Notes | +| --------- | ---------- | -------------- | ----- | +| `app/controllers/` | `spec/controllers/` | RSpec | | +| `app/mailers/` | `spec/mailers/` | RSpec | | +| `lib/api/` | `spec/requests/api/` | RSpec | | +| `lib/ci/api/` | `spec/requests/ci/api/` | RSpec | | +| `app/assets/javascripts/` | `spec/javascripts/` | Karma | More details in the [JavaScript](#javascript) section. | + +#### About controller tests + +In an ideal world, controllers should be thin. However, when this is not the +case, it's acceptable to write a system/feature test without JavaScript instead +of a controller test. The reason is that testing a fat controller usually +involves a lot of stubbing, things like: -GitLab uses [factory_girl] as a test fixture replacement. - -- Factory definitions live in `spec/factories/`, named using the pluralization - of their corresponding model (`User` factories are defined in `users.rb`). -- There should be only one top-level factory definition per file. -- FactoryGirl methods are mixed in to all RSpec groups. This means you can (and - should) call `create(...)` instead of `FactoryGirl.create(...)`. -- Make use of [traits] to clean up definitions and usages. -- When defining a factory, don't define attributes that are not required for the - resulting record to pass validation. -- When instantiating from a factory, don't supply attributes that aren't - required by the test. -- Factories don't have to be limited to `ActiveRecord` objects. - [See example](https://gitlab.com/gitlab-org/gitlab-ce/commit/0b8cefd3b2385a21cfed779bd659978c0402766d). - -[factory_girl]: https://github.com/thoughtbot/factory_girl -[traits]: http://www.rubydoc.info/gems/factory_girl/file/GETTING_STARTED.md#Traits - -## JavaScript - -GitLab uses [Karma] to run its [Jasmine] JavaScript specs. They can be run on -the command line via `bundle exec karma`. - -- JavaScript tests live in `spec/javascripts/`, matching the folder structure - of `app/assets/javascripts/`: `app/assets/javascripts/behaviors/autosize.js` - has a corresponding `spec/javascripts/behaviors/autosize_spec.js` file. -- Haml fixtures required for JavaScript tests live in - `spec/javascripts/fixtures`. They should contain the bare minimum amount of - markup necessary for the test. - - > **Warning:** Keep in mind that a Rails view may change and - invalidate your test, but everything will still pass because your fixture - doesn't reflect the latest view. Because of this we encourage you to - generate fixtures from actual rails views whenever possible. - -- Keep in mind that in a CI environment, these tests are run in a headless - browser and you will not have access to certain APIs, such as - [`Notification`](https://developer.mozilla.org/en-US/docs/Web/API/notification), - which will have to be stubbed. - -[Karma]: https://github.com/karma-runner/karma -[Jasmine]: https://github.com/jasmine/jasmine +```ruby +controller.instance_variable_set(:@user, user) +``` -For more information, see the [frontend testing guide](fe_guide/testing.md). +and use methods which are deprecated in Rails 5 ([#23768]). + +[#23768]: https://gitlab.com/gitlab-org/gitlab-ce/issues/23768 + +#### About Karma + +As you may have noticed, Karma is both in the Unit tests and the Integration +tests category. That's because Karma is a tool that provides an environment to +run JavaScript tests, so you can either run unit tests (e.g. test a single +JavaScript method), or integration tests (e.g. test a component that is composed +of multiple components). + +### System tests or Feature tests + +Formal definition: https://en.wikipedia.org/wiki/System_testing. + +These kind of tests ensure the application works as expected from a user point +of view (aka black-box testing). These tests should test a happy path for a +given page or set of pages, and a test case should be added for any regression +that couldn't have been caught at lower levels with better tests (i.e. if a +regression is found, regression tests should be added at the lowest-level +possible). + +| Tests path | Testing engine | Notes | +| ---------- | -------------- | ----- | +| `spec/features/` | [Capybara] + [RSpec] | If your spec has the `:js` metadata, the browser driver will be [Poltergeist], otherwise it's using [RackTest]. | +| `features/` | Spinach | Spinach tests are deprecated, [you shouldn't add new Spinach tests](#spinach-feature-tests). | + +[Capybara]: https://github.com/teamcapybara/capybara +[RSpec]: https://github.com/rspec/rspec-rails#feature-specs +[Poltergeist]: https://github.com/teamcapybara/capybara#poltergeist +[RackTest]: https://github.com/teamcapybara/capybara#racktest + +#### Best practices + +- Create only the necessary records in the database +- Test a happy path and a less happy path but that's it +- Every other possible path should be tested with Unit or Integration tests +- Test what's displayed on the page, not the internals of ActiveRecord models. + For instance, if you want to verify that a record was created, add + expectations that its attributes are displayed on the page, not that + `Model.count` increased by one. +- It's ok to look for DOM elements but don't abuse it since it makes the tests + more brittle + +If we're confident that the low-level components work well (and we should be if +we have enough Unit & Integration tests), we shouldn't need to duplicate their +thorough testing at the System test level. + +It's very easy to add tests, but a lot harder to remove or improve tests, so one +should take care of not introducing too many (slow and duplicated) specs. + +The reasons why we should follow these best practices are as follows: + +- System tests are slow to run since they spin up the entire application stack + in a headless browser, and even slower when they integrate a JS driver +- When system tests run with a JavaScript driver, the tests are run in a + different thread than the application. This means it does not share a + database connection and your test will have to commit the transactions in + order for the running application to see the data (and vice-versa). In that + case we need to truncate the database after each spec instead of simply + rolling back a transaction (the faster strategy that's in use for other kind + of tests). This is slower than transactions, however, so we want to use + truncation only when necessary. + +### Black-box tests or End-to-end tests + +GitLab consists of [multiple pieces] such as [GitLab Shell], [GitLab Workhorse], +[Gitaly], [GitLab Pages], [GitLab Runner], and GitLab Rails. All theses pieces +are configured and packaged by [GitLab Omnibus]. + +[GitLab QA] is a tool that allows to test that all these pieces integrate well +together by building a Docker image for a given version of GitLab Rails and +running feature tests (i.e. using Capybara) against it. + +The actual test scenarios and steps are [part of GitLab Rails] so that they're +always in-sync with the codebase. + +[multiple pieces]: ./architecture.md#components +[GitLab Shell]: https://gitlab.com/gitlab-org/gitlab-shell +[GitLab Workhorse]: https://gitlab.com/gitlab-org/gitlab-workhorse +[Gitaly]: https://gitlab.com/gitlab-org/gitaly +[GitLab Pages]: https://gitlab.com/gitlab-org/gitlab-pages +[GitLab Runner]: https://gitlab.com/gitlab-org/gitlab-ci-multi-runner +[GitLab Omnibus]: https://gitlab.com/gitlab-org/omnibus-gitlab +[GitLab QA]: https://gitlab.com/gitlab-org/gitlab-qa +[part of GitLab Rails]: https://gitlab.com/gitlab-org/gitlab-ce/tree/master/qa + +## How to test at the correct level? + +As many things in life, deciding what to test at each level of testing is a +trade-off: + +- Unit tests are usually cheap, and you should consider them like the basement + of your house: you need them to be confident that your code is behaving + correctly. However if you run only unit tests without integration / system tests, you might [miss] the [big] [picture]! +- Integration tests are a bit more expensive, but don't abuse them. A feature test + is often better than an integration test that is stubbing a lot of internals. +- System tests are expensive (compared to unit tests), even more if they require + a JavaScript driver. Make sure to follow the guidelines in the [Speed](#test-speed) + section. + +Another way to see it is to think about the "cost of tests", this is well +explained [in this article][tests-cost] and the basic idea is that the cost of a +test includes: + +- The time it takes to write the test +- The time it takes to run the test every time the suite runs +- The time it takes to understand the test +- The time it takes to fix the test if it breaks and the underlying code is OK +- Maybe, the time it takes to change the code to make the code testable. + +[miss]: https://twitter.com/ThePracticalDev/status/850748070698651649 +[big]: https://twitter.com/timbray/status/822470746773409794 +[picture]: https://twitter.com/withzombies/status/829716565834752000 +[tests-cost]: https://medium.com/table-xi/high-cost-tests-and-high-value-tests-a86e27a54df#.2ulyh3a4e + +## Frontend testing + +Please consult the [dedicated "Frontend testing" guide](./fe_guide/testing.md). ## RSpec @@ -117,53 +244,124 @@ it 'is overdue' do end ``` -### Test speed +### System / Feature tests -GitLab has a massive test suite that, without parallelization, can take more -than an hour to run. It's important that we make an effort to write tests that -are accurate and effective _as well as_ fast. +- Feature specs should be named `ROLE_ACTION_spec.rb`, such as + `user_changes_password_spec.rb`. +- Use only one `feature` block per feature spec file. +- Use scenario titles that describe the success and failure paths. +- Avoid scenario titles that add no information, such as "successfully". +- Avoid scenario titles that repeat the feature title. -Here are some things to keep in mind regarding test performance: +### Matchers -- `double` and `spy` are faster than `FactoryGirl.build(...)` -- `FactoryGirl.build(...)` and `.build_stubbed` are faster than `.create`. -- Don't `create` an object when `build`, `build_stubbed`, `attributes_for`, - `spy`, or `double` will do. Database persistence is slow! -- Use `create(:empty_project)` instead of `create(:project)` when you don't need - the underlying Git repository. Filesystem operations are slow! -- Don't mark a feature as requiring JavaScript (through `@javascript` in - Spinach or `js: true` in RSpec) unless it's _actually_ required for the test - to be valid. Headless browser testing is slow! +Custom matchers should be created to clarify the intent and/or hide the +complexity of RSpec expectations.They should be placed under +`spec/support/matchers/`. Matchers can be placed in subfolder if they apply to +a certain type of specs only (e.g. features, requests etc.) but shouldn't be if +they apply to multiple type of specs. -### Features / Integration +### Shared contexts -GitLab uses [rspec-rails feature specs] to test features in a browser -environment. These are [capybara] specs running on the headless [poltergeist] -driver. +All shared contexts should be be placed under `spec/support/shared_contexts/`. +Shared contexts can be placed in subfolder if they apply to a certain type of +specs only (e.g. features, requests etc.) but shouldn't be if they apply to +multiple type of specs. -- Feature specs live in `spec/features/` and should be named - `ROLE_ACTION_spec.rb`, such as `user_changes_password_spec.rb`. -- Use only one `feature` block per feature spec file. -- Use scenario titles that describe the success and failure paths. -- Avoid scenario titles that add no information, such as "successfully." -- Avoid scenario titles that repeat the feature title. +Each file should include only one context and have a descriptive name, e.g. +`spec/support/shared_contexts/controllers/githubish_import_controller_shared_context.rb`. -[rspec-rails feature specs]: https://github.com/rspec/rspec-rails#feature-specs -[capybara]: https://github.com/teamcapybara/capybara -[poltergeist]: https://github.com/teampoltergeist/poltergeist +### Shared examples -## Spinach (feature) tests +All shared examples should be be placed under `spec/support/shared_examples/`. +Shared examples can be placed in subfolder if they apply to a certain type of +specs only (e.g. features, requests etc.) but shouldn't be if they apply to +multiple type of specs. -GitLab [moved from Cucumber to Spinach](https://github.com/gitlabhq/gitlabhq/pull/1426) -for its feature/integration tests in September 2012. +Each file should include only one context and have a descriptive name, e.g. +`spec/support/shared_examples/controllers/githubish_import_controller_shared_example.rb`. -As of March 2016, we are [trying to avoid adding new Spinach -tests](https://gitlab.com/gitlab-org/gitlab-ce/issues/14121) going forward, -opting for [RSpec feature](#features-integration) specs. +### Helpers -Adding new Spinach scenarios is acceptable _only if_ the new scenario requires -no more than one new `step` definition. If more than that is required, the -test should be re-implemented using RSpec instead. +Helpers are usually modules that provide some methods to hide the complexity of +specific RSpec examples. You can define helpers in RSpec files if they're not +intended to be shared with other specs. Otherwise, they should be be placed +under `spec/support/helpers/`. Helpers can be placed in subfolder if they apply +to a certain type of specs only (e.g. features, requests etc.) but shouldn't be +if they apply to multiple type of specs. + +Helpers should follow the Rails naming / namespacing convention. For instance +`spec/support/helpers/cycle_analytics_helpers.rb` should define: + +```ruby +module Spec + module Support + module Helpers + module CycleAnalyticsHelpers + def create_commit_referencing_issue(issue, branch_name: random_git_name) + project.repository.add_branch(user, branch_name, 'master') + create_commit("Commit for ##{issue.iid}", issue.project, user, branch_name) + end + end + end + end +end +``` + +Helpers should not change the RSpec config. For instance, the helpers module +described above should not include: + +```ruby +RSpec.configure do |config| + config.include Spec::Support::Helpers::CycleAnalyticsHelpers +end +``` + +### Factories + +GitLab uses [factory_girl] as a test fixture replacement. + +- Factory definitions live in `spec/factories/`, named using the pluralization + of their corresponding model (`User` factories are defined in `users.rb`). +- There should be only one top-level factory definition per file. +- FactoryGirl methods are mixed in to all RSpec groups. This means you can (and + should) call `create(...)` instead of `FactoryGirl.create(...)`. +- Make use of [traits] to clean up definitions and usages. +- When defining a factory, don't define attributes that are not required for the + resulting record to pass validation. +- When instantiating from a factory, don't supply attributes that aren't + required by the test. +- Factories don't have to be limited to `ActiveRecord` objects. + [See example](https://gitlab.com/gitlab-org/gitlab-ce/commit/0b8cefd3b2385a21cfed779bd659978c0402766d). + +[factory_girl]: https://github.com/thoughtbot/factory_girl +[traits]: http://www.rubydoc.info/gems/factory_girl/file/GETTING_STARTED.md#Traits + +### Fixtures + +All fixtures should be be placed under `spec/fixtures/`. + +### Config + +RSpec config files are files that change the RSpec config (i.e. +`RSpec.configure do |config|` blocks). They should be placed under +`spec/support/config/`. + +Each file should be related to a specific domain, e.g. +`spec/support/config/capybara.rb`, `spec/support/config/carrierwave.rb`, etc. + +Helpers can be included in the `spec/support/config/rspec.rb` file. If a +helpers module applies only to a certain kind of specs, it should add modifiers +to the `config.include` call. For instance if +`spec/support/helpers/cycle_analytics_helpers.rb` applies to `:lib` and +`type: :model` specs only, you would write the following: + +```ruby +RSpec.configure do |config| + config.include Spec::Support::Helpers::CycleAnalyticsHelpers, :lib + config.include Spec::Support::Helpers::CycleAnalyticsHelpers, type: :model +end +``` ## Testing Rake Tasks @@ -201,6 +399,77 @@ describe 'gitlab:shell rake tasks' do end ``` +## Test speed + +GitLab has a massive test suite that, without [parallelization], can take hours +to run. It's important that we make an effort to write tests that are accurate +and effective _as well as_ fast. + +Here are some things to keep in mind regarding test performance: + +- `double` and `spy` are faster than `FactoryGirl.build(...)` +- `FactoryGirl.build(...)` and `.build_stubbed` are faster than `.create`. +- Don't `create` an object when `build`, `build_stubbed`, `attributes_for`, + `spy`, or `double` will do. Database persistence is slow! +- Use `create(:empty_project)` instead of `create(:project)` when you don't need + the underlying Git repository. Filesystem operations are slow! +- Don't mark a feature as requiring JavaScript (through `@javascript` in + Spinach or `:js` in RSpec) unless it's _actually_ required for the test + to be valid. Headless browser testing is slow! + +[parallelization]: #test-suite-parallelization-on-the-ci + +### Test suite parallelization on the CI + +Our current CI parallelization setup is as follows: + +1. The `knapsack` job in the prepare stage that is supposed to ensure we have a + `knapsack/${CI_PROJECT_NAME}/rspec_report-master.json` file: + - The `knapsack/${CI_PROJECT_NAME}/rspec_report-master.json` file is fetched + from S3, if it's not here we initialize the file with `{}`. +1. Each `rspec x y` job are run with `knapsack rspec` and should have an evenly + distributed share of tests: + - It works because the jobs have access to the + `knapsack/${CI_PROJECT_NAME}/rspec_report-master.json` since the "artifacts + from all previous stages are passed by default". [^1] + - the jobs set their own report path to + `KNAPSACK_REPORT_PATH=knapsack/${CI_PROJECT_NAME}/${JOB_NAME[0]}_node_${CI_NODE_INDEX}_${CI_NODE_TOTAL}_report.json`. + - if knapsack is doing its job, test files that are run should be listed under + `Report specs`, not under `Leftover specs`. +1. The `update-knapsack` job takes all the + `knapsack/${CI_PROJECT_NAME}/${JOB_NAME[0]}_node_${CI_NODE_INDEX}_${CI_NODE_TOTAL}_report.json` + files from the `rspec x y` jobs and merge them all together into a single + `knapsack/${CI_PROJECT_NAME}/rspec_report-master.json` file that is then + uploaded to S3. + +After that, the next pipeline will use the up-to-date +`knapsack/${CI_PROJECT_NAME}/rspec_report-master.json` file. The same strategy +is used for Spinach tests as well. + +### Monitoring + +The GitLab test suite is [monitored] and a [public dashboard] is available for +everyone to see. Feel free to look at the slowest test files and try to improve +them. + +[monitored]: ./performance.md#rspec-profiling +[public dashboard]: https://redash.gitlab.com/public/dashboards/l1WhHXaxrCWM5Ai9D7YDqHKehq6OU3bx5gssaiWe?org_slug=default + +## Spinach (feature) tests + +GitLab [moved from Cucumber to Spinach](https://github.com/gitlabhq/gitlabhq/pull/1426) +for its feature/integration tests in September 2012. + +As of March 2016, we are [trying to avoid adding new Spinach +tests](https://gitlab.com/gitlab-org/gitlab-ce/issues/14121) going forward, +opting for [RSpec feature](#features-integration) specs. + +Adding new Spinach scenarios is acceptable _only if_ the new scenario requires +no more than one new `step` definition. If more than that is required, the +test should be re-implemented using RSpec instead. + --- [Return to Development documentation](README.md) + +[^1]: /ci/yaml/README.html#dependencies diff --git a/doc/install/installation.md b/doc/install/installation.md index 5b72c2cce07..1f61a4f67bb 100644 --- a/doc/install/installation.md +++ b/doc/install/installation.md @@ -289,9 +289,9 @@ sudo usermod -aG redis git ### Clone the Source # Clone GitLab repository - sudo -u git -H git clone https://gitlab.com/gitlab-org/gitlab-ce.git -b 9-0-stable gitlab + sudo -u git -H git clone https://gitlab.com/gitlab-org/gitlab-ce.git -b 9-1-stable gitlab -**Note:** You can change `9-0-stable` to `master` if you want the *bleeding edge* version, but never install master on a production server! +**Note:** You can change `9-1-stable` to `master` if you want the *bleeding edge* version, but never install master on a production server! ### Configure It @@ -475,7 +475,7 @@ with setting up Gitaly until you upgrade to GitLab 9.2 or later. sudo -u git cp config.toml.example config.toml # If you are using non-default settings you need to update config.toml sudo -u git -H editor config.toml - + # Enable Gitaly in the init script echo 'gitaly_enabled=true' | sudo tee -a /etc/default/gitlab diff --git a/doc/topics/authentication/index.md b/doc/topics/authentication/index.md new file mode 100644 index 00000000000..47d3f05999d --- /dev/null +++ b/doc/topics/authentication/index.md @@ -0,0 +1,46 @@ +# Authentication + +This page gathers all the resources for the topic **Authentication** within GitLab. + +## GitLab users + +- [SSH](../../ssh/README.md) +- [Two-Factor Authentication (2FA)](../../user/profile/account/two_factor_authentication.md#two-factor-authentication) +- **Articles:** + - [Support for Universal 2nd Factor Authentication - YubiKeys](https://about.gitlab.com/2016/06/22/gitlab-adds-support-for-u2f/) + - [Security Webcast with Yubico](https://about.gitlab.com/2016/08/31/gitlab-and-yubico-security-webcast/) +- **Integrations:** + - [GitLab as OAuth2 authentication service provider](../../integration/oauth_provider.md#introduction-to-oauth) + +## GitLab administrators + +- [LDAP (Community Edition)](../../administration/auth/ldap.md) +- [LDAP (Enterprise Edition)](https://docs.gitlab.com/ee/administration/auth/ldap-ee.md) +- [Enforce Two-factor Authentication (2FA)](../../security/two_factor_authentication.md#enforce-two-factor-authentication-2fa) +- **Articles:** + - [Feature Highlight: LDAP Integration](https://about.gitlab.com/2014/07/10/feature-highlight-ldap-sync/) + - [Debugging LDAP](https://about.gitlab.com/handbook/support/workflows/ldap/debugging_ldap.md) +- **Integrations:** + - [OmniAuth](../../integration/omniauth.md) + - [Authentiq OmniAuth Provider](../../administration/auth/authentiq.md#authentiq-omniauth-provider) + - [Atlassian Crowd OmniAuth Provider](../../administration/auth/crowd.md) + - [CAS OmniAuth Provider](../../integration/cas.md) + - [SAML OmniAuth Provider](../../integration/saml.md) + - [Okta SSO provider](../../administration/auth/okta.md) + - [Kerberos integration (GitLab EE)](https://docs.gitlab.com/ee/integration/kerberos.md) + +## API + +- [OAuth 2 Tokens](../../api/README.md#oauth-2-tokens) +- [Private Tokens](../../api/README.md#private-tokens) +- [Impersonation tokens](../../api/README.md#impersonation-tokens) +- [GitLab as an OAuth2 provider](../../api/oauth2.md#gitlab-as-an-oauth2-provider) +- [GitLab Runner API - Authentication](../../api/ci/runners.md#authentication) + +## Third-party resources + +- [Kanboard Plugin GitLab Authentication](https://kanboard.net/plugin/gitlab-auth) +- [Jenkins GitLab OAuth Plugin](https://wiki.jenkins-ci.org/display/JENKINS/GitLab+OAuth+Plugin) +- [Setup Gitlab CE with Active Directory authentication](https://www.caseylabs.com/setup-gitlab-ce-with-active-directory-authentication/) +- [How to customize GitLab to support OpenID authentication](http://eric.van-der-vlist.com/blog/2013/11/23/how-to-customize-gitlab-to-support-openid-authentication/) +- [Openshift - Configuring Authentication and User Agent](https://docs.openshift.org/latest/install_config/configuring_authentication.html#GitLab) diff --git a/doc/topics/git/index.md b/doc/topics/git/index.md new file mode 100644 index 00000000000..b99ba317a43 --- /dev/null +++ b/doc/topics/git/index.md @@ -0,0 +1,61 @@ +# Git documentation + +Git is a [free and open source](https://git-scm.com/about/free-and-open-source) +distributed version control system designed to handle everything from small to +very large projects with speed and efficiency. + +[GitLab](https://about.gitlab.com) is a Git-based fully integrated platform for +software development. Besides Git's functionalities, GitLab has a lot of +powerful [features](https://about.gitlab.com/features/) to enhance your +[workflow](https://about.gitlab.com/2016/10/25/gitlab-workflow-an-overview/). + +We've gathered some resources to help you to get the best from Git with GitLab. + +## Getting started + +- [Git concepts](../../university/training/user_training.md#git-concepts) +- [Start using Git on the command line](../../gitlab-basics/start-using-git.md) +- [Command Line basic commands](../../gitlab-basics/command-line-commands.md) +- [GitLab Git Cheat Sheet (download)](https://gitlab.com/gitlab-com/marketing/raw/master/design/print/git-cheatsheet/print-pdf/git-cheatsheet.pdf) +- **Articles:** + - [Git Tips & Tricks](https://about.gitlab.com/2016/12/08/git-tips-and-tricks/) + - [Eight Tips to help you work better with Git](https://about.gitlab.com/2015/02/19/8-tips-to-help-you-work-better-with-git/) +- **Presentations:** + - [GLU Course: About Version Control](https://docs.google.com/presentation/d/16sX7hUrCZyOFbpvnrAFrg6tVO5_yT98IgdAqOmXwBho/edit?usp=sharing) +- **Third-party resources:** + - What is [Git](https://git-scm.com) + - [Version control](https://git-scm.com/book/en/v2/Getting-Started-About-Version-Control) + - [Getting Started - Git Basics](https://git-scm.com/book/en/v2/Getting-Started-Git-Basics) + - [Getting Started - Installing Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) + - [Git on the Server - GitLab](https://git-scm.com/book/en/v2/Git-on-the-Server-GitLab) + +## Branching strategies + +- **Articles:** + - [GitLab Flow](https://about.gitlab.com/2014/09/29/gitlab-flow/) +- **Third-party resources:** + - [Git Branching - Branches in a Nutshell](https://git-scm.com/book/en/v2/Git-Branching-Branches-in-a-Nutshell) + - [Git Branching - Branching Workflows](https://git-scm.com/book/en/v2/Git-Branching-Branching-Workflows) + +## Advanced use + +- [Custom Git Hooks](../../administration/custom_hooks.md) +- [Git Attributes](../../user/project/git_attributes.md) +- Git Submodules: [Using Git submodules with GitLab CI](../../ci/git_submodules.md#using-git-submodules-with-gitlab-ci) + +## API + +- [Gitignore templates](../../api/templates/gitignores.md) + +## Git LFS + +- [Git LFS](../../workflow/lfs/manage_large_binaries_with_git_lfs.md) +- [Git-Annex to Git-LFS migration guide](https://docs.gitlab.com/ee/workflow/lfs/migrate_from_git_annex_to_git_lfs.html) +- **Articles:** + - [Getting Started with Git LFS](https://about.gitlab.com/2017/01/30/getting-started-with-git-lfs-tutorial/) + - [Towards a production quality open source Git LFS server](https://about.gitlab.com/2015/08/13/towards-a-production-quality-open-source-git-lfs-server/) + +## General information + +- **Articles:** + - [The future of SaaS hosted Git repository pricing](https://about.gitlab.com/2016/05/11/git-repository-pricing/) diff --git a/doc/topics/index.md b/doc/topics/index.md index 6de13d79554..4a16f6f629c 100644 --- a/doc/topics/index.md +++ b/doc/topics/index.md @@ -7,10 +7,9 @@ you through better understanding GitLab's concepts through our regular docs, and, when available, through articles (guides, tutorials, technical overviews, blog posts) and videos. -- [GitLab Installation](../install/README.md) - [Continuous Integration (GitLab CI)](../ci/README.md) +- [Git](git/index.md) +- [GitLab Installation](../install/README.md) - [GitLab Pages](../user/project/pages/index.md) ->**Note:** -Non-linked topics are currently under development and subjected to change. -More topics will be available soon. +>**Note:** More topics will be available soon.
\ No newline at end of file diff --git a/doc/update/9.0-to-9.1.md b/doc/update/9.0-to-9.1.md index ae983dea384..1191662ee14 100644 --- a/doc/update/9.0-to-9.1.md +++ b/doc/update/9.0-to-9.1.md @@ -1,9 +1,5 @@ # From 9.0 to 9.1 -** TODO: ** - -# TODO clean out 9.0-specific stuff - Make sure you view this update guide from the tag (version) of GitLab you would like to install. In most cases this should be the highest numbered production tag (without rc in it). You can select the tag in the version dropdown at the diff --git a/doc/user/project/cycle_analytics.md b/doc/user/project/cycle_analytics.md index 62afd8cf247..8f6b530c033 100644 --- a/doc/user/project/cycle_analytics.md +++ b/doc/user/project/cycle_analytics.md @@ -5,10 +5,10 @@ Cycle Analytics measures the time it takes to go from an [idea to production] for each project you have. This is achieved by not only indicating the total time it -takes to reach at that point, but the total time is broken down into the +takes to reach that point, but the total time is broken down into the multiple stages an idea has to pass through to be shipped. -Cycle Analytics is that it is tightly coupled with the [GitLab flow] and +Cycle Analytics is tightly coupled with the [GitLab flow] and calculates a separate median for each stage. ## Overview diff --git a/lib/api/groups.rb b/lib/api/groups.rb index 32bbf956d7f..09d105f6b4c 100644 --- a/lib/api/groups.rb +++ b/lib/api/groups.rb @@ -5,11 +5,16 @@ module API before { authenticate! } helpers do - params :optional_params do + params :optional_params_ce do optional :description, type: String, desc: 'The description of the group' optional :visibility, type: String, values: Gitlab::VisibilityLevel.string_values, desc: 'The visibility of the group' optional :lfs_enabled, type: Boolean, desc: 'Enable/disable LFS for the projects in this group' optional :request_access_enabled, type: Boolean, desc: 'Allow users to request member access' + optional :share_with_group_lock, type: Boolean, desc: 'Prevent sharing a project with another group within this group' + end + + params :optional_params do + use :optional_params_ce end params :statistics_params do diff --git a/lib/api/issues.rb b/lib/api/issues.rb index 09053e615cb..05423c17449 100644 --- a/lib/api/issues.rb +++ b/lib/api/issues.rb @@ -30,7 +30,7 @@ module API use :pagination end - params :issue_params do + params :issue_params_ce do optional :description, type: String, desc: 'The description of an issue' optional :assignee_id, type: Integer, desc: 'The ID of a user to assign issue' optional :milestone_id, type: Integer, desc: 'The ID of a milestone to assign issue' @@ -38,6 +38,10 @@ module API optional :due_date, type: String, desc: 'Date time string in the format YEAR-MONTH-DAY' optional :confidential, type: Boolean, desc: 'Boolean parameter if the issue should be confidential' end + + params :issue_params do + use :issue_params_ce + end end resource :issues do diff --git a/lib/api/merge_requests.rb b/lib/api/merge_requests.rb index c8033664133..cb7aec47cf0 100644 --- a/lib/api/merge_requests.rb +++ b/lib/api/merge_requests.rb @@ -33,13 +33,17 @@ module API end end - params :optional_params do + params :optional_params_ce do optional :description, type: String, desc: 'The description of the merge request' optional :assignee_id, type: Integer, desc: 'The ID of a user to assign the merge request' optional :milestone_id, type: Integer, desc: 'The ID of a milestone to assign the merge request' optional :labels, type: String, desc: 'Comma-separated list of label names' optional :remove_source_branch, type: Boolean, desc: 'Remove source branch when merging' end + + params :optional_params do + use :optional_params_ce + end end desc 'List merge requests' do @@ -145,14 +149,24 @@ module API success Entities::MergeRequest end params do + # CE + at_least_one_of_ce = [ + :assignee_id, + :description, + :labels, + :milestone_id, + :remove_source_branch, + :state_event, + :target_branch, + :title + ] optional :title, type: String, allow_blank: false, desc: 'The title of the merge request' optional :target_branch, type: String, allow_blank: false, desc: 'The target branch' optional :state_event, type: String, values: %w[close reopen], desc: 'Status of the merge request' + use :optional_params - at_least_one_of :title, :target_branch, :description, :assignee_id, - :milestone_id, :labels, :state_event, - :remove_source_branch + at_least_one_of(*at_least_one_of_ce) end put ':id/merge_requests/:merge_request_iid' do merge_request = find_merge_request_with_access(params.delete(:merge_request_iid), :update_merge_request) @@ -173,6 +187,7 @@ module API success Entities::MergeRequest end params do + # CE optional :merge_commit_message, type: String, desc: 'Custom merge commit message' optional :should_remove_source_branch, type: Boolean, desc: 'When true, the source branch will be deleted if possible' diff --git a/lib/api/project_hooks.rb b/lib/api/project_hooks.rb index 53791166c33..87dfd1573a4 100644 --- a/lib/api/project_hooks.rb +++ b/lib/api/project_hooks.rb @@ -13,7 +13,7 @@ module API optional :merge_requests_events, type: Boolean, desc: "Trigger hook on merge request events" optional :tag_push_events, type: Boolean, desc: "Trigger hook on tag push events" optional :note_events, type: Boolean, desc: "Trigger hook on note(comment) events" - optional :build_events, type: Boolean, desc: "Trigger hook on build events" + optional :job_events, type: Boolean, desc: "Trigger hook on job events" optional :pipeline_events, type: Boolean, desc: "Trigger hook on pipeline events" optional :wiki_page_events, type: Boolean, desc: "Trigger hook on wiki events" optional :enable_ssl_verification, type: Boolean, desc: "Do SSL verification when triggering the hook" @@ -53,7 +53,10 @@ module API use :project_hook_properties end post ":id/hooks" do - hook = user_project.hooks.new(declared_params(include_missing: false)) + hook_params = declared_params(include_missing: false) + hook_params[:build_events] = hook_params.delete(:job_events) { false } + + hook = user_project.hooks.new(hook_params) if hook.save present hook, with: Entities::ProjectHook @@ -74,7 +77,10 @@ module API put ":id/hooks/:hook_id" do hook = user_project.hooks.find(params.delete(:hook_id)) - if hook.update_attributes(declared_params(include_missing: false)) + update_params = declared_params(include_missing: false) + update_params[:build_events] = update_params.delete(:job_events) if update_params[:job_events] + + if hook.update_attributes(update_params) present hook, with: Entities::ProjectHook else error!("Invalid url given", 422) if hook.errors[:url].present? diff --git a/lib/api/projects.rb b/lib/api/projects.rb index 766fbea53e6..50842370947 100644 --- a/lib/api/projects.rb +++ b/lib/api/projects.rb @@ -6,7 +6,7 @@ module API before { authenticate_non_get! } helpers do - params :optional_params do + params :optional_params_ce do optional :description, type: String, desc: 'The description of the project' optional :issues_enabled, type: Boolean, desc: 'Flag indication if the issue tracker is enabled' optional :merge_requests_enabled, type: Boolean, desc: 'Flag indication if merge requests are enabled' @@ -22,6 +22,10 @@ module API optional :only_allow_merge_if_pipeline_succeeds, type: Boolean, desc: 'Only allow to merge if builds succeed' optional :only_allow_merge_if_all_discussions_are_resolved, type: Boolean, desc: 'Only allow to merge if all discussions are resolved' end + + params :optional_params do + use :optional_params_ce + end end resource :projects do @@ -198,17 +202,33 @@ module API success Entities::Project end params do + # CE + at_least_one_of_ce = + [ + :builds_enabled, + :container_registry_enabled, + :default_branch, + :description, + :issues_enabled, + :lfs_enabled, + :merge_requests_enabled, + :name, + :only_allow_merge_if_all_discussions_are_resolved, + :only_allow_merge_if_pipeline_succeeds, + :path, + :public_builds, + :request_access_enabled, + :shared_runners_enabled, + :snippets_enabled, + :visibility, + :wiki_enabled, + ] optional :name, type: String, desc: 'The name of the project' optional :default_branch, type: String, desc: 'The default branch of the project' optional :path, type: String, desc: 'The path of the repository' + use :optional_params - at_least_one_of :name, :description, :issues_enabled, :merge_requests_enabled, - :wiki_enabled, :builds_enabled, :snippets_enabled, - :shared_runners_enabled, :container_registry_enabled, - :lfs_enabled, :visibility, :public_builds, - :request_access_enabled, :only_allow_merge_if_pipeline_succeeds, - :only_allow_merge_if_all_discussions_are_resolved, :path, - :default_branch + at_least_one_of(*at_least_one_of_ce) end put ':id' do authorize_admin_project diff --git a/lib/api/settings.rb b/lib/api/settings.rb index c7f97ad2aab..d01c7f2703b 100644 --- a/lib/api/settings.rb +++ b/lib/api/settings.rb @@ -20,6 +20,55 @@ module API success Entities::ApplicationSetting end params do + # CE + at_least_one_of_ce = [ + :admin_notification_email, + :after_sign_out_path, + :after_sign_up_text, + :akismet_enabled, + :container_registry_token_expire_delay, + :default_artifacts_expire_in, + :default_branch_protection, + :default_group_visibility, + :default_project_visibility, + :default_projects_limit, + :default_snippet_visibility, + :disabled_oauth_sign_in_sources, + :domain_blacklist_enabled, + :domain_whitelist, + :email_author_in_body, + :enabled_git_access_protocol, + :gravatar_enabled, + :help_page_text, + :home_page_url, + :housekeeping_enabled, + :html_emails_enabled, + :import_sources, + :koding_enabled, + :max_artifacts_size, + :max_attachment_size, + :max_pages_size, + :metrics_enabled, + :plantuml_enabled, + :polling_interval_multiplier, + :recaptcha_enabled, + :repository_checks_enabled, + :repository_storage, + :require_two_factor_authentication, + :restricted_visibility_levels, + :send_user_confirmation_email, + :sentry_enabled, + :session_expire_delay, + :shared_runners_enabled, + :sidekiq_throttling_enabled, + :sign_in_text, + :signin_enabled, + :signup_enabled, + :terminal_max_session_time, + :user_default_external, + :user_oauth_applications, + :version_check_enabled + ] optional :default_branch_protection, type: Integer, values: [0, 1, 2], desc: 'Determine if developers can push to master' optional :default_project_visibility, type: String, values: Gitlab::VisibilityLevel.string_values, desc: 'The default project visibility' optional :default_snippet_visibility, type: String, values: Gitlab::VisibilityLevel.string_values, desc: 'The default snippet visibility' @@ -111,22 +160,8 @@ module API end optional :terminal_max_session_time, type: Integer, desc: 'Maximum time for web terminal websocket connection (in seconds). Set to 0 for unlimited time.' optional :polling_interval_multiplier, type: BigDecimal, desc: 'Interval multiplier used by endpoints that perform polling. Set to 0 to disable polling.' - at_least_one_of :default_branch_protection, :default_project_visibility, :default_snippet_visibility, - :default_group_visibility, :restricted_visibility_levels, :import_sources, - :enabled_git_access_protocol, :gravatar_enabled, :default_projects_limit, - :max_attachment_size, :session_expire_delay, :disabled_oauth_sign_in_sources, - :user_oauth_applications, :user_default_external, :signup_enabled, - :send_user_confirmation_email, :domain_whitelist, :domain_blacklist_enabled, - :after_sign_up_text, :signin_enabled, :require_two_factor_authentication, - :home_page_url, :after_sign_out_path, :sign_in_text, :help_page_text, - :shared_runners_enabled, :max_artifacts_size, - :default_artifacts_expire_in, :max_pages_size, - :container_registry_token_expire_delay, - :metrics_enabled, :sidekiq_throttling_enabled, :recaptcha_enabled, - :akismet_enabled, :admin_notification_email, :sentry_enabled, - :repository_storage, :repository_checks_enabled, :koding_enabled, :plantuml_enabled, - :version_check_enabled, :email_author_in_body, :html_emails_enabled, - :housekeeping_enabled, :terminal_max_session_time, :polling_interval_multiplier + + at_least_one_of(*at_least_one_of_ce) end put "application/settings" do attrs = declared_params(include_missing: false) diff --git a/lib/api/users.rb b/lib/api/users.rb index 6f40f92240a..eedc59f8636 100644 --- a/lib/api/users.rb +++ b/lib/api/users.rb @@ -37,11 +37,13 @@ module API success Entities::UserBasic end params do + # CE optional :username, type: String, desc: 'Get a single user with a specific username' optional :search, type: String, desc: 'Search for a username' optional :active, type: Boolean, default: false, desc: 'Filters only active users' optional :external, type: Boolean, default: false, desc: 'Filters only external users' optional :blocked, type: Boolean, default: false, desc: 'Filters only blocked users' + use :pagination end get do diff --git a/lib/bitbucket/representation/base.rb b/lib/bitbucket/representation/base.rb index 94adaacc9b5..800d5a075c6 100644 --- a/lib/bitbucket/representation/base.rb +++ b/lib/bitbucket/representation/base.rb @@ -1,6 +1,8 @@ module Bitbucket module Representation class Base + attr_reader :raw + def initialize(raw) @raw = raw end @@ -8,10 +10,6 @@ module Bitbucket def self.decorate(entries) entries.map { |entry| new(entry)} end - - private - - attr_reader :raw end end end diff --git a/lib/gitlab/bitbucket_import/importer.rb b/lib/gitlab/bitbucket_import/importer.rb index f4efa20374a..5a6d9ae99a0 100644 --- a/lib/gitlab/bitbucket_import/importer.rb +++ b/lib/gitlab/bitbucket_import/importer.rb @@ -149,7 +149,7 @@ module Gitlab description += @formatter.author_line(pull_request.author) unless find_user_id(pull_request.author) description += pull_request.description - merge_request = project.merge_requests.create( + merge_request = project.merge_requests.create!( iid: pull_request.iid, title: pull_request.title, description: description, @@ -168,7 +168,7 @@ module Gitlab import_pull_request_comments(pull_request, merge_request) if merge_request.persisted? rescue StandardError => e - errors << { type: :pull_request, iid: pull_request.iid, errors: e.message } + errors << { type: :pull_request, iid: pull_request.iid, errors: e.message, trace: e.backtrace.join("\n"), raw_response: pull_request.raw } end end end diff --git a/lib/gitlab/ci/trace/stream.rb b/lib/gitlab/ci/trace/stream.rb index 2af94e2c60e..41dcf846fed 100644 --- a/lib/gitlab/ci/trace/stream.rb +++ b/lib/gitlab/ci/trace/stream.rb @@ -76,11 +76,14 @@ module Gitlab stream.each_line do |line| matches = line.scan(regex) next unless matches.is_a?(Array) + next if matches.empty? match = matches.flatten.last coverage = match.gsub(/\d+(\.\d+)?/).first - return coverage.to_f if coverage.present? + return coverage if coverage.present? end + + nil rescue # if bad regex or something goes wrong we dont want to interrupt transition # so we just silentrly ignore error for now diff --git a/lib/gitlab/database.rb b/lib/gitlab/database.rb index 63b8d0d3b9d..d0bd1299671 100644 --- a/lib/gitlab/database.rb +++ b/lib/gitlab/database.rb @@ -57,16 +57,16 @@ module Gitlab postgresql? ? "RANDOM()" : "RAND()" end - def true_value - if Gitlab::Database.postgresql? + def self.true_value + if postgresql? "'t'" else 1 end end - def false_value - if Gitlab::Database.postgresql? + def self.false_value + if postgresql? "'f'" else 0 diff --git a/lib/gitlab/database/migration_helpers.rb b/lib/gitlab/database/migration_helpers.rb index 525aa920328..21f1b32d467 100644 --- a/lib/gitlab/database/migration_helpers.rb +++ b/lib/gitlab/database/migration_helpers.rb @@ -114,6 +114,14 @@ module Gitlab execute('SET statement_timeout TO 0') if Database.postgresql? end + def true_value + Database.true_value + end + + def false_value + Database.false_value + end + # Updates the value of a column in batches. # # This method updates the table in batches of 5% of the total row count. diff --git a/lib/gitlab/diff/diff_refs.rb b/lib/gitlab/diff/diff_refs.rb index 8406ca4269c..7948782aecc 100644 --- a/lib/gitlab/diff/diff_refs.rb +++ b/lib/gitlab/diff/diff_refs.rb @@ -18,6 +18,12 @@ module Gitlab head_sha == other.head_sha end + alias_method :eql?, :== + + def hash + [base_sha, start_sha, head_sha].hash + end + # There is only one case in which we will have `start_sha` and `head_sha`, # but not `base_sha`, which is when a diff is generated between an # orphaned branch and another branch, which means there _is_ no base, but diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb index 41ab73abb56..d7dac9f6149 100644 --- a/lib/gitlab/git/repository.rb +++ b/lib/gitlab/git/repository.rb @@ -45,13 +45,15 @@ module Gitlab # Default branch in the repository def root_ref - @root_ref ||= Gitlab::GitalyClient.migrate(:root_ref) do |is_enabled| - if is_enabled - gitaly_ref_client.default_branch_name - else - discover_default_branch - end - end + # NOTE: This feature is intentionally disabled until + # https://gitlab.com/gitlab-org/gitaly/issues/179 is resolved + # @root_ref ||= Gitlab::GitalyClient.migrate(:root_ref) do |is_enabled| + # if is_enabled + # gitaly_ref_client.default_branch_name + # else + @root_ref ||= discover_default_branch + # end + # end rescue GRPC::BadStatus => e raise CommandError.new(e) end @@ -70,13 +72,15 @@ module Gitlab # Returns an Array of branch names # sorted by name ASC def branch_names - Gitlab::GitalyClient.migrate(:branch_names) do |is_enabled| - if is_enabled - gitaly_ref_client.branch_names - else - branches.map(&:name) - end - end + # Gitlab::GitalyClient.migrate(:branch_names) do |is_enabled| + # NOTE: This feature is intentionally disabled until + # https://gitlab.com/gitlab-org/gitaly/issues/179 is resolved + # if is_enabled + # gitaly_ref_client.branch_names + # else + branches.map(&:name) + # end + # end rescue GRPC::BadStatus => e raise CommandError.new(e) end @@ -131,13 +135,15 @@ module Gitlab # Returns an Array of tag names def tag_names - Gitlab::GitalyClient.migrate(:tag_names) do |is_enabled| - if is_enabled - gitaly_ref_client.tag_names - else - rugged.tags.map { |t| t.name } - end - end + # Gitlab::GitalyClient.migrate(:tag_names) do |is_enabled| + # NOTE: This feature is intentionally disabled until + # https://gitlab.com/gitlab-org/gitaly/issues/179 is resolved + # if is_enabled + # gitaly_ref_client.tag_names + # else + rugged.tags.map { |t| t.name } + # end + # end rescue GRPC::BadStatus => e raise CommandError.new(e) end @@ -458,17 +464,19 @@ module Gitlab # Returns a RefName for a given SHA def ref_name_for_sha(ref_path, sha) - Gitlab::GitalyClient.migrate(:find_ref_name) do |is_enabled| - if is_enabled - gitaly_ref_client.find_ref_name(sha, ref_path) - else - args = %W(#{Gitlab.config.git.bin_path} for-each-ref --count=1 #{ref_path} --contains #{sha}) - - # Not found -> ["", 0] - # Found -> ["b8d95eb4969eefacb0a58f6a28f6803f8070e7b9 commit\trefs/environments/production/77\n", 0] - Gitlab::Popen.popen(args, @path).first.split.last - end - end + # NOTE: This feature is intentionally disabled until + # https://gitlab.com/gitlab-org/gitaly/issues/180 is resolved + # Gitlab::GitalyClient.migrate(:find_ref_name) do |is_enabled| + # if is_enabled + # gitaly_ref_client.find_ref_name(sha, ref_path) + # else + args = %W(#{Gitlab.config.git.bin_path} for-each-ref --count=1 #{ref_path} --contains #{sha}) + + # Not found -> ["", 0] + # Found -> ["b8d95eb4969eefacb0a58f6a28f6803f8070e7b9 commit\trefs/environments/production/77\n", 0] + Gitlab::Popen.popen(args, @path).first.split.last + # end + # end end # Returns commits collection diff --git a/lib/tasks/gitlab/update_templates.rake b/lib/tasks/gitlab/update_templates.rake index dbdfb335a5c..cb2adc81c9d 100644 --- a/lib/tasks/gitlab/update_templates.rake +++ b/lib/tasks/gitlab/update_templates.rake @@ -44,7 +44,7 @@ namespace :gitlab do ), Template.new( "https://gitlab.com/gitlab-org/gitlab-ci-yml.git", - /(\.{1,2}|LICENSE|Pages|autodeploy|\.gitlab-ci.yml)\z/ + /(\.{1,2}|LICENSE|CONTRIBUTING.md|Pages|autodeploy|\.gitlab-ci.yml)\z/ ) ].freeze diff --git a/qa/qa/page/main/menu.rb b/qa/qa/page/main/menu.rb index 45db7a92fa4..7ce4e9009f5 100644 --- a/qa/qa/page/main/menu.rb +++ b/qa/qa/page/main/menu.rb @@ -11,7 +11,7 @@ module QA end def go_to_admin_area - within_user_menu { click_link 'Admin Area' } + within_user_menu { click_link 'Admin area' } end def sign_out diff --git a/spec/factories/notes.rb b/spec/factories/notes.rb index 90c35e2c7f8..93f4903119c 100644 --- a/spec/factories/notes.rb +++ b/spec/factories/notes.rb @@ -40,6 +40,7 @@ FactoryGirl.define do transient do line_number 14 + diff_refs { noteable.try(:diff_refs) } end position do @@ -48,7 +49,7 @@ FactoryGirl.define do new_path: "files/ruby/popen.rb", old_line: nil, new_line: line_number, - diff_refs: noteable.try(:diff_refs) + diff_refs: diff_refs ) end diff --git a/spec/features/discussion_comments/commit_spec.rb b/spec/features/discussion_comments/commit_spec.rb new file mode 100644 index 00000000000..96e0b78f6b9 --- /dev/null +++ b/spec/features/discussion_comments/commit_spec.rb @@ -0,0 +1,18 @@ +require 'spec_helper' + +describe 'Discussion Comments Merge Request', :feature, :js do + include RepoHelpers + + let(:user) { create(:user) } + let(:project) { create(:project) } + let(:merge_request) { create(:merge_request, source_project: project) } + + before do + project.add_master(user) + login_as(user) + + visit namespace_project_commit_path(project.namespace, project, sample_commit.id) + end + + it_behaves_like 'discussion comments', 'commit' +end diff --git a/spec/features/discussion_comments/issue_spec.rb b/spec/features/discussion_comments/issue_spec.rb new file mode 100644 index 00000000000..ccc9efccd18 --- /dev/null +++ b/spec/features/discussion_comments/issue_spec.rb @@ -0,0 +1,16 @@ +require 'spec_helper' + +describe 'Discussion Comments Issue', :feature, :js do + let(:user) { create(:user) } + let(:project) { create(:empty_project) } + let(:issue) { create(:issue, project: project) } + + before do + project.add_master(user) + login_as(user) + + visit namespace_project_issue_path(project.namespace, project, issue) + end + + it_behaves_like 'discussion comments', 'issue' +end diff --git a/spec/features/discussion_comments/merge_request_spec.rb b/spec/features/discussion_comments/merge_request_spec.rb new file mode 100644 index 00000000000..f99ebeb9cd9 --- /dev/null +++ b/spec/features/discussion_comments/merge_request_spec.rb @@ -0,0 +1,16 @@ +require 'spec_helper' + +describe 'Discussion Comments Merge Request', :feature, :js do + let(:user) { create(:user) } + let(:project) { create(:project) } + let(:merge_request) { create(:merge_request, source_project: project) } + + before do + project.add_master(user) + login_as(user) + + visit namespace_project_merge_request_path(project.namespace, project, merge_request) + end + + it_behaves_like 'discussion comments', 'merge request' +end diff --git a/spec/features/discussion_comments/snippets_spec.rb b/spec/features/discussion_comments/snippets_spec.rb new file mode 100644 index 00000000000..19a306511b2 --- /dev/null +++ b/spec/features/discussion_comments/snippets_spec.rb @@ -0,0 +1,16 @@ +require 'spec_helper' + +describe 'Discussion Comments Issue', :feature, :js do + let(:user) { create(:user) } + let(:project) { create(:empty_project) } + let(:snippet) { create(:project_snippet, :private, project: project, author: user) } + + before do + project.add_master(user) + login_as(user) + + visit namespace_project_snippet_path(project.namespace, project, snippet) + end + + it_behaves_like 'discussion comments', 'snippet' +end diff --git a/spec/features/merge_requests/discussion_spec.rb b/spec/features/merge_requests/discussion_spec.rb new file mode 100644 index 00000000000..f59d0faa274 --- /dev/null +++ b/spec/features/merge_requests/discussion_spec.rb @@ -0,0 +1,51 @@ +require 'spec_helper' + +feature 'Merge Request Discussions', feature: true do + before do + login_as :admin + end + + context "Diff discussions" do + let(:merge_request) { create(:merge_request, importing: true) } + let(:project) { merge_request.source_project } + let!(:old_merge_request_diff) { merge_request.merge_request_diffs.create(diff_refs: outdated_diff_refs) } + let!(:new_merge_request_diff) { merge_request.merge_request_diffs.create } + + let!(:outdated_discussion) { create(:diff_note_on_merge_request, project: project, noteable: merge_request, position: outdated_position).to_discussion } + let!(:active_discussion) { create(:diff_note_on_merge_request, noteable: merge_request, project: project).to_discussion } + + let(:outdated_position) do + Gitlab::Diff::Position.new( + old_path: "files/ruby/popen.rb", + new_path: "files/ruby/popen.rb", + old_line: nil, + new_line: 9, + diff_refs: outdated_diff_refs + ) + end + + let(:outdated_diff_refs) { project.commit("874797c3a73b60d2187ed6e2fcabd289ff75171e").diff_refs } + + before(:each) do + visit namespace_project_merge_request_path(project.namespace, project, merge_request) + end + + context 'active discussions' do + it 'shows a link to the diff' do + within(".discussion[data-discussion-id='#{active_discussion.id}']") do + path = diffs_namespace_project_merge_request_path(project.namespace, project, merge_request, anchor: active_discussion.line_code) + expect(page).to have_link('the diff', href: path) + end + end + end + + context 'outdated discussions' do + it 'shows a link to the outdated diff' do + within(".discussion[data-discussion-id='#{outdated_discussion.id}']") do + path = diffs_namespace_project_merge_request_path(project.namespace, project, merge_request, diff_id: old_merge_request_diff.id, anchor: outdated_discussion.line_code) + expect(page).to have_link('an outdated diff', href: path) + end + end + end + end +end diff --git a/spec/features/merge_requests/merge_request_versions_spec.rb b/spec/features/merge_requests/versions_spec.rb index 04e85ed3f73..68a68f5d3f3 100644 --- a/spec/features/merge_requests/merge_request_versions_spec.rb +++ b/spec/features/merge_requests/versions_spec.rb @@ -36,8 +36,23 @@ feature 'Merge Request versions', js: true, feature: true do expect(page).to have_content '5 changed files' end - it 'show the message about disabled comments' do - expect(page).to have_content 'Comments are disabled' + it 'show the message about disabled comment creation' do + expect(page).to have_content 'comment creation is disabled' + end + + it 'shows comments that were last relevant at that version' do + position = Gitlab::Diff::Position.new( + old_path: ".gitmodules", + new_path: ".gitmodules", + old_line: nil, + new_line: 4, + diff_refs: merge_request_diff1.diff_refs + ) + outdated_diff_note = create(:diff_note_on_merge_request, project: project, noteable: merge_request, position: position) + outdated_diff_note.position = outdated_diff_note.original_position + outdated_diff_note.save! + + expect(page).to have_css(".diffs .notes[data-discussion-id='#{outdated_diff_note.discussion_id}']") end end diff --git a/spec/javascripts/lib/utils/poll_spec.js b/spec/javascripts/lib/utils/poll_spec.js index e3429c2a1cb..918b6d32c43 100644 --- a/spec/javascripts/lib/utils/poll_spec.js +++ b/spec/javascripts/lib/utils/poll_spec.js @@ -4,6 +4,20 @@ import Poll from '~/lib/utils/poll'; Vue.use(VueResource); +const waitForAllCallsToFinish = (service, waitForCount, successCallback) => { + const timer = () => { + setTimeout(() => { + if (service.fetch.calls.count() === waitForCount) { + successCallback(); + } else { + timer(); + } + }, 5); + }; + + timer(); +}; + class ServiceMock { constructor(endpoint) { this.service = Vue.resource(endpoint); @@ -16,6 +30,7 @@ class ServiceMock { describe('Poll', () => { let callbacks; + let service; beforeEach(() => { callbacks = { @@ -23,8 +38,11 @@ describe('Poll', () => { error: () => {}, }; + service = new ServiceMock('endpoint'); + spyOn(callbacks, 'success'); spyOn(callbacks, 'error'); + spyOn(service, 'fetch').and.callThrough(); }); it('calls the success callback when no header for interval is provided', (done) => { @@ -35,19 +53,20 @@ describe('Poll', () => { Vue.http.interceptors.push(successInterceptor); new Poll({ - resource: new ServiceMock('endpoint'), + resource: service, method: 'fetch', successCallback: callbacks.success, errorCallback: callbacks.error, }).makeRequest(); - setTimeout(() => { + waitForAllCallsToFinish(service, 1, () => { expect(callbacks.success).toHaveBeenCalled(); expect(callbacks.error).not.toHaveBeenCalled(); + + Vue.http.interceptors = _.without(Vue.http.interceptors, successInterceptor); + done(); }, 0); - - Vue.http.interceptors = _.without(Vue.http.interceptors, successInterceptor); }); it('calls the error callback whe the http request returns an error', (done) => { @@ -58,19 +77,19 @@ describe('Poll', () => { Vue.http.interceptors.push(errorInterceptor); new Poll({ - resource: new ServiceMock('endpoint'), + resource: service, method: 'fetch', successCallback: callbacks.success, errorCallback: callbacks.error, }).makeRequest(); - setTimeout(() => { + waitForAllCallsToFinish(service, 1, () => { expect(callbacks.success).not.toHaveBeenCalled(); expect(callbacks.error).toHaveBeenCalled(); - done(); - }, 0); + Vue.http.interceptors = _.without(Vue.http.interceptors, errorInterceptor); - Vue.http.interceptors = _.without(Vue.http.interceptors, errorInterceptor); + done(); + }); }); it('should call the success callback when the interval header is -1', (done) => { @@ -81,7 +100,7 @@ describe('Poll', () => { Vue.http.interceptors.push(intervalInterceptor); new Poll({ - resource: new ServiceMock('endpoint'), + resource: service, method: 'fetch', successCallback: callbacks.success, errorCallback: callbacks.error, @@ -90,10 +109,11 @@ describe('Poll', () => { setTimeout(() => { expect(callbacks.success).toHaveBeenCalled(); expect(callbacks.error).not.toHaveBeenCalled(); + + Vue.http.interceptors = _.without(Vue.http.interceptors, intervalInterceptor); + done(); }, 0); - - Vue.http.interceptors = _.without(Vue.http.interceptors, intervalInterceptor); }); it('starts polling when http status is 200 and interval header is provided', (done) => { @@ -103,26 +123,28 @@ describe('Poll', () => { Vue.http.interceptors.push(pollInterceptor); - const service = new ServiceMock('endpoint'); - spyOn(service, 'fetch').and.callThrough(); - - new Poll({ + const Polling = new Poll({ resource: service, method: 'fetch', data: { page: 1 }, successCallback: callbacks.success, errorCallback: callbacks.error, - }).makeRequest(); + }); + + Polling.makeRequest(); + + waitForAllCallsToFinish(service, 2, () => { + Polling.stop(); - setTimeout(() => { expect(service.fetch.calls.count()).toEqual(2); expect(service.fetch).toHaveBeenCalledWith({ page: 1 }); expect(callbacks.success).toHaveBeenCalled(); expect(callbacks.error).not.toHaveBeenCalled(); - done(); - }, 5); - Vue.http.interceptors = _.without(Vue.http.interceptors, pollInterceptor); + Vue.http.interceptors = _.without(Vue.http.interceptors, pollInterceptor); + + done(); + }); }); describe('stop', () => { @@ -133,9 +155,6 @@ describe('Poll', () => { Vue.http.interceptors.push(pollInterceptor); - const service = new ServiceMock('endpoint'); - spyOn(service, 'fetch').and.callThrough(); - const Polling = new Poll({ resource: service, method: 'fetch', @@ -150,14 +169,15 @@ describe('Poll', () => { Polling.makeRequest(); - setTimeout(() => { + waitForAllCallsToFinish(service, 1, () => { expect(service.fetch.calls.count()).toEqual(1); expect(service.fetch).toHaveBeenCalledWith({ page: 1 }); expect(Polling.stop).toHaveBeenCalled(); - done(); - }, 100); - Vue.http.interceptors = _.without(Vue.http.interceptors, pollInterceptor); + Vue.http.interceptors = _.without(Vue.http.interceptors, pollInterceptor); + + done(); + }); }); }); @@ -169,10 +189,6 @@ describe('Poll', () => { Vue.http.interceptors.push(pollInterceptor); - const service = new ServiceMock('endpoint'); - - spyOn(service, 'fetch').and.callThrough(); - const Polling = new Poll({ resource: service, method: 'fetch', @@ -187,17 +203,22 @@ describe('Poll', () => { }); spyOn(Polling, 'stop').and.callThrough(); + spyOn(Polling, 'restart').and.callThrough(); Polling.makeRequest(); - setTimeout(() => { + waitForAllCallsToFinish(service, 2, () => { + Polling.stop(); + expect(service.fetch.calls.count()).toEqual(2); expect(service.fetch).toHaveBeenCalledWith({ page: 1 }); expect(Polling.stop).toHaveBeenCalled(); - done(); - }, 10); + expect(Polling.restart).toHaveBeenCalled(); - Vue.http.interceptors = _.without(Vue.http.interceptors, pollInterceptor); + Vue.http.interceptors = _.without(Vue.http.interceptors, pollInterceptor); + + done(); + }); }); }); }); diff --git a/spec/lib/gitlab/ci/trace/stream_spec.rb b/spec/lib/gitlab/ci/trace/stream_spec.rb index f1a1a71c528..2e57ccef182 100644 --- a/spec/lib/gitlab/ci/trace/stream_spec.rb +++ b/spec/lib/gitlab/ci/trace/stream_spec.rb @@ -167,7 +167,7 @@ describe Gitlab::Ci::Trace::Stream do let(:data) { 'Coverage 1033 / 1051 LOC (98.29%) covered' } let(:regex) { '\(\d+.\d+\%\) covered' } - it { is_expected.to eq(98.29) } + it { is_expected.to eq("98.29") } end context 'valid content & bad regex' do @@ -188,14 +188,14 @@ describe Gitlab::Ci::Trace::Stream do let(:data) { ' (98.39%) covered. (98.29%) covered' } let(:regex) { '\(\d+.\d+\%\) covered' } - it { is_expected.to eq(98.29) } + it { is_expected.to eq("98.29") } end context 'using a regex capture' do let(:data) { 'TOTAL 9926 3489 65%' } let(:regex) { 'TOTAL\s+\d+\s+\d+\s+(\d{1,3}\%)' } - it { is_expected.to eq(65) } + it { is_expected.to eq("65") } end end end diff --git a/spec/lib/gitlab/ci/trace_spec.rb b/spec/lib/gitlab/ci/trace_spec.rb index 69e8dc9220d..9cb0b62590a 100644 --- a/spec/lib/gitlab/ci/trace_spec.rb +++ b/spec/lib/gitlab/ci/trace_spec.rb @@ -40,12 +40,24 @@ describe Gitlab::Ci::Trace do describe '#extract_coverage' do let(:regex) { '\(\d+.\d+\%\) covered' } - before do - trace.set('Coverage 1033 / 1051 LOC (98.29%) covered') + context 'matching coverage' do + before do + trace.set('Coverage 1033 / 1051 LOC (98.29%) covered') + end + + it "returns valid coverage" do + expect(trace.extract_coverage(regex)).to eq("98.29") + end end - it "returns valid coverage" do - expect(trace.extract_coverage(regex)).to eq(98.29) + context 'no coverage' do + before do + trace.set('No coverage') + end + + it 'returs nil' do + expect(trace.extract_coverage(regex)).to be_nil + end end end diff --git a/spec/lib/gitlab/database/migration_helpers_spec.rb b/spec/lib/gitlab/database/migration_helpers_spec.rb index 4ac79454647..bc43bcf0714 100644 --- a/spec/lib/gitlab/database/migration_helpers_spec.rb +++ b/spec/lib/gitlab/database/migration_helpers_spec.rb @@ -175,6 +175,50 @@ describe Gitlab::Database::MigrationHelpers, lib: true do end end + describe '#true_value' do + context 'using PostgreSQL' do + before do + expect(Gitlab::Database).to receive(:postgresql?).and_return(true) + end + + it 'returns the appropriate value' do + expect(model.true_value).to eq("'t'") + end + end + + context 'using MySQL' do + before do + expect(Gitlab::Database).to receive(:postgresql?).and_return(false) + end + + it 'returns the appropriate value' do + expect(model.true_value).to eq(1) + end + end + end + + describe '#false_value' do + context 'using PostgreSQL' do + before do + expect(Gitlab::Database).to receive(:postgresql?).and_return(true) + end + + it 'returns the appropriate value' do + expect(model.false_value).to eq("'f'") + end + end + + context 'using MySQL' do + before do + expect(Gitlab::Database).to receive(:postgresql?).and_return(false) + end + + it 'returns the appropriate value' do + expect(model.false_value).to eq(0) + end + end + end + describe '#update_column_in_batches' do before do create_list(:empty_project, 5) diff --git a/spec/lib/gitlab/database_spec.rb b/spec/lib/gitlab/database_spec.rb index 4ce4e6e1034..9b1d66a1b1c 100644 --- a/spec/lib/gitlab/database_spec.rb +++ b/spec/lib/gitlab/database_spec.rb @@ -150,13 +150,13 @@ describe Gitlab::Database, lib: true do it 'returns correct value for PostgreSQL' do expect(described_class).to receive(:postgresql?).and_return(true) - expect(MigrationTest.new.true_value).to eq "'t'" + expect(described_class.true_value).to eq "'t'" end it 'returns correct value for MySQL' do expect(described_class).to receive(:postgresql?).and_return(false) - expect(MigrationTest.new.true_value).to eq 1 + expect(described_class.true_value).to eq 1 end end @@ -164,13 +164,13 @@ describe Gitlab::Database, lib: true do it 'returns correct value for PostgreSQL' do expect(described_class).to receive(:postgresql?).and_return(true) - expect(MigrationTest.new.false_value).to eq "'f'" + expect(described_class.false_value).to eq "'f'" end it 'returns correct value for MySQL' do expect(described_class).to receive(:postgresql?).and_return(false) - expect(MigrationTest.new.false_value).to eq 0 + expect(described_class.false_value).to eq 0 end end end diff --git a/spec/lib/gitlab/git/repository_spec.rb b/spec/lib/gitlab/git/repository_spec.rb index 690f604db5e..3d6d7292b42 100644 --- a/spec/lib/gitlab/git/repository_spec.rb +++ b/spec/lib/gitlab/git/repository_spec.rb @@ -24,20 +24,21 @@ describe Gitlab::Git::Repository, seed_helper: true do end end - context 'with gitaly enabled' do - before { stub_gitaly } - - it 'gets the branch name from GitalyClient' do - expect_any_instance_of(Gitlab::GitalyClient::Ref).to receive(:default_branch_name) - repository.root_ref - end - - it 'wraps GRPC exceptions' do - expect_any_instance_of(Gitlab::GitalyClient::Ref).to receive(:default_branch_name). - and_raise(GRPC::Unknown) - expect { repository.root_ref }.to raise_error(Gitlab::Git::CommandError) - end - end + # TODO: Uncomment when feature is reenabled + # context 'with gitaly enabled' do + # before { stub_gitaly } + # + # it 'gets the branch name from GitalyClient' do + # expect_any_instance_of(Gitlab::GitalyClient::Ref).to receive(:default_branch_name) + # repository.root_ref + # end + # + # it 'wraps GRPC exceptions' do + # expect_any_instance_of(Gitlab::GitalyClient::Ref).to receive(:default_branch_name). + # and_raise(GRPC::Unknown) + # expect { repository.root_ref }.to raise_error(Gitlab::Git::CommandError) + # end + # end end describe "#rugged" do @@ -112,20 +113,21 @@ describe Gitlab::Git::Repository, seed_helper: true do it { is_expected.to include("master") } it { is_expected.not_to include("branch-from-space") } - context 'with gitaly enabled' do - before { stub_gitaly } - - it 'gets the branch names from GitalyClient' do - expect_any_instance_of(Gitlab::GitalyClient::Ref).to receive(:branch_names) - subject - end - - it 'wraps GRPC exceptions' do - expect_any_instance_of(Gitlab::GitalyClient::Ref).to receive(:branch_names). - and_raise(GRPC::Unknown) - expect { subject }.to raise_error(Gitlab::Git::CommandError) - end - end + # TODO: Uncomment when feature is reenabled + # context 'with gitaly enabled' do + # before { stub_gitaly } + # + # it 'gets the branch names from GitalyClient' do + # expect_any_instance_of(Gitlab::GitalyClient::Ref).to receive(:branch_names) + # subject + # end + # + # it 'wraps GRPC exceptions' do + # expect_any_instance_of(Gitlab::GitalyClient::Ref).to receive(:branch_names). + # and_raise(GRPC::Unknown) + # expect { subject }.to raise_error(Gitlab::Git::CommandError) + # end + # end end describe '#tag_names' do @@ -143,20 +145,21 @@ describe Gitlab::Git::Repository, seed_helper: true do it { is_expected.to include("v1.0.0") } it { is_expected.not_to include("v5.0.0") } - context 'with gitaly enabled' do - before { stub_gitaly } - - it 'gets the tag names from GitalyClient' do - expect_any_instance_of(Gitlab::GitalyClient::Ref).to receive(:tag_names) - subject - end - - it 'wraps GRPC exceptions' do - expect_any_instance_of(Gitlab::GitalyClient::Ref).to receive(:tag_names). - and_raise(GRPC::Unknown) - expect { subject }.to raise_error(Gitlab::Git::CommandError) - end - end + # TODO: Uncomment when feature is reenabled + # context 'with gitaly enabled' do + # before { stub_gitaly } + # + # it 'gets the tag names from GitalyClient' do + # expect_any_instance_of(Gitlab::GitalyClient::Ref).to receive(:tag_names) + # subject + # end + # + # it 'wraps GRPC exceptions' do + # expect_any_instance_of(Gitlab::GitalyClient::Ref).to receive(:tag_names). + # and_raise(GRPC::Unknown) + # expect { subject }.to raise_error(Gitlab::Git::CommandError) + # end + # end end shared_examples 'archive check' do |extenstion| diff --git a/spec/models/commit_spec.rb b/spec/models/commit_spec.rb index 980a1b70ef5..ce31c8ed94c 100644 --- a/spec/models/commit_spec.rb +++ b/spec/models/commit_spec.rb @@ -389,31 +389,32 @@ eos end end - describe '#raw_diffs' do - context 'Gitaly commit_raw_diffs feature enabled' do - before do - allow(Gitlab::GitalyClient).to receive(:feature_enabled?).with(:commit_raw_diffs).and_return(true) - end - - context 'when a truthy deltas_only is not passed to args' do - it 'fetches diffs from Gitaly server' do - expect(Gitlab::GitalyClient::Commit).to receive(:diff_from_parent). - with(commit) - - commit.raw_diffs - end - end - - context 'when a truthy deltas_only is passed to args' do - it 'fetches diffs using Rugged' do - opts = { deltas_only: true } - - expect(Gitlab::GitalyClient::Commit).not_to receive(:diff_from_parent) - expect(commit.raw).to receive(:diffs).with(opts) - - commit.raw_diffs(opts) - end - end - end - end + # describe '#raw_diffs' do + # TODO: Uncomment when feature is reenabled + # context 'Gitaly commit_raw_diffs feature enabled' do + # before do + # allow(Gitlab::GitalyClient).to receive(:feature_enabled?).with(:commit_raw_diffs).and_return(true) + # end + # + # context 'when a truthy deltas_only is not passed to args' do + # it 'fetches diffs from Gitaly server' do + # expect(Gitlab::GitalyClient::Commit).to receive(:diff_from_parent). + # with(commit) + # + # commit.raw_diffs + # end + # end + # + # context 'when a truthy deltas_only is passed to args' do + # it 'fetches diffs using Rugged' do + # opts = { deltas_only: true } + # + # expect(Gitlab::GitalyClient::Commit).not_to receive(:diff_from_parent) + # expect(commit.raw).to receive(:diffs).with(opts) + # + # commit.raw_diffs(opts) + # end + # end + # end + # end end diff --git a/spec/models/diff_note_spec.rb b/spec/models/diff_note_spec.rb index fb80b74b226..f32b6b99b3d 100644 --- a/spec/models/diff_note_spec.rb +++ b/spec/models/diff_note_spec.rb @@ -155,6 +155,23 @@ describe DiffNote, models: true do end end + describe '#latest_merge_request_diff' do + context 'when active' do + it 'returns the current merge request diff' do + expect(subject.latest_merge_request_diff).to eq(merge_request.merge_request_diff) + end + end + + context 'when outdated' do + let!(:old_merge_request_diff) { merge_request.merge_request_diff } + let!(:new_merge_request_diff) { merge_request.merge_request_diffs.create(diff_refs: commit.diff_refs) } + + it 'returns the latest merge request diff that this diff note applied to' do + expect(subject.latest_merge_request_diff).to eq(old_merge_request_diff) + end + end + end + describe "creation" do describe "updating of position" do context "when noteable is a commit" do diff --git a/spec/models/environment_spec.rb b/spec/models/environment_spec.rb index af7753caba6..070716e859a 100644 --- a/spec/models/environment_spec.rb +++ b/spec/models/environment_spec.rb @@ -110,17 +110,18 @@ describe Environment, models: true do end end - context 'Gitaly find_ref_name feature enabled' do - before do - allow(Gitlab::GitalyClient).to receive(:feature_enabled?).with(:find_ref_name).and_return(true) - end - - it 'calls GitalyClient' do - expect_any_instance_of(Gitlab::GitalyClient::Ref).to receive(:find_ref_name) - - environment.first_deployment_for(commit) - end - end + # TODO: Uncomment when feature is reenabled + # context 'Gitaly find_ref_name feature enabled' do + # before do + # allow(Gitlab::GitalyClient).to receive(:feature_enabled?).with(:find_ref_name).and_return(true) + # end + # + # it 'calls GitalyClient' do + # expect_any_instance_of(Gitlab::GitalyClient::Ref).to receive(:find_ref_name) + # + # environment.first_deployment_for(commit) + # end + # end end describe '#environment_type' do diff --git a/spec/models/label_spec.rb b/spec/models/label_spec.rb index a9139f7d4ab..80ca19acdda 100644 --- a/spec/models/label_spec.rb +++ b/spec/models/label_spec.rb @@ -42,11 +42,27 @@ describe Label, models: true do end end + describe '#color' do + it 'strips color' do + label = described_class.new(color: ' #abcdef ') + label.valid? + + expect(label.color).to eq('#abcdef') + end + end + describe '#title' do it 'sanitizes title' do label = described_class.new(title: '<b>foo & bar?</b>') expect(label.title).to eq('foo & bar?') end + + it 'strips title' do + label = described_class.new(title: ' label ') + label.valid? + + expect(label.title).to eq('label') + end end describe 'priorization' do diff --git a/spec/models/note_spec.rb b/spec/models/note_spec.rb index 3c4bf3f4ddb..557ea97b008 100644 --- a/spec/models/note_spec.rb +++ b/spec/models/note_spec.rb @@ -622,12 +622,22 @@ describe Note, models: true do describe 'expiring ETag cache' do let(:note) { build(:note_on_issue) } - it "expires cache for note's issue when note is saved" do + def expect_expiration(note) expect_any_instance_of(Gitlab::EtagCaching::Store) .to receive(:touch) .with("/#{note.project.namespace.to_param}/#{note.project.to_param}/noteable/issue/#{note.noteable.id}/notes") + end + + it "expires cache for note's issue when note is saved" do + expect_expiration(note) note.save! end + + it "expires cache for note's issue when note is destroyed" do + expect_expiration(note) + + note.destroy! + end end end diff --git a/spec/models/repository_spec.rb b/spec/models/repository_spec.rb index 8bd436558cb..5e5c2b016b6 100644 --- a/spec/models/repository_spec.rb +++ b/spec/models/repository_spec.rb @@ -1829,16 +1829,17 @@ describe Repository, models: true do end end - describe '#is_ancestor?' do - context 'Gitaly is_ancestor feature enabled' do - it 'asks Gitaly server if it\'s an ancestor' do - commit = repository.commit - allow(Gitlab::GitalyClient).to receive(:feature_enabled?).with(:is_ancestor).and_return(true) - expect(Gitlab::GitalyClient::Commit).to receive(:is_ancestor). - with(repository.raw_repository, commit.id, commit.id).and_return(true) - - expect(repository.is_ancestor?(commit.id, commit.id)).to be true - end - end - end + # TODO: Uncomment when feature is reenabled + # describe '#is_ancestor?' do + # context 'Gitaly is_ancestor feature enabled' do + # it 'asks Gitaly server if it\'s an ancestor' do + # commit = repository.commit + # allow(Gitlab::GitalyClient).to receive(:feature_enabled?).with(:is_ancestor).and_return(true) + # expect(Gitlab::GitalyClient::Commit).to receive(:is_ancestor). + # with(repository.raw_repository, commit.id, commit.id).and_return(true) + # + # expect(repository.is_ancestor?(commit.id, commit.id)).to be true + # end + # end + # end end diff --git a/spec/policies/group_policy_spec.rb b/spec/policies/group_policy_spec.rb index 5c34ff04152..2077c14ff7a 100644 --- a/spec/policies/group_policy_spec.rb +++ b/spec/policies/group_policy_spec.rb @@ -22,7 +22,8 @@ describe GroupPolicy, models: true do :admin_group, :admin_namespace, :admin_group_member, - :change_visibility_level + :change_visibility_level, + :create_subgroup ] end diff --git a/spec/requests/api/project_hooks_spec.rb b/spec/requests/api/project_hooks_spec.rb index b1f8c249092..b1603233f9e 100644 --- a/spec/requests/api/project_hooks_spec.rb +++ b/spec/requests/api/project_hooks_spec.rb @@ -22,8 +22,8 @@ describe API::ProjectHooks, 'ProjectHooks', api: true do context "authorized user" do it "returns project hooks" do get api("/projects/#{project.id}/hooks", user) - expect(response).to have_http_status(200) + expect(response).to have_http_status(200) expect(json_response).to be_an Array expect(response).to include_pagination_headers expect(json_response.count).to eq(1) @@ -43,6 +43,7 @@ describe API::ProjectHooks, 'ProjectHooks', api: true do context "unauthorized user" do it "does not access project hooks" do get api("/projects/#{project.id}/hooks", user3) + expect(response).to have_http_status(403) end end @@ -52,6 +53,7 @@ describe API::ProjectHooks, 'ProjectHooks', api: true do context "authorized user" do it "returns a project hook" do get api("/projects/#{project.id}/hooks/#{hook.id}", user) + expect(response).to have_http_status(200) expect(json_response['url']).to eq(hook.url) expect(json_response['issues_events']).to eq(hook.issues_events) @@ -67,6 +69,7 @@ describe API::ProjectHooks, 'ProjectHooks', api: true do it "returns a 404 error if hook id is not available" do get api("/projects/#{project.id}/hooks/1234", user) + expect(response).to have_http_status(404) end end @@ -88,7 +91,8 @@ describe API::ProjectHooks, 'ProjectHooks', api: true do it "adds hook to project" do expect do post api("/projects/#{project.id}/hooks", user), - url: "http://example.com", issues_events: true, wiki_page_events: true + url: "http://example.com", issues_events: true, wiki_page_events: true, + job_events: true end.to change {project.hooks.count}.by(1) expect(response).to have_http_status(201) @@ -98,7 +102,7 @@ describe API::ProjectHooks, 'ProjectHooks', api: true do expect(json_response['merge_requests_events']).to eq(false) expect(json_response['tag_push_events']).to eq(false) expect(json_response['note_events']).to eq(false) - expect(json_response['job_events']).to eq(false) + expect(json_response['job_events']).to eq(true) expect(json_response['pipeline_events']).to eq(false) expect(json_response['wiki_page_events']).to eq(true) expect(json_response['enable_ssl_verification']).to eq(true) @@ -136,7 +140,8 @@ describe API::ProjectHooks, 'ProjectHooks', api: true do describe "PUT /projects/:id/hooks/:hook_id" do it "updates an existing project hook" do put api("/projects/#{project.id}/hooks/#{hook.id}", user), - url: 'http://example.org', push_events: false + url: 'http://example.org', push_events: false, job_events: true + expect(response).to have_http_status(200) expect(json_response['url']).to eq('http://example.org') expect(json_response['issues_events']).to eq(hook.issues_events) diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb index 2e291eb3cea..74bc4847247 100644 --- a/spec/requests/api/projects_spec.rb +++ b/spec/requests/api/projects_spec.rb @@ -1076,6 +1076,13 @@ describe API::Projects, :api do before { project_member3 } before { project_member2 } + it 'returns 400 when nothing sent' do + project_param = {} + put api("/projects/#{project.id}", user), project_param + expect(response).to have_http_status(400) + expect(json_response['error']).to match('at least one parameter must be provided') + end + context 'when unauthenticated' do it 'returns authentication error' do project_param = { name: 'bar' } diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 4eb5b150af5..a3665795452 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -59,6 +59,10 @@ RSpec.configure do |config| TestEnv.init end + config.after(:suite) do + TestEnv.cleanup + end + if ENV['CI'] # Retry only on feature specs that use JS config.around :each, :js do |ex| diff --git a/spec/features/discussion_comments_spec.rb b/spec/support/features/discussion_comments_shared_example.rb index ae778118c5c..1a061ef069e 100644 --- a/spec/features/discussion_comments_spec.rb +++ b/spec/support/features/discussion_comments_shared_example.rb @@ -1,5 +1,3 @@ -require 'spec_helper' - shared_examples 'discussion comments' do |resource_name| let(:form_selector) { '.js-main-target-form' } let(:dropdown_selector) { "#{form_selector} .comment-type-dropdown" } @@ -9,11 +7,9 @@ shared_examples 'discussion comments' do |resource_name| let(:close_selector) { "#{form_selector} .btn-comment-and-close" } let(:comments_selector) { '.timeline > .note.timeline-entry' } - it 'should show a comment type toggle' do + it 'clicking "Comment" will post a comment' do expect(page).to have_selector toggle_selector - end - it 'clicking "Comment" will post a comment' do find("#{form_selector} .note-textarea").send_keys('a') find(submit_selector).click @@ -49,44 +45,29 @@ shared_examples 'discussion comments' do |resource_name| find(toggle_selector).click end - it 'opens a comment type dropdown with "Comment" and "Start discussion"' do + it 'has a "Comment" item (selected by default) and "Start discussion" item' do expect(page).to have_selector menu_selector - end - - it 'has a "Comment" item' do - menu = find(menu_selector) - - expect(menu).to have_content 'Comment' - expect(menu).to have_content "Add a general comment to this #{resource_name}." - end - it 'has a "Start discussion" item' do - menu = find(menu_selector) - - expect(menu).to have_content 'Start discussion' - expect(menu).to have_content "Discuss a specific suggestion or question#{' that needs to be resolved' if resource_name == 'merge request'}." - end - - it 'has the "Comment" item selected by default' do find("#{menu_selector} li", match: :first) items = all("#{menu_selector} li") expect(items.first).to have_content 'Comment' + expect(items.first).to have_content "Add a general comment to this #{resource_name}." expect(items.first).to have_selector '.fa-check' expect(items.first['class']).to match 'droplab-item-selected' expect(items.last).to have_content 'Start discussion' + expect(items.last).to have_content "Discuss a specific suggestion or question#{' that needs to be resolved' if resource_name == 'merge request'}." expect(items.last).not_to have_selector '.fa-check' expect(items.last['class']).not_to match 'droplab-item-selected' end - it 'closes the menu when clicking the toggle' do + it 'closes the menu when clicking the toggle or body' do find(toggle_selector).click expect(page).not_to have_selector menu_selector - end - it 'closes the menu when clicking the body' do + find(toggle_selector).click find('body').click expect(page).not_to have_selector menu_selector @@ -104,12 +85,10 @@ shared_examples 'discussion comments' do |resource_name| all("#{menu_selector} li").last.click end - it 'updates the note_type input to "DiscussionNote"' do - expect(find("#{form_selector} #note_type", visible: false).value).to eq('DiscussionNote') - end - - it 'updates the submit button text' do + it 'updates the submit button text, note_type input and closes the dropdown' do expect(find(dropdown_selector)).to have_content 'Start discussion' + expect(find("#{form_selector} #note_type", visible: false).value).to eq('DiscussionNote') + expect(page).not_to have_selector menu_selector end if resource_name =~ /(issue|merge request)/ @@ -124,10 +103,6 @@ shared_examples 'discussion comments' do |resource_name| end end - it 'closes the dropdown' do - expect(page).not_to have_selector menu_selector - end - it 'clicking "Start discussion" will post a discussion' do find(submit_selector).click @@ -176,12 +151,10 @@ shared_examples 'discussion comments' do |resource_name| find("#{menu_selector} li", match: :first).click end - it 'clears the note_type input"' do - expect(find("#{form_selector} #note_type", visible: false).value).to eq('') - end - - it 'updates the submit button text' do + it 'updates the submit button text, clears the note_type input and closes the dropdown' do expect(find(dropdown_selector)).to have_content 'Comment' + expect(find("#{form_selector} #note_type", visible: false).value).to eq('') + expect(page).not_to have_selector menu_selector end if resource_name =~ /(issue|merge request)/ @@ -196,10 +169,6 @@ shared_examples 'discussion comments' do |resource_name| end end - it 'closes the dropdown' do - expect(page).not_to have_selector menu_selector - end - it 'should have "Comment" selected when opening the menu' do find(toggle_selector).click @@ -242,54 +211,3 @@ shared_examples 'discussion comments' do |resource_name| end end end - -describe 'Discussion Comments', :feature, :js do - include RepoHelpers - - let(:user) { create(:user) } - let(:project) { create(:project) } - - before do - project.team << [user, :developer] - - login_as(user) - end - - describe 'on a merge request' do - let(:merge_request) { create(:merge_request, source_project: project) } - - before do - visit namespace_project_merge_request_path(project.namespace, project, merge_request) - end - - it_behaves_like 'discussion comments', 'merge request' - end - - describe 'on an issue' do - let(:issue) { create(:issue, project: project) } - - before do - visit namespace_project_issue_path(project.namespace, project, issue) - end - - it_behaves_like 'discussion comments', 'issue' - end - - describe 'on an snippet' do - let(:snippet) { create(:project_snippet, :private, project: project, author: user) } - - before do - visit namespace_project_snippet_path(project.namespace, project, snippet) - end - - it_behaves_like 'discussion comments', 'snippet' - end - - describe 'on a commit' do - before do - visit namespace_project_commit_path(project.namespace, project, sample_commit.id) - end - - it_behaves_like 'discussion comments', 'commit' - end -end diff --git a/spec/support/gitaly.rb b/spec/support/gitaly.rb new file mode 100644 index 00000000000..7aca902fc61 --- /dev/null +++ b/spec/support/gitaly.rb @@ -0,0 +1,7 @@ +if Gitlab::GitalyClient.enabled? + RSpec.configure do |config| + config.before(:each) do + allow(Gitlab::GitalyClient).to receive(:feature_enabled?).and_return(true) + end + end +end diff --git a/spec/support/test_env.rb b/spec/support/test_env.rb index 1b5cb71a6b0..60c2096a126 100644 --- a/spec/support/test_env.rb +++ b/spec/support/test_env.rb @@ -64,6 +64,8 @@ module TestEnv # Setup GitLab shell for test instance setup_gitlab_shell + setup_gitaly if Gitlab::GitalyClient.enabled? + # Create repository for FactoryGirl.create(:project) setup_factory_repo @@ -71,6 +73,10 @@ module TestEnv setup_forked_repo end + def cleanup + stop_gitaly + end + def disable_mailer allow_any_instance_of(NotificationService).to receive(:mailer). and_return(double.as_null_object) @@ -92,7 +98,7 @@ module TestEnv tmp_test_path = Rails.root.join('tmp', 'tests', '**') Dir[tmp_test_path].each do |entry| - unless File.basename(entry) =~ /\Agitlab-(shell|test|test_bare|test-fork|test-fork_bare)\z/ + unless File.basename(entry) =~ /\A(gitaly|gitlab-(shell|test|test_bare|test-fork|test-fork_bare))\z/ FileUtils.rm_rf(entry) end end @@ -110,6 +116,28 @@ module TestEnv end end + def setup_gitaly + socket_path = Gitlab::GitalyClient.get_address('default').sub(/\Aunix:/, '') + gitaly_dir = File.dirname(socket_path) + + unless File.directory?(gitaly_dir) || system('rake', "gitlab:gitaly:install[#{gitaly_dir}]") + raise "Can't clone gitaly" + end + + start_gitaly(gitaly_dir, socket_path) + end + + def start_gitaly(gitaly_dir, socket_path) + gitaly_exec = File.join(gitaly_dir, 'gitaly') + @gitaly_pid = spawn({ "GITALY_SOCKET_PATH" => socket_path }, gitaly_exec, [:out, :err] => '/dev/null') + end + + def stop_gitaly + return unless @gitaly_pid + + Process.kill('KILL', @gitaly_pid) + end + def setup_factory_repo setup_repo(factory_repo_path, factory_repo_path_bare, factory_repo_name, BRANCH_SHA) diff --git a/vendor/assets/javascripts/notebooklab.js b/vendor/assets/javascripts/notebooklab.js index 296271205d1..601a645b655 100644 --- a/vendor/assets/javascripts/notebooklab.js +++ b/vendor/assets/javascripts/notebooklab.js @@ -233,22 +233,6 @@ var Component = __webpack_require__(0)( /* cssModules */ null ) -Component.options.__file = "/Users/phil/Projects/notebooklab/src/cells/prompt.vue" -if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key !== "__esModule"})) {console.error("named exports are not supported in *.vue files.")} -if (Component.options.functional) {console.error("[vue-loader] prompt.vue: functional components are not supported with templates, they should use render functions.")} - -/* hot reload */ -if (false) {(function () { - var hotAPI = require("vue-hot-reload-api") - hotAPI.install(require("vue"), false) - if (!hotAPI.compatible) return - module.hot.accept() - if (!module.hot.data) { - hotAPI.createRecord("data-v-4f6bf458", Component.options) - } else { - hotAPI.reload("data-v-4f6bf458", Component.options) - } -})()} module.exports = Component.exports @@ -515,22 +499,6 @@ var Component = __webpack_require__(0)( /* cssModules */ null ) -Component.options.__file = "/Users/phil/Projects/notebooklab/src/cells/code/index.vue" -if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key !== "__esModule"})) {console.error("named exports are not supported in *.vue files.")} -if (Component.options.functional) {console.error("[vue-loader] index.vue: functional components are not supported with templates, they should use render functions.")} - -/* hot reload */ -if (false) {(function () { - var hotAPI = require("vue-hot-reload-api") - hotAPI.install(require("vue"), false) - if (!hotAPI.compatible) return - module.hot.accept() - if (!module.hot.data) { - hotAPI.createRecord("data-v-d42105b8", Component.options) - } else { - hotAPI.reload("data-v-d42105b8", Component.options) - } -})()} module.exports = Component.exports @@ -553,22 +521,6 @@ var Component = __webpack_require__(0)( /* cssModules */ null ) -Component.options.__file = "/Users/phil/Projects/notebooklab/src/index.vue" -if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key !== "__esModule"})) {console.error("named exports are not supported in *.vue files.")} -if (Component.options.functional) {console.error("[vue-loader] index.vue: functional components are not supported with templates, they should use render functions.")} - -/* hot reload */ -if (false) {(function () { - var hotAPI = require("vue-hot-reload-api") - hotAPI.install(require("vue"), false) - if (!hotAPI.compatible) return - module.hot.accept() - if (!module.hot.data) { - hotAPI.createRecord("data-v-4cb2b168", Component.options) - } else { - hotAPI.reload("data-v-4cb2b168", Component.options) - } -})()} module.exports = Component.exports @@ -630,9 +582,9 @@ exports.default = { rawInputCode: function rawInputCode() { if (this.cell.source) { return this.cell.source.join(''); - } else { - return ''; } + + return ''; }, hasOutput: function hasOutput() { return this.cell.outputs.length; @@ -1030,13 +982,14 @@ exports.default = { cells: [] }; - return this.notebook.worksheets.reduce(function (data, sheet) { - data.cells = data.cells.concat(sheet.cells); - return data; + return this.notebook.worksheets.reduce(function (cellData, sheet) { + var cellDataCopy = cellData; + cellDataCopy.cells = cellDataCopy.cells.concat(sheet.cells); + return cellDataCopy; }, data).cells; - } else { - return this.notebook.cells; } + + return this.notebook.cells; }, hasNotebook: function hasNotebook() { return Object.keys(this.notebook).length; @@ -3052,7 +3005,7 @@ exports = module.exports = __webpack_require__(1)(undefined); // module -exports.push([module.i, "\n.cell[data-v-3ac4c361] {\n flex-direction: column;\n}\n", ""]); +exports.push([module.i, ".cell[data-v-3ac4c361]{flex-direction:column}", ""]); // exports @@ -3066,7 +3019,7 @@ exports = module.exports = __webpack_require__(1)(undefined); // module -exports.push([module.i, "\n.cell,\n.input,\n.output {\n display: flex;\n width: 100%;\n margin-bottom: 10px;\n}\n.cell pre {\n margin: 0;\n width: 100%;\n}\n", ""]); +exports.push([module.i, ".cell,.input,.output{display:flex;width:100%;margin-bottom:10px}.cell pre{margin:0;width:100%}", ""]); // exports @@ -3080,7 +3033,7 @@ exports = module.exports = __webpack_require__(1)(undefined); // module -exports.push([module.i, "\n.prompt[data-v-4f6bf458] {\n padding: 0 10px;\n min-width: 7em;\n font-family: monospace;\n}\n", ""]); +exports.push([module.i, ".prompt[data-v-4f6bf458]{padding:0 10px;min-width:7em;font-family:monospace}", ""]); // exports @@ -3094,7 +3047,7 @@ exports = module.exports = __webpack_require__(1)(undefined); // module -exports.push([module.i, "\n.markdown .katex {\n display: block;\n text-align: center;\n}\n", ""]); +exports.push([module.i, ".markdown .katex{display:block;text-align:center}", ""]); // exports @@ -5382,22 +5335,6 @@ var Component = __webpack_require__(0)( /* cssModules */ null ) -Component.options.__file = "/Users/phil/Projects/notebooklab/src/cells/code.vue" -if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key !== "__esModule"})) {console.error("named exports are not supported in *.vue files.")} -if (Component.options.functional) {console.error("[vue-loader] code.vue: functional components are not supported with templates, they should use render functions.")} - -/* hot reload */ -if (false) {(function () { - var hotAPI = require("vue-hot-reload-api") - hotAPI.install(require("vue"), false) - if (!hotAPI.compatible) return - module.hot.accept() - if (!module.hot.data) { - hotAPI.createRecord("data-v-3ac4c361", Component.options) - } else { - hotAPI.reload("data-v-3ac4c361", Component.options) - } -})()} module.exports = Component.exports @@ -5420,22 +5357,6 @@ var Component = __webpack_require__(0)( /* cssModules */ null ) -Component.options.__file = "/Users/phil/Projects/notebooklab/src/cells/markdown.vue" -if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key !== "__esModule"})) {console.error("named exports are not supported in *.vue files.")} -if (Component.options.functional) {console.error("[vue-loader] markdown.vue: functional components are not supported with templates, they should use render functions.")} - -/* hot reload */ -if (false) {(function () { - var hotAPI = require("vue-hot-reload-api") - hotAPI.install(require("vue"), false) - if (!hotAPI.compatible) return - module.hot.accept() - if (!module.hot.data) { - hotAPI.createRecord("data-v-7342b363", Component.options) - } else { - hotAPI.reload("data-v-7342b363", Component.options) - } -})()} module.exports = Component.exports @@ -5454,22 +5375,6 @@ var Component = __webpack_require__(0)( /* cssModules */ null ) -Component.options.__file = "/Users/phil/Projects/notebooklab/src/cells/output/html.vue" -if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key !== "__esModule"})) {console.error("named exports are not supported in *.vue files.")} -if (Component.options.functional) {console.error("[vue-loader] html.vue: functional components are not supported with templates, they should use render functions.")} - -/* hot reload */ -if (false) {(function () { - var hotAPI = require("vue-hot-reload-api") - hotAPI.install(require("vue"), false) - if (!hotAPI.compatible) return - module.hot.accept() - if (!module.hot.data) { - hotAPI.createRecord("data-v-48ada535", Component.options) - } else { - hotAPI.reload("data-v-48ada535", Component.options) - } -})()} module.exports = Component.exports @@ -5488,22 +5393,6 @@ var Component = __webpack_require__(0)( /* cssModules */ null ) -Component.options.__file = "/Users/phil/Projects/notebooklab/src/cells/output/image.vue" -if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key !== "__esModule"})) {console.error("named exports are not supported in *.vue files.")} -if (Component.options.functional) {console.error("[vue-loader] image.vue: functional components are not supported with templates, they should use render functions.")} - -/* hot reload */ -if (false) {(function () { - var hotAPI = require("vue-hot-reload-api") - hotAPI.install(require("vue"), false) - if (!hotAPI.compatible) return - module.hot.accept() - if (!module.hot.data) { - hotAPI.createRecord("data-v-09b68c41", Component.options) - } else { - hotAPI.reload("data-v-09b68c41", Component.options) - } -})()} module.exports = Component.exports @@ -5522,29 +5411,13 @@ var Component = __webpack_require__(0)( /* cssModules */ null ) -Component.options.__file = "/Users/phil/Projects/notebooklab/src/cells/output/index.vue" -if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key !== "__esModule"})) {console.error("named exports are not supported in *.vue files.")} -if (Component.options.functional) {console.error("[vue-loader] index.vue: functional components are not supported with templates, they should use render functions.")} - -/* hot reload */ -if (false) {(function () { - var hotAPI = require("vue-hot-reload-api") - hotAPI.install(require("vue"), false) - if (!hotAPI.compatible) return - module.hot.accept() - if (!module.hot.data) { - hotAPI.createRecord("data-v-0dec7838", Component.options) - } else { - hotAPI.reload("data-v-0dec7838", Component.options) - } -})()} module.exports = Component.exports /***/ }), /* 34 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, exports) { module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h; return _c('div', { @@ -5555,17 +5428,10 @@ module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c } })], 1) },staticRenderFns: []} -module.exports.render._withStripped = true -if (false) { - module.hot.accept() - if (module.hot.data) { - require("vue-hot-reload-api").rerender("data-v-09b68c41", module.exports) - } -} /***/ }), /* 35 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, exports) { module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h; return _c(_vm.componentName, { @@ -5579,17 +5445,10 @@ module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c } }) },staticRenderFns: []} -module.exports.render._withStripped = true -if (false) { - module.hot.accept() - if (module.hot.data) { - require("vue-hot-reload-api").rerender("data-v-0dec7838", module.exports) - } -} /***/ }), /* 36 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, exports) { module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h; return _c('div', { @@ -5609,17 +5468,10 @@ module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c } }) : _vm._e()], 1) },staticRenderFns: []} -module.exports.render._withStripped = true -if (false) { - module.hot.accept() - if (module.hot.data) { - require("vue-hot-reload-api").rerender("data-v-3ac4c361", module.exports) - } -} /***/ }), /* 37 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, exports) { module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h; return _c('div', { @@ -5630,17 +5482,10 @@ module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c } })], 1) },staticRenderFns: []} -module.exports.render._withStripped = true -if (false) { - module.hot.accept() - if (module.hot.data) { - require("vue-hot-reload-api").rerender("data-v-48ada535", module.exports) - } -} /***/ }), /* 38 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, exports) { module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h; return (_vm.hasNotebook) ? _c('div', _vm._l((_vm.cells), function(cell, index) { @@ -5654,34 +5499,20 @@ module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c }) })) : _vm._e() },staticRenderFns: []} -module.exports.render._withStripped = true -if (false) { - module.hot.accept() - if (module.hot.data) { - require("vue-hot-reload-api").rerender("data-v-4cb2b168", module.exports) - } -} /***/ }), /* 39 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, exports) { module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h; return _c('div', { staticClass: "prompt" }, [(_vm.type && _vm.count) ? _c('span', [_vm._v("\n " + _vm._s(_vm.type) + " [" + _vm._s(_vm.count) + "]:\n ")]) : _vm._e()]) },staticRenderFns: []} -module.exports.render._withStripped = true -if (false) { - module.hot.accept() - if (module.hot.data) { - require("vue-hot-reload-api").rerender("data-v-4f6bf458", module.exports) - } -} /***/ }), /* 40 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, exports) { module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h; return _c('div', { @@ -5693,17 +5524,10 @@ module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c } })], 1) },staticRenderFns: []} -module.exports.render._withStripped = true -if (false) { - module.hot.accept() - if (module.hot.data) { - require("vue-hot-reload-api").rerender("data-v-7342b363", module.exports) - } -} /***/ }), /* 41 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, exports) { module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h; return _c('div', { @@ -5722,13 +5546,6 @@ module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c } }, [_vm._v("\n ")])], 1) },staticRenderFns: []} -module.exports.render._withStripped = true -if (false) { - module.hot.accept() - if (module.hot.data) { - require("vue-hot-reload-api").rerender("data-v-d42105b8", module.exports) - } -} /***/ }), /* 42 */ @@ -5741,13 +5558,13 @@ var content = __webpack_require__(19); if(typeof content === 'string') content = [[module.i, content, '']]; if(content.locals) module.exports = content.locals; // add the styles to the DOM -var update = __webpack_require__(3)("06fc6a9f", content, false); +var update = __webpack_require__(3)("74a276de", content, true); // Hot Module Replacement if(false) { // When the styles change, update the <style> tags if(!content.locals) { - module.hot.accept("!!../../node_modules/css-loader/index.js!../../node_modules/vue-loader/lib/style-compiler/index.js?{\"id\":\"data-v-3ac4c361\",\"scoped\":true,\"hasInlineConfig\":false}!../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./code.vue", function() { - var newContent = require("!!../../node_modules/css-loader/index.js!../../node_modules/vue-loader/lib/style-compiler/index.js?{\"id\":\"data-v-3ac4c361\",\"scoped\":true,\"hasInlineConfig\":false}!../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./code.vue"); + module.hot.accept("!!../../node_modules/css-loader/index.js?minimize!../../node_modules/vue-loader/lib/style-compiler/index.js?{\"id\":\"data-v-3ac4c361\",\"scoped\":true,\"hasInlineConfig\":false}!../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./code.vue", function() { + var newContent = require("!!../../node_modules/css-loader/index.js?minimize!../../node_modules/vue-loader/lib/style-compiler/index.js?{\"id\":\"data-v-3ac4c361\",\"scoped\":true,\"hasInlineConfig\":false}!../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./code.vue"); if(typeof newContent === 'string') newContent = [[module.id, newContent, '']]; update(newContent); }); @@ -5767,13 +5584,13 @@ var content = __webpack_require__(20); if(typeof content === 'string') content = [[module.i, content, '']]; if(content.locals) module.exports = content.locals; // add the styles to the DOM -var update = __webpack_require__(3)("87c28124", content, false); +var update = __webpack_require__(3)("55f9d67b", content, true); // Hot Module Replacement if(false) { // When the styles change, update the <style> tags if(!content.locals) { - module.hot.accept("!!../node_modules/css-loader/index.js!../node_modules/vue-loader/lib/style-compiler/index.js?{\"id\":\"data-v-4cb2b168\",\"scoped\":false,\"hasInlineConfig\":false}!../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./index.vue", function() { - var newContent = require("!!../node_modules/css-loader/index.js!../node_modules/vue-loader/lib/style-compiler/index.js?{\"id\":\"data-v-4cb2b168\",\"scoped\":false,\"hasInlineConfig\":false}!../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./index.vue"); + module.hot.accept("!!../node_modules/css-loader/index.js?minimize!../node_modules/vue-loader/lib/style-compiler/index.js?{\"id\":\"data-v-4cb2b168\",\"scoped\":false,\"hasInlineConfig\":false}!../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./index.vue", function() { + var newContent = require("!!../node_modules/css-loader/index.js?minimize!../node_modules/vue-loader/lib/style-compiler/index.js?{\"id\":\"data-v-4cb2b168\",\"scoped\":false,\"hasInlineConfig\":false}!../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./index.vue"); if(typeof newContent === 'string') newContent = [[module.id, newContent, '']]; update(newContent); }); @@ -5793,13 +5610,13 @@ var content = __webpack_require__(21); if(typeof content === 'string') content = [[module.i, content, '']]; if(content.locals) module.exports = content.locals; // add the styles to the DOM -var update = __webpack_require__(3)("5b60b003", content, false); +var update = __webpack_require__(3)("1096aefc", content, true); // Hot Module Replacement if(false) { // When the styles change, update the <style> tags if(!content.locals) { - module.hot.accept("!!../../node_modules/css-loader/index.js!../../node_modules/vue-loader/lib/style-compiler/index.js?{\"id\":\"data-v-4f6bf458\",\"scoped\":true,\"hasInlineConfig\":false}!../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./prompt.vue", function() { - var newContent = require("!!../../node_modules/css-loader/index.js!../../node_modules/vue-loader/lib/style-compiler/index.js?{\"id\":\"data-v-4f6bf458\",\"scoped\":true,\"hasInlineConfig\":false}!../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./prompt.vue"); + module.hot.accept("!!../../node_modules/css-loader/index.js?minimize!../../node_modules/vue-loader/lib/style-compiler/index.js?{\"id\":\"data-v-4f6bf458\",\"scoped\":true,\"hasInlineConfig\":false}!../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./prompt.vue", function() { + var newContent = require("!!../../node_modules/css-loader/index.js?minimize!../../node_modules/vue-loader/lib/style-compiler/index.js?{\"id\":\"data-v-4f6bf458\",\"scoped\":true,\"hasInlineConfig\":false}!../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./prompt.vue"); if(typeof newContent === 'string') newContent = [[module.id, newContent, '']]; update(newContent); }); @@ -5819,13 +5636,13 @@ var content = __webpack_require__(22); if(typeof content === 'string') content = [[module.i, content, '']]; if(content.locals) module.exports = content.locals; // add the styles to the DOM -var update = __webpack_require__(3)("48dda57c", content, false); +var update = __webpack_require__(3)("58a0689d", content, true); // Hot Module Replacement if(false) { // When the styles change, update the <style> tags if(!content.locals) { - module.hot.accept("!!../../node_modules/css-loader/index.js!../../node_modules/vue-loader/lib/style-compiler/index.js?{\"id\":\"data-v-7342b363\",\"scoped\":false,\"hasInlineConfig\":false}!../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./markdown.vue", function() { - var newContent = require("!!../../node_modules/css-loader/index.js!../../node_modules/vue-loader/lib/style-compiler/index.js?{\"id\":\"data-v-7342b363\",\"scoped\":false,\"hasInlineConfig\":false}!../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./markdown.vue"); + module.hot.accept("!!../../node_modules/css-loader/index.js?minimize!../../node_modules/vue-loader/lib/style-compiler/index.js?{\"id\":\"data-v-7342b363\",\"scoped\":false,\"hasInlineConfig\":false}!../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./markdown.vue", function() { + var newContent = require("!!../../node_modules/css-loader/index.js?minimize!../../node_modules/vue-loader/lib/style-compiler/index.js?{\"id\":\"data-v-7342b363\",\"scoped\":false,\"hasInlineConfig\":false}!../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./markdown.vue"); if(typeof newContent === 'string') newContent = [[module.id, newContent, '']]; update(newContent); }); diff --git a/vendor/gitignore/C.gitignore b/vendor/gitignore/C.gitignore index 8a365b3d829..c6127b38c1a 100644 --- a/vendor/gitignore/C.gitignore +++ b/vendor/gitignore/C.gitignore @@ -45,6 +45,7 @@ # Kernel Module Compile Results *.mod* *.cmd +.tmp_versions/ modules.order Module.symvers Mkfile.old diff --git a/vendor/gitignore/Dart.gitignore b/vendor/gitignore/Dart.gitignore index 4b366585ddc..4d2a4d6db7c 100644 --- a/vendor/gitignore/Dart.gitignore +++ b/vendor/gitignore/Dart.gitignore @@ -1,33 +1,12 @@ # See https://www.dartlang.org/tools/private-files.html # Files and directories created by pub - -# SDK 1.20 and later (no longer creates packages directories) .packages .pub/ build/ - -# Older SDK versions -# (Include if the minimum SDK version specified in pubsepc.yaml is earlier than 1.20) -.project -.buildlog -**/packages/ - - -# Files created by dart2js -# (Most Dart developers will use pub build to compile Dart, use/modify these -# rules if you intend to use dart2js directly -# Convention is to use extension '.dart.js' for Dart compiled to Javascript to -# differentiate from explicit Javascript files) -*.dart.js -*.part.js -*.js.deps -*.js.map -*.info.json +# If you're building an application, you may want to check-in your pubspec.lock +pubspec.lock # Directory created by dartdoc +# If you don't generate documentation locally you can remove this line. doc/api/ - -# Don't commit pubspec lock file -# (Library packages only! Remove pattern if developing an application package) -pubspec.lock diff --git a/vendor/gitignore/Global/Eclipse.gitignore b/vendor/gitignore/Global/Eclipse.gitignore index 4f88399d2d8..ce1c12cdb7a 100644 --- a/vendor/gitignore/Global/Eclipse.gitignore +++ b/vendor/gitignore/Global/Eclipse.gitignore @@ -11,9 +11,6 @@ local.properties .loadpath .recommenders -# Eclipse Core -.project - # External tool builders .externalToolBuilders/ @@ -26,9 +23,6 @@ local.properties # CDT-specific (C/C++ Development Tooling) .cproject -# JDT-specific (Eclipse Java Development Tools) -.classpath - # Java annotation processor (APT) .factorypath diff --git a/vendor/gitignore/Global/JetBrains.gitignore b/vendor/gitignore/Global/JetBrains.gitignore index ec7e95c6ab5..a5d4cc86d33 100644 --- a/vendor/gitignore/Global/JetBrains.gitignore +++ b/vendor/gitignore/Global/JetBrains.gitignore @@ -36,6 +36,9 @@ # JIRA plugin atlassian-ide-plugin.xml +# Cursive Clojure plugin +.idea/replstate.xml + # Crashlytics plugin (for Android Studio and IntelliJ) com_crashlytics_export_strings.xml crashlytics.properties diff --git a/vendor/gitignore/Global/macOS.gitignore b/vendor/gitignore/Global/macOS.gitignore index f0f3fbc06c8..5972fe50f66 100644 --- a/vendor/gitignore/Global/macOS.gitignore +++ b/vendor/gitignore/Global/macOS.gitignore @@ -1,26 +1,25 @@ -*.DS_Store
-.AppleDouble
-.LSOverride
-
-# Icon must end with two \r
-Icon
-
-
-# Thumbnails
-._*
-
-# Files that might appear in the root of a volume
-.DocumentRevisions-V100
-.fseventsd
-.Spotlight-V100
-.TemporaryItems
-.Trashes
-.VolumeIcon.icns
-.com.apple.timemachine.donotpresent
-
-# Directories potentially created on remote AFP share
-.AppleDB
-.AppleDesktop
-Network Trash Folder
-Temporary Items
-.apdisk
+*.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon
+ +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk diff --git a/vendor/gitignore/Python.gitignore b/vendor/gitignore/Python.gitignore index 62c1e736924..ff65a437185 100644 --- a/vendor/gitignore/Python.gitignore +++ b/vendor/gitignore/Python.gitignore @@ -92,3 +92,6 @@ ENV/ # Rope project settings .ropeproject + +# mkdocs documentation +/site diff --git a/vendor/gitignore/Rails.gitignore b/vendor/gitignore/Rails.gitignore index e97427608c1..42aeb55000a 100644 --- a/vendor/gitignore/Rails.gitignore +++ b/vendor/gitignore/Rails.gitignore @@ -8,7 +8,7 @@ capybara-*.html /public/system /coverage/ /spec/tmp -**.orig +*.orig rerun.txt pickle-email-*.html diff --git a/vendor/gitignore/TeX.gitignore b/vendor/gitignore/TeX.gitignore index 57ed9f5d972..a0322dbd35a 100644 --- a/vendor/gitignore/TeX.gitignore +++ b/vendor/gitignore/TeX.gitignore @@ -148,6 +148,9 @@ _minted* # pax *.pax +# pdfpcnotes +*.pdfpc + # sagetex *.sagetex.sage *.sagetex.py diff --git a/vendor/gitignore/Unity.gitignore b/vendor/gitignore/Unity.gitignore index b829399ae85..eb83a8f122d 100644 --- a/vendor/gitignore/Unity.gitignore +++ b/vendor/gitignore/Unity.gitignore @@ -23,7 +23,6 @@ ExportedObj/ *.svd *.pdb - # Unity3D generated meta files *.pidb.meta diff --git a/vendor/gitignore/VisualStudio.gitignore b/vendor/gitignore/VisualStudio.gitignore index a752eacca7d..940794e60f2 100644 --- a/vendor/gitignore/VisualStudio.gitignore +++ b/vendor/gitignore/VisualStudio.gitignore @@ -219,6 +219,7 @@ UpgradeLog*.htm # SQL Server files *.mdf *.ldf +*.ndf # Business Intelligence projects *.rdl.data @@ -284,4 +285,4 @@ __pycache__/ *.btp.cs *.btm.cs *.odx.cs -*.xsd.cs
\ No newline at end of file +*.xsd.cs diff --git a/vendor/gitlab-ci-yml/CONTRIBUTING.md b/vendor/gitlab-ci-yml/CONTRIBUTING.md new file mode 100644 index 00000000000..6e5160a2487 --- /dev/null +++ b/vendor/gitlab-ci-yml/CONTRIBUTING.md @@ -0,0 +1,5 @@ +The canonical repository for `.gitlab-ci.yml` templates is +https://gitlab.com/gitlab-org/gitlab-ci-yml. + +GitLab only mirrors the templates. Please submit your merge requests to +https://gitlab.com/gitlab-org/gitlab-ci-yml. diff --git a/vendor/gitlab-ci-yml/Django.gitlab-ci.yml b/vendor/gitlab-ci-yml/Django.gitlab-ci.yml index b3106863cca..5ded2f5ce76 100644 --- a/vendor/gitlab-ci-yml/Django.gitlab-ci.yml +++ b/vendor/gitlab-ci-yml/Django.gitlab-ci.yml @@ -26,9 +26,24 @@ before_script: # - apt-get update -q && apt-get install nodejs -yqq - pip install -r requirements.txt +# To get Django tests to work you may need to create a settings file using +# the following DATABASES: +# +# DATABASES = { +# 'default': { +# 'ENGINE': 'django.db.backends.postgresql_psycopg2', +# 'NAME': 'ci', +# 'USER': 'postgres', +# 'PASSWORD': 'postgres', +# 'HOST': 'postgres', +# 'PORT': '5432', +# }, +# } +# +# and then adding `--settings app.settings.ci` (or similar) to the test command + test: variables: DATABASE_URL: "postgresql://postgres:postgres@postgres:5432/$POSTGRES_DB" script: - - python manage.py migrate - python manage.py test diff --git a/vendor/gitlab-ci-yml/Pages/Hexo.gitlab-ci.yml b/vendor/gitlab-ci-yml/Pages/Hexo.gitlab-ci.yml index 908463c9d12..02d02250bbf 100644 --- a/vendor/gitlab-ci-yml/Pages/Hexo.gitlab-ci.yml +++ b/vendor/gitlab-ci-yml/Pages/Hexo.gitlab-ci.yml @@ -1,17 +1,16 @@ # Full project: https://gitlab.com/pages/hexo -image: node:4.2.2 +image: node:6.10.0 pages: - cache: - paths: - - node_modules/ - script: - - npm install hexo-cli -g - npm install - - hexo deploy + - ./node_modules/hexo/bin/hexo generate artifacts: paths: - public + cache: + paths: + - node_modules + key: project only: - master diff --git a/vendor/gitlab-ci-yml/Pages/Jekyll.gitlab-ci.yml b/vendor/gitlab-ci-yml/Pages/Jekyll.gitlab-ci.yml index d98cf94d635..37f50554036 100644 --- a/vendor/gitlab-ci-yml/Pages/Jekyll.gitlab-ci.yml +++ b/vendor/gitlab-ci-yml/Pages/Jekyll.gitlab-ci.yml @@ -1,8 +1,10 @@ # Template project: https://gitlab.com/pages/jekyll # Docs: https://docs.gitlab.com/ce/pages/ -# Jekyll version: 3.4.0 image: ruby:2.3 +variables: + JEKYLL_ENV: production + before_script: - bundle install @@ -25,4 +27,4 @@ pages: - public only: - master -
\ No newline at end of file + diff --git a/vendor/gitlab-ci-yml/Scala.gitlab-ci.yml b/vendor/gitlab-ci-yml/Scala.gitlab-ci.yml index 443ba42e38c..b4208ed9d7d 100644 --- a/vendor/gitlab-ci-yml/Scala.gitlab-ci.yml +++ b/vendor/gitlab-ci-yml/Scala.gitlab-ci.yml @@ -9,7 +9,7 @@ before_script: - apt-get install apt-transport-https -yqq # Add keyserver for SBT - echo "deb http://dl.bintray.com/sbt/debian /" | tee -a /etc/apt/sources.list.d/sbt.list - - apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 642AC823 + - apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2EE0EA64E40A89B84B2DF73499E82A75642AC823 # Install SBT - apt-get update -yqq - apt-get install sbt -yqq diff --git a/vendor/licenses.csv b/vendor/licenses.csv index a2cbef126ad..6441df25fe1 100644 --- a/vendor/licenses.csv +++ b/vendor/licenses.csv @@ -1,9 +1,9 @@ RedCloth,4.3.2,MIT abbrev,1.0.9,ISC accepts,1.3.3,MIT -ace-rails-ap,4.1.0,MIT -acorn,4.0.4,MIT -acorn-dynamic-import,2.0.1,MIT +ace-rails-ap,4.1.2,MIT +acorn,4.0.11,MIT +acorn-dynamic-import,2.0.2,MIT acorn-jsx,3.0.1,MIT actionmailer,4.2.8,MIT actionpack,4.2.8,MIT @@ -16,19 +16,20 @@ acts-as-taggable-on,4.0.0,MIT addressable,2.3.8,Apache 2.0 after,0.8.2,MIT after_commit_queue,1.3.0,MIT -ajv,4.11.2,MIT +ajv,4.11.5,MIT ajv-keywords,1.5.1,MIT akismet,2.0.0,MIT align-text,0.1.4,MIT allocations,1.0.5,MIT +alphanum-sort,1.0.2,MIT amdefine,1.0.1,BSD-3-Clause OR MIT ansi-escapes,1.4.0,MIT -ansi-html,0.0.7,Apache 2.0 +ansi-html,0.0.5,"Apache, Version 2.0" ansi-regex,2.1.1,MIT ansi-styles,2.2.1,MIT anymatch,1.3.0,ISC append-transform,0.4.0,MIT -aproba,1.1.0,ISC +aproba,1.1.1,ISC are-we-there-yet,1.1.2,ISC arel,6.0.4,MIT argparse,1.0.9,MIT @@ -55,13 +56,14 @@ asynckit,0.4.0,MIT attr_encrypted,3.0.3,MIT attr_required,1.0.0,MIT autoparse,0.3.3,Apache 2.0 +autoprefixer,6.7.7,MIT autoprefixer-rails,6.2.3,MIT aws-sign2,0.6.0,Apache 2.0 aws4,1.6.0,MIT axiom-types,0.1.1,MIT babel-code-frame,6.22.0,MIT -babel-core,6.23.1,MIT -babel-generator,6.23.0,MIT +babel-core,6.24.0,MIT +babel-generator,6.24.0,MIT babel-helper-bindify-decorators,6.22.0,MIT babel-helper-builder-binary-assignment-operator-visitor,6.22.0,MIT babel-helper-call-delegate,6.22.0,MIT @@ -76,10 +78,10 @@ babel-helper-regex,6.22.0,MIT babel-helper-remap-async-to-generator,6.22.0,MIT babel-helper-replace-supers,6.23.0,MIT babel-helpers,6.23.0,MIT -babel-loader,6.2.10,MIT +babel-loader,6.4.1,MIT babel-messages,6.23.0,MIT babel-plugin-check-es2015-constants,6.22.0,MIT -babel-plugin-istanbul,4.0.0,New BSD +babel-plugin-istanbul,4.1.1,New BSD babel-plugin-syntax-async-functions,6.13.0,MIT babel-plugin-syntax-async-generators,6.13.0,MIT babel-plugin-syntax-class-properties,6.13.0,MIT @@ -92,6 +94,7 @@ babel-plugin-transform-async-generator-functions,6.22.0,MIT babel-plugin-transform-async-to-generator,6.22.0,MIT babel-plugin-transform-class-properties,6.23.0,MIT babel-plugin-transform-decorators,6.22.0,MIT +babel-plugin-transform-define,1.2.0,MIT babel-plugin-transform-es2015-arrow-functions,6.22.0,MIT babel-plugin-transform-es2015-block-scoped-functions,6.22.0,MIT babel-plugin-transform-es2015-block-scoping,6.23.0,MIT @@ -102,10 +105,10 @@ babel-plugin-transform-es2015-duplicate-keys,6.22.0,MIT babel-plugin-transform-es2015-for-of,6.23.0,MIT babel-plugin-transform-es2015-function-name,6.22.0,MIT babel-plugin-transform-es2015-literals,6.22.0,MIT -babel-plugin-transform-es2015-modules-amd,6.22.0,MIT -babel-plugin-transform-es2015-modules-commonjs,6.23.0,MIT +babel-plugin-transform-es2015-modules-amd,6.24.0,MIT +babel-plugin-transform-es2015-modules-commonjs,6.24.0,MIT babel-plugin-transform-es2015-modules-systemjs,6.23.0,MIT -babel-plugin-transform-es2015-modules-umd,6.23.0,MIT +babel-plugin-transform-es2015-modules-umd,6.24.0,MIT babel-plugin-transform-es2015-object-super,6.22.0,MIT babel-plugin-transform-es2015-parameters,6.23.0,MIT babel-plugin-transform-es2015-shorthand-properties,6.22.0,MIT @@ -118,16 +121,19 @@ babel-plugin-transform-exponentiation-operator,6.22.0,MIT babel-plugin-transform-object-rest-spread,6.23.0,MIT babel-plugin-transform-regenerator,6.22.0,MIT babel-plugin-transform-strict-mode,6.22.0,MIT -babel-preset-es2015,6.22.0,MIT +babel-preset-es2015,6.24.0,MIT +babel-preset-es2016,6.22.0,MIT +babel-preset-es2017,6.22.0,MIT +babel-preset-latest,6.24.0,MIT babel-preset-stage-2,6.22.0,MIT babel-preset-stage-3,6.22.0,MIT -babel-register,6.23.0,MIT -babel-runtime,6.22.0,MIT +babel-register,6.24.0,MIT +babel-runtime,6.23.0,MIT babel-template,6.23.0,MIT babel-traverse,6.23.1,MIT babel-types,6.23.0,MIT babosa,1.0.2,MIT -babylon,6.15.0,MIT +babylon,6.16.1,MIT backo2,1.0.2,MIT balanced-match,0.4.2,MIT base32,0.3.2,MIT @@ -143,21 +149,22 @@ binary-extensions,1.8.0,MIT bindata,2.3.5,ruby blob,0.0.4,unknown block-stream,0.0.9,ISC -bluebird,3.4.7,MIT +bluebird,3.5.0,MIT bn.js,4.11.6,MIT -body-parser,1.16.0,MIT +body-parser,1.17.1,MIT boom,2.10.1,New BSD bootstrap-sass,3.3.6,MIT brace-expansion,1.1.6,MIT braces,1.8.5,MIT -brorand,1.0.7,MIT +brorand,1.1.0,MIT browser,2.2.0,MIT browserify-aes,1.0.6,MIT browserify-cipher,1.0.0,MIT browserify-des,1.0.0,MIT browserify-rsa,4.0.1,MIT -browserify-sign,4.0.0,ISC +browserify-sign,4.0.4,ISC browserify-zlib,0.1.4,MIT +browserslist,1.7.7,MIT buffer,4.9.1,MIT buffer-shims,1.0.0,MIT buffer-xor,1.0.3,MIT @@ -169,8 +176,10 @@ caller-path,0.1.0,MIT callsite,1.0.0,unknown callsites,0.2.0,MIT camelcase,1.2.1,MIT +caniuse-api,1.6.1,MIT +caniuse-db,1.0.30000649,CC-BY-4.0 carrierwave,0.11.2,MIT -caseless,0.11.0,Apache 2.0 +caseless,0.12.0,Apache 2.0 cause,0.1,MIT center-align,0.1.3,MIT chalk,1.1.3,MIT @@ -181,16 +190,24 @@ chronic_duration,0.10.6,MIT chunky_png,1.3.5,MIT cipher-base,1.0.3,MIT circular-json,0.3.1,MIT +citrus,3.0.2,MIT +clap,1.1.3,MIT cli-cursor,1.0.2,MIT cli-width,2.1.0,ISC cliui,2.1.0,ISC clone,1.0.2,MIT co,4.6.0,MIT +coa,1.0.1,MIT code-point-at,1.1.0,MIT coercible,1.0.0,MIT coffee-rails,4.1.1,MIT coffee-script,2.4.1,MIT coffee-script-source,1.10.0,MIT +color,0.11.4,MIT +color-convert,1.9.0,MIT +color-name,1.1.2,MIT +color-string,0.3.0,MIT +colormin,1.1.2,MIT colors,1.1.2,MIT combine-lists,1.0.1,MIT combined-stream,1.0.5,MIT @@ -199,26 +216,29 @@ commondir,1.0.1,MIT component-bind,1.0.0,unknown component-emitter,1.2.1,MIT component-inherit,0.0.3,unknown -compressible,2.0.9,MIT +compressible,2.0.10,MIT compression,1.6.2,MIT compression-webpack-plugin,0.3.2,MIT concat-map,0.0.1,MIT concat-stream,1.6.0,MIT -concurrent-ruby,1.0.4,MIT -connect,3.5.0,MIT +config-chain,1.1.11,MIT +configstore,1.4.0,Simplified BSD +connect,3.6.0,MIT connect-history-api-fallback,1.3.0,MIT connection_pool,2.2.1,MIT console-browserify,1.1.0,MIT console-control-strings,1.1.0,ISC +consolidate,0.14.5,MIT constants-browserify,1.0.0,MIT contains-path,0.1.0,MIT content-disposition,0.5.2,MIT content-type,1.0.2,MIT -convert-source-map,1.3.0,MIT +convert-source-map,1.5.0,MIT cookie,0.3.1,MIT cookie-signature,1.0.6,MIT core-js,2.4.1,MIT core-util-is,1.0.2,MIT +cosmiconfig,2.1.1,MIT crack,0.4.3,MIT create-ecdh,4.0.0,MIT create-hash,1.1.2,MIT @@ -226,14 +246,21 @@ create-hmac,1.1.4,MIT creole,0.5.0,ruby cryptiles,2.0.5,New BSD crypto-browserify,3.11.0,MIT +css-color-names,0.0.4,MIT +css-loader,0.28.0,MIT +css-selector-tokenizer,0.7.0,MIT css_parser,1.4.1,MIT +cssesc,0.1.0,MIT +cssnano,3.10.0,MIT +csso,2.3.2,MIT custom-event,1.0.1,MIT -d,0.1.1,MIT -d3,3.5.11,New BSD +d,1.0.0,MIT +d3,3.5.17,New BSD d3_rails,3.5.11,MIT dashdash,1.14.1,MIT date-now,0.1.4,MIT -debug,2.6.0,MIT +de-indent,1.0.2,MIT +debug,2.6.3,MIT decamelize,1.2.0,MIT deckar01-task_list,1.0.6,MIT deep-extend,0.4.1,MIT @@ -241,6 +268,7 @@ deep-is,0.1.3,MIT default-require-extensions,1.0.0,MIT default_value_for,3.0.2,MIT defaults,1.0.3,MIT +defined,1.0.0,MIT del,2.2.2,MIT delayed-stream,1.0.0,MIT delegates,1.0.0,MIT @@ -255,62 +283,74 @@ di,0.0.1,MIT diff-lcs,1.2.5,"MIT,Perl Artistic v2,GNU GPL v2" diffie-hellman,5.0.2,MIT diffy,3.1.0,MIT -doctrine,1.5.0,BSD -document-register-element,1.3.0,MIT +doctrine,2.0.0,Apache 2.0 +document-register-element,1.4.1,MIT dom-serialize,2.2.1,MIT +dom-serializer,0.1.0,MIT domain-browser,1.1.7,MIT domain_name,0.5.20161021,"Simplified BSD,New BSD,Mozilla Public License 2.0" +domelementtype,1.3.0,unknown +domhandler,2.3.0,unknown +domutils,1.5.1,unknown doorkeeper,4.2.0,MIT doorkeeper-openid_connect,1.1.2,MIT -dropzone,4.2.0,MIT +dropzone,4.3.0,MIT dropzonejs-rails,0.7.2,MIT duplexer,0.1.1,MIT +duplexify,3.5.0,MIT ecc-jsbn,0.1.1,MIT +editorconfig,0.13.2,MIT ee-first,1.1.1,MIT ejs,2.5.6,Apache 2.0 -elliptic,6.3.3,MIT +electron-to-chromium,1.3.3,ISC +elliptic,6.4.0,MIT email_reply_trimmer,0.1.6,MIT emoji-unicode-version,0.2.1,MIT emojis-list,2.1.0,MIT encodeurl,1.0.1,MIT encryptor,3.0.0,MIT -engine.io,1.8.2,MIT -engine.io-client,1.8.2,MIT +end-of-stream,1.0.0,MIT +engine.io,1.8.3,MIT +engine.io-client,1.8.3,MIT engine.io-parser,1.3.2,MIT enhanced-resolve,3.1.0,MIT ent,2.2.0,MIT +entities,1.1.1,BSD-like equalizer,0.0.11,MIT errno,0.1.4,MIT -error-ex,1.3.0,MIT +error-ex,1.3.1,MIT erubis,2.7.0,MIT -es5-ext,0.10.12,MIT -es6-iterator,2.0.0,MIT -es6-map,0.1.4,MIT -es6-promise,4.0.5,MIT -es6-set,0.1.4,MIT -es6-symbol,3.1.0,MIT -es6-weak-map,2.0.1,MIT +es5-ext,0.10.15,MIT +es6-iterator,2.0.1,MIT +es6-map,0.1.5,MIT +es6-promise,3.0.2,MIT +es6-set,0.1.5,MIT +es6-symbol,3.1.1,MIT +es6-weak-map,2.0.2,MIT escape-html,1.0.3,MIT escape-string-regexp,1.0.5,MIT escape_utils,1.1.1,MIT escodegen,1.8.1,Simplified BSD escope,3.6.0,Simplified BSD -eslint,3.15.0,MIT +eslint,3.19.0,MIT eslint-config-airbnb-base,10.0.1,MIT eslint-import-resolver-node,0.2.3,MIT eslint-import-resolver-webpack,0.8.1,MIT eslint-module-utils,2.0.0,MIT eslint-plugin-filenames,1.1.0,MIT +eslint-plugin-html,2.0.1,ISC eslint-plugin-import,2.2.0,MIT eslint-plugin-jasmine,2.2.0,MIT -espree,3.4.0,Simplified BSD -esprima,3.1.3,Simplified BSD +espree,3.4.1,Simplified BSD +esprima,2.7.3,Simplified BSD +esquery,1.0.0,BSD esrecurse,4.1.0,Simplified BSD estraverse,4.1.1,Simplified BSD esutils,2.0.2,BSD -etag,1.7.0,MIT +etag,1.8.0,MIT eve-raphael,0.5.0,Apache 2.0 -event-emitter,0.3.4,MIT +event-emitter,0.3.5,MIT +event-stream,3.3.4,MIT eventemitter3,1.2.0,MIT events,1.1.1,MIT eventsource,0.1.6,MIT @@ -321,7 +361,7 @@ exit-hook,1.1.1,MIT expand-braces,0.1.2,MIT expand-brackets,0.1.5,MIT expand-range,1.8.2,MIT -express,4.14.1,MIT +express,4.15.2,MIT expression_parser,0.9.0,MIT extend,3.0.0,MIT extglob,0.3.2,MIT @@ -332,20 +372,23 @@ faraday,0.9.2,MIT faraday_middleware,0.10.0,MIT faraday_middleware-multi_json,0.0.6,MIT fast-levenshtein,2.0.6,MIT -faye-websocket,0.10.0,MIT +fastparse,1.1.1,MIT +faye-websocket,0.7.3,MIT fd-slicer,1.0.1,MIT ffi,1.9.10,BSD figures,1.7.0,MIT file-entry-cache,2.0.0,MIT +file-loader,0.11.1,MIT filename-regex,2.0.0,MIT fileset,2.0.3,MIT -filesize,3.5.4,New BSD +filesize,3.3.0,New BSD fill-range,2.2.3,MIT -finalhandler,0.5.1,MIT +finalhandler,1.0.1,MIT find-cache-dir,0.1.1,MIT find-root,0.1.2,MIT find-up,2.1.0,MIT flat-cache,1.2.2,MIT +flatten,1.0.2,MIT flowdock,0.7.1,MIT fog-aws,0.11.0,MIT fog-core,1.42.0,MIT @@ -356,20 +399,21 @@ fog-openstack,0.1.6,MIT fog-rackspace,0.1.1,MIT fog-xml,0.1.2,MIT font-awesome-rails,4.7.0.1,"MIT,SIL Open Font License" -for-in,0.1.6,MIT -for-own,0.1.4,MIT +for-in,1.0.2,MIT +for-own,0.1.5,MIT forever-agent,0.6.1,Apache 2.0 form-data,2.1.2,MIT formatador,0.2.5,MIT forwarded,0.1.0,MIT -fresh,0.3.0,MIT +fresh,0.5.0,MIT +from,0.1.7,MIT fs-extra,1.0.0,MIT fs.realpath,1.0.0,ISC fsevents,,unknown -fstream,1.0.10,ISC +fstream,1.0.11,ISC fstream-ignore,1.0.5,ISC function-bind,1.1.0,MIT -gauge,2.7.2,ISC +gauge,2.7.3,ISC gemnasium-gitlab-service,0.2.6,MIT gemojione,3.0.1,MIT generate-function,2.0.0,MIT @@ -377,7 +421,7 @@ generate-object-property,1.2.0,MIT get-caller-file,1.0.2,ISC get_process_mem,0.2.0,MIT getpass,0.1.6,MIT -gitaly,0.2.1,MIT +gitaly,0.5.0,MIT github-linguist,4.7.6,MIT github-markup,1.4.0,MIT gitlab-flowdock-git-hook,1.0.1,MIT @@ -388,15 +432,16 @@ glob,7.1.1,ISC glob-base,0.3.0,MIT glob-parent,2.0.0,ISC globalid,0.3.7,MIT -globals,9.14.0,MIT +globals,9.17.0,MIT globby,5.0.0,MIT gollum-grit_adapter,1.0.1,MIT gollum-lib,4.2.1,MIT -gollum-rugged_adapter,0.4.2,MIT +gollum-rugged_adapter,0.4.4,MIT gon,6.1.0,MIT google-api-client,0.8.7,Apache 2.0 -google-protobuf,3.2.0,New BSD +google-protobuf,3.2.0.2,New BSD googleauth,0.5.1,Apache 2.0 +got,3.3.1,MIT graceful-fs,4.1.11,ISC graceful-readlink,1.0.1,MIT grape,0.19.1,MIT @@ -406,34 +451,40 @@ gzip-size,3.0.0,MIT hamlit,2.6.1,MIT handle-thing,1.2.5,MIT handlebars,4.0.6,MIT -har-validator,2.0.6,ISC +har-schema,1.0.5,ISC +har-validator,4.2.1,ISC has,1.0.1,MIT has-ansi,2.0.0,MIT has-binary,0.1.7,MIT has-cors,1.1.0,MIT has-flag,1.0.0,MIT has-unicode,2.0.1,ISC +hash-sum,1.0.2,MIT hash.js,1.0.3,MIT hasha,2.2.0,MIT hashie,3.5.5,MIT hawk,3.1.3,New BSD +he,1.1.1,MIT health_check,2.6.0,MIT hipchat,1.5.2,MIT +hmac-drbg,1.0.0,MIT hoek,2.16.3,New BSD home-or-tmp,2.0.0,MIT -hosted-git-info,2.2.0,ISC +hosted-git-info,2.4.1,ISC hpack.js,2.1.6,MIT +html-comment-regex,1.1.1,MIT html-entities,1.2.0,MIT html-pipeline,1.11.0,MIT html2text,0.2.0,MIT htmlentities,4.3.4,MIT +htmlparser2,3.9.2,MIT http,0.9.8,MIT http-cookie,1.0.3,MIT http-deceiver,1.2.7,MIT -http-errors,1.5.1,MIT +http-errors,1.6.1,MIT http-form_data,1.0.1,MIT http-proxy,1.16.2,MIT -http-proxy-middleware,0.17.3,MIT +http-proxy-middleware,0.17.4,MIT http-signature,1.1.1,MIT http_parser.rb,0.6.0,MIT httparty,0.13.7,MIT @@ -442,24 +493,30 @@ https-browserify,0.0.1,MIT i18n,0.8.1,MIT ice_nine,0.11.2,MIT iconv-lite,0.4.15,MIT +icss-replace-symbols,1.0.2,ISC ieee754,1.1.8,New BSD -ignore,3.2.2,MIT +ignore,3.2.6,MIT +ignore-by-default,1.0.1,ISC +immediate,3.0.6,MIT imurmurhash,0.1.4,MIT +indexes-of,1.0.1,MIT indexof,0.0.1,unknown +infinity-agent,2.0.3,MIT inflight,1.0.6,ISC influxdb,0.2.3,MIT inherits,2.0.3,ISC ini,1.3.4,ISC inquirer,0.12.0,MIT -interpret,1.0.1,MIT +interpret,1.0.2,MIT invariant,2.2.2,New BSD invert-kv,1.0.0,MIT -ipaddr.js,1.2.0,MIT +ipaddr.js,1.3.0,MIT ipaddress,0.8.3,MIT is-absolute,0.2.6,MIT +is-absolute-url,2.1.0,MIT is-arrayish,0.2.1,MIT is-binary-path,1.0.1,MIT -is-buffer,1.1.4,MIT +is-buffer,1.1.5,MIT is-builtin-module,1.0.0,MIT is-dotfile,1.0.2,MIT is-equal-shallow,0.1.3,MIT @@ -468,46 +525,52 @@ is-extglob,1.0.0,MIT is-finite,1.0.2,MIT is-fullwidth-code-point,1.0.0,MIT is-glob,2.0.1,MIT -is-my-json-valid,2.15.0,MIT +is-my-json-valid,2.16.0,MIT +is-npm,1.0.0,MIT is-number,2.1.0,MIT is-path-cwd,1.0.0,MIT is-path-in-cwd,1.0.0,MIT is-path-inside,1.0.0,MIT +is-plain-obj,1.1.0,MIT is-posix-bracket,0.1.1,MIT is-primitive,2.0.0,MIT is-property,1.0.2,MIT +is-redirect,1.0.0,MIT is-relative,0.2.1,MIT is-resolvable,1.0.0,MIT is-stream,1.1.0,MIT +is-svg,2.1.0,MIT is-typedarray,1.0.0,MIT is-unc-path,0.1.2,MIT is-utf8,0.2.1,MIT is-windows,0.2.0,MIT isarray,1.0.0,MIT isbinaryfile,3.0.2,MIT -isexe,1.1.2,ISC +isexe,2.0.0,ISC isobject,2.1.0,MIT isstream,0.1.2,MIT istanbul,0.4.5,New BSD -istanbul-api,1.1.1,New BSD -istanbul-lib-coverage,1.0.1,New BSD -istanbul-lib-hook,1.0.0,New BSD -istanbul-lib-instrument,1.4.2,New BSD -istanbul-lib-report,1.0.0-alpha.3,New BSD -istanbul-lib-source-maps,1.1.0,New BSD -istanbul-reports,1.0.1,New BSD +istanbul-api,1.1.7,New BSD +istanbul-lib-coverage,1.0.2,New BSD +istanbul-lib-hook,1.0.5,New BSD +istanbul-lib-instrument,1.7.0,New BSD +istanbul-lib-report,1.0.0,New BSD +istanbul-lib-source-maps,1.1.1,New BSD +istanbul-reports,1.0.2,New BSD jasmine-core,2.5.2,MIT jasmine-jquery,2.1.1,MIT jira-ruby,1.1.2,MIT jodid25519,1.0.2,MIT -jquery,2.2.1,MIT +jquery,2.2.4,MIT jquery-atwho-rails,1.3.2,MIT jquery-rails,4.1.1,MIT -jquery-ujs,1.2.1,MIT -js-cookie,2.1.3,MIT +jquery-ujs,1.2.2,MIT +js-base64,2.1.9,BSD +js-beautify,1.6.12,MIT +js-cookie,2.1.4,MIT js-tokens,3.0.1,MIT -js-yaml,3.8.1,MIT -jsbn,0.1.0,BSD +js-yaml,3.7.0,MIT +jsbn,0.1.1,MIT jsesc,1.3.0,MIT json,1.8.6,ruby json-jwt,1.7.1,MIT @@ -520,51 +583,72 @@ json5,0.5.1,MIT jsonfile,2.4.0,MIT jsonify,0.0.0,Public Domain jsonpointer,4.0.1,MIT -jsprim,1.3.1,MIT +jsprim,1.4.0,MIT +jszip,3.1.3,(MIT OR GPL-3.0) +jszip-utils,0.0.2,MIT or GPLv3 jwt,1.5.6,MIT kaminari,0.17.0,MIT -karma,1.4.1,MIT -karma-coverage-istanbul-reporter,0.2.0,MIT +karma,1.6.0,MIT +karma-coverage-istanbul-reporter,0.2.3,MIT karma-jasmine,1.1.0,MIT -karma-mocha-reporter,2.2.2,MIT -karma-phantomjs-launcher,1.0.2,MIT +karma-mocha-reporter,2.2.3,MIT +karma-phantomjs-launcher,1.0.4,MIT karma-sourcemap-loader,0.3.7,MIT -karma-webpack,2.0.2,MIT +karma-webpack,2.0.3,MIT kew,0.7.0,Apache 2.0 kgio,2.10.0,LGPL-2.1+ kind-of,3.1.0,MIT klaw,1.3.1,MIT kubeclient,2.2.0,MIT +latest-version,1.0.1,MIT launchy,2.4.3,ISC lazy-cache,1.0.4,MIT lcid,1.0.0,MIT levn,0.3.0,MIT licensee,8.7.0,MIT +lie,3.1.1,MIT little-plugger,1.1.4,MIT load-json-file,1.1.0,MIT loader-runner,2.3.0,MIT -loader-utils,0.2.16,MIT +loader-utils,0.2.17,MIT locate-path,2.0.0,MIT lodash,4.17.4,MIT +lodash._baseassign,3.2.0,MIT +lodash._basecopy,3.0.1,MIT lodash._baseget,3.7.2,MIT +lodash._bindcallback,3.0.1,MIT +lodash._createassigner,3.1.1,MIT +lodash._getnative,3.9.1,MIT +lodash._isiterateecall,3.0.9,MIT lodash._topath,3.8.1,MIT -lodash.camelcase,4.1.1,MIT +lodash.assign,3.2.0,MIT +lodash.camelcase,4.3.0,MIT lodash.capitalize,4.2.1,MIT lodash.cond,4.5.2,MIT lodash.deburr,4.1.0,MIT -lodash.get,3.7.0,MIT +lodash.defaults,3.1.2,MIT +lodash.get,4.4.2,MIT +lodash.isarguments,3.1.0,MIT lodash.isarray,3.0.4,MIT lodash.kebabcase,4.0.1,MIT +lodash.keys,3.1.2,MIT +lodash.memoize,4.1.2,MIT +lodash.restparam,3.6.1,MIT lodash.snakecase,4.0.1,MIT +lodash.uniq,4.5.0,MIT lodash.words,4.2.0,MIT log4js,0.6.38,Apache 2.0 logging,2.1.0,MIT longest,1.0.1,MIT loofah,2.0.3,MIT loose-envify,1.3.1,MIT -lru-cache,2.2.4,MIT +lowercase-keys,1.0.0,MIT +lru-cache,3.2.0,ISC +macaddress,0.2.8,MIT mail,2.6.4,MIT mail_room,0.9.1,MIT +map-stream,0.1.0,unknown +math-expression-evaluator,1.2.16,MIT media-typer,0.3.0,MIT memoist,0.15.0,MIT memory-fs,0.4.1,MIT @@ -574,16 +658,17 @@ methods,1.1.2,MIT micromatch,2.3.11,MIT miller-rabin,4.0.0,MIT mime,1.3.4,MIT -mime-db,1.26.0,MIT +mime-db,1.27.0,MIT mime-types,2.99.3,"MIT,Artistic-2.0,GPL-2.0" mimemagic,0.3.0,MIT mini_portile2,2.1.0,MIT minimalistic-assert,1.0.0,ISC +minimalistic-crypto-utils,1.0.1,MIT minimatch,3.0.3,ISC minimist,0.0.8,MIT mkdirp,0.5.1,MIT -moment,2.17.1,MIT -mousetrap,1.4.6,Apache 2.0 +moment,2.18.1,MIT +mousetrap,1.6.1,Apache 2.0 mousetrap-rails,1.4.6,"MIT,Apache" ms,0.7.2,MIT multi_json,1.12.1,MIT @@ -595,17 +680,22 @@ mute-stream,0.0.5,ISC nan,2.5.1,MIT natural-compare,1.4.0,MIT negotiator,0.6.1,MIT +nested-error-stacks,1.0.2,MIT net-ldap,0.12.1,MIT net-ssh,3.0.1,MIT netrc,0.11.0,MIT node-libs-browser,2.0.0,MIT -node-pre-gyp,0.6.33,New BSD +node-pre-gyp,0.6.34,New BSD node-zopfli,2.0.2,MIT +nodemon,1.11.0,MIT nokogiri,1.6.8.1,MIT -nopt,3.0.6,ISC -normalize-package-data,2.3.5,Simplified BSD -normalize-path,2.0.1,MIT +nopt,4.0.1,ISC +normalize-package-data,2.3.6,Simplified BSD +normalize-path,2.1.1,MIT +normalize-range,0.1.2,MIT +normalize-url,1.9.1,MIT npmlog,4.0.2,ISC +num2fraction,1.2.2,MIT number-is-nan,1.0.1,MIT numerizer,0.1.1,MIT oauth,0.5.1,MIT @@ -637,7 +727,7 @@ omniauth-twitter,1.2.1,MIT omniauth_crowd,2.2.3,MIT on-finished,2.3.0,MIT on-headers,1.0.1,MIT -once,1.3.3,ISC +once,1.4.0,ISC onetime,1.1.0,MIT opener,1.4.3,(WTFPL OR MIT) opn,4.0.2,MIT @@ -652,11 +742,13 @@ os-browserify,0.2.1,MIT os-homedir,1.0.2,MIT os-locale,1.4.0,MIT os-tmpdir,1.0.2,MIT +osenv,0.1.4,ISC p-limit,1.1.0,MIT p-locate,2.0.0,MIT -pako,0.2.9,MIT +package-json,1.2.0,MIT +pako,1.0.5,(MIT AND Zlib) paranoia,2.2.0,MIT -parse-asn1,5.0.0,ISC +parse-asn1,5.1.0,ISC parse-glob,3.0.4,MIT parse-json,2.2.0,MIT parsejson,0.0.3,MIT @@ -670,8 +762,10 @@ path-is-inside,1.0.2,(WTFPL OR MIT) path-parse,1.0.5,MIT path-to-regexp,0.1.7,MIT path-type,1.1.0,MIT +pause-stream,0.0.11,"Apache2,MIT" pbkdf2,3.0.9,MIT pend,1.2.0,MIT +performance-now,0.2.0,MIT pg,0.18.4,"BSD,ruby,GPL" phantomjs-prebuilt,2.1.14,Apache 2.0 pify,2.3.0,MIT @@ -683,21 +777,63 @@ pkg-up,1.0.0,MIT pluralize,1.2.1,MIT portfinder,1.0.13,MIT posix-spawn,0.3.11,"MIT,LGPL" +postcss,5.2.16,MIT +postcss-calc,5.3.1,MIT +postcss-colormin,2.2.2,MIT +postcss-convert-values,2.6.1,MIT +postcss-discard-comments,2.0.4,MIT +postcss-discard-duplicates,2.1.0,MIT +postcss-discard-empty,2.1.0,MIT +postcss-discard-overridden,0.1.1,MIT +postcss-discard-unused,2.2.3,MIT +postcss-filter-plugins,2.0.2,MIT +postcss-load-config,1.2.0,MIT +postcss-load-options,1.2.0,MIT +postcss-load-plugins,2.3.0,MIT +postcss-merge-idents,2.1.7,MIT +postcss-merge-longhand,2.0.2,MIT +postcss-merge-rules,2.1.2,MIT +postcss-message-helpers,2.0.0,MIT +postcss-minify-font-values,1.0.5,MIT +postcss-minify-gradients,1.0.5,MIT +postcss-minify-params,1.2.2,MIT +postcss-minify-selectors,2.1.1,MIT +postcss-modules-extract-imports,1.0.1,ISC +postcss-modules-local-by-default,1.1.1,MIT +postcss-modules-scope,1.0.2,ISC +postcss-modules-values,1.2.2,ISC +postcss-normalize-charset,1.1.1,MIT +postcss-normalize-url,3.0.8,MIT +postcss-ordered-values,2.2.3,MIT +postcss-reduce-idents,2.4.0,MIT +postcss-reduce-initial,1.0.1,MIT +postcss-reduce-transforms,1.0.4,MIT +postcss-selector-parser,2.2.3,MIT +postcss-svgo,2.1.6,MIT +postcss-unique-selectors,2.0.2,MIT +postcss-value-parser,3.3.0,MIT +postcss-zindex,2.2.0,MIT prelude-ls,1.1.2,MIT premailer,1.8.6,New BSD premailer-rails,1.9.2,MIT +prepend-http,1.0.4,MIT preserve,0.2.0,MIT private,0.1.7,MIT process,0.11.9,MIT process-nextick-args,1.0.7,MIT progress,1.1.8,MIT -proxy-addr,1.1.3,MIT +proto-list,1.2.4,ISC +proxy-addr,1.1.4,MIT prr,0.0.0,MIT +ps-tree,1.1.0,MIT +pseudomap,1.0.2,ISC public-encrypt,4.0.0,MIT punycode,1.4.1,MIT pyu-ruby-sasl,0.0.3.3,MIT +q,1.5.0,MIT qjobs,1.1.5,MIT -qs,6.2.0,New BSD +qs,6.4.0,New BSD +query-string,4.3.2,MIT querystring,0.2.0,MIT querystring-es3,0.2.1,MIT querystringify,0.0.4,MIT @@ -723,16 +859,19 @@ range-parser,1.2.0,MIT raphael,2.2.7,MIT raw-body,2.2.0,MIT raw-loader,0.5.1,MIT -rc,1.1.6,(BSD-2-Clause OR MIT OR Apache-2.0) +rc,1.2.1,(BSD-2-Clause OR MIT OR Apache-2.0) rdoc,4.2.2,ruby +react-dev-utils,0.5.2,New BSD +read-all-stream,3.1.0,MIT read-pkg,1.1.0,MIT read-pkg-up,1.0.1,MIT -readable-stream,2.1.5,MIT +readable-stream,2.0.6,MIT readdirp,2.1.0,MIT readline2,1.0.1,MIT recaptcha,3.0.0,MIT rechoir,0.6.2,MIT recursive-open-struct,1.0.0,MIT +recursive-readdir,2.1.1,MIT redcarpet,3.4.0,MIT redis,3.2.2,MIT redis-actionpack,5.0.1,MIT @@ -741,31 +880,36 @@ redis-namespace,1.5.2,MIT redis-rack,1.6.0,MIT redis-rails,5.0.1,MIT redis-store,1.2.0,MIT +reduce-css-calc,1.3.0,MIT +reduce-function-call,1.0.2,MIT regenerate,1.3.2,MIT -regenerator-runtime,0.10.1,MIT +regenerator-runtime,0.10.3,MIT regenerator-transform,0.9.8,BSD regex-cache,0.4.3,MIT regexpu-core,2.0.0,MIT +registry-url,3.1.0,MIT regjsgen,0.2.0,MIT regjsparser,0.1.5,BSD +remove-trailing-separator,1.0.1,ISC repeat-element,1.1.2,MIT repeat-string,1.6.1,MIT repeating,2.0.1,MIT -request,2.79.0,Apache 2.0 +request,2.81.0,Apache 2.0 request-progress,2.0.1,MIT request_store,1.3.1,MIT require-directory,2.1.1,MIT +require-from-string,1.2.1,MIT require-main-filename,1.0.1,ISC require-uncached,1.0.3,MIT requires-port,1.0.0,MIT -resolve,1.2.0,MIT +resolve,1.3.2,MIT resolve-from,1.0.1,MIT responders,2.3.0,MIT rest-client,2.0.0,MIT restore-cursor,1.0.1,MIT retriable,1.4.1,MIT right-align,0.1.3,MIT -rimraf,2.5.4,ISC +rimraf,2.6.1,ISC rinku,2.0.0,ISC ripemd160,1.0.1,New BSD rotp,2.1.2,MIT @@ -778,7 +922,7 @@ ruby-saml,1.4.1,MIT rubyntlm,0.5.2,MIT rubypants,0.2.0,BSD rufus-scheduler,3.1.10,MIT -rugged,0.24.0,MIT +rugged,0.25.1.1,MIT run-async,0.1.0,MIT rx-lite,3.1.2,Apache 2.0 safe-buffer,5.0.1,MIT @@ -787,158 +931,190 @@ sanitize,2.1.0,MIT sass,3.4.22,MIT sass-rails,5.0.6,MIT sawyer,0.8.1,MIT +sax,1.2.2,ISC securecompare,1.0.0,MIT seed-fu,2.3.6,MIT select-hose,2.0.0,MIT select2,3.5.2-browserify,unknown select2-rails,3.5.9.3,MIT semver,5.3.0,ISC -send,0.14.2,MIT -sentry-raven,2.0.2,Apache 2.0 +semver-diff,2.1.0,MIT +send,0.15.1,MIT +sentry-raven,2.4.0,Apache 2.0 serve-index,1.8.0,MIT -serve-static,1.11.2,MIT +serve-static,1.12.1,MIT set-blocking,2.0.0,ISC set-immediate-shim,1.0.1,MIT setimmediate,1.0.5,MIT -setprototypeof,1.0.2,ISC +setprototypeof,1.0.3,ISC settingslogic,2.0.9,MIT sha.js,2.4.8,MIT -shelljs,0.7.6,New BSD +shelljs,0.7.7,New BSD sidekiq,4.2.7,LGPL sidekiq-cron,0.4.4,MIT sidekiq-limit_fetch,3.4.0,MIT +sigmund,1.0.1,ISC signal-exit,3.0.2,ISC signet,0.7.3,Apache 2.0 slack-notifier,1.5.1,MIT slash,1.0.0,MIT slice-ansi,0.0.4,MIT +slide,1.1.6,ISC sntp,1.0.9,BSD -socket.io,1.7.2,MIT +socket.io,1.7.3,MIT socket.io-adapter,0.5.0,MIT -socket.io-client,1.7.2,MIT +socket.io-client,1.7.3,MIT socket.io-parser,2.3.1,MIT sockjs,0.3.18,MIT -sockjs-client,1.1.1,MIT +sockjs-client,1.0.1,MIT +sort-keys,1.1.2,MIT source-list-map,0.1.8,MIT source-map,0.5.6,New BSD -source-map-support,0.4.11,MIT +source-map-support,0.4.14,MIT spdx-correct,1.0.2,Apache 2.0 spdx-expression-parse,1.0.4,(MIT AND CC-BY-3.0) spdx-license-ids,1.2.2,Unlicense spdy,3.4.4,MIT spdy-transport,2.0.18,MIT +split,0.3.3,MIT sprintf-js,1.0.3,New BSD sprockets,3.7.1,MIT sprockets-rails,3.2.0,MIT -sshpk,1.10.2,MIT +sshpk,1.11.0,MIT state_machines,0.4.0,MIT state_machines-activemodel,0.4.0,MIT state_machines-activerecord,0.4.0,MIT stats-webpack-plugin,0.4.3,MIT statuses,1.3.1,MIT stream-browserify,2.0.1,MIT -stream-http,2.6.3,MIT +stream-combiner,0.0.4,MIT +stream-http,2.7.0,MIT +stream-shift,1.0.0,MIT +strict-uri-encode,1.1.0,MIT +string-length,1.0.1,MIT string-width,1.0.2,MIT -string.fromcodepoint,0.2.1,MIT -string.prototype.codepointat,0.2.0,MIT string_decoder,0.10.31,MIT stringex,2.5.2,MIT stringstream,0.0.5,MIT strip-ansi,3.0.1,MIT strip-bom,2.0.0,MIT -strip-json-comments,1.0.4,MIT -supports-color,0.2.0,MIT +strip-json-comments,2.0.1,MIT +supports-color,3.2.3,MIT +svgo,0.7.2,MIT sys-filesystem,1.1.6,Artistic 2.0 table,3.8.3,New BSD tapable,0.2.6,MIT tar,2.2.1,ISC -tar-pack,3.3.0,Simplified BSD +tar-pack,3.4.0,Simplified BSD temple,0.7.7,MIT -test-exclude,4.0.0,ISC +test-exclude,4.0.3,ISC text-table,0.2.0,MIT thor,0.19.4,MIT thread_safe,0.3.6,Apache 2.0 +three,0.84.0,MIT +three-orbit-controls,82.1.0,MIT +three-stl-loader,1.0.4,MIT throttleit,1.0.0,MIT through,2.3.8,MIT tilt,2.0.6,MIT timeago.js,2.0.5,MIT +timed-out,2.0.0,MIT timers-browserify,2.0.2,MIT timfel-krb5-auth,0.8.3,LGPL -tmp,0.0.28,MIT +tmp,0.0.31,MIT to-array,0.1.4,MIT to-arraybuffer,1.0.1,MIT to-fast-properties,1.0.2,MIT +toml-rb,0.3.15,MIT tool,0.2.3,MIT +touch,1.0.0,ISC tough-cookie,2.3.2,New BSD +traverse,0.6.6,MIT trim-right,1.0.1,MIT truncato,0.7.8,MIT tryit,1.0.3,MIT tty-browserify,0.0.0,MIT -tunnel-agent,0.4.3,Apache 2.0 +tunnel-agent,0.6.0,Apache 2.0 tweetnacl,0.14.5,Unlicense type-check,0.3.2,MIT -type-is,1.6.14,MIT +type-is,1.6.15,MIT typedarray,0.0.6,MIT tzinfo,1.2.2,MIT u2f,0.2.1,MIT uglifier,2.7.2,MIT -uglify-js,2.7.5,Simplified BSD +uglify-js,2.8.21,Simplified BSD uglify-to-browserify,1.0.2,MIT uid-number,0.0.6,ISC ultron,1.0.2,MIT unc-path-regex,0.1.2,MIT +undefsafe,0.0.3,MIT / http://rem.mit-license.org underscore,1.8.3,MIT underscore-rails,1.8.3,MIT unf,0.1.4,BSD unf_ext,0.0.7.2,MIT unicorn,5.1.0,ruby unicorn-worker-killer,0.4.4,ruby +uniq,1.0.1,MIT +uniqid,4.1.1,MIT +uniqs,2.0.0,MIT unpipe,1.0.0,MIT +update-notifier,0.5.0,Simplified BSD url,0.11.0,MIT url-parse,1.0.5,MIT url_safe_base64,0.2.2,MIT user-home,2.0.0,MIT -useragent,2.1.12,MIT +useragent,2.1.13,MIT util,0.10.3,MIT util-deprecate,1.0.2,MIT utils-merge,1.0.0,MIT uuid,3.0.1,MIT validate-npm-package-license,3.0.1,Apache 2.0 validates_hostname,1.0.6,MIT -vary,1.1.0,MIT +vary,1.1.1,MIT +vendors,1.0.1,MIT verror,1.3.6,MIT version_sorter,2.1.0,MIT virtus,1.0.5,MIT +visibilityjs,1.2.4,MIT vm-browserify,0.0.4,MIT vmstat,2.3.0,MIT void-elements,2.0.1,MIT -vue,2.1.10,MIT +vue,2.2.6,MIT +vue-hot-reload-api,2.0.11,MIT +vue-loader,11.3.4,MIT vue-resource,0.9.3,MIT +vue-style-loader,2.0.5,MIT +vue-template-compiler,2.2.6,MIT +vue-template-es2015-compiler,1.5.2,MIT warden,1.2.6,MIT -watchpack,1.2.1,MIT +watchpack,1.3.1,MIT wbuf,1.7.2,MIT -webpack,2.2.1,MIT -webpack-bundle-analyzer,2.3.0,MIT -webpack-dev-middleware,1.10.0,MIT -webpack-dev-server,2.3.0,MIT -webpack-rails,0.9.9,MIT -webpack-sources,0.1.4,MIT +webpack,2.3.3,MIT +webpack-bundle-analyzer,2.3.1,MIT +webpack-dev-middleware,1.10.1,MIT +webpack-dev-server,2.4.2,MIT +webpack-rails,0.9.10,MIT +webpack-sources,0.1.5,MIT websocket-driver,0.6.5,MIT websocket-extensions,0.1.1,MIT -which,1.2.12,ISC +whet.extend,0.9.9,MIT +which,1.2.14,ISC which-module,1.0.0,ISC wide-align,1.1.0,ISC wikicloth,0.8.1,MIT window-size,0.1.0,MIT -wordwrap,0.0.2,MIT/X11 +wordwrap,1.0.0,MIT wrap-ansi,2.1.0,MIT wrappy,1.0.2,ISC write,0.2.1,MIT -ws,1.1.1,MIT +write-file-atomic,1.3.1,ISC +ws,1.1.2,MIT wtf-8,1.0.0,MIT +xdg-basedir,2.0.0,MIT xmlhttprequest-ssl,1.5.3,MIT xtend,4.0.1,MIT y18n,3.2.1,ISC +yallist,2.1.2,ISC yargs,3.10.0,MIT yargs-parser,4.2.1,ISC yauzl,2.4.1,MIT |