From c6701fef0e2082e1adae15adb97c75311115617f Mon Sep 17 00:00:00 2001 From: Fabio Huser Date: Mon, 27 Mar 2017 22:18:09 +0200 Subject: [PATCH 01/83] fix(subgroups): add verification of group creation capability to subgroup UI --- app/models/user.rb | 4 ++++ app/views/groups/subgroups.html.haml | 2 +- spec/models/user_spec.rb | 22 ++++++++++++++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/app/models/user.rb b/app/models/user.rb index cbd741f96ed..bed2f0cae53 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -570,6 +570,10 @@ class User < ActiveRecord::Base can?(:create_group) end + def can_create_subgroup?(group) + can?(:create_group) && can?(:admin_group, group) + end + def can_select_namespace? several_namespaces? || admin end diff --git a/app/views/groups/subgroups.html.haml b/app/views/groups/subgroups.html.haml index be809083139..3342ba118ef 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 current_user.can_create_subgroup? @group = link_to new_group_path(parent_id: @group.id), class: 'btn btn-new pull-right' do New Subgroup diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index a9e37be1157..575b43c3d88 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -464,6 +464,28 @@ describe User, models: true do it { expect(@user2.several_namespaces?).to be_truthy } end + describe 'subgroups' do + let(:group) { create :group } + + it 'allows if owner' do + user = create :user + group.add_user(user, GroupMember::OWNER) + expect(user.can_create_subgroup?(group)).to be_truthy + end + + it 'disallows if missing right' do + user = create(:user, can_create_group: false) + group.add_user(user, GroupMember::MASTER) + expect(user.can_create_subgroup?(group)).to be_falsey + end + + it 'disallows if developer' do + user = create :user + group.add_user(user, GroupMember::DEVELOPER) + expect(user.can_create_subgroup?(group)).to be_falsey + end + end + describe 'namespaced' do before do @user = create :user From 66bb4f47b1b62fa94454204ca50608df11412c51 Mon Sep 17 00:00:00 2001 From: Marcia Ramos Date: Thu, 30 Mar 2017 17:53:09 -0300 Subject: [PATCH 02/83] add Git topic, reorder topics alphabetically --- doc/topics/index.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/topics/index.md b/doc/topics/index.md index 6de13d79554..1bd50d646ea 100644 --- a/doc/topics/index.md +++ b/doc/topics/index.md @@ -7,8 +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:** From 199bd04428ced528eab61a4acad7eab48cab86a3 Mon Sep 17 00:00:00 2001 From: Marcia Ramos Date: Thu, 30 Mar 2017 17:53:25 -0300 Subject: [PATCH 03/83] add Git index --- doc/topics/git/index.md | 46 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 doc/topics/git/index.md diff --git a/doc/topics/git/index.md b/doc/topics/git/index.md new file mode 100644 index 00000000000..30812074874 --- /dev/null +++ b/doc/topics/git/index.md @@ -0,0 +1,46 @@ +# Git documentation + +## Getting started + +- [Git concepts](../university/training/user_training.html#git-concepts) +- [Start using Git on the command line](../gitlab-basics/start-using-git.html) +- [Command Line basic commands](../gitlab-basics/command-line-commands.html) +- [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/) +- **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) + +### Version control + +- **Presentations:** + - [GLU Course: About Version Control](https://docs.google.com/presentation/d/16sX7hUrCZyOFbpvnrAFrg6tVO5_yT98IgdAqOmXwBho/edit?usp=sharing) + +## Advanced use + +- [Custom Git Hooks](../administration/custom_hooks.html) +- [Git Attributes](../user/project/git_attributes.html) +- Git Submodules: [Using Git submodules with GitLab CI](../ci/git_submodules.html#using-git-submodules-with-gitlab-ci) + +## API + +- [Gitignore templates](../api/templates/gitignores.html) + +## Git LFS + +- [Git LFS](https://docs.gitlab.com/ce/workflow/lfs/manage_large_binaries_with_git_lfs.html) +- **Articles:** + - [Getting Started with Git LFS](https://about.gitlab.com/2017/01/30/getting-started-with-git-lfs-tutorial/) + - [Git-Annex to Git-LFS migration guide](https://docs.gitlab.com/ee/workflow/lfs/migrate_from_git_annex_to_git_lfs.html) From 3581476d0481074d6461d9809c60ddaed14e9a06 Mon Sep 17 00:00:00 2001 From: Marcia Ramos Date: Thu, 30 Mar 2017 18:05:40 -0300 Subject: [PATCH 04/83] add general info, fix links --- doc/topics/git/index.md | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/doc/topics/git/index.md b/doc/topics/git/index.md index 30812074874..8701d09289e 100644 --- a/doc/topics/git/index.md +++ b/doc/topics/git/index.md @@ -2,12 +2,13 @@ ## Getting started -- [Git concepts](../university/training/user_training.html#git-concepts) -- [Start using Git on the command line](../gitlab-basics/start-using-git.html) -- [Command Line basic commands](../gitlab-basics/command-line-commands.html) +- [Git concepts](../../university/training/user_training.html#git-concepts) +- [Start using Git on the command line](../../gitlab-basics/start-using-git.html) +- [Command Line basic commands](../../gitlab-basics/command-line-commands.html) - [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/) + - [8 Tips to help you work better with Git](https://about.gitlab.com/2015/02/19/8-tips-to-help-you-work-better-with-git/) - **Third-party resources:** - What is [Git](https://git-scm.com) - [Version control](https://git-scm.com/book/en/v2/Getting-Started-About-Version-Control) @@ -30,17 +31,24 @@ ## Advanced use -- [Custom Git Hooks](../administration/custom_hooks.html) -- [Git Attributes](../user/project/git_attributes.html) -- Git Submodules: [Using Git submodules with GitLab CI](../ci/git_submodules.html#using-git-submodules-with-gitlab-ci) +- [Custom Git Hooks](../../administration/custom_hooks.html) +- [Git Attributes](../../user/project/git_attributes.html) +- Git Submodules: [Using Git submodules with GitLab CI](../../ci/git_submodules.html#using-git-submodules-with-gitlab-ci) ## API -- [Gitignore templates](../api/templates/gitignores.html) +- [Gitignore templates](../../api/templates/gitignores.html) ## Git LFS - [Git LFS](https://docs.gitlab.com/ce/workflow/lfs/manage_large_binaries_with_git_lfs.html) +- [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/) - - [Git-Annex to Git-LFS migration guide](https://docs.gitlab.com/ee/workflow/lfs/migrate_from_git_annex_to_git_lfs.html) + - [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/) + - [Did you install GitLab from source? Check your Git version](https://about.gitlab.com/2015/06/12/did-you-install-gitlab-from-source-recently-check-your-git-version/) From 4e1d1b8bc7a5b5ce41b8e181ad07b1d563fa0aa6 Mon Sep 17 00:00:00 2001 From: Marcia Ramos Date: Thu, 30 Mar 2017 18:15:36 -0300 Subject: [PATCH 05/83] add intro, move version control to getting started --- doc/topics/git/index.md | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/doc/topics/git/index.md b/doc/topics/git/index.md index 8701d09289e..2d6bb1fe1e8 100644 --- a/doc/topics/git/index.md +++ b/doc/topics/git/index.md @@ -1,5 +1,16 @@ # 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. It has all functionalities Git has, plus 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.html#git-concepts) @@ -8,7 +19,9 @@ - [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/) - - [8 Tips to help you work better with Git](https://about.gitlab.com/2015/02/19/8-tips-to-help-you-work-better-with-git/) + - [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) @@ -24,11 +37,6 @@ - [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) -### Version control - -- **Presentations:** - - [GLU Course: About Version Control](https://docs.google.com/presentation/d/16sX7hUrCZyOFbpvnrAFrg6tVO5_yT98IgdAqOmXwBho/edit?usp=sharing) - ## Advanced use - [Custom Git Hooks](../../administration/custom_hooks.html) From e0fba6e5cf5d9d2846efec1b9bc4cffcdae5bec7 Mon Sep 17 00:00:00 2001 From: Marcia Ramos Date: Thu, 30 Mar 2017 18:16:20 -0300 Subject: [PATCH 06/83] fix heading --- doc/topics/git/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/topics/git/index.md b/doc/topics/git/index.md index 2d6bb1fe1e8..5afc5b09eef 100644 --- a/doc/topics/git/index.md +++ b/doc/topics/git/index.md @@ -29,7 +29,7 @@ We've gathered some resources to help you to get the best from Git with GitLab. - [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 +## Branching strategies - **Articles:** - [GitLab Flow](https://about.gitlab.com/2014/09/29/gitlab-flow/) From 9fa06abe78881fae349d11f83383f398c68945f7 Mon Sep 17 00:00:00 2001 From: Marcia Ramos Date: Thu, 30 Mar 2017 18:20:53 -0300 Subject: [PATCH 07/83] replace relative urls - html to md --- doc/topics/git/index.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/topics/git/index.md b/doc/topics/git/index.md index 5afc5b09eef..88baeddcb94 100644 --- a/doc/topics/git/index.md +++ b/doc/topics/git/index.md @@ -13,9 +13,9 @@ We've gathered some resources to help you to get the best from Git with GitLab. ## Getting started -- [Git concepts](../../university/training/user_training.html#git-concepts) -- [Start using Git on the command line](../../gitlab-basics/start-using-git.html) -- [Command Line basic commands](../../gitlab-basics/command-line-commands.html) +- [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/) @@ -39,17 +39,17 @@ We've gathered some resources to help you to get the best from Git with GitLab. ## Advanced use -- [Custom Git Hooks](../../administration/custom_hooks.html) -- [Git Attributes](../../user/project/git_attributes.html) -- Git Submodules: [Using Git submodules with GitLab CI](../../ci/git_submodules.html#using-git-submodules-with-gitlab-ci) +- [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.html) +- [Gitignore templates](../../api/templates/gitignores.md) ## Git LFS -- [Git LFS](https://docs.gitlab.com/ce/workflow/lfs/manage_large_binaries_with_git_lfs.html) +- [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/) From b202b42cfee6bb8cf0c142c918c545f45464a29c Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Fri, 31 Mar 2017 17:39:14 -0600 Subject: [PATCH 08/83] Link to outdated diff in older MR version from outdated diff discussion --- .../stylesheets/pages/merge_requests.scss | 2 ++ .../projects/merge_requests_controller.rb | 28 ++++++++----------- app/models/concerns/note_on_diff.rb | 10 +++++++ app/models/concerns/noteable.rb | 4 +-- app/models/diff_discussion.rb | 1 + app/models/diff_note.rb | 14 ++++------ app/models/legacy_diff_note.rb | 3 +- app/models/merge_request.rb | 4 +++ app/models/merge_request_diff.rb | 1 + app/models/note.rb | 8 ++++-- app/views/discussions/_discussion.html.haml | 7 ++++- .../projects/diffs/_parallel_view.html.haml | 3 +- app/views/projects/diffs/_text_file.html.haml | 3 +- .../merge_requests/show/_versions.html.haml | 10 ++++--- .../dm-link-discussion-to-outdated-diff.yml | 4 +++ 15 files changed, 63 insertions(+), 39 deletions(-) create mode 100644 changelogs/unreleased/dm-link-discussion-to-outdated-diff.yml diff --git a/app/assets/stylesheets/pages/merge_requests.scss b/app/assets/stylesheets/pages/merge_requests.scss index 2f946ab2f59..cc43d046b54 100644 --- a/app/assets/stylesheets/pages/merge_requests.scss +++ b/app/assets/stylesheets/pages/merge_requests.scss @@ -528,6 +528,8 @@ } .comments-disabled-notif { + line-height: 28px; + .btn { margin-left: 5px; } diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb index 5c1f7e69ee8..bba3e007610 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] @@ -108,6 +107,8 @@ class Projects::MergeRequestsController < Projects::ApplicationController @merge_request.merge_request_diff end + define_diff_comment_vars + @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 } @@ -123,11 +124,14 @@ class Projects::MergeRequestsController < Projects::ApplicationController @environment = @merge_request.environments_for(current_user).last - if @start_sha - compared_diff_version - else - original_diff_version - end + @diff_notes_disabled = !@merge_request_diff.latest? || @start_sha + + @diffs = + if @start_sha + @merge_request_diff.compare_with(@start_sha).diffs(diff_options) + else + @merge_request_diff.diffs(diff_options) + end render json: { html: view_to_html_string("projects/merge_requests/show/_diffs") } end @@ -594,7 +598,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController @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 +682,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/models/concerns/note_on_diff.rb b/app/models/concerns/note_on_diff.rb index 1a5a7007a2b..ac4c3099c00 100644 --- a/app/models/concerns/note_on_diff.rb +++ b/app/models/concerns/note_on_diff.rb @@ -25,4 +25,14 @@ module NoteOnDiff def diff_attributes 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/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 b71a9e17a93..1b6e898a7fd 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -367,6 +367,10 @@ class MergeRequest < ActiveRecord::Base merge_request_diff(true) end + def merge_request_diff_for(diff_refs) + merge_request_diffs.viewable.select_without_diff.with_diff_refs(diff_refs).take + 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..bf9289086f0 100644 --- a/app/models/merge_request_diff.rb +++ b/app/models/merge_request_diff.rb @@ -26,6 +26,7 @@ class MergeRequestDiff < ActiveRecord::Base end scope :viewable, -> { without_state(:empty) } + scope :with_diff_refs, ->(diff_refs) { where(start_commit_sha: diff_refs.start_sha, head_commit_sha: diff_refs.head_sha, base_commit_sha: diff_refs.base_sha) } # All diff information is collected from repository after object is created. # It allows you to override variables like head_commit_sha before getting diff. diff --git a/app/models/note.rb b/app/models/note.rb index 1ea7b946061..c85692c5aec 100644 --- a/app/models/note.rb +++ b/app/models/note.rb @@ -113,11 +113,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 +140,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/views/discussions/_discussion.html.haml b/app/views/discussions/_discussion.html.haml index e04958817e4..f12778be305 100644 --- a/app/views/discussions/_discussion.html.haml +++ b/app/views/discussions/_discussion.html.haml @@ -34,7 +34,12 @@ - if discussion.active? = link_to 'the diff', discussion_diff_path(discussion) - else - an outdated diff + - merge_request_diff = discussion.latest_merge_request_diff + - if merge_request_diff + = link_to diffs_namespace_project_merge_request_path(discussion.project.namespace, discussion.project, discussion.noteable, diff_id: merge_request_diff, anchor: discussion.line_code) do + an outdated 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/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..47f45e8e061 100644 --- a/app/views/projects/merge_requests/show/_versions.html.haml +++ b/app/views/projects/merge_requests/show/_versions.html.haml @@ -74,11 +74,13 @@ from %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. + Comment creation is 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 old version of the merge request are displayed but comment creation has been 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/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: From 2c0de7aaafd5fb842618bb7fa218e11255363bc8 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Fri, 31 Mar 2017 17:49:43 -0600 Subject: [PATCH 09/83] Cache MR diffs by diff refs --- app/models/merge_request.rb | 6 +++++- lib/gitlab/diff/diff_refs.rb | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index 1b6e898a7fd..95e41106b49 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -368,7 +368,11 @@ class MergeRequest < ActiveRecord::Base end def merge_request_diff_for(diff_refs) - merge_request_diffs.viewable.select_without_diff.with_diff_refs(diff_refs).take + @merge_request_diffs_by_diff_refs ||= Hash.new do |h, diff_refs| + h[diff_refs] = merge_request_diffs.viewable.select_without_diff.with_diff_refs(diff_refs).take + end + + @merge_request_diffs_by_diff_refs[diff_refs] end def reload_diff_if_branch_changed 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 From d65d245e06fbe45455e130e2d4ca0ca1d066a8c6 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Fri, 31 Mar 2017 18:10:53 -0600 Subject: [PATCH 10/83] Add link to diff header too --- app/helpers/notes_helper.rb | 13 ++++++++++--- app/views/discussions/_discussion.html.haml | 17 ++++++----------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/app/helpers/notes_helper.rb b/app/helpers/notes_helper.rb index 5f3d89cf6cb..b244ae4fcbf 100644 --- a/app/helpers/notes_helper.rb +++ b/app/helpers/notes_helper.rb @@ -61,10 +61,17 @@ module NotesHelper end def discussion_diff_path(discussion) - return unless discussion.diff_discussion? + if discussion.for_merge_request? + 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 + 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) end diff --git a/app/views/discussions/_discussion.html.haml b/app/views/discussions/_discussion.html.haml index f12778be305..47739809108 100644 --- a/app/views/discussions/_discussion.html.haml +++ b/app/views/discussions/_discussion.html.haml @@ -20,24 +20,19 @@ = 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, discussion_diff_path(discussion), class: 'monospace' - else a deleted commit - - elsif discussion.diff_discussion? - on - - if discussion.active? - = link_to 'the diff', discussion_diff_path(discussion) - - else - - merge_request_diff = discussion.latest_merge_request_diff - - if merge_request_diff - = link_to diffs_namespace_project_merge_request_path(discussion.project.namespace, discussion.project, discussion.noteable, diff_id: merge_request_diff, anchor: discussion.line_code) do - an outdated diff + - else + = conditional_link_to url.present?, url do + - if discussion.active? + the diff - else an outdated diff From f47b737456f848784fddb5958c3fa781d2ede2f1 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Fri, 31 Mar 2017 18:20:44 -0600 Subject: [PATCH 11/83] Change discussion headline to 'a now outdated portion of the diff' --- app/views/discussions/_discussion.html.haml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/views/discussions/_discussion.html.haml b/app/views/discussions/_discussion.html.haml index 47739809108..6f74948f498 100644 --- a/app/views/discussions/_discussion.html.haml +++ b/app/views/discussions/_discussion.html.haml @@ -30,11 +30,10 @@ - else a deleted commit - else + - unless discussion.active? + a now outdated portion of = conditional_link_to url.present?, url do - - if discussion.active? - the diff - - else - an outdated diff + the diff = time_ago_with_tooltip(discussion.created_at, placement: "bottom", html_class: "note-created-ago") = render "discussions/headline", discussion: discussion From 50eae640dbbfa42a42e8b6966bd739cfda3adabc Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Thu, 6 Apr 2017 17:13:28 -0500 Subject: [PATCH 12/83] Fix specs and make tweaks --- .../projects/merge_requests_controller.rb | 65 ++++++++++--------- app/helpers/notes_helper.rb | 2 + app/models/merge_request.rb | 2 +- app/models/merge_request_diff.rb | 5 +- app/views/discussions/_discussion.html.haml | 9 +-- .../merge_requests/show/_versions.html.haml | 2 +- .../merge_request_versions_spec.rb | 4 +- 7 files changed, 50 insertions(+), 39 deletions(-) diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb index bba3e007610..c25d33e12cf 100755 --- a/app/controllers/projects/merge_requests_controller.rb +++ b/app/controllers/projects/merge_requests_controller.rb @@ -100,39 +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 - + define_diff_vars define_diff_comment_vars - @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 - @environment = @merge_request.environments_for(current_user).last - @diff_notes_disabled = !@merge_request_diff.latest? || @start_sha - - @diffs = - if @start_sha - @merge_request_diff.compare_with(@start_sha).diffs(diff_options) - else - @merge_request_diff.diffs(diff_options) - end - render json: { html: view_to_html_string("projects/merge_requests/show/_diffs") } end end @@ -144,16 +116,18 @@ 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 @@ -590,12 +564,43 @@ 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(@merge_request_diff.diff_refs) diff --git a/app/helpers/notes_helper.rb b/app/helpers/notes_helper.rb index b244ae4fcbf..6f4ba79b80b 100644 --- a/app/helpers/notes_helper.rb +++ b/app/helpers/notes_helper.rb @@ -68,6 +68,8 @@ module NotesHelper 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 diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index 95e41106b49..1e24c03e5b6 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -369,7 +369,7 @@ class MergeRequest < ActiveRecord::Base 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.with_diff_refs(diff_refs).take + 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] diff --git a/app/models/merge_request_diff.rb b/app/models/merge_request_diff.rb index bf9289086f0..3a26b4ee401 100644 --- a/app/models/merge_request_diff.rb +++ b/app/models/merge_request_diff.rb @@ -26,12 +26,15 @@ class MergeRequestDiff < ActiveRecord::Base end scope :viewable, -> { without_state(:empty) } - scope :with_diff_refs, ->(diff_refs) { where(start_commit_sha: diff_refs.start_sha, head_commit_sha: diff_refs.head_sha, base_commit_sha: diff_refs.base_sha) } # All diff information is collected from repository after object is created. # 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) + where(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 diff --git a/app/views/discussions/_discussion.html.haml b/app/views/discussions/_discussion.html.haml index 6f74948f498..0ee27b6ff20 100644 --- a/app/views/discussions/_discussion.html.haml +++ b/app/views/discussions/_discussion.html.haml @@ -26,14 +26,15 @@ - commit = discussion.noteable - if commit commit - = link_to commit.short_id, discussion_diff_path(discussion), class: 'monospace' + = link_to commit.short_id, url, class: 'monospace' - else a deleted commit - else - - unless discussion.active? - a now outdated portion of = conditional_link_to url.present?, url do - the diff + - 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/projects/merge_requests/show/_versions.html.haml b/app/views/projects/merge_requests/show/_versions.html.haml index 47f45e8e061..9842f737ff0 100644 --- a/app/views/projects/merge_requests/show/_versions.html.haml +++ b/app/views/projects/merge_requests/show/_versions.html.haml @@ -80,7 +80,7 @@ - if @start_sha Comment creation is disabled because you're comparing two versions of this merge request. - else - Discussions on this old version of the merge request are displayed but comment creation has been disabled. + Discussions on this old 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/spec/features/merge_requests/merge_request_versions_spec.rb b/spec/features/merge_requests/merge_request_versions_spec.rb index 04e85ed3f73..2577336bf0f 100644 --- a/spec/features/merge_requests/merge_request_versions_spec.rb +++ b/spec/features/merge_requests/merge_request_versions_spec.rb @@ -37,7 +37,7 @@ feature 'Merge Request versions', js: true, feature: true do end it 'show the message about disabled comments' do - expect(page).to have_content 'Comments are disabled' + expect(page).to have_content 'comment creation is disabled' end end @@ -66,7 +66,7 @@ feature 'Merge Request versions', js: true, feature: true do end it 'show the message about disabled comments' do - expect(page).to have_content 'Comments are disabled' + expect(page).to have_content 'Comment creation is disabled' end it 'show diff between new and old version' do From f112f81d3d463a81c8b5e9225d5e9bb40e82abe8 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Thu, 6 Apr 2017 17:24:51 -0500 Subject: [PATCH 13/83] Fix find_by_diff_refs --- app/models/merge_request_diff.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/merge_request_diff.rb b/app/models/merge_request_diff.rb index 3a26b4ee401..0143dd83501 100644 --- a/app/models/merge_request_diff.rb +++ b/app/models/merge_request_diff.rb @@ -32,7 +32,7 @@ class MergeRequestDiff < ActiveRecord::Base after_create :save_git_content, unless: :importing? def self.find_by_diff_refs(diff_refs) - where(start_commit_sha: diff_refs.start_sha, head_commit_sha: diff_refs.head_sha, base_commit_sha: diff_refs.base_sha) + 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 From a8339fe1aa95d489e00cb0b79a20557d711639ec Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Thu, 6 Apr 2017 18:18:53 -0500 Subject: [PATCH 14/83] Fix views after rebase --- app/helpers/notes_helper.rb | 6 ++++-- app/views/discussions/_discussion.html.haml | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/helpers/notes_helper.rb b/app/helpers/notes_helper.rb index 6f4ba79b80b..c831f89dc19 100644 --- a/app/helpers/notes_helper.rb +++ b/app/helpers/notes_helper.rb @@ -61,7 +61,7 @@ module NotesHelper end def discussion_diff_path(discussion) - if discussion.for_merge_request? + 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 @@ -75,7 +75,9 @@ module NotesHelper 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/views/discussions/_discussion.html.haml b/app/views/discussions/_discussion.html.haml index 0ee27b6ff20..f48dc575661 100644 --- a/app/views/discussions/_discussion.html.haml +++ b/app/views/discussions/_discussion.html.haml @@ -29,7 +29,7 @@ = link_to commit.short_id, url, class: 'monospace' - else a deleted commit - - else + - elsif discussion.diff_discussion? = conditional_link_to url.present?, url do - if discussion.active? the diff From 1817f877e19628417dd8209f070386b111de59c4 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Sat, 8 Apr 2017 14:58:08 -0500 Subject: [PATCH 15/83] Some code tweaks --- app/controllers/projects/merge_requests_controller.rb | 9 +++------ app/helpers/notes_helper.rb | 2 +- app/models/concerns/discussion_on_diff.rb | 8 -------- app/models/concerns/note_on_diff.rb | 4 ++++ app/models/legacy_diff_discussion.rb | 8 ++++++++ app/views/discussions/_discussion.html.haml | 1 + .../projects/merge_requests/show/_versions.html.haml | 5 +++-- .../merge_requests/merge_request_versions_spec.rb | 2 +- 8 files changed, 21 insertions(+), 18 deletions(-) diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb index c25d33e12cf..87d684e5c7a 100755 --- a/app/controllers/projects/merge_requests_controller.rb +++ b/app/controllers/projects/merge_requests_controller.rb @@ -576,13 +576,10 @@ class Projects::MergeRequestsController < Projects::ApplicationController @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 } + 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 + @start_sha = start_sha if @start_version end @diffs = diff --git a/app/helpers/notes_helper.rb b/app/helpers/notes_helper.rb index c831f89dc19..eab0738a368 100644 --- a/app/helpers/notes_helper.rb +++ b/app/helpers/notes_helper.rb @@ -76,7 +76,7 @@ module NotesHelper 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? anchor = discussion.line_code if discussion.diff_discussion? - + namespace_project_commit_path(discussion.project.namespace, discussion.project, discussion.noteable, anchor: anchor) end end 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 ac4c3099c00..6c27dd5aa5c 100644 --- a/app/models/concerns/note_on_diff.rb +++ b/app/models/concerns/note_on_diff.rb @@ -26,6 +26,10 @@ module NoteOnDiff raise NotImplementedError end + def active?(diff_refs = nil) + raise NotImplementedError + end + private def noteable_diff_refs 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/views/discussions/_discussion.html.haml b/app/views/discussions/_discussion.html.haml index f48dc575661..8440fb3d785 100644 --- a/app/views/discussions/_discussion.html.haml +++ b/app/views/discussions/_discussion.html.haml @@ -30,6 +30,7 @@ - else a deleted commit - elsif discussion.diff_discussion? + on = conditional_link_to url.present?, url do - if discussion.active? the diff diff --git a/app/views/projects/merge_requests/show/_versions.html.haml b/app/views/projects/merge_requests/show/_versions.html.haml index 9842f737ff0..434d9b5837f 100644 --- a/app/views/projects/merge_requests/show/_versions.html.haml +++ b/app/views/projects/merge_requests/show/_versions.html.haml @@ -72,13 +72,14 @@ = 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 - if @diff_notes_disabled .comments-disabled-notif.content-block = icon('info-circle') - if @start_sha - Comment creation is disabled because you're comparing two versions of this merge request. + Comments are disabled because you're comparing two versions of this merge request. - else Discussions on this old version of the merge request are displayed but comment creation is disabled. diff --git a/spec/features/merge_requests/merge_request_versions_spec.rb b/spec/features/merge_requests/merge_request_versions_spec.rb index 2577336bf0f..2f627004578 100644 --- a/spec/features/merge_requests/merge_request_versions_spec.rb +++ b/spec/features/merge_requests/merge_request_versions_spec.rb @@ -66,7 +66,7 @@ feature 'Merge Request versions', js: true, feature: true do end it 'show the message about disabled comments' do - expect(page).to have_content 'Comment creation is disabled' + expect(page).to have_content 'Comments are disabled' end it 'show diff between new and old version' do From 48a0e9f6aece36e83e3ffde5be42f964b5362221 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Sun, 9 Apr 2017 22:27:45 -0500 Subject: [PATCH 16/83] Fix specs --- app/controllers/projects/compare_controller.rb | 1 - app/controllers/projects/merge_requests_controller.rb | 10 ++++++---- app/helpers/diff_helper.rb | 2 ++ 3 files changed, 8 insertions(+), 5 deletions(-) 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/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb index 87d684e5c7a..224b44db397 100755 --- a/app/controllers/projects/merge_requests_controller.rb +++ b/app/controllers/projects/merge_requests_controller.rb @@ -122,7 +122,6 @@ class Projects::MergeRequestsController < Projects::ApplicationController build_merge_request @diffs = @merge_request.diffs(diff_options) @diff_notes_disabled = true - @grouped_diff_discussions = {} end define_commit_vars @@ -576,10 +575,13 @@ class Projects::MergeRequestsController < Projects::ApplicationController @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 } + @start_sha = params[:start_sha] + @start_version = @comparable_diffs.find { |diff| diff.head_commit_sha == @start_sha } - @start_sha = start_sha if @start_version + unless @start_version + @start_sha = @merge_request_diff.head_commit_sha + @start_version = @merge_request_diff + end end @diffs = 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?) From e46f67a5123433f132da28770e4027542062fc81 Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Mon, 10 Apr 2017 13:24:14 +0200 Subject: [PATCH 17/83] Use gRPC 1.2.2 Fixes LoadError after local compilation. https://github.com/grpc/grpc/issues/9998 --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) From 35bf7c7e47eb0ccd1f10fdfd19f9a85b426c184e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Wed, 22 Mar 2017 23:09:22 +0100 Subject: [PATCH 18/83] Firs pass at improving the testing documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [ci skip] Signed-off-by: Rémy Coutable --- doc/development/fe_guide/testing.md | 7 +- doc/development/testing.md | 218 ++++++++++++++++++++++++---- 2 files changed, 194 insertions(+), 31 deletions(-) diff --git a/doc/development/fe_guide/testing.md b/doc/development/fe_guide/testing.md index 8d3513d3566..a8a01747c75 100644 --- a/doc/development/fe_guide/testing.md +++ b/doc/development/fe_guide/testing.md @@ -80,18 +80,17 @@ 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 +it 'presents information about abuse report', :js do # assertions... end -describe "Admin::AbuseReports", js: true do +describe "Admin::AbuseReports", :js do it 'presents information about abuse report' do # assertions... end diff --git a/doc/development/testing.md b/doc/development/testing.md index 5bc958f5a96..9dc75fd1337 100644 --- a/doc/development/testing.md +++ b/doc/development/testing.md @@ -9,6 +9,144 @@ this guide defines a rule that contradicts the thoughtbot guide, this guide takes precedence. Some guidelines may be repeated verbatim to stress their importance. +## 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 instance model methods that don't do anything with the database shouldn't need a DB record). + +| Code path | Tests path | Testing engine | Notes | +| --------- | ---------- | -------------- | ----- | +| `app/finders/` | `spec/finders/` | RSpec | | +| `app/helpers/` | `spec/helpers/` | RSpec | | +| `app/migrations/` | `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 | | +| `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 test without JavaScript instead of a +controller test. The reason is that testing a fat controller usually involves a +lot of stubbing, things like: + +```ruby +controller.instance_variable_set(:@user, user) +``` + +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 + +#### Good 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 paths should be tested with Unit or Integration tests +- Test what's displayed on the page, not the internal of ActiveRecord models +- 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 reason why we should follow these good 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 +- With System tests run with a driver that supports JavaScript, the tests are + run in 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. + +## 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 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. + +[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 + ## Factories GitLab uses [factory_girl] as a test fixture replacement. @@ -117,11 +255,20 @@ it 'is overdue' do end ``` -### Test speed +### System / Features 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. + +## 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: @@ -132,38 +279,40 @@ Here are some things to keep in mind regarding test performance: - 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 + Spinach or `:js` in RSpec) unless it's _actually_ required for the test to be valid. Headless browser testing is slow! -### Features / Integration +[parallelization]: #test-suite-parallelization-on-the-ci -GitLab uses [rspec-rails feature specs] to test features in a browser -environment. These are [capybara] specs running on the headless [poltergeist] -driver. +### Monitoring -- 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. +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. -[rspec-rails feature specs]: https://github.com/rspec/rspec-rails#feature-specs -[capybara]: https://github.com/teamcapybara/capybara -[poltergeist]: https://github.com/teampoltergeist/poltergeist +[monitored]: /development/performance.html#rspec-profiling +[public dashboard]: https://redash.gitlab.com/public/dashboards/l1WhHXaxrCWM5Ai9D7YDqHKehq6OU3bx5gssaiWe?org_slug=default -## Spinach (feature) tests +## Test suite parallelization on the CI -GitLab [moved from Cucumber to Spinach](https://github.com/gitlabhq/gitlabhq/pull/1426) -for its feature/integration tests in September 2012. +Our current CI parallelization setup is as follows: -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. +1. The `knapsack` job in the prepare stage that is supposed to ensure we have a `knapsack/rspec_report.json` file: + - The `knapsack/rspec_report.json` file is fetched from the cache with the + `knapsack` key, 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/rspec_report.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/spinach_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/spinach_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/rspec_report.json` that is then cached with the `knapsack` key -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. +After that, the next pipeline will use the up-to-date +`knapsack/rspec_report.json` file. ## Testing Rake Tasks @@ -201,6 +350,21 @@ describe 'gitlab:shell rake tasks' do end ``` +## 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 From 91fb9f446fa8476f287657032003aa286c2606b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Fri, 7 Apr 2017 20:50:41 +0200 Subject: [PATCH 19/83] Improve testing documentation with Robert's feedback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rémy Coutable --- doc/development/fe_guide/testing.md | 27 +++++++------ doc/development/testing.md | 59 ++++++++++++++++++----------- 2 files changed, 49 insertions(+), 37 deletions(-) diff --git a/doc/development/fe_guide/testing.md b/doc/development/fe_guide/testing.md index a8a01747c75..175873c9efa 100644 --- a/doc/development/fe_guide/testing.md +++ b/doc/development/fe_guide/testing.md @@ -87,16 +87,16 @@ JavaScript enabled: ```ruby # For one spec it 'presents information about abuse report', :js do - # assertions... + # 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 + it 'presents information about abuse report' do + # assertions... + end + it 'shows buttons for adding to abuse report' do + # assertions... + end end ``` @@ -112,13 +112,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 9dc75fd1337..e096adcdf1c 100644 --- a/doc/development/testing.md +++ b/doc/development/testing.md @@ -15,7 +15,10 @@ importance. 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 instance model methods that don't do anything with the database shouldn't need a DB record). +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). | Code path | Tests path | Testing engine | Notes | | --------- | ---------- | -------------- | ----- | @@ -42,6 +45,7 @@ These kind of tests ensure that individual parts of the application work well to | 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. | @@ -49,9 +53,9 @@ These kind of tests ensure that individual parts of the application work well to #### 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 test without JavaScript instead of a -controller test. The reason is that testing a fat controller usually involves a -lot of stubbing, things like: +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: ```ruby controller.instance_variable_set(:@user, user) @@ -90,12 +94,15 @@ possible). [Poltergeist]: https://github.com/teamcapybara/capybara#poltergeist [RackTest]: https://github.com/teamcapybara/capybara#racktest -#### Good practices +#### 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 paths should be tested with Unit or Integration tests -- Test what's displayed on the page, not the internal of ActiveRecord models +- 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 @@ -106,12 +113,12 @@ 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 reason why we should follow these good practices are as follows: +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 -- With System tests run with a driver that supports JavaScript, the tests are - run in different thread than the application. This means it does not share a +- 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 @@ -127,7 +134,7 @@ 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 bit more expensive but don't abuse them. A feature test +- 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) @@ -255,7 +262,7 @@ it 'is overdue' do end ``` -### System / Features tests +### System / Feature tests - Feature specs should be named `ROLE_ACTION_spec.rb`, such as `user_changes_password_spec.rb`. @@ -297,22 +304,28 @@ them. 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/rspec_report.json` file: - - The `knapsack/rspec_report.json` file is fetched from the cache with the - `knapsack` key, if it's not here we initialize the file with `{}`. +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/rspec_report.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/spinach_node_${CI_NODE_INDEX}_${CI_NODE_TOTAL}_report.json` + - 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/spinach_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/rspec_report.json` that is then cached with the `knapsack` key + `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/rspec_report.json` file. +`knapsack/${CI_PROJECT_NAME}/rspec_report-master.json` file. The same strategy +is used for Spinach tests as well. ## Testing Rake Tasks From 0aafb6abb89b4b0fc4c033b21ccbfd1082b56b30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Mon, 10 Apr 2017 11:32:23 +0200 Subject: [PATCH 20/83] Document GitLab QA MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rémy Coutable --- doc/development/testing.md | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/doc/development/testing.md b/doc/development/testing.md index e096adcdf1c..0d29697df9e 100644 --- a/doc/development/testing.md +++ b/doc/development/testing.md @@ -17,8 +17,9 @@ 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). +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 | | --------- | ---------- | -------------- | ----- | @@ -94,6 +95,29 @@ possible). [Poltergeist]: https://github.com/teamcapybara/capybara#poltergeist [RackTest]: https://github.com/teamcapybara/capybara#racktest +### 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 + #### Best practices - Create only the necessary records in the database @@ -133,7 +157,7 @@ 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]! + 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 @@ -150,6 +174,7 @@ test includes: - 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 From 2b606a3a2eb408c4c66a959f7efdfeeb76bb18e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Mon, 10 Apr 2017 15:23:26 +0200 Subject: [PATCH 21/83] Re-organize testing doc, and add RSpec structure doc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rémy Coutable --- doc/development/fe_guide/testing.md | 11 +- doc/development/testing.md | 245 ++++++++++++++++++---------- 2 files changed, 166 insertions(+), 90 deletions(-) diff --git a/doc/development/fe_guide/testing.md b/doc/development/fe_guide/testing.md index 175873c9efa..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. diff --git a/doc/development/testing.md b/doc/development/testing.md index 0d29697df9e..e530b1c07bd 100644 --- a/doc/development/testing.md +++ b/doc/development/testing.md @@ -179,52 +179,9 @@ test includes: [picture]: https://twitter.com/withzombies/status/829716565834752000 [tests-cost]: https://medium.com/table-xi/high-cost-tests-and-high-value-tests-a86e27a54df#.2ulyh3a4e -## Factories +## Frontend testing -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 - -For more information, see the [frontend testing guide](fe_guide/testing.md). +Please consult the [dedicated "Frontend testing" guide](./fe_guide/testing.md). ## RSpec @@ -296,61 +253,115 @@ end - Avoid scenario titles that add no information, such as "successfully". - Avoid scenario titles that repeat the feature title. -## Test speed +### Matchers -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. +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. -Here are some things to keep in mind regarding test performance: +### Shared contexts -- `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! +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. -[parallelization]: #test-suite-parallelization-on-the-ci +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`. -### Monitoring +### Shared examples -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. +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. -[monitored]: /development/performance.html#rspec-profiling -[public dashboard]: https://redash.gitlab.com/public/dashboards/l1WhHXaxrCWM5Ai9D7YDqHKehq6OU3bx5gssaiWe?org_slug=default +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`. -## Test suite parallelization on the CI +### Helpers -Our current CI parallelization setup is as follows: +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. -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. +Helpers should follow the Rails naming / namespacing convention. For instance +`spec/support/helpers/cycle_analytics_helpers.rb` should define: -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. +```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 @@ -388,6 +399,62 @@ 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]: /development/performance.html#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) From c7011c88901c7fa8972f02444bd5e3feef698ca4 Mon Sep 17 00:00:00 2001 From: Annabel Dunstone Gray Date: Mon, 10 Apr 2017 10:58:41 -0500 Subject: [PATCH 22/83] Use avatars instead of icons in activity view --- app/assets/stylesheets/pages/events.scss | 13 ++++++---- app/views/events/event/_common.html.haml | 24 +++++++++++-------- .../events/event/_created_project.html.haml | 8 +++++-- app/views/events/event/_note.html.haml | 8 +++++-- app/views/events/event/_push.html.haml | 14 +++++++---- 5 files changed, 43 insertions(+), 24 deletions(-) diff --git a/app/assets/stylesheets/pages/events.scss b/app/assets/stylesheets/pages/events.scss index 79da490675a..6b5cf394d00 100644 --- a/app/assets/stylesheets/pages/events.scss +++ b/app/assets/stylesheets/pages/events.scss @@ -10,10 +10,14 @@ position: relative; &.event-inline { - .profile-icon { + .system-note-image { top: 20px; } + .user-avatar { + top: 14px; + } + .event-title, .event-item-timestamp { line-height: 40px; @@ -24,7 +28,7 @@ color: $gl-text-color; } - .profile-icon { + .system-note-image { position: absolute; left: 0; top: 14px; @@ -128,8 +132,7 @@ li { &.commit { background: transparent; - padding: 3px; - padding-left: 0; + padding: 0; border: none; .commit-row-title { @@ -183,7 +186,7 @@ max-width: 100%; } - .profile-icon { + .system-note-image { display: none; } diff --git a/app/views/events/event/_common.html.haml b/app/views/events/event/_common.html.haml index af97e9588a5..e6bb05e975e 100644 --- a/app/views/events/event/_common.html.haml +++ b/app/views/events/event/_common.html.haml @@ -1,13 +1,17 @@ -- if event.target - - if event.action_name == "opened" - .profile-icon.open-icon - = custom_icon("icon_status_open") - - elsif event.action_name == "closed" - .profile-icon.closed-icon - = custom_icon("icon_status_closed") - - else - .profile-icon.fork-icon - = custom_icon("icon_code_fork") +- if current_path?('dashboard#activity') + .system-note-image.user-avatar + = author_avatar(event, size: 32) +- else + - if event.target + - if event.action_name == "opened" + .system-note-image.open-icon + = custom_icon("icon_status_open") + - elsif event.action_name == "closed" + .system-note-image.closed-icon + = custom_icon("icon_status_closed") + - else + .system-note-image.fork-icon + = custom_icon("icon_code_fork") .event-title %span.author_name= link_to_author event diff --git a/app/views/events/event/_created_project.html.haml b/app/views/events/event/_created_project.html.haml index fee85c94277..259533bd400 100644 --- a/app/views/events/event/_created_project.html.haml +++ b/app/views/events/event/_created_project.html.haml @@ -1,5 +1,9 @@ -.profile-icon.open-icon - = custom_icon("icon_status_open") +- if current_path?('dashboard#activity') + .system-note-image.user-avatar + = author_avatar(event, size: 32) +- else + .system-note-image.open-icon + = custom_icon("icon_status_open") .event-title %span.author_name= link_to_author event diff --git a/app/views/events/event/_note.html.haml b/app/views/events/event/_note.html.haml index 83709f5e4d0..1785fe6ab16 100644 --- a/app/views/events/event/_note.html.haml +++ b/app/views/events/event/_note.html.haml @@ -1,5 +1,9 @@ -.profile-icon - = custom_icon("icon_comment_o") +- if current_path?('dashboard#activity') + .system-note-image.user-avatar + = author_avatar(event, size: 32) +- else + .system-note-image + = custom_icon("icon_comment_o") .event-title %span.author_name= link_to_author event diff --git a/app/views/events/event/_push.html.haml b/app/views/events/event/_push.html.haml index efdc8764acf..8acee9c1da0 100644 --- a/app/views/events/event/_push.html.haml +++ b/app/views/events/event/_push.html.haml @@ -1,10 +1,14 @@ - project = event.project -.profile-icon - - if event.action_name == "deleted" - = custom_icon("trash_o") - - else - = custom_icon("icon_commit") +- if current_path?('dashboard#activity') + .system-note-image.user-avatar + = author_avatar(event, size: 32) +- else + .system-note-image + - if event.action_name == "deleted" + = custom_icon("trash_o") + - else + = custom_icon("icon_commit") .event-title %span.author_name= link_to_author event From fd32960e7c94bdc0db9704b5ec7661defdc488e3 Mon Sep 17 00:00:00 2001 From: Oswaldo Ferreira Date: Wed, 5 Apr 2017 13:31:15 -0300 Subject: [PATCH 23/83] Separate CE params on Grape API --- .../28017-separate-ce-params-on-api.yml | 4 ++ lib/api/groups.rb | 6 +- lib/api/issues.rb | 6 +- lib/api/merge_requests.rb | 23 +++++-- lib/api/projects.rb | 36 +++++++--- lib/api/settings.rb | 67 ++++++++++++++----- lib/api/users.rb | 2 + spec/requests/api/projects_spec.rb | 7 ++ 8 files changed, 121 insertions(+), 30 deletions(-) create mode 100644 changelogs/unreleased/28017-separate-ce-params-on-api.yml 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/lib/api/groups.rb b/lib/api/groups.rb index 32bbf956d7f..073c0145cd8 100644 --- a/lib/api/groups.rb +++ b/lib/api/groups.rb @@ -5,13 +5,17 @@ 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' end + params :optional_params do + use :optional_params_ce + end + params :statistics_params do optional :statistics, type: Boolean, default: false, desc: 'Include project statistics' end 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/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/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' } From ce4a50fcfb4167ffaba748140c87d2c9be8a59df Mon Sep 17 00:00:00 2001 From: Oswaldo Ferreira Date: Mon, 10 Apr 2017 16:22:48 -0300 Subject: [PATCH 24/83] Add share_with_group_lock to CE optional params block --- lib/api/groups.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/api/groups.rb b/lib/api/groups.rb index 073c0145cd8..09d105f6b4c 100644 --- a/lib/api/groups.rb +++ b/lib/api/groups.rb @@ -10,6 +10,7 @@ module API 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 From 4f839b4e63045f8d705bb02d95aa9c1ee88b6fb0 Mon Sep 17 00:00:00 2001 From: Achilleas Pipinellis Date: Mon, 10 Apr 2017 22:13:45 +0200 Subject: [PATCH 25/83] Replace pipelines image in docs [ci skip] --- doc/ci/img/pipelines.png | Bin 7516 -> 6298 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/doc/ci/img/pipelines.png b/doc/ci/img/pipelines.png index 5937e9d99c896fcc2e9960aac33b2fe021fbf394..a604fcb258780fde65a94176f66714e3eaf287bd 100644 GIT binary patch literal 6298 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 literal 7516 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 Date: Mon, 10 Apr 2017 15:17:47 -0500 Subject: [PATCH 26/83] Add specs --- app/models/merge_request_diff.rb | 12 +++++ spec/factories/notes.rb | 3 +- .../merge_requests/discussion_spec.rb | 51 +++++++++++++++++++ ...uest_versions_spec.rb => versions_spec.rb} | 17 ++++++- spec/models/diff_note_spec.rb | 17 +++++++ 5 files changed, 98 insertions(+), 2 deletions(-) create mode 100644 spec/features/merge_requests/discussion_spec.rb rename spec/features/merge_requests/{merge_request_versions_spec.rb => versions_spec.rb} (85%) diff --git a/app/models/merge_request_diff.rb b/app/models/merge_request_diff.rb index 0143dd83501..08066db4767 100644 --- a/app/models/merge_request_diff.rb +++ b/app/models/merge_request_diff.rb @@ -134,6 +134,18 @@ class MergeRequestDiff < ActiveRecord::Base st_commits.map { |commit| commit[:id] } end + def diff_refs=(new_diff_refs) + if 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 + else + self.base_commit_sha = nil + self.start_commit_sha = nil + self.head_commit_sha = nil + end + end + def diff_refs return unless start_commit_sha || base_commit_sha 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/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 similarity index 85% rename from spec/features/merge_requests/merge_request_versions_spec.rb rename to spec/features/merge_requests/versions_spec.rb index 2f627004578..68a68f5d3f3 100644 --- a/spec/features/merge_requests/merge_request_versions_spec.rb +++ b/spec/features/merge_requests/versions_spec.rb @@ -36,9 +36,24 @@ 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 + 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 describe 'compare with older version' do 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 From b4f0ecde79b3263e8875d75cdcf94d011d0d81fe Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Mon, 10 Apr 2017 13:30:46 -0500 Subject: [PATCH 27/83] Fix edit button on blame page without repo perms Without repo permissions, pressing the "Edit" button on the blame page will now prompt to Fork/Cancel. Fix https://gitlab.com/gitlab-org/gitlab-ce/issues/30636 --- app/views/projects/blob/_blob.html.haml | 7 ------- app/views/projects/blob/_header.html.haml | 7 +++++++ 2 files changed, 7 insertions(+), 7 deletions(-) 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 From c60ee7c751ae170d87f15db2505caf4fa0c51121 Mon Sep 17 00:00:00 2001 From: Marcia Ramos Date: Mon, 10 Apr 2017 19:11:41 -0300 Subject: [PATCH 28/83] add topic: authentication --- doc/topics/authentication/index.md | 46 ++++++++++++++++++++++++++++++ doc/topics/index.md | 4 +-- 2 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 doc/topics/authentication/index.md diff --git a/doc/topics/authentication/index.md b/doc/topics/authentication/index.md new file mode 100644 index 00000000000..660833f4819 --- /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) + +## Thirdy-part resources + +- [Kabanboard 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/index.md b/doc/topics/index.md index 6de13d79554..ae2c1708f68 100644 --- a/doc/topics/index.md +++ b/doc/topics/index.md @@ -7,10 +7,10 @@ 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) +- [Authentication](authentication/index.md) - [Continuous Integration (GitLab CI)](../ci/README.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. From 0b3da49e3af32534048a853b9f54ca60e813711f Mon Sep 17 00:00:00 2001 From: Marcia Ramos Date: Mon, 10 Apr 2017 19:43:32 -0300 Subject: [PATCH 29/83] fix links --- doc/topics/authentication/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/topics/authentication/index.md b/doc/topics/authentication/index.md index 660833f4819..666be4e1dc6 100644 --- a/doc/topics/authentication/index.md +++ b/doc/topics/authentication/index.md @@ -10,7 +10,7 @@ This page gathers all the resources for the topic **Authentication** within GitL - [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 as OAuth2 authentication service provider](../../integration/oauth_provider.md#introduction-to-oauth) ## GitLab administrators @@ -33,7 +33,7 @@ This page gathers all the resources for the topic **Authentication** within GitL - [OAuth 2 Tokens](../../api/README.md#oauth-2-tokens) - [Private Tokens](../../api/README.md#private-tokens) -- [Impersonation tokens](../api/README.md#impersonation-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) From f7cafe1d2e3df27d80cba15e4f30e2bd57d83401 Mon Sep 17 00:00:00 2001 From: Marcia Ramos Date: Mon, 10 Apr 2017 22:40:47 -0300 Subject: [PATCH 30/83] fix typo --- doc/topics/authentication/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/topics/authentication/index.md b/doc/topics/authentication/index.md index 666be4e1dc6..aa1c1488b35 100644 --- a/doc/topics/authentication/index.md +++ b/doc/topics/authentication/index.md @@ -37,7 +37,7 @@ This page gathers all the resources for the topic **Authentication** within GitL - [GitLab as an OAuth2 provider](../../api/oauth2.md#gitlab-as-an-oauth2-provider) - [GitLab Runner API - Authentication](../../api/ci/runners.md#authentication) -## Thirdy-part resources +## Third-party resources - [Kabanboard Plugin GitLab Authentication](https://kanboard.net/plugin/gitlab-auth) - [Jenkins GitLab OAuth Plugin](https://wiki.jenkins-ci.org/display/JENKINS/GitLab+OAuth+Plugin) From 85cfde8332d9d5d3280fcb0b9de8d56de2d29ed4 Mon Sep 17 00:00:00 2001 From: Marcia Ramos Date: Mon, 10 Apr 2017 22:41:03 -0300 Subject: [PATCH 31/83] typo --- doc/topics/authentication/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/topics/authentication/index.md b/doc/topics/authentication/index.md index aa1c1488b35..47d3f05999d 100644 --- a/doc/topics/authentication/index.md +++ b/doc/topics/authentication/index.md @@ -39,7 +39,7 @@ This page gathers all the resources for the topic **Authentication** within GitL ## Third-party resources -- [Kabanboard Plugin GitLab Authentication](https://kanboard.net/plugin/gitlab-auth) +- [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/) From 335d746b43351ab6423aae0cf996c5310893036b Mon Sep 17 00:00:00 2001 From: Marcia Ramos Date: Tue, 11 Apr 2017 01:33:37 -0300 Subject: [PATCH 32/83] remove unnecessary line --- doc/topics/index.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/doc/topics/index.md b/doc/topics/index.md index 1bd50d646ea..0d367bae204 100644 --- a/doc/topics/index.md +++ b/doc/topics/index.md @@ -12,6 +12,4 @@ tutorials, technical overviews, blog posts) and videos. - [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. From 991cb916e1d5b6269c8f90ea7cb32eed47eed4ea Mon Sep 17 00:00:00 2001 From: Marcia Ramos Date: Tue, 11 Apr 2017 01:33:47 -0300 Subject: [PATCH 33/83] Axil's review --- doc/topics/git/index.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/topics/git/index.md b/doc/topics/git/index.md index 88baeddcb94..b99ba317a43 100644 --- a/doc/topics/git/index.md +++ b/doc/topics/git/index.md @@ -5,7 +5,7 @@ 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. It has all functionalities Git has, plus a lot of +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/). @@ -59,4 +59,3 @@ We've gathered some resources to help you to get the best from Git with GitLab. - **Articles:** - [The future of SaaS hosted Git repository pricing](https://about.gitlab.com/2016/05/11/git-repository-pricing/) - - [Did you install GitLab from source? Check your Git version](https://about.gitlab.com/2015/06/12/did-you-install-gitlab-from-source-recently-check-your-git-version/) From 947617f6374b053a54425344fb42b2bf327c84de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Tue, 11 Apr 2017 10:04:42 +0200 Subject: [PATCH 34/83] Fix wrong link MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rémy Coutable --- doc/development/testing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/development/testing.md b/doc/development/testing.md index e530b1c07bd..686cd7be1d2 100644 --- a/doc/development/testing.md +++ b/doc/development/testing.md @@ -452,7 +452,7 @@ 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]: /development/performance.html#rspec-profiling +[monitored]: ./development/performance.html#rspec-profiling [public dashboard]: https://redash.gitlab.com/public/dashboards/l1WhHXaxrCWM5Ai9D7YDqHKehq6OU3bx5gssaiWe?org_slug=default ## Spinach (feature) tests From c0b5ddc73d8605893a7953ecc193163802efa474 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Tue, 11 Apr 2017 13:48:55 +0200 Subject: [PATCH 35/83] Fix path to migrations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rémy Coutable --- doc/development/testing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/development/testing.md b/doc/development/testing.md index 686cd7be1d2..9d3ab8d74cf 100644 --- a/doc/development/testing.md +++ b/doc/development/testing.md @@ -25,7 +25,7 @@ records should use stubs/doubles as much as possible. | --------- | ---------- | -------------- | ----- | | `app/finders/` | `spec/finders/` | RSpec | | | `app/helpers/` | `spec/helpers/` | RSpec | | -| `app/migrations/` | `spec/migrations/` | RSpec | | +| `app/db/{post_,}migrate/` | `spec/migrations/` | RSpec | | | `app/policies/` | `spec/policies/` | RSpec | | | `app/presenters/` | `spec/presenters/` | RSpec | | | `app/routing/` | `spec/routing/` | RSpec | | From f1f9578f1c95ca6fb60d45b60ace42638980adb5 Mon Sep 17 00:00:00 2001 From: mhasbini Date: Tue, 11 Apr 2017 15:20:25 +0300 Subject: [PATCH 36/83] Fix issue's note cache expiration after delete --- app/models/note.rb | 1 + changelogs/unreleased/30457-expire-note-destroy.yml | 4 ++++ spec/models/note_spec.rb | 12 +++++++++++- 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 changelogs/unreleased/30457-expire-note-destroy.yml diff --git a/app/models/note.rb b/app/models/note.rb index 1ea7b946061..834507feccc 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 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/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 From d41eb62e20a74ccb4964602a9e1ea105f8a72d34 Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Tue, 11 Apr 2017 12:33:58 +0000 Subject: [PATCH 37/83] Update templates via: rake gitlab:update_templates --- vendor/gitignore/C.gitignore | 1 + vendor/gitignore/Dart.gitignore | 27 ++-------- vendor/gitignore/Global/Eclipse.gitignore | 6 --- vendor/gitignore/Global/JetBrains.gitignore | 3 ++ vendor/gitignore/Global/macOS.gitignore | 51 +++++++++---------- vendor/gitignore/Python.gitignore | 3 ++ vendor/gitignore/Rails.gitignore | 2 +- vendor/gitignore/TeX.gitignore | 3 ++ vendor/gitignore/Unity.gitignore | 1 - vendor/gitignore/VisualStudio.gitignore | 3 +- vendor/gitlab-ci-yml/Django.gitlab-ci.yml | 17 ++++++- vendor/gitlab-ci-yml/Pages/Hexo.gitlab-ci.yml | 13 +++-- .../gitlab-ci-yml/Pages/Jekyll.gitlab-ci.yml | 6 ++- vendor/gitlab-ci-yml/Scala.gitlab-ci.yml | 2 +- 14 files changed, 68 insertions(+), 70 deletions(-) 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/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 From e7b11d509eea5e3de890c777cbb072f7b23bacd9 Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Tue, 11 Apr 2017 12:39:06 +0000 Subject: [PATCH 38/83] Update licenses.csv via: license_finder report --format=csv --save=vendor/licenses.csv --- vendor/licenses.csv | 468 ++++++++++++++++++++++++++++++-------------- 1 file changed, 322 insertions(+), 146 deletions(-) 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 From 2deef3feea68709810baf46ca77d5dadcddbc858 Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Tue, 11 Apr 2017 12:44:05 +0000 Subject: [PATCH 39/83] Update documents according to: https://gitlab.com/gitlab-org/release-tools/blob/master/doc/release-candidates.md#step-1-update-the-installation-from-source-guide In step 1 and step 2 --- doc/install/installation.md | 6 +++--- doc/update/9.0-to-9.1.md | 4 ---- 2 files changed, 3 insertions(+), 7 deletions(-) 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/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 From d4c5dc49e0e8b419b507369ec33946392eb315be Mon Sep 17 00:00:00 2001 From: Annabel Dunstone Gray Date: Tue, 11 Apr 2017 08:14:04 -0500 Subject: [PATCH 40/83] Only show icons on profile page; change to case statement --- app/views/events/event/_common.html.haml | 14 ++++++++------ app/views/events/event/_created_project.html.haml | 9 +++++---- app/views/events/event/_note.html.haml | 8 ++++---- app/views/events/event/_push.html.haml | 8 ++++---- 4 files changed, 21 insertions(+), 18 deletions(-) diff --git a/app/views/events/event/_common.html.haml b/app/views/events/event/_common.html.haml index e6bb05e975e..7e18618ab49 100644 --- a/app/views/events/event/_common.html.haml +++ b/app/views/events/event/_common.html.haml @@ -1,17 +1,19 @@ -- if current_path?('dashboard#activity') - .system-note-image.user-avatar - = author_avatar(event, size: 32) -- else +- if current_path?('users#show') - if event.target - - if event.action_name == "opened" + - case event.action_name + - when 'opened' .system-note-image.open-icon = custom_icon("icon_status_open") - - elsif event.action_name == "closed" + - when 'closed' .system-note-image.closed-icon = custom_icon("icon_status_closed") - else .system-note-image.fork-icon = custom_icon("icon_code_fork") +- else + .system-note-image.user-avatar + = author_avatar(event, size: 32) + .event-title %span.author_name= link_to_author event diff --git a/app/views/events/event/_created_project.html.haml b/app/views/events/event/_created_project.html.haml index 259533bd400..653aa16ca00 100644 --- a/app/views/events/event/_created_project.html.haml +++ b/app/views/events/event/_created_project.html.haml @@ -1,9 +1,10 @@ -- if current_path?('dashboard#activity') - .system-note-image.user-avatar - = author_avatar(event, size: 32) -- else +- if current_path?('users#show') .system-note-image.open-icon = custom_icon("icon_status_open") +- else + .system-note-image.user-avatar + = author_avatar(event, size: 32) + .event-title %span.author_name= link_to_author event diff --git a/app/views/events/event/_note.html.haml b/app/views/events/event/_note.html.haml index 1785fe6ab16..8437ace22b5 100644 --- a/app/views/events/event/_note.html.haml +++ b/app/views/events/event/_note.html.haml @@ -1,9 +1,9 @@ -- if current_path?('dashboard#activity') - .system-note-image.user-avatar - = author_avatar(event, size: 32) -- else +- if current_path?('users#show') .system-note-image = custom_icon("icon_comment_o") +- else + .system-note-image.user-avatar + = author_avatar(event, size: 32) .event-title %span.author_name= link_to_author event diff --git a/app/views/events/event/_push.html.haml b/app/views/events/event/_push.html.haml index 8acee9c1da0..d67139777a1 100644 --- a/app/views/events/event/_push.html.haml +++ b/app/views/events/event/_push.html.haml @@ -1,14 +1,14 @@ - project = event.project -- if current_path?('dashboard#activity') - .system-note-image.user-avatar - = author_avatar(event, size: 32) -- else +- if current_path?('users#show') .system-note-image - if event.action_name == "deleted" = custom_icon("trash_o") - else = custom_icon("icon_commit") +- else + .system-note-image.user-avatar + = author_avatar(event, size: 32) .event-title %span.author_name= link_to_author event From 6de5aad237d3fd2edf987c5f2a4f38c16b2375ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Tue, 11 Apr 2017 15:19:50 +0200 Subject: [PATCH 41/83] Fix link again MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rémy Coutable --- doc/development/testing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/development/testing.md b/doc/development/testing.md index 9d3ab8d74cf..0d02b7ca597 100644 --- a/doc/development/testing.md +++ b/doc/development/testing.md @@ -452,7 +452,7 @@ 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]: ./development/performance.html#rspec-profiling +[monitored]: ./performance.md#rspec-profiling [public dashboard]: https://redash.gitlab.com/public/dashboards/l1WhHXaxrCWM5Ai9D7YDqHKehq6OU3bx5gssaiWe?org_slug=default ## Spinach (feature) tests From 543dcdacc2d4536ddeb1d88a7fa85e5fefed3f80 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Tue, 11 Apr 2017 10:51:48 -0500 Subject: [PATCH 42/83] Statisfy Robertcop and Seancop --- app/models/merge_request_diff.rb | 12 +++--------- .../projects/merge_requests/show/_versions.html.haml | 2 +- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/app/models/merge_request_diff.rb b/app/models/merge_request_diff.rb index 08066db4767..6604af2b47e 100644 --- a/app/models/merge_request_diff.rb +++ b/app/models/merge_request_diff.rb @@ -135,15 +135,9 @@ class MergeRequestDiff < ActiveRecord::Base end def diff_refs=(new_diff_refs) - if 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 - else - self.base_commit_sha = nil - self.start_commit_sha = nil - self.head_commit_sha = nil - end + 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 diff --git a/app/views/projects/merge_requests/show/_versions.html.haml b/app/views/projects/merge_requests/show/_versions.html.haml index 434d9b5837f..547be78992e 100644 --- a/app/views/projects/merge_requests/show/_versions.html.haml +++ b/app/views/projects/merge_requests/show/_versions.html.haml @@ -81,7 +81,7 @@ - if @start_sha Comments are disabled because you're comparing two versions of this merge request. - else - Discussions on this old version of the merge request are displayed but comment creation is disabled. + 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' From 3bc114a7c173ecf03fe5348bbf12e270dfe94a2b Mon Sep 17 00:00:00 2001 From: Valery Sizov Date: Wed, 1 Mar 2017 10:25:35 +0200 Subject: [PATCH 43/83] [BB Importer] Save the error trace and the whole raw document --- changelogs/unreleased/bb_save_trace.yml | 5 +++++ lib/bitbucket/representation/base.rb | 6 ++---- lib/gitlab/bitbucket_import/importer.rb | 4 ++-- 3 files changed, 9 insertions(+), 6 deletions(-) create mode 100644 changelogs/unreleased/bb_save_trace.yml 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/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 From 525ea066877d82d3a3ed0ed0025866753b794290 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 11 Apr 2017 19:36:56 +0300 Subject: [PATCH 44/83] Move permission to create subgroup into GroupPolicy Signed-off-by: Dmitriy Zaporozhets --- app/models/user.rb | 4 ---- app/policies/group_policy.rb | 1 + app/views/groups/subgroups.html.haml | 2 +- ...ens-gitlab-ce-fix-subgroup-hide-button.yml | 4 ++++ spec/models/user_spec.rb | 22 ------------------- spec/policies/group_policy_spec.rb | 3 ++- 6 files changed, 8 insertions(+), 28 deletions(-) create mode 100644 changelogs/unreleased/siemens-gitlab-ce-fix-subgroup-hide-button.yml diff --git a/app/models/user.rb b/app/models/user.rb index bed2f0cae53..cbd741f96ed 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -570,10 +570,6 @@ class User < ActiveRecord::Base can?(:create_group) end - def can_create_subgroup?(group) - can?(:create_group) && can?(:admin_group, group) - end - def can_select_namespace? several_namespaces? || admin end diff --git a/app/policies/group_policy.rb b/app/policies/group_policy.rb index 4cc21696eb6..556ea3a8c72 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/groups/subgroups.html.haml b/app/views/groups/subgroups.html.haml index 3342ba118ef..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 current_user.can_create_subgroup? @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/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..338944cdbbb --- /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: +author: diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 575b43c3d88..a9e37be1157 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -464,28 +464,6 @@ describe User, models: true do it { expect(@user2.several_namespaces?).to be_truthy } end - describe 'subgroups' do - let(:group) { create :group } - - it 'allows if owner' do - user = create :user - group.add_user(user, GroupMember::OWNER) - expect(user.can_create_subgroup?(group)).to be_truthy - end - - it 'disallows if missing right' do - user = create(:user, can_create_group: false) - group.add_user(user, GroupMember::MASTER) - expect(user.can_create_subgroup?(group)).to be_falsey - end - - it 'disallows if developer' do - user = create :user - group.add_user(user, GroupMember::DEVELOPER) - expect(user.can_create_subgroup?(group)).to be_falsey - end - end - describe 'namespaced' do before do @user = create :user 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 From 0424f3fa73259719ecb409eeafaf732b74739916 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 11 Apr 2017 19:40:53 +0300 Subject: [PATCH 45/83] Update changelog with MR id Signed-off-by: Dmitriy Zaporozhets --- .../unreleased/siemens-gitlab-ce-fix-subgroup-hide-button.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelogs/unreleased/siemens-gitlab-ce-fix-subgroup-hide-button.yml b/changelogs/unreleased/siemens-gitlab-ce-fix-subgroup-hide-button.yml index 338944cdbbb..716311c7582 100644 --- a/changelogs/unreleased/siemens-gitlab-ce-fix-subgroup-hide-button.yml +++ b/changelogs/unreleased/siemens-gitlab-ce-fix-subgroup-hide-button.yml @@ -1,4 +1,4 @@ --- title: Hide new subgroup button if user has no permission to create one -merge_request: +merge_request: 10627 author: From e13ad82074d4a4fc2f9f31c1797b43d47b9b3e04 Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Tue, 11 Apr 2017 17:48:15 +0100 Subject: [PATCH 46/83] Fixed notebooklab code including file paths --- vendor/assets/javascripts/notebooklab.js | 247 +++-------------------- 1 file changed, 32 insertions(+), 215 deletions(-) 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