summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Gemfile2
-rw-r--r--Gemfile.lock4
-rw-r--r--app/assets/javascripts/behaviors/markdown/copy_as_gfm.js34
-rw-r--r--app/assets/javascripts/boards/components/board_list.vue2
-rw-r--r--app/assets/javascripts/notes/components/note_actions.vue6
-rw-r--r--app/assets/stylesheets/pages/boards.scss7
-rw-r--r--app/assets/stylesheets/pages/branches.scss13
-rw-r--r--app/controllers/application_controller.rb2
-rw-r--r--app/controllers/projects/branches_controller.rb3
-rw-r--r--app/controllers/projects/pages_domains_controller.rb2
-rw-r--r--app/models/concerns/with_uploads.rb34
-rw-r--r--app/models/project.rb4
-rw-r--r--app/models/repository.rb9
-rw-r--r--app/presenters/project_presenter.rb3
-rw-r--r--app/services/task_list_toggle_service.rb2
-rw-r--r--app/views/layouts/_mailer.html.haml2
-rw-r--r--app/views/projects/branches/_branch.html.haml28
-rw-r--r--changelogs/unreleased/47150-update-sshkey.yml5
-rw-r--r--changelogs/unreleased/54850-pages-domain-show-view-is-not-protected-by-access-control.yml5
-rw-r--r--changelogs/unreleased/55209-tool-tip-hides-menu-item.yml5
-rw-r--r--changelogs/unreleased/57223-wiki-finder.yml5
-rw-r--r--changelogs/unreleased/57564-contributing-button-border.yml5
-rw-r--r--changelogs/unreleased/fast-destroy-uploads.yml5
-rw-r--r--changelogs/unreleased/improve-performance-for-diverging-commit-counts.yml5
-rw-r--r--changelogs/unreleased/ravlen-fix-spaces-unicode.yml5
-rw-r--r--changelogs/unreleased/sh-import-source-branch-github-forks.yml5
-rw-r--r--changelogs/unreleased/sh-log-rails-queue-duration.yml5
-rw-r--r--config/initializers/lograge.rb3
-rw-r--r--doc/administration/high_availability/gitlab.md8
-rw-r--r--doc/administration/high_availability/load_balancer.md54
-rw-r--r--doc/administration/logs.md7
-rw-r--r--doc/administration/uploads.md2
-rw-r--r--doc/api/repositories.md6
-rw-r--r--doc/ci/examples/sast_docker.md2
-rw-r--r--doc/ci/merge_request_pipelines/index.md43
-rw-r--r--doc/development/ee_features.md23
-rw-r--r--doc/development/testing_guide/ci.md2
-rw-r--r--doc/install/README.md2
-rw-r--r--doc/install/installation.md2
-rw-r--r--doc/intro/README.md4
-rw-r--r--doc/security/README.md1
-rw-r--r--doc/ssh/README.md11
-rw-r--r--doc/system_hooks/system_hooks.md2
-rw-r--r--doc/topics/authentication/index.md2
-rw-r--r--doc/topics/autodevops/index.md12
-rw-r--r--doc/update/README.md17
-rw-r--r--doc/user/admin_area/settings/third_party_offers.md5
-rw-r--r--doc/user/profile/preferences.md5
-rw-r--r--doc/user/project/integrations/prometheus.md2
-rw-r--r--doc/user/project/integrations/webhooks.md25
-rw-r--r--doc/user/project/issues/issues_functionalities.md74
-rw-r--r--doc/user/project/milestones/index.md5
-rw-r--r--doc/user/project/pipelines/job_artifacts.md6
-rw-r--r--doc/user/project/pipelines/settings.md1
-rw-r--r--doc/user/project/repository/web_editor.md4
-rw-r--r--doc/user/project/web_ide/index.md12
-rw-r--r--doc/user/reserved_names.md2
-rw-r--r--doc/workflow/time_tracking.md10
-rw-r--r--lib/gitlab/git/repository.rb7
-rw-r--r--lib/gitlab/gitaly_client/commit_service.rb11
-rw-r--r--lib/gitlab/github_import/importer/pull_request_importer.rb30
-rw-r--r--lib/gitlab/github_import/representation/pull_request.rb4
-rw-r--r--lib/gitlab/middleware/rails_queue_duration.rb3
-rw-r--r--lib/gitlab/sql/recursive_cte.rb2
-rw-r--r--lib/gitlab/usage_data.rb14
-rw-r--r--lib/gitlab/wiki_file_finder.rb4
-rw-r--r--lib/tasks/gitlab/setup.rake25
-rw-r--r--locale/gitlab.pot3
-rw-r--r--package.json2
-rw-r--r--qa/qa/page/base.rb17
-rw-r--r--qa/qa/page/group/show.rb16
-rw-r--r--qa/qa/page/main/menu.rb2
-rw-r--r--qa/qa/page/main/sign_up.rb2
-rw-r--r--qa/qa/page/project/web_ide/edit.rb2
-rwxr-xr-xscripts/security-harness2
-rw-r--r--spec/controllers/projects/pages_domains_controller_spec.rb17
-rw-r--r--spec/features/dashboard/todos/todos_spec.rb8
-rw-r--r--spec/features/projects/branches/user_views_branches_spec.rb2
-rw-r--r--spec/javascripts/notes/components/note_actions_spec.js30
-rw-r--r--spec/lib/gitlab/git/repository_spec.rb90
-rw-r--r--spec/lib/gitlab/github_import/importer/pull_request_importer_spec.rb38
-rw-r--r--spec/lib/gitlab/github_import/representation/pull_request_spec.rb2
-rw-r--r--spec/lib/gitlab/sql/recursive_cte_spec.rb9
-rw-r--r--spec/lib/gitlab/usage_data_spec.rb6
-rw-r--r--spec/models/project_spec.rb15
-rw-r--r--spec/support/shared_examples/models/with_uploads_shared_examples.rb20
-rw-r--r--yarn.lock8
87 files changed, 746 insertions, 206 deletions
diff --git a/Gemfile b/Gemfile
index 3ff78312559..452860d60b4 100644
--- a/Gemfile
+++ b/Gemfile
@@ -410,7 +410,7 @@ gem 'sys-filesystem', '~> 1.1.6'
# SSH host key support
gem 'net-ssh', '~> 5.0'
-gem 'sshkey', '~> 1.9.0'
+gem 'sshkey', '~> 2.0'
# Required for ED25519 SSH host key support
group :ed25519 do
diff --git a/Gemfile.lock b/Gemfile.lock
index 9aea8919287..92dd5dac0ca 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -855,7 +855,7 @@ GEM
activesupport (>= 4.0)
sprockets (>= 3.0.0)
sqlite3 (1.3.13)
- sshkey (1.9.0)
+ sshkey (2.0.0)
stackprof (0.2.10)
state_machines (0.5.0)
state_machines-activemodel (0.5.1)
@@ -1157,7 +1157,7 @@ DEPENDENCIES
spring (~> 2.0.0)
spring-commands-rspec (~> 1.0.4)
sprockets (~> 3.7.0)
- sshkey (~> 1.9.0)
+ sshkey (~> 2.0)
stackprof (~> 0.2.10)
state_machines-activerecord (~> 0.5.1)
sys-filesystem (~> 1.1.6)
diff --git a/app/assets/javascripts/behaviors/markdown/copy_as_gfm.js b/app/assets/javascripts/behaviors/markdown/copy_as_gfm.js
index 52d9f2f0322..9482a9f166d 100644
--- a/app/assets/javascripts/behaviors/markdown/copy_as_gfm.js
+++ b/app/assets/javascripts/behaviors/markdown/copy_as_gfm.js
@@ -36,13 +36,20 @@ export class CopyAsGFM {
div.appendChild(el.cloneNode(true));
const html = div.innerHTML;
+ clipboardData.setData('text/plain', el.textContent);
+ clipboardData.setData('text/html', html);
+ // We are also setting this as fallback to transform the selection to gfm on paste
+ clipboardData.setData('text/x-gfm-html', html);
+
CopyAsGFM.nodeToGFM(el)
.then(res => {
- clipboardData.setData('text/plain', el.textContent);
clipboardData.setData('text/x-gfm', res);
- clipboardData.setData('text/html', html);
})
- .catch(() => {});
+ .catch(() => {
+ // Not showing the error as Firefox might doesn't allow
+ // it or other browsers who have a time limit on the execution
+ // of the copy event
+ });
}
static pasteGFM(e) {
@@ -51,11 +58,28 @@ export class CopyAsGFM {
const text = clipboardData.getData('text/plain');
const gfm = clipboardData.getData('text/x-gfm');
- if (!gfm) return;
+ const gfmHtml = clipboardData.getData('text/x-gfm-html');
+ if (!gfm && !gfmHtml) return;
e.preventDefault();
- window.gl.utils.insertText(e.target, textBefore => {
+ // We have the original selection already converted to gfm
+ if (gfm) {
+ CopyAsGFM.insertPastedText(e.target, text, gfm);
+ } else {
+ // Due to the async copy call we are not able to produce gfm so we transform the cached HTML
+ const div = document.createElement('div');
+ div.innerHTML = gfmHtml;
+ CopyAsGFM.nodeToGFM(div)
+ .then(transformedGfm => {
+ CopyAsGFM.insertPastedText(e.target, text, transformedGfm);
+ })
+ .catch(() => {});
+ }
+ }
+
+ static insertPastedText(target, text, gfm) {
+ window.gl.utils.insertText(target, textBefore => {
// If the text before the cursor contains an odd number of backticks,
// we are either inside an inline code span that starts with 1 backtick
// or a code block that starts with 3 backticks.
diff --git a/app/assets/javascripts/boards/components/board_list.vue b/app/assets/javascripts/boards/components/board_list.vue
index a689dfc3768..f3f341ece5c 100644
--- a/app/assets/javascripts/boards/components/board_list.vue
+++ b/app/assets/javascripts/boards/components/board_list.vue
@@ -221,7 +221,7 @@ export default {
</script>
<template>
- <div class="board-list-component d-flex flex-column">
+ <div class="board-list-component">
<div v-if="loading" class="board-list-loading text-center" aria-label="Loading issues">
<gl-loading-icon />
</div>
diff --git a/app/assets/javascripts/notes/components/note_actions.vue b/app/assets/javascripts/notes/components/note_actions.vue
index 91b9e5de374..969d5b69c25 100644
--- a/app/assets/javascripts/notes/components/note_actions.vue
+++ b/app/assets/javascripts/notes/components/note_actions.vue
@@ -126,6 +126,11 @@ export default {
onResolve() {
this.$emit('handleResolve');
},
+ closeTooltip() {
+ this.$nextTick(() => {
+ this.$root.$emit('bv::hide::tooltip');
+ });
+ },
},
};
</script>
@@ -202,6 +207,7 @@ export default {
title="More actions"
class="note-action-button more-actions-toggle btn btn-transparent"
data-toggle="dropdown"
+ @click="closeTooltip"
>
<icon css-classes="icon" name="ellipsis_v" />
</button>
diff --git a/app/assets/stylesheets/pages/boards.scss b/app/assets/stylesheets/pages/boards.scss
index bc28ffb3a92..a9324ba2ed0 100644
--- a/app/assets/stylesheets/pages/boards.scss
+++ b/app/assets/stylesheets/pages/boards.scss
@@ -164,6 +164,13 @@
display: none;
}
}
+
+ &:not(.is-collapsed) {
+ .board-list-component {
+ display: flex;
+ flex-direction: column;
+ }
+ }
}
.board-inner {
diff --git a/app/assets/stylesheets/pages/branches.scss b/app/assets/stylesheets/pages/branches.scss
index 38fec3f0aa8..ce0622b3d48 100644
--- a/app/assets/stylesheets/pages/branches.scss
+++ b/app/assets/stylesheets/pages/branches.scss
@@ -11,15 +11,24 @@
}
.divergence-graph {
+ $graph-side-width: 80px;
+ $graph-separator-width: 1px;
+
padding: 0 6px;
.graph-side {
position: relative;
- width: 80px;
+ width: $graph-side-width;
height: 22px;
padding: 5px 0 13px;
float: left;
+ &.full {
+ width: $graph-side-width * 2 + $graph-separator-width;
+ display: flex;
+ justify-content: center;
+ }
+
.bar {
position: absolute;
height: 4px;
@@ -57,7 +66,7 @@
.graph-separator {
position: relative;
- width: 1px;
+ width: $graph-separator-width;
height: 18px;
margin: 5px 0 0;
float: left;
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 26cd5dc801f..af0b0c64814 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -137,6 +137,8 @@ class ApplicationController < ActionController::Base
if response.status == 422 && response.body.present? && response.content_type == 'application/json'.freeze
payload[:response] = response.body
end
+
+ payload[:queue_duration] = request.env[::Gitlab::Middleware::RailsQueueDuration::GITLAB_RAILS_QUEUE_DURATION_KEY]
end
##
diff --git a/app/controllers/projects/branches_controller.rb b/app/controllers/projects/branches_controller.rb
index a6bfb913900..32b7f3207ef 100644
--- a/app/controllers/projects/branches_controller.rb
+++ b/app/controllers/projects/branches_controller.rb
@@ -29,7 +29,8 @@ class Projects::BranchesController < Projects::ApplicationController
Gitlab::GitalyClient.allow_n_plus_1_calls do
@max_commits = @branches.reduce(0) do |memo, branch|
diverging_commit_counts = repository.diverging_commit_counts(branch)
- [memo, diverging_commit_counts[:behind], diverging_commit_counts[:ahead]].max
+ [memo, diverging_commit_counts.values_at(:behind, :ahead, :distance)]
+ .flatten.compact.max
end
end
diff --git a/app/controllers/projects/pages_domains_controller.rb b/app/controllers/projects/pages_domains_controller.rb
index 439ec9b1731..58b1bc54181 100644
--- a/app/controllers/projects/pages_domains_controller.rb
+++ b/app/controllers/projects/pages_domains_controller.rb
@@ -4,7 +4,7 @@ class Projects::PagesDomainsController < Projects::ApplicationController
layout 'project_settings'
before_action :require_pages_enabled!
- before_action :authorize_update_pages!, except: [:show]
+ before_action :authorize_update_pages!
before_action :domain, except: [:new, :create]
def show
diff --git a/app/models/concerns/with_uploads.rb b/app/models/concerns/with_uploads.rb
index d79c0eae77e..6c6febd186c 100644
--- a/app/models/concerns/with_uploads.rb
+++ b/app/models/concerns/with_uploads.rb
@@ -27,40 +27,14 @@ module WithUploads
included do
has_many :uploads, as: :model
- has_many :file_uploads, -> { where(uploader: FILE_UPLOADERS) }, class_name: 'Upload', as: :model
+ has_many :file_uploads, -> { where(uploader: FILE_UPLOADERS) },
+ class_name: 'Upload', as: :model,
+ dependent: :delete_all # rubocop:disable Cop/ActiveRecordDependent
- # TODO: when feature flag is removed, we can use just dependent: destroy
- # option on :file_uploads
- before_destroy :remove_file_uploads
-
- use_fast_destroy :file_uploads, if: :fast_destroy_enabled?
+ use_fast_destroy :file_uploads
end
def retrieve_upload(_identifier, paths)
uploads.find_by(path: paths)
end
-
- private
-
- # mounted uploads are deleted in carrierwave's after_commit hook,
- # but FileUploaders which are not mounted must be deleted explicitly and
- # it can not be done in after_commit because FileUploader requires loads
- # associated model on destroy (which is already deleted in after_commit)
- def remove_file_uploads
- fast_destroy_enabled? ? delete_uploads : destroy_uploads
- end
-
- def delete_uploads
- file_uploads.delete_all(:delete_all)
- end
-
- def destroy_uploads
- file_uploads.find_each do |upload|
- upload.destroy
- end
- end
-
- def fast_destroy_enabled?
- Feature.enabled?(:fast_destroy_uploads, self)
- end
end
diff --git a/app/models/project.rb b/app/models/project.rb
index 58df4019450..c72d3a3b725 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -2073,6 +2073,10 @@ class Project < ActiveRecord::Base
pool_repository&.link_repository(repository)
end
+ def has_pool_repository?
+ pool_repository.present?
+ end
+
private
def merge_requests_allowing_collaboration(source_branch = nil)
diff --git a/app/models/repository.rb b/app/models/repository.rb
index 7c50b4488e5..ed55a6e572b 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -288,13 +288,16 @@ class Repository
# Rugged seems to throw a `ReferenceError` when given branch_names rather
# than SHA-1 hashes
number_commits_behind, number_commits_ahead =
- raw_repository.count_commits_between(
+ raw_repository.diverging_commit_count(
@root_ref_hash,
branch.dereferenced_target.sha,
- left_right: true,
max_count: MAX_DIVERGING_COUNT)
- { behind: number_commits_behind, ahead: number_commits_ahead }
+ if number_commits_behind + number_commits_ahead >= MAX_DIVERGING_COUNT
+ { distance: MAX_DIVERGING_COUNT }
+ else
+ { behind: number_commits_behind, ahead: number_commits_ahead }
+ end
end
end
diff --git a/app/presenters/project_presenter.rb b/app/presenters/project_presenter.rb
index ea1d941cf83..4cac90c2567 100644
--- a/app/presenters/project_presenter.rb
+++ b/app/presenters/project_presenter.rb
@@ -256,7 +256,8 @@ class ProjectPresenter < Gitlab::View::Presenter::Delegated
elsif repository.contribution_guide.present?
AnchorData.new(false,
statistic_icon('doc-text') + _('CONTRIBUTING'),
- contribution_guide_path)
+ contribution_guide_path,
+ 'default')
end
end
diff --git a/app/services/task_list_toggle_service.rb b/app/services/task_list_toggle_service.rb
index cfe187d9b12..af24bc0524c 100644
--- a/app/services/task_list_toggle_service.rb
+++ b/app/services/task_list_toggle_service.rb
@@ -33,7 +33,7 @@ class TaskListToggleService
markdown_task = source_lines[source_line_index]
# The source in the DB could be using either \n or \r\n line endings
- return unless markdown_task == line_source || markdown_task == line_source + "\r"
+ return unless markdown_task.chomp == line_source
return unless source_checkbox = Taskable::ITEM_PATTERN.match(markdown_task)
currently_checked = TaskList::Item.new(source_checkbox[1]).complete?
diff --git a/app/views/layouts/_mailer.html.haml b/app/views/layouts/_mailer.html.haml
index ddc1cdb24b5..26fd34347ec 100644
--- a/app/views/layouts/_mailer.html.haml
+++ b/app/views/layouts/_mailer.html.haml
@@ -49,7 +49,7 @@
%table#body{ border: "0", cellpadding: "0", cellspacing: "0", style: "background-color:#fafafa;margin:0;padding:0;text-align:center;min-width:640px;width:100%;" }
%tbody
%tr.line
- %td{ style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;background-color:#6b4fbb;height:4px;font-size:4px;line-height:4px;" }  
+ %td{ style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;background-color:#6b4fbb;height:4px;font-size:4px;line-height:4px;" }
%tr.header
%td{ style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;padding:25px 0;font-size:13px;line-height:1.6;color:#5c5c5c;" }
= header_logo
diff --git a/app/views/projects/branches/_branch.html.haml b/app/views/projects/branches/_branch.html.haml
index 4b0ea15335e..c64ad1c8147 100644
--- a/app/views/projects/branches/_branch.html.haml
+++ b/app/views/projects/branches/_branch.html.haml
@@ -2,6 +2,7 @@
- commit = @repository.commit(branch.dereferenced_target)
- bar_graph_width_factor = @max_commits > 0 ? 100.0/@max_commits : 0
- diverging_commit_counts = @repository.diverging_commit_counts(branch)
+- number_commits_distance = diverging_commit_counts[:distance]
- number_commits_behind = diverging_commit_counts[:behind]
- number_commits_ahead = diverging_commit_counts[:ahead]
- merge_project = merge_request_source_project_for_project(@project)
@@ -28,16 +29,23 @@
= s_('Branches|Cant find HEAD commit for this branch')
- if branch.name != @repository.root_ref
- .divergence-graph.d-none.d-md-block{ title: s_('%{number_commits_behind} commits behind %{default_branch}, %{number_commits_ahead} commits ahead') % { number_commits_behind: diverging_count_label(number_commits_behind),
- default_branch: @repository.root_ref,
- number_commits_ahead: diverging_count_label(number_commits_ahead) } }
- .graph-side
- .bar.bar-behind{ style: "width: #{number_commits_behind * bar_graph_width_factor}%" }
- %span.count.count-behind= diverging_count_label(number_commits_behind)
- .graph-separator
- .graph-side
- .bar.bar-ahead{ style: "width: #{number_commits_ahead * bar_graph_width_factor}%" }
- %span.count.count-ahead= diverging_count_label(number_commits_ahead)
+ - if number_commits_distance.nil?
+ .divergence-graph.d-none.d-md-block{ title: s_('%{number_commits_behind} commits behind %{default_branch}, %{number_commits_ahead} commits ahead') % { number_commits_behind: diverging_count_label(number_commits_behind),
+ default_branch: @repository.root_ref,
+ number_commits_ahead: diverging_count_label(number_commits_ahead) } }
+ .graph-side
+ .bar.bar-behind{ style: "width: #{number_commits_behind * bar_graph_width_factor}%" }
+ %span.count.count-behind= diverging_count_label(number_commits_behind)
+ .graph-separator
+ .graph-side
+ .bar.bar-ahead{ style: "width: #{number_commits_ahead * bar_graph_width_factor}%" }
+ %span.count.count-ahead= diverging_count_label(number_commits_ahead)
+ - else
+ .divergence-graph.d-none.d-md-block{ title: s_('More than %{number_commits_distance} commits different with %{default_branch}') % { number_commits_distance: diverging_count_label(number_commits_distance),
+ default_branch: @repository.root_ref} }
+ .graph-side.full
+ .bar{ style: "width: #{number_commits_distance * bar_graph_width_factor}%" }
+ %span.count= diverging_count_label(number_commits_distance)
.controls.d-none.d-md-block<
- if merge_project && create_mr_button?(@repository.root_ref, branch.name)
diff --git a/changelogs/unreleased/47150-update-sshkey.yml b/changelogs/unreleased/47150-update-sshkey.yml
new file mode 100644
index 00000000000..342bdb1e2bc
--- /dev/null
+++ b/changelogs/unreleased/47150-update-sshkey.yml
@@ -0,0 +1,5 @@
+---
+title: Fix validation of certain ed25519 keys
+merge_request: 25115
+author: Merlijn B. W. Wajer
+type: fixed
diff --git a/changelogs/unreleased/54850-pages-domain-show-view-is-not-protected-by-access-control.yml b/changelogs/unreleased/54850-pages-domain-show-view-is-not-protected-by-access-control.yml
new file mode 100644
index 00000000000..41761213d7b
--- /dev/null
+++ b/changelogs/unreleased/54850-pages-domain-show-view-is-not-protected-by-access-control.yml
@@ -0,0 +1,5 @@
+---
+title: Require maintainer access to show pages domain settings
+merge_request: 24926
+author:
+type: fixed
diff --git a/changelogs/unreleased/55209-tool-tip-hides-menu-item.yml b/changelogs/unreleased/55209-tool-tip-hides-menu-item.yml
new file mode 100644
index 00000000000..44ea4141632
--- /dev/null
+++ b/changelogs/unreleased/55209-tool-tip-hides-menu-item.yml
@@ -0,0 +1,5 @@
+---
+title: Close More Actions tooltip when menu opens
+merge_request: 24285
+author:
+type: fixed
diff --git a/changelogs/unreleased/57223-wiki-finder.yml b/changelogs/unreleased/57223-wiki-finder.yml
new file mode 100644
index 00000000000..5ddf197568d
--- /dev/null
+++ b/changelogs/unreleased/57223-wiki-finder.yml
@@ -0,0 +1,5 @@
+---
+title: Remove BATCH_SIZE from WikiFileFinder
+merge_request: 24933
+author:
+type: other
diff --git a/changelogs/unreleased/57564-contributing-button-border.yml b/changelogs/unreleased/57564-contributing-button-border.yml
new file mode 100644
index 00000000000..e5875ef1c0f
--- /dev/null
+++ b/changelogs/unreleased/57564-contributing-button-border.yml
@@ -0,0 +1,5 @@
+---
+title: Fix the border style of CONTRIBUTING button when it exists
+merge_request: 25124
+author: Takuya Noguchi
+type: fixed
diff --git a/changelogs/unreleased/fast-destroy-uploads.yml b/changelogs/unreleased/fast-destroy-uploads.yml
new file mode 100644
index 00000000000..ee3363a6ae9
--- /dev/null
+++ b/changelogs/unreleased/fast-destroy-uploads.yml
@@ -0,0 +1,5 @@
+---
+title: File uploads are deleted asynchronously when deleting a project or group.
+merge_request:
+author:
+type: added
diff --git a/changelogs/unreleased/improve-performance-for-diverging-commit-counts.yml b/changelogs/unreleased/improve-performance-for-diverging-commit-counts.yml
new file mode 100644
index 00000000000..76ff15cba5b
--- /dev/null
+++ b/changelogs/unreleased/improve-performance-for-diverging-commit-counts.yml
@@ -0,0 +1,5 @@
+---
+title: Improve performance for diverging commit counts
+merge_request: 24287
+author:
+type: performance
diff --git a/changelogs/unreleased/ravlen-fix-spaces-unicode.yml b/changelogs/unreleased/ravlen-fix-spaces-unicode.yml
new file mode 100644
index 00000000000..fbcbdc53cfe
--- /dev/null
+++ b/changelogs/unreleased/ravlen-fix-spaces-unicode.yml
@@ -0,0 +1,5 @@
+---
+title: Correct non-standard unicode spaces to regular unicode
+merge_request: 24795
+author: Marcel Amirault
+type: other
diff --git a/changelogs/unreleased/sh-import-source-branch-github-forks.yml b/changelogs/unreleased/sh-import-source-branch-github-forks.yml
new file mode 100644
index 00000000000..b5ea60202c0
--- /dev/null
+++ b/changelogs/unreleased/sh-import-source-branch-github-forks.yml
@@ -0,0 +1,5 @@
+---
+title: Create the source branch for a GitHub import
+merge_request: 25064
+author:
+type: fixed
diff --git a/changelogs/unreleased/sh-log-rails-queue-duration.yml b/changelogs/unreleased/sh-log-rails-queue-duration.yml
new file mode 100644
index 00000000000..89390aef108
--- /dev/null
+++ b/changelogs/unreleased/sh-log-rails-queue-duration.yml
@@ -0,0 +1,5 @@
+---
+title: Log queue duration in production_json.log
+merge_request: 25075
+author:
+type: other
diff --git a/config/initializers/lograge.rb b/config/initializers/lograge.rb
index c897bc30e76..164954d1293 100644
--- a/config/initializers/lograge.rb
+++ b/config/initializers/lograge.rb
@@ -23,7 +23,8 @@ unless Sidekiq.server?
remote_ip: event.payload[:remote_ip],
user_id: event.payload[:user_id],
username: event.payload[:username],
- ua: event.payload[:ua]
+ ua: event.payload[:ua],
+ queue_duration: event.payload[:queue_duration]
}
gitaly_calls = Gitlab::GitalyClient.get_request_count
diff --git a/doc/administration/high_availability/gitlab.md b/doc/administration/high_availability/gitlab.md
index 2ca860bd763..e554c06532e 100644
--- a/doc/administration/high_availability/gitlab.md
+++ b/doc/administration/high_availability/gitlab.md
@@ -58,6 +58,7 @@ for each GitLab application server in your environment.
# Disable components that will not be on the GitLab application server
roles ['application_role']
+ nginx['enable'] = true
# PostgreSQL connection details
gitlab_rails['db_adapter'] = 'postgresql'
@@ -90,6 +91,8 @@ for each GitLab application server in your environment.
certificates are not present, Nginx will fail to start. See
[Nginx documentation](http://docs.gitlab.com/omnibus/settings/nginx.html#enable-https)
for more information.
+ >
+ > **Note:** It is best to set the `uid` and `gid`s prior to the initial reconfigure of GitLab. Omnibus will not recursively `chown` directories if set after the initial reconfigure.
## First GitLab application server
@@ -108,8 +111,9 @@ Additional GitLab servers (servers configured **after** the first GitLab server)
need some extra configuration.
1. Configure shared secrets. These values can be obtained from the primary
- GitLab server in `/etc/gitlab/gitlab-secrets.json`. Add these to
- `/etc/gitlab/gitlab.rb` **prior to** running the first `reconfigure`.
+ GitLab server in `/etc/gitlab/gitlab-secrets.json`. Copy this file to the
+ secondary servers **prior to** running the first `reconfigure` in the steps
+ above.
```ruby
gitlab_shell['secret_token'] = 'fbfb19c355066a9afb030992231c4a363357f77345edd0f2e772359e5be59b02538e1fa6cae8f93f7d23355341cea2b93600dab6d6c3edcdced558fc6d739860'
diff --git a/doc/administration/high_availability/load_balancer.md b/doc/administration/high_availability/load_balancer.md
index 359de0efadb..28b226cacd5 100644
--- a/doc/administration/high_availability/load_balancer.md
+++ b/doc/administration/high_availability/load_balancer.md
@@ -8,7 +8,53 @@ choice already. Some examples including HAProxy (open-source), F5 Big-IP LTM,
and Citrix Net Scaler. This documentation will outline what ports and protocols
you need to use with GitLab.
-## Basic ports
+## SSL
+
+How will you handle SSL in your HA environment? There are several different
+options:
+
+- Each application node terminates SSL
+- The load balancer(s) terminate SSL and communication is not secure between
+ the load balancer(s) and the application nodes
+- The load balancer(s) terminate SSL and communication is *secure* between the
+ load balancer(s) and the application nodes
+
+### Application nodes terminate SSL
+
+Configure your load balancer(s) to pass connections on port 443 as 'TCP' rather
+than 'HTTP(S)' protocol. This will pass the connection to the application nodes
+Nginx service untouched. Nginx will have the SSL certificate and listen on port 443.
+
+See [Nginx HTTPS documentation](https://docs.gitlab.com/omnibus/settings/nginx.html#enable-https)
+for details on managing SSL certificates and configuring Nginx.
+
+### Load Balancer(s) terminate SSL without backend SSL
+
+Configure your load balancer(s) to use the 'HTTP(S)' protocol rather than 'TCP'.
+The load balancer(s) will then be responsible for managing SSL certificates and
+terminating SSL.
+
+Since communication between the load balancer(s) and GitLab will not be secure,
+there is some additional configuration needed. See
+[Nginx Proxied SSL documentation](https://docs.gitlab.com/omnibus/settings/nginx.html#supporting-proxied-ssl)
+for details.
+
+### Load Balancer(s) terminate SSL with backend SSL
+
+Configure your load balancer(s) to use the 'HTTP(S)' protocol rather than 'TCP'.
+The load balancer(s) will be responsible for managing SSL certificates that
+end users will see.
+
+Traffic will also be secure between the load balancer(s) and Nginx in this
+scenario. There is no need to add configuration for proxied SSL since the
+connection will be secure all the way. However, configuration will need to be
+added to GitLab to configure SSL certificates. See
+[Nginx HTTPS documentation](https://docs.gitlab.com/omnibus/settings/nginx.html#enable-https)
+for details on managing SSL certificates and configuring Nginx.
+
+## Ports
+
+### Basic ports
| LB Port | Backend Port | Protocol |
| ------- | ------------ | --------------- |
@@ -16,9 +62,9 @@ you need to use with GitLab.
| 443 | 443 | TCP or HTTPS [^1] [^2] |
| 22 | 22 | TCP |
-## GitLab Pages Ports
+### GitLab Pages Ports
-If you're using GitLab Pages with custom domain support you will need some
+If you're using GitLab Pages with custom domain support you will need some
additional port configurations.
GitLab Pages requires a separate virtual IP address. Configure DNS to point the
`pages_external_url` from `/etc/gitlab/gitlab.rb` at the new virtual IP address. See the
@@ -29,7 +75,7 @@ GitLab Pages requires a separate virtual IP address. Configure DNS to point the
| 80 | Varies [^3] | HTTP |
| 443 | Varies [^3] | TCP [^4] |
-## Alternate SSH Port
+### Alternate SSH Port
Some organizations have policies against opening SSH port 22. In this case,
it may be helpful to configure an alternate SSH hostname that allows users
diff --git a/doc/administration/logs.md b/doc/administration/logs.md
index 698f4caab3a..36dee75bd44 100644
--- a/doc/administration/logs.md
+++ b/doc/administration/logs.md
@@ -23,12 +23,13 @@ requests from the API are logged to a separate file in `api_json.log`.
Each line contains a JSON line that can be ingested by Elasticsearch, Splunk, etc. For example:
```json
-{"method":"GET","path":"/gitlab/gitlab-ce/issues/1234","format":"html","controller":"Projects::IssuesController","action":"show","status":200,"duration":229.03,"view":174.07,"db":13.24,"time":"2017-08-08T20:15:54.821Z","params":[{"key":"param_key","value":"param_value"}],"remote_ip":"18.245.0.1","user_id":1,"username":"admin","gitaly_calls":76}
+{"method":"GET","path":"/gitlab/gitlab-ce/issues/1234","format":"html","controller":"Projects::IssuesController","action":"show","status":200,"duration":229.03,"view":174.07,"db":13.24,"time":"2017-08-08T20:15:54.821Z","params":[{"key":"param_key","value":"param_value"}],"remote_ip":"18.245.0.1","user_id":1,"username":"admin","gitaly_calls":76,"queue_duration": 112.47}
```
In this example, you can see this was a GET request for a specific issue. Notice each line also contains performance data:
-1. `duration`: the total time taken to retrieve the request
+1. `duration`: total time in milliseconds taken to retrieve the request
+1. `queue_duration`: total time in milliseconds that the request was queued inside GitLab Workhorse
1. `view`: total time taken inside the Rails views
1. `db`: total time to retrieve data from the database
1. `gitaly_calls`: total number of calls made to Gitaly
@@ -91,6 +92,8 @@ This entry above shows an access to an internal endpoint to check whether an
associated SSH key can download the project in question via a `git fetch` or
`git clone`. In this example, we see:
+1. `duration`: total time in milliseconds taken to retrieve the request
+1. `queue_duration`: total time in milliseconds that the request was queued inside GitLab Workhorse
1. `method`: The HTTP method used to make the request
1. `path`: The relative path of the query
1. `params`: Key-value pairs passed in a query string or HTTP body. Sensitive parameters (e.g. passwords, tokens, etc.) are filtered out.
diff --git a/doc/administration/uploads.md b/doc/administration/uploads.md
index 476ae8e8a76..9dfe085425f 100644
--- a/doc/administration/uploads.md
+++ b/doc/administration/uploads.md
@@ -149,7 +149,7 @@ _The uploads are stored by default in
[reconfigure gitlab]: restart_gitlab.md#omnibus-gitlab-reconfigure "How to reconfigure Omnibus GitLab"
[restart gitlab]: restart_gitlab.md#installations-from-source "How to restart GitLab"
-[eep]: https://about.gitlab.com/gitlab-ee/ "GitLab Enterprise Edition Premium"
+[eep]: https://about.gitlab.com/gitlab-ee/ "GitLab Premium"
[ce]: https://about.gitlab.com/gitlab-ce/ "GitLab Community Edition"
[ee-3867]: https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/3867
[ce-17358]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/17358
diff --git a/doc/api/repositories.md b/doc/api/repositories.md
index 104c64a89ce..681dc72c934 100644
--- a/doc/api/repositories.md
+++ b/doc/api/repositories.md
@@ -119,7 +119,11 @@ would send an archive in ZIP format.
Parameters:
- `id` (required) - The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user
-- `sha` (optional) - The commit SHA to download. A tag, branch reference or sha can be used. This defaults to the tip of the default branch if not specified
+- `sha` (optional) - The commit SHA to download. A tag, branch reference, or SHA can be used. This defaults to the tip of the default branch if not specified. For example:
+
+ ```sh
+ curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.com/api/v4/projects/<project_id>/repository/archive?sha=<commit_sha>
+ ```
## Compare branches, tags or commits
diff --git a/doc/ci/examples/sast_docker.md b/doc/ci/examples/sast_docker.md
index 9f4a63e296d..3a657b3a3d5 100644
--- a/doc/ci/examples/sast_docker.md
+++ b/doc/ci/examples/sast_docker.md
@@ -1 +1 @@
-This document was moved to [another location](./container_scanning.md). \ No newline at end of file
+This document was moved to [another location](./container_scanning.md).
diff --git a/doc/ci/merge_request_pipelines/index.md b/doc/ci/merge_request_pipelines/index.md
index bf1e61442d4..b7b5c660586 100644
--- a/doc/ci/merge_request_pipelines/index.md
+++ b/doc/ci/merge_request_pipelines/index.md
@@ -56,6 +56,49 @@ The same tag is shown on the pipeline's details:
![Pipeline's details](img/pipeline_detail.png)
+## Excluding certain jobs
+
+The behavior of the `only: merge_requests` rule is such that _only_ jobs with
+that rule are run in the context of a merge request; no other jobs will be run.
+
+However, you may want to reverse this behaviour, having all of your jobs to run _except_
+for one or two. Consider the following pipeline, with jobs `A`, `B`, and `C`. If you want
+all pipelines to always run `A` and `B`, but only want `C` to run for a merge request,
+you can configure your `.gitlab-ci.yml` file as follows:
+
+``` yaml
+.only-default: &only-default
+ only:
+ - master
+ - merge_requests
+ - tags
+
+A:
+ <<: *only-default
+ script:
+ - ...
+
+B:
+ <<: *only-default
+ script:
+ - ...
+
+C:
+ script:
+ - ...
+ only:
+ - merge_requests
+```
+
+Since `A` and `B` are getting the `only:` rule to execute in all cases, they will
+always run. `C` specifies that it should only run for merge requests, so for any
+pipeline except a merge request pipeline, it will not run.
+
+As you can see, this will help you avoid a lot of boilerplate where you'd need
+to add that `only:` rule to all of your jobs in order to make them always run. You
+can use this for scenarios like having only pipelines with merge requests get a
+Review App set up, helping to save resources.
+
## Important notes about merge requests from forked projects
Note that the current behavior is subject to change. In the usual contribution
diff --git a/doc/development/ee_features.md b/doc/development/ee_features.md
index e0985922443..3e85c0e1995 100644
--- a/doc/development/ee_features.md
+++ b/doc/development/ee_features.md
@@ -831,6 +831,29 @@ should remain working as-is when EE is running without a license.
Instead place EE specs in the `ee/spec` folder.
+### Code in `spec/factories`
+
+Use `FactoryBot.modify` to extend factories already defined in CE.
+
+Note that you cannot define new factories (even nested ones) inside the `FactoryBot.modify` block. You can do so in a
+separate `FactoryBot.define` block as shown in the example below:
+
+```ruby
+# ee/spec/factories/notes.rb
+FactoryBot.modify do
+ factory :note do
+ trait :on_epic do
+ noteable { create(:epic) }
+ project nil
+ end
+ end
+end
+
+FactoryBot.define do
+ factory :note_on_epic, parent: :note, traits: [:on_epic]
+end
+```
+
## JavaScript code in `assets/javascripts/`
To separate EE-specific JS-files we should also move the files into an `ee` folder.
diff --git a/doc/development/testing_guide/ci.md b/doc/development/testing_guide/ci.md
index d685cacf9ea..5aa668290b4 100644
--- a/doc/development/testing_guide/ci.md
+++ b/doc/development/testing_guide/ci.md
@@ -24,7 +24,7 @@ Our current CI parallelization setup is as follows:
uploaded to S3.
After that, the next pipeline will use the up-to-date
-`knapsack/${CI_PROJECT_NAME}/rspec_report-master.json` file.
+`knapsack/${CI_PROJECT_NAME}/rspec_report-master.json` file.
### Monitoring
diff --git a/doc/install/README.md b/doc/install/README.md
index ae48306e65e..52011526768 100644
--- a/doc/install/README.md
+++ b/doc/install/README.md
@@ -3,7 +3,7 @@ comments: false
description: Read through the GitLab installation methods.
---
-# Installation
+# Installation **[CORE ONLY]**
GitLab can be installed in most GNU/Linux distributions and in a number
of cloud providers. To get the best experience from GitLab you need to balance
diff --git a/doc/install/installation.md b/doc/install/installation.md
index a8064ae046e..fb24d4fa0ef 100644
--- a/doc/install/installation.md
+++ b/doc/install/installation.md
@@ -108,7 +108,7 @@ sudo apt-get install -y libcurl4-openssl-dev libexpat1-dev gettext libz-dev libs
# Download and compile from source
cd /tmp
-curl --remote-name --progress https://www.kernel.org/pub/software/scm/git/git-2.18.0.tar.gz
+curl --remote-name --location --progress https://www.kernel.org/pub/software/scm/git/git-2.18.0.tar.gz
echo '94faf2c0b02a7920b0b46f4961d8e9cad08e81418614102898a55f980fa3e7e4 git-2.18.0.tar.gz' | shasum -a256 -c - && tar -xzf git-2.18.0.tar.gz
cd git-2.18.0/
./configure
diff --git a/doc/intro/README.md b/doc/intro/README.md
index d9acc5bdeac..9bc7c3d9ea4 100644
--- a/doc/intro/README.md
+++ b/doc/intro/README.md
@@ -9,13 +9,13 @@ comments: false
Create projects and groups.
- [Create a new project](../gitlab-basics/create-project.md)
-- [Create a new group](../gitlab-basics/create-group.md)
+- [Create a new group](../user/group/index.md#create-a-new-group)
## Prioritize
Create issues, labels, milestones, cast your vote, and review issues.
-- [Create a new issue](../user/project/issues/index.md#new-issue)
+- [Create an issue](../user/project/issues/create_new_issue.md)
- [Assign labels to issues](../user/project/labels.md)
- [Use milestones as an overview of your project's tracker](../user/project/milestones/index.md)
- [Use voting to express your like/dislike to issues and merge requests](../workflow/award_emoji.md)
diff --git a/doc/security/README.md b/doc/security/README.md
index e22dc00759d..a90127e0356 100644
--- a/doc/security/README.md
+++ b/doc/security/README.md
@@ -15,3 +15,4 @@ comments: false
- [How we manage the CRIME vulnerability](crime_vulnerability.md)
- [Enforce Two-factor authentication](two_factor_authentication.md)
- [Send email confirmation on sign-up](user_email_confirmation.md)
+- [Security of running jobs](https://docs.gitlab.com/runner/security/)
diff --git a/doc/ssh/README.md b/doc/ssh/README.md
index 1b53be15b44..9c4a391e8da 100644
--- a/doc/ssh/README.md
+++ b/doc/ssh/README.md
@@ -247,6 +247,17 @@ Public SSH keys need to be unique to GitLab, as they will bind to your account.
Your SSH key is the only identifier you'll have when pushing code via SSH,
that's why it needs to uniquely map to a single user.
+## Per-repository SSH keys
+
+If you want to use different keys depending on the repository you are working
+on, you can issue the following command while inside your repository:
+
+```sh
+git config core.sshCommand "ssh -o IdentitiesOnly=yes -i ~/.ssh/private-key-filename-for-this-repository -F /dev/null"
+```
+
+This will not use the SSH Agent and requires at least Git 2.10.
+
## Deploy keys
### Per-repository deploy keys
diff --git a/doc/system_hooks/system_hooks.md b/doc/system_hooks/system_hooks.md
index 6d63906ea4d..55b678d6af5 100644
--- a/doc/system_hooks/system_hooks.md
+++ b/doc/system_hooks/system_hooks.md
@@ -138,7 +138,7 @@ Please refer to `group_rename` and `user_rename` for that case.
"created_at": "2012-07-21T07:30:56Z",
"updated_at": "2012-07-21T07:38:22Z",
"event_name": "user_add_to_team",
- "project_access": "Maintainer",
+ "access_level": "Maintainer",
"project_id": 74,
"project_name": "StoreCloud",
"project_path": "storecloud",
diff --git a/doc/topics/authentication/index.md b/doc/topics/authentication/index.md
index a354d3e7884..df6897002c9 100644
--- a/doc/topics/authentication/index.md
+++ b/doc/topics/authentication/index.md
@@ -21,7 +21,7 @@ This page gathers all the resources for the topic **Authentication** within GitL
- [Enforce Two-factor Authentication (2FA)](../../security/two_factor_authentication.md#enforce-two-factor-authentication-2fa)
- **Articles:**
- [How to Configure LDAP with GitLab CE](../../administration/auth/how_to_configure_ldap_gitlab_ce/index.md)
- - [How to Configure LDAP with GitLab EE](https://docs.gitlab.com/ee/articles/how_to_configure_ldap_gitlab_ee/)
+ - [How to Configure LDAP with GitLab EE](https://docs.gitlab.com/ee/administration/auth/how_to_configure_ldap_gitlab_ee/index.md)
- [Feature Highlight: LDAP Integration](https://about.gitlab.com/2014/07/10/feature-highlight-ldap-sync/)
- [Debugging LDAP](https://about.gitlab.com/handbook/support/workflows/support-engineering/ldap/debugging_ldap.html)
- **Integrations:**
diff --git a/doc/topics/autodevops/index.md b/doc/topics/autodevops/index.md
index 91be3e3d45d..b72138ef24f 100644
--- a/doc/topics/autodevops/index.md
+++ b/doc/topics/autodevops/index.md
@@ -58,15 +58,15 @@ project in a simple and automatic way:
1. [Auto Build](#auto-build)
1. [Auto Test](#auto-test)
-1. [Auto Code Quality](#auto-code-quality) **[STARTER]**
-1. [Auto SAST (Static Application Security Testing)](#auto-sast) **[ULTIMATE]**
-1. [Auto Dependency Scanning](#auto-dependency-scanning) **[ULTIMATE]**
-1. [Auto License Management](#auto-license-management) **[ULTIMATE]**
+1. [Auto Code Quality](#auto-code-quality-starter) **[STARTER]**
+1. [Auto SAST (Static Application Security Testing)](#auto-sast-ultimate) **[ULTIMATE]**
+1. [Auto Dependency Scanning](#auto-dependency-scanning-ultimate) **[ULTIMATE]**
+1. [Auto License Management](#auto-license-management-ultimate) **[ULTIMATE]**
1. [Auto Container Scanning](#auto-container-scanning)
1. [Auto Review Apps](#auto-review-apps)
-1. [Auto DAST (Dynamic Application Security Testing)](#auto-dast) **[ULTIMATE]**
+1. [Auto DAST (Dynamic Application Security Testing)](#auto-dast-ultimate) **[ULTIMATE]**
1. [Auto Deploy](#auto-deploy)
-1. [Auto Browser Performance Testing](#auto-browser-performance-testing) **[PREMIUM]**
+1. [Auto Browser Performance Testing](#auto-browser-performance-testing-premium) **[PREMIUM]**
1. [Auto Monitoring](#auto-monitoring)
As Auto DevOps relies on many different components, it's good to have a basic
diff --git a/doc/update/README.md b/doc/update/README.md
index d098dc99518..e2fffadb1ea 100644
--- a/doc/update/README.md
+++ b/doc/update/README.md
@@ -5,15 +5,15 @@ update guides.
There are currently 3 official ways to install GitLab:
-- Omnibus packages
-- Source installation
-- Docker installation
+- [Omnibus packages](#omnibus-packages)
+- [Source installation](#installation-from-source)
+- [Docker installation](#installation-using-docker)
Based on your installation, choose a section below that fits your needs.
## Omnibus Packages
-- The [Omnibus update guide](http://docs.gitlab.com/omnibus/update/README.html)
+- The [Omnibus update guide][omni-update]
contains the steps needed to update an Omnibus GitLab package.
## Installation from source
@@ -36,7 +36,7 @@ can still be found in the Git repository:
GitLab provides official Docker images for both Community and Enterprise
editions. They are based on the Omnibus package and instructions on how to
-update them are in [a separate document][omnidocker].
+update them are in [a separate document][omni-docker].
## Upgrading without downtime
@@ -103,6 +103,10 @@ migrations this could potentially lead to hours of downtime, depending on the
size of your database. To work around this you will have to use PostgreSQL and
meet the other online upgrade requirements mentioned above.
+### Steps
+
+Steps to [upgrade without downtime][omni-zero-downtime].
+
## Upgrading between editions
GitLab comes in two flavors: [Community Edition][ce] which is MIT licensed,
@@ -150,3 +154,6 @@ possible.
[ce]: https://about.gitlab.com/features/#community
[ee]: https://about.gitlab.com/features/#enterprise
[omni-ce-ee]: https://docs.gitlab.com/omnibus/update/README.html#updating-community-edition-to-enterprise-edition
+[omni-docker]: https://docs.gitlab.com/omnibus/docker/README.html
+[omni-update]: https://docs.gitlab.com/omnibus/update/README.html
+[omni-zero-downtime]: https://docs.gitlab.com/omnibus/update/README.html#zero-downtime-updates
diff --git a/doc/user/admin_area/settings/third_party_offers.md b/doc/user/admin_area/settings/third_party_offers.md
index 177251b52b9..23311801790 100644
--- a/doc/user/admin_area/settings/third_party_offers.md
+++ b/doc/user/admin_area/settings/third_party_offers.md
@@ -3,4 +3,7 @@
> [Introduced](https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20379)
> in [GitLab Core](https://about.gitlab.com/pricing/) 11.1
-The display of third party offers can be controlled in the Admin Area -> Settings page.
+Within GitLab, we inform users of available third-party offers they might find valuable in order to enhance the development of their projects.
+An example is the Google Cloud Platform free credit for using [Google Kubernetes Engine](https://cloud.google.com/kubernetes-engine/).
+
+The display of third-party offers can be toggled in the Admin area on the Settings page.
diff --git a/doc/user/profile/preferences.md b/doc/user/profile/preferences.md
index 363d3db8db1..7387d1810ca 100644
--- a/doc/user/profile/preferences.md
+++ b/doc/user/profile/preferences.md
@@ -57,7 +57,10 @@ and default views of your dashboard and the projects' landing pages.
### Layout width
GitLab can be set up to use different widths depending on your liking. Choose
-between the fixed (max. 1200px) and the fluid (100%) application layout.
+between the fixed (max. `1280px`) and the fluid (`100%`) application layout.
+
+NOTE: **Note:**
+While `1280px` is the standard max width when using fixed layout, some pages still use 100% width, depending on the content.
### Default dashboard
diff --git a/doc/user/project/integrations/prometheus.md b/doc/user/project/integrations/prometheus.md
index a4698fd172a..ed289b0c4eb 100644
--- a/doc/user/project/integrations/prometheus.md
+++ b/doc/user/project/integrations/prometheus.md
@@ -89,7 +89,7 @@ to integrate with.
Once configured, GitLab will attempt to retrieve performance metrics for any
environment which has had a successful deployment.
-GitLab will automatically scan the Prometheus server for metrics from known serves like Kubernetes and NGINX, and attempt to identify individual environment. The supported metrics and scan process is detailed in our [Prometheus Metrics Library documentation](prometheus_library/index.md).
+GitLab will automatically scan the Prometheus server for metrics from known servers like Kubernetes and NGINX, and attempt to identify individual environment. The supported metrics and scan process is detailed in our [Prometheus Metrics Library documentation](prometheus_library/index.md).
You can view the performance dashboard for an environment by [clicking on the monitoring button](../../../ci/environments.md#monitoring-environments).
diff --git a/doc/user/project/integrations/webhooks.md b/doc/user/project/integrations/webhooks.md
index 4d1d95da6f0..60a4c6aaf64 100644
--- a/doc/user/project/integrations/webhooks.md
+++ b/doc/user/project/integrations/webhooks.md
@@ -22,12 +22,37 @@ a new issue is created. You can configure webhooks to listen for specific events
like pushes, issues or merge requests. GitLab will send a POST request with data
to the webhook URL.
+In most cases, you'll need to set up your own [webhook receiver](#example-webhook-receiver)
+to receive information from GitLab, and send it to another app, according to your needs.
+We already have a [built-in receiver](http://docs.gitlab.com/ce/project_services/slack.html)
+for sending [Slack](https://api.slack.com/incoming-webhooks) notifications _per project_.
+
+## Overview
+
+[Webhooks](https://en.wikipedia.org/wiki/Webhook) are "_user-defined HTTP
+callbacks_". They are usually triggered by some
+event, such as pushing code to a repository or a comment being posted to a blog.
+When that event occurs, the source app makes an HTTP request to the URI
+configured for the webhook. The action taken may be anything.
+Common uses are to trigger builds with continuous integration systems or to
+notify bug tracking systems.
+
Webhooks can be used to update an external issue tracker, trigger CI jobs,
update a backup mirror, or even deploy to your production server.
+They are available **per project** for GitLab Community Edition,
+and **per project and per group** for **GitLab Enterprise Edition**.
Navigate to the webhooks page by going to your project's
**Settings ➔ Integrations**.
+## Use-cases
+
+- You can set up a webhook in GitLab to send a notification to
+[Slack](https://api.slack.com/incoming-webhooks) every time a build fails, for example
+- You can [integrate with Twilio to be notified via SMS](https://www.datadoghq.com/blog/send-alerts-sms-customizable-webhooks-twilio/)
+every time an issue is created for a specific project or group within GitLab
+- You can use them to [automatically assign labels to merge requests](https://about.gitlab.com/2016/08/19/applying-gitlab-labels-automatically/).
+
## Webhook endpoint tips
If you are writing your own endpoint (web server) that will receive
diff --git a/doc/user/project/issues/issues_functionalities.md b/doc/user/project/issues/issues_functionalities.md
index d78721f8658..e4a3ff52e07 100644
--- a/doc/user/project/issues/issues_functionalities.md
+++ b/doc/user/project/issues/issues_functionalities.md
@@ -4,7 +4,7 @@ Please read through the [GitLab Issue Documentation](index.md) for an overview o
## Issues Functionalities
-The image bellow illustrates how an issue looks like:
+The image below illustrates what an issue looks like:
![Issue view](img/issues_main_view_numbered.jpg)
@@ -13,7 +13,7 @@ You can find all the information on that issue on one screen.
### Issue screen
An issue starts with its status (open or closed), followed by its author,
-and includes many other functionalities, numbered on the image above to
+and includes many other functionalities, numbered in the image above to
explain what they mean, one by one.
Many of the elements of the issue screen refresh automatically, such as the title and description, when they are changed by another user.
@@ -27,7 +27,7 @@ Comments and system notes also appear automatically in response to various actio
#### 2. Todos
-- Add todo: add that issue to your [GitLab Todo](../../../workflow/todos.html) list
+- Add todo: add that issue to your [GitLab Todo](../../../workflow/todos.md) list
- Mark todo as done: mark that issue as done (reflects on the Todo list)
#### 3. Assignee
@@ -43,14 +43,14 @@ assigned to them if they created the issue themselves.
##### 3.1. Multiple Assignees **[STARTER]**
-Often multiple people likely work on the same issue together,
-which can especially be difficult to track in large teams
+Often multiple people work on the same issue together,
+which can be especially difficult to track in large teams
where there is shared ownership of an issue.
-In [GitLab Starter](https://about.gitlab.com/pricing/), you can also
-select multiple assignees to an issue.
+In [GitLab Starter](https://about.gitlab.com/pricing/), you can
+assign multiple people to an issue.
-Learn more on the [Multiple Assignees documentation](https://docs.gitlab.com/ee/user/project/issues/multiple_assignees_for_issues.html).
+Learn more in the [Multiple Assignees documentation](https://docs.gitlab.com/ee/user/project/issues/multiple_assignees_for_issues.html).
#### 4. Milestone
@@ -58,40 +58,39 @@ Learn more on the [Multiple Assignees documentation](https://docs.gitlab.com/ee/
#### 5. Time Tracking
-- Estimate time: add an estimate time in which the issue will be implemented
-- Spend: add the time spent on the implementation of that issue
+- Estimate time: add an estimate of the time it will take to resolve the issue.
+- Spend: add the time spent on the resolution of the issue
> **Note:**
Both estimate and spend times are set via [GitLab Quick Actions](../quick_actions.md).
-Learn more on the [Time Tracking documentation](../../../workflow/time_tracking.md).
+Learn more in the [Time Tracking documentation](../../../workflow/time_tracking.md).
#### 6. Due date
-When you work on a tight schedule, and it's important to
-have a way to set up a deadline for implementations and for solving
-problems. This can be facilitated by the [due date](due_dates.md)). Due dates
+When you work on a tight schedule, it's important to
+have a way to set a deadline for implementations and for solving
+problems. This can be done in the [due date](due_dates.md) element. Due dates
can be changed as many times as needed.
#### 7. Labels
Categorize issues by giving them [labels](../labels.md). They help to
-organize team's workflows, once they enable you to work with the
-[GitLab Issue Board](index.md#gitlab-issue-board).
+organize workflows, and they enable you to work with the
+[GitLab Issue Board](index.md#issue-board).
-Group Labels, which allow you to use the same labels per
+Group Labels, which allow you to use the same labels for a
group of projects, can be also given to issues. They work exactly the same,
but they are immediately available to all projects in the group.
> **Tip:**
-if the label doesn't exist yet, when you click **Edit**, it opens a dropdown menu from which you can select **Create new label**.
+If a label doesn't exist yet, you can click **Edit**, and it opens a dropdown menu from which you can select **Create new label**.
#### 8. Weight **[STARTER]**
-- Attribute a weight (in a 0 to 9 range) to that issue. Easy to complete
-should weight 1 and very hard to complete should weight 9.
+- Assign a weight. Larger values are used to indicate more effort is required to complete the issue. Only positive values or zero are allowed.
-Learn more on the [Issue Weight documentation](https://docs.gitlab.com/ee/workflow/issue_weight.html).
+Learn more in the [Issue Weight documentation](https://docs.gitlab.com/ee/workflow/issue_weight.html).
#### 9. Participants
@@ -102,32 +101,33 @@ Learn more on the [Issue Weight documentation](https://docs.gitlab.com/ee/workfl
- Subscribe: if you are not a participant of the discussion on that issue, but
want to receive notifications on each new input, subscribe to it.
- Unsubscribe: if you are receiving notifications on that issue but no
-longer want to receive them, unsubscribe to it.
+longer want to receive them, unsubscribe from it.
-Read more on the [notifications documentation](../../../workflow/notifications.md#issue-merge-request-events).
+Read more in the [notifications documentation](../../../workflow/notifications.md#issue--merge-request-events).
#### 11. Reference
-- A quick "copy to clipboard" button to that issue's reference, `foo/bar#xxx`, where `foo` is the `username` or `groupname`, `bar`
+- A quick "copy to clipboard" button for that issue's reference, `foo/bar#xxx`, where `foo` is the `username` or `groupname`, `bar`
is the `project-name`, and `xxx` is the issue number.
#### 12. Title and description
-- Title: a plain text title describing the issue's subject.
-- Description: a text field which fully supports [GitLab Flavored Markdown](../../markdown.md#gitlab-flavored-markdown-gfm).
+- Title: a plain text title for describing the subject of the issue.
+- Description: a large text field which fully supports [GitLab Flavored Markdown](../../markdown.md#gitlab-flavored-markdown-gfm),
+ to describe all the details of the issue.
-#### 13. @mentions
+#### 13. Mentions
-- You can either `@mention` a user or a group present in your
- GitLab instance and they will be notified via todos and email, unless that
- person has disabled all notifications in their profile settings.
-- Mentions for yourself (the current logged in user),will be distinctly highlighted
+- You can mention a user or a group present in your GitLab instance with
+ `@username` or `@groupname` and they will be notified via todos and email, unless
+ they have disabled all notifications in their profile settings.
+- Mentions for yourself (the current logged in user), will be highlighted
in a different color, allowing you to easily see which comments involve you,
helping you focus on them quickly.
-To change your [notification settings](../../../workflow/notifications.md) navigate to
+To change your [notification settings](../../../workflow/notifications.md), navigate to
**Profile Settings** > **Notifications** > **Global notification level**
-and choose your preferences from the dropdown menu.
+and choose your preference from the dropdown menu.
> **Tip:**
Avoid mentioning `@all` in issues and merge requests,
@@ -138,14 +138,14 @@ interpreted as spam.
#### 14. Related Merge Requests
- Any merge requests mentioned in that issue's description
-or in the issue thread.
+or in the issue discussion thread.
#### 15. Award emoji
- Award an emoji to that issue.
> **Tip:**
-Posting "+1" as comments in threads spam all
+Posting "+1" as a comment in a thread spams all subscribed
participants of that issue. Awarding an emoji is a way to let them
know you like it without spamming them.
@@ -157,7 +157,7 @@ These text fields also fully support
#### 17. Comment, start a discussion, or comment and close
-Once you wrote your comment, you can either:
+Once you write a comment, you can either:
- Click "Comment" and your comment will be published.
- Click "Start discussion": start a thread within that issue's thread to discuss specific points.
@@ -167,6 +167,6 @@ Once you wrote your comment, you can either:
- Create a new merge request (with a new source branch named after the issue) in one action.
The merge request will automatically inherit the milestone and labels of the issue. The merge
-request will automatically close that issue as soon as merged.
+request will automatically close that issue when it is merged.
- Optionally, you can just create a [new branch](../repository/web_editor.md#create-a-new-branch-from-an-issue)
named after that issue.
diff --git a/doc/user/project/milestones/index.md b/doc/user/project/milestones/index.md
index ac58a0b5c18..e6033ca8655 100644
--- a/doc/user/project/milestones/index.md
+++ b/doc/user/project/milestones/index.md
@@ -28,8 +28,9 @@ the milestone to the issue.
## Project milestones and group milestones
-- **Project milestones** can be assigned to issues or merge requests in that project only.
-- **Group milestones** can be assigned to any issue or merge request of any project in that group.
+- **Project milestones** can be assigned to issues or merge requests in that project only. Navigate to **Issues > Milestones** in a project to view the project milestone list.
+- **Group milestones** can be assigned to any issue or merge request of any project in that group. Navigate to **Issues > Milestones** in a group to view the group milestone list.
+- All milestones you have access to can also be viewed in the dashboard milestones list. Click on **Milestones** on the top navigation bar to view both project milestones and group milestones you have access to.
## Creating milestones
diff --git a/doc/user/project/pipelines/job_artifacts.md b/doc/user/project/pipelines/job_artifacts.md
index 0d0575b1ab4..4ab66063dcf 100644
--- a/doc/user/project/pipelines/job_artifacts.md
+++ b/doc/user/project/pipelines/job_artifacts.md
@@ -191,5 +191,9 @@ artifacts and the job's trace.
1. Click the trash icon at the top right of the job's trace.
1. Confirm the deletion.
+## Retrieve artifacts of private projects when using GitLab CI
+
+In order to retrieve a job artifact of a different project, you might need to use a private token in order to [authenticate and download](../../../api/jobs.md#get-job-artifacts) the artifacts.
+
[expiry date]: ../../../ci/yaml/README.md#artifacts-expire_in
-[ce-14399]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/14399
+[ce-14399]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/14399 \ No newline at end of file
diff --git a/doc/user/project/pipelines/settings.md b/doc/user/project/pipelines/settings.md
index bb9b4238ee9..cce330aecc7 100644
--- a/doc/user/project/pipelines/settings.md
+++ b/doc/user/project/pipelines/settings.md
@@ -23,6 +23,7 @@ in `.gitlab-ci.yml`.
## Timeout
Timeout defines the maximum amount of time in minutes that a job is able run.
+This is configureable under your project's **Settings > CI/CD > General pipelines settings**.
The default value is 60 minutes. Decrease the time limit if you want to impose
a hard limit on your jobs' running time or increase it otherwise. In any case,
if the job surpasses the threshold, it is marked as failed.
diff --git a/doc/user/project/repository/web_editor.md b/doc/user/project/repository/web_editor.md
index 035028c9266..57e8437697b 100644
--- a/doc/user/project/repository/web_editor.md
+++ b/doc/user/project/repository/web_editor.md
@@ -33,13 +33,13 @@ easy for you.
![First file for your project](img/web_editor_template_dropdown_first_file.png)
-When clicking on either `LICENSE` or `.gitignore`, a dropdown will be displayed
+When clicking on either `LICENSE` or `.gitignore`, etc., a dropdown will be displayed
to provide you with a template which might be suitable for your project.
![MIT license selected](img/web_editor_template_dropdown_mit_license.png)
The license, changelog, contribution guide, or `.gitlab-ci.yml` file could also
-be added through a button on the project page. In the example below the license
+be added through a button on the project page. In the example below, the license
has already been created, which creates a link to the license itself.
![New file button](img/web_editor_template_dropdown_buttons.png)
diff --git a/doc/user/project/web_ide/index.md b/doc/user/project/web_ide/index.md
index 55e53b865af..9c095da5a4b 100644
--- a/doc/user/project/web_ide/index.md
+++ b/doc/user/project/web_ide/index.md
@@ -3,8 +3,8 @@
> [Introduced](https://gitlab.com/gitlab-org/gitlab-ee/issues/4539) in [GitLab Ultimate][ee] 10.4.
> [Brought to GitLab Core](https://gitlab.com/gitlab-org/gitlab-ce/issues/44157) in 10.7.
-The Web IDE makes it faster and easier to contribute changes to your projects
-by providing an advanced editor with commit staging.
+The Web IDE editor makes it faster and easier to contribute changes to your
+projects by providing an advanced editor with commit staging.
## Open the Web IDE
@@ -22,7 +22,7 @@ searching. The file finder is launched using the keyboard shortcut `Command-p`,
`Control-p`, or `t` (when editor is not in focus). Type the filename or
file path fragments to start seeing results.
-## Syntax highligting
+## Syntax highlighting
As expected from an IDE, syntax highlighting for many languages within
the Web IDE will make your direct editing even easier.
@@ -47,7 +47,7 @@ Single file editing is based on the [Ace Editor](https://ace.c9.io).
After making your changes, click the Commit button in the bottom left to
review the list of changed files. Click on each file to review the changes and
-click the tick icon to stage the file.
+click the tick icon to stage the file.
Once you have staged some changes, you can add a commit message and commit the
staged changes. Unstaged changes will not be commited.
@@ -80,7 +80,7 @@ left.
> [Introduced](https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/19318) in [GitLab Core][ce] 11.0.
Switching between your authored and assigned merge requests can be done without
-leaving the Web IDE. Click the dropdown in the top of the sidebar to open a list
+leaving the Web IDE. Click the dropdown in the top of the sidebar to open a list
of merge requests. You will need to commit or discard all your changes before
switching to a different merge request.
@@ -89,7 +89,7 @@ switching to a different merge request.
> [Introduced](https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20850) in [GitLab Core][ce] 11.2.
Switching between branches of the current project repository can be done without
-leaving the Web IDE. Click the dropdown in the top of the sidebar to open a list
+leaving the Web IDE. Click the dropdown in the top of the sidebar to open a list
of branches. You will need to commit or discard all your changes before
switching to a different branch.
diff --git a/doc/user/reserved_names.md b/doc/user/reserved_names.md
index 45c306f5988..a14df6c8402 100644
--- a/doc/user/reserved_names.md
+++ b/doc/user/reserved_names.md
@@ -61,8 +61,6 @@ Currently the following names are reserved as top level groups:
- favicon.ico
- favicon.png
- groups
-- header_logo_dark.png
-- header_logo_light.png
- health_check
- help
- import
diff --git a/doc/workflow/time_tracking.md b/doc/workflow/time_tracking.md
index 2bb140b99d0..ad43189148c 100644
--- a/doc/workflow/time_tracking.md
+++ b/doc/workflow/time_tracking.md
@@ -38,13 +38,14 @@ Adding time entries (time spent or estimates) is limited to project members.
To enter an estimate, write `/estimate`, followed by the time. For example, if
you need to enter an estimate of 3 days, 5 hours and 10 minutes, you would write
-`/estimate 3d 5h 10m`.
+`/estimate 3d 5h 10m`. Time units that we support are listed at the bottom of
+this help page.
Every time you enter a new time estimate, any previous time estimates will be
overridden by this new value. There should only be one valid estimate in an
issue or a merge request.
-To remove an estimation entirely, use `/remove_estimation`.
+To remove an estimation entirely, use `/remove_estimate`.
### Time spent
@@ -72,5 +73,8 @@ The following time units are available:
Default conversion rates are 1mo = 4w, 1w = 5d and 1d = 8h.
-[landing]: https://about.gitlab.com/features/time-tracking
+Other interesting links:
+
+- [Time Tracking landing page on about.gitlab.com](https://about.gitlab.com/features/time-tracking)
+
[quick actions]: ../user/project/quick_actions.md
diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb
index 54bbd531398..593a3676519 100644
--- a/lib/gitlab/git/repository.rb
+++ b/lib/gitlab/git/repository.rb
@@ -491,6 +491,13 @@ module Gitlab
end
end
+ # Return total diverging commits count
+ def diverging_commit_count(from, to, max_count:)
+ wrapped_gitaly_errors do
+ gitaly_commit_client.diverging_commit_count(from, to, max_count: max_count)
+ end
+ end
+
# Mimic the `git clean` command and recursively delete untracked files.
# Valid keys that can be passed in the +options+ hash are:
#
diff --git a/lib/gitlab/gitaly_client/commit_service.rb b/lib/gitlab/gitaly_client/commit_service.rb
index 4e46cb9f05c..ea12424eb4a 100644
--- a/lib/gitlab/gitaly_client/commit_service.rb
+++ b/lib/gitlab/gitaly_client/commit_service.rb
@@ -150,6 +150,17 @@ module Gitlab
GitalyClient.call(@repository.storage, :commit_service, :count_commits, request, timeout: GitalyClient.medium_timeout).count
end
+ def diverging_commit_count(from, to, max_count:)
+ request = Gitaly::CountDivergingCommitsRequest.new(
+ repository: @gitaly_repo,
+ from: encode_binary(from),
+ to: encode_binary(to),
+ max_count: max_count
+ )
+ response = GitalyClient.call(@repository.storage, :commit_service, :count_diverging_commits, request, timeout: GitalyClient.medium_timeout)
+ [response.left_count, response.right_count]
+ end
+
def list_last_commits_for_tree(revision, path, offset: 0, limit: 25)
request = Gitaly::ListLastCommitsForTreeRequest.new(
repository: @gitaly_repo,
diff --git a/lib/gitlab/github_import/importer/pull_request_importer.rb b/lib/gitlab/github_import/importer/pull_request_importer.rb
index ae7c4cf1b38..e294173f992 100644
--- a/lib/gitlab/github_import/importer/pull_request_importer.rb
+++ b/lib/gitlab/github_import/importer/pull_request_importer.rb
@@ -67,6 +67,36 @@ module Gitlab
def insert_git_data(merge_request, already_exists)
insert_or_replace_git_data(merge_request, pull_request.source_branch_sha, pull_request.target_branch_sha, already_exists)
+ # We need to create the branch after the merge request is
+ # populated to ensure the merge request is in the right state
+ # when the branch is created.
+ create_source_branch_if_not_exists(merge_request)
+ end
+
+ # An imported merge request will not be mergeable unless the
+ # source branch exists. For pull requests from forks, the source
+ # branch will be in the form of
+ # "github/fork/{project-name}/{source_branch}". This branch will never
+ # exist, so we create it here.
+ #
+ # Note that we only create the branch if the merge request is still open.
+ # For projects that have many pull requests, we assume that if it's closed
+ # the branch has already been deleted.
+ def create_source_branch_if_not_exists(merge_request)
+ return unless merge_request.open?
+
+ source_branch = pull_request.formatted_source_branch
+
+ return if project.repository.branch_exists?(source_branch)
+
+ project.repository.add_branch(merge_request.author, source_branch, pull_request.source_branch_sha)
+ rescue Gitlab::Git::CommandError => e
+ Gitlab::Sentry.track_acceptable_exception(e,
+ extra: {
+ source_branch: source_branch,
+ project_id: merge_request.project.id,
+ merge_request_id: merge_request.id
+ })
end
end
end
diff --git a/lib/gitlab/github_import/representation/pull_request.rb b/lib/gitlab/github_import/representation/pull_request.rb
index 593b491a837..0ccc4bfaed3 100644
--- a/lib/gitlab/github_import/representation/pull_request.rb
+++ b/lib/gitlab/github_import/representation/pull_request.rb
@@ -76,10 +76,10 @@ module Gitlab
# Returns a formatted source branch.
#
# For cross-project pull requests the branch name will be in the format
- # `owner-name:branch-name`.
+ # `github/fork/owner-name/branch-name`.
def formatted_source_branch
if cross_project? && source_repository_owner
- "#{source_repository_owner}:#{source_branch}"
+ "github/fork/#{source_repository_owner}/#{source_branch}"
elsif source_branch == target_branch
# Sometimes the source and target branch are the same, but GitLab
# doesn't support this. This can happen when both the user and
diff --git a/lib/gitlab/middleware/rails_queue_duration.rb b/lib/gitlab/middleware/rails_queue_duration.rb
index 96c6a0a7d28..a147e165262 100644
--- a/lib/gitlab/middleware/rails_queue_duration.rb
+++ b/lib/gitlab/middleware/rails_queue_duration.rb
@@ -7,6 +7,8 @@
module Gitlab
module Middleware
class RailsQueueDuration
+ GITLAB_RAILS_QUEUE_DURATION_KEY = 'GITLAB_RAILS_QUEUE_DURATION'
+
def initialize(app)
@app = app
end
@@ -19,6 +21,7 @@ module Gitlab
duration = Time.now.to_f * 1_000 - proxy_start.to_f / 1_000_000
trans.set(:rails_queue_duration, duration)
metric_rails_queue_duration_seconds.observe(trans.labels, duration / 1_000)
+ env[GITLAB_RAILS_QUEUE_DURATION_KEY] = duration.round(2)
end
@app.call(env)
diff --git a/lib/gitlab/sql/recursive_cte.rb b/lib/gitlab/sql/recursive_cte.rb
index ec1f00a3a91..e45ac5d4765 100644
--- a/lib/gitlab/sql/recursive_cte.rb
+++ b/lib/gitlab/sql/recursive_cte.rb
@@ -48,7 +48,7 @@ module Gitlab
#
# alias_table - The Arel table to use as the alias.
def alias_to(alias_table)
- Arel::Nodes::As.new(table, alias_table)
+ Arel::Nodes::As.new(table, Arel::Table.new(alias_table.name.tr('.', '_')))
end
# Applies the CTE to the given relation, returning a new one that will
diff --git a/lib/gitlab/usage_data.rb b/lib/gitlab/usage_data.rb
index 6bfcf83f388..a65f4a8639c 100644
--- a/lib/gitlab/usage_data.rb
+++ b/lib/gitlab/usage_data.rb
@@ -90,8 +90,14 @@ module Gitlab
todos: count(Todo),
uploads: count(Upload),
web_hooks: count(WebHook)
- }.merge(services_usage).merge(approximate_counts)
- }
+ }
+ .merge(services_usage)
+ .merge(approximate_counts)
+ }.tap do |data|
+ if Feature.enabled?(:group_overview_security_dashboard)
+ data[:counts][:user_preferences] = user_preferences_usage
+ end
+ end
end
# rubocop: enable CodeReuse/ActiveRecord
@@ -159,6 +165,10 @@ module Gitlab
}
end
+ def user_preferences_usage
+ {} # augmented in EE
+ end
+
def count(relation, fallback: -1)
relation.count
rescue ActiveRecord::StatementInvalid
diff --git a/lib/gitlab/wiki_file_finder.rb b/lib/gitlab/wiki_file_finder.rb
index 5303b3582ab..e9be6db50da 100644
--- a/lib/gitlab/wiki_file_finder.rb
+++ b/lib/gitlab/wiki_file_finder.rb
@@ -2,8 +2,6 @@
module Gitlab
class WikiFileFinder < FileFinder
- BATCH_SIZE = 100
-
attr_reader :repository
def initialize(project, ref)
@@ -19,7 +17,7 @@ module Gitlab
safe_query = Regexp.new(safe_query, Regexp::IGNORECASE)
filenames = repository.ls_files(ref)
- filenames.grep(safe_query).first(BATCH_SIZE)
+ filenames.grep(safe_query)
end
end
end
diff --git a/lib/tasks/gitlab/setup.rake b/lib/tasks/gitlab/setup.rake
index f71e69987cb..e876b23d43f 100644
--- a/lib/tasks/gitlab/setup.rake
+++ b/lib/tasks/gitlab/setup.rake
@@ -25,6 +25,11 @@ namespace :gitlab do
puts ""
end
+ # In production, we might want to prevent ourselves from shooting
+ # ourselves in the foot, so let's only do this in a test or
+ # development environment.
+ terminate_all_connections unless Rails.env.production?
+
Rake::Task["db:reset"].invoke
Rake::Task["add_limits_mysql"].invoke
Rake::Task["setup_postgresql"].invoke
@@ -33,4 +38,24 @@ namespace :gitlab do
puts "Quitting...".color(:red)
exit 1
end
+
+ # If there are any clients connected to the DB, PostgreSQL won't let
+ # you drop the database. It's possible that Sidekiq, Unicorn, or
+ # some other client will be hanging onto a connection, preventing
+ # the DROP DATABASE from working. To workaround this problem, this
+ # method terminates all the connections so that a subsequent DROP
+ # will work.
+ def self.terminate_all_connections
+ return false unless Gitlab::Database.postgresql?
+
+ cmd = <<~SQL
+ SELECT pg_terminate_backend(pg_stat_activity.pid)
+ FROM pg_stat_activity
+ WHERE datname = current_database()
+ AND pid <> pg_backend_pid();
+ SQL
+
+ ActiveRecord::Base.connection.execute(cmd)&.result_status == PG::PGRES_TUPLES_OK
+ rescue ActiveRecord::NoDatabaseError
+ end
end
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index 8d7ed7a5b88..7cbba0779f7 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -4722,6 +4722,9 @@ msgstr ""
msgid "More information is available|here"
msgstr ""
+msgid "More than %{number_commits_distance} commits different with %{default_branch}"
+msgstr ""
+
msgid "Most stars"
msgstr ""
diff --git a/package.json b/package.json
index c88ade87af6..3cd023c0b0c 100644
--- a/package.json
+++ b/package.json
@@ -28,7 +28,7 @@
"@babel/plugin-syntax-import-meta": "^7.2.0",
"@babel/preset-env": "^7.3.1",
"@gitlab/csslab": "^1.8.0",
- "@gitlab/svgs": "^1.51.0",
+ "@gitlab/svgs": "^1.52.0",
"@gitlab/ui": "^2.0.2",
"apollo-boost": "^0.1.20",
"apollo-client": "^2.4.5",
diff --git a/qa/qa/page/base.rb b/qa/qa/page/base.rb
index 69a8e691ceb..01ac161d26d 100644
--- a/qa/qa/page/base.rb
+++ b/qa/qa/page/base.rb
@@ -24,7 +24,7 @@ module QA
end
end
- def with_retry(max_attempts: 3, reload: false)
+ def retry_until(max_attempts: 3, reload: false)
attempts = 0
while attempts < max_attempts
@@ -39,6 +39,21 @@ module QA
false
end
+ def retry_on_exception(max_attempts: 3, reload: false, sleep_interval: 0.0)
+ attempts = 0
+
+ begin
+ yield
+ rescue StandardError
+ sleep sleep_interval
+ refresh if reload
+ attempts += 1
+
+ retry if attempts < max_attempts
+ raise
+ end
+ end
+
def scroll_to(selector, text: nil)
page.execute_script <<~JS
var elements = Array.from(document.querySelectorAll('#{selector}'));
diff --git a/qa/qa/page/group/show.rb b/qa/qa/page/group/show.rb
index 6dd9ff997a4..9d6bd338027 100644
--- a/qa/qa/page/group/show.rb
+++ b/qa/qa/page/group/show.rb
@@ -45,15 +45,17 @@ module QA
private
def select_kind(kind)
- within_element(:new_project_or_subgroup_dropdown) do
- # May need to click again because it is possible to click the button quicker than the JS is bound
- wait(reload: false) do
- click_element :new_project_or_subgroup_dropdown_toggle
+ retry_on_exception(sleep_interval: 1.0) do
+ within_element(:new_project_or_subgroup_dropdown) do
+ # May need to click again because it is possible to click the button quicker than the JS is bound
+ wait(reload: false) do
+ click_element :new_project_or_subgroup_dropdown_toggle
- has_element?(kind)
- end
+ has_element?(kind)
+ end
- click_element kind
+ click_element kind
+ end
end
end
end
diff --git a/qa/qa/page/main/menu.rb b/qa/qa/page/main/menu.rb
index 616d50f47fc..55500e831c6 100644
--- a/qa/qa/page/main/menu.rb
+++ b/qa/qa/page/main/menu.rb
@@ -57,7 +57,7 @@ module QA
end
def go_to_profile_settings
- with_retry(reload: false) do
+ retry_until(reload: false) do
within_user_menu do
click_link 'Settings'
end
diff --git a/qa/qa/page/main/sign_up.rb b/qa/qa/page/main/sign_up.rb
index 9ca498012eb..46a105003d0 100644
--- a/qa/qa/page/main/sign_up.rb
+++ b/qa/qa/page/main/sign_up.rb
@@ -23,7 +23,7 @@ module QA
check_element :new_user_accept_terms if has_element?(:new_user_accept_terms)
- signed_in = with_retry do
+ signed_in = retry_until do
click_element :new_user_register_button
Page::Main::Menu.act { has_personal_area? }
diff --git a/qa/qa/page/project/web_ide/edit.rb b/qa/qa/page/project/web_ide/edit.rb
index a3e126b51da..2b6c01888d5 100644
--- a/qa/qa/page/project/web_ide/edit.rb
+++ b/qa/qa/page/project/web_ide/edit.rb
@@ -80,7 +80,7 @@ module QA
# Retry the attempt to click :commit_button just in case part of the
# animation is still in process even when the buttons have the
# expected visibility.
- commit_success_msg_shown = with_retry do
+ commit_success_msg_shown = retry_until do
click_element :commit_button
wait(reload: false) do
diff --git a/scripts/security-harness b/scripts/security-harness
index c60b3410095..8369cf06223 100755
--- a/scripts/security-harness
+++ b/scripts/security-harness
@@ -37,7 +37,7 @@ else
end
__END__
-#!/bin/sh
+#!/bin/bash
set -e
diff --git a/spec/controllers/projects/pages_domains_controller_spec.rb b/spec/controllers/projects/pages_domains_controller_spec.rb
index 8b7f7587701..ffb9867a203 100644
--- a/spec/controllers/projects/pages_domains_controller_spec.rb
+++ b/spec/controllers/projects/pages_domains_controller_spec.rb
@@ -23,12 +23,27 @@ describe Projects::PagesDomainsController do
end
describe 'GET show' do
- it "displays the 'show' page" do
+ def make_request
get(:show, params: request_params.merge(id: pages_domain.domain))
+ end
+ it "displays the 'show' page" do
+ make_request
expect(response).to have_gitlab_http_status(200)
expect(response).to render_template('show')
end
+
+ context 'when user is developer' do
+ before do
+ project.add_developer(user)
+ end
+
+ it 'renders 404 page' do
+ make_request
+
+ expect(response).to have_gitlab_http_status(404)
+ end
+ end
end
describe 'GET new' do
diff --git a/spec/features/dashboard/todos/todos_spec.rb b/spec/features/dashboard/todos/todos_spec.rb
index 51f158d3045..fd8677feab5 100644
--- a/spec/features/dashboard/todos/todos_spec.rb
+++ b/spec/features/dashboard/todos/todos_spec.rb
@@ -126,7 +126,7 @@ describe 'Dashboard Todos' do
it 'shows you added a todo message' do
page.within('.js-todos-all') do
- expect(page).to have_content("You added a todo for issue #{issue.to_reference(full: true)}")
+ expect(page).to have_content("You added a todo for issue #{issue.to_reference(full: true)}")
expect(page).not_to have_content('to yourself')
end
end
@@ -140,7 +140,7 @@ describe 'Dashboard Todos' do
it 'shows you mentioned yourself message' do
page.within('.js-todos-all') do
- expect(page).to have_content("You mentioned yourself on issue #{issue.to_reference(full: true)}")
+ expect(page).to have_content("You mentioned yourself on issue #{issue.to_reference(full: true)}")
expect(page).not_to have_content('to yourself')
end
end
@@ -154,7 +154,7 @@ describe 'Dashboard Todos' do
it 'shows you directly addressed yourself message' do
page.within('.js-todos-all') do
- expect(page).to have_content("You directly addressed yourself on issue #{issue.to_reference(full: true)}")
+ expect(page).to have_content("You directly addressed yourself on issue #{issue.to_reference(full: true)}")
expect(page).not_to have_content('to yourself')
end
end
@@ -170,7 +170,7 @@ describe 'Dashboard Todos' do
it 'shows you set yourself as an approver message' do
page.within('.js-todos-all') do
- expect(page).to have_content("You set yourself as an approver for merge request #{merge_request.to_reference(full: true)}")
+ expect(page).to have_content("You set yourself as an approver for merge request #{merge_request.to_reference(full: true)}")
expect(page).not_to have_content('to yourself')
end
end
diff --git a/spec/features/projects/branches/user_views_branches_spec.rb b/spec/features/projects/branches/user_views_branches_spec.rb
index 62ae793151c..777d30fdffd 100644
--- a/spec/features/projects/branches/user_views_branches_spec.rb
+++ b/spec/features/projects/branches/user_views_branches_spec.rb
@@ -15,6 +15,8 @@ describe "User views branches" do
it "shows branches" do
expect(page).to have_content("Branches").and have_content("master")
+
+ expect(page.all(".graph-side")).to all( have_content(/\d+/) )
end
end
diff --git a/spec/javascripts/notes/components/note_actions_spec.js b/spec/javascripts/notes/components/note_actions_spec.js
index 0c1962912b4..d604e90b529 100644
--- a/spec/javascripts/notes/components/note_actions_spec.js
+++ b/spec/javascripts/notes/components/note_actions_spec.js
@@ -1,5 +1,5 @@
import Vue from 'vue';
-import { shallowMount, createLocalVue } from '@vue/test-utils';
+import { shallowMount, createLocalVue, createWrapper } from '@vue/test-utils';
import createStore from '~/notes/stores';
import noteActions from '~/notes/components/note_actions.vue';
import { TEST_HOST } from 'spec/test_constants';
@@ -10,7 +10,7 @@ describe('noteActions', () => {
let store;
let props;
- const createWrapper = propsData => {
+ const shallowMountNoteActions = propsData => {
const localVue = createLocalVue();
return shallowMount(noteActions, {
store,
@@ -44,7 +44,7 @@ describe('noteActions', () => {
beforeEach(() => {
store.dispatch('setUserData', userDataMock);
- wrapper = createWrapper(props);
+ wrapper = shallowMountNoteActions(props);
});
it('should render access level badge', () => {
@@ -90,13 +90,27 @@ describe('noteActions', () => {
it('should be possible to delete comment', () => {
expect(wrapper.find('.js-note-delete').exists()).toBe(true);
});
+
+ it('closes tooltip when dropdown opens', done => {
+ wrapper.find('.more-actions-toggle').trigger('click');
+
+ const rootWrapper = createWrapper(wrapper.vm.$root);
+ Vue.nextTick()
+ .then(() => {
+ const emitted = Object.keys(rootWrapper.emitted());
+
+ expect(emitted).toEqual(['bv::hide::tooltip']);
+ done();
+ })
+ .catch(done.fail);
+ });
});
});
describe('user is not logged in', () => {
beforeEach(() => {
store.dispatch('setUserData', {});
- wrapper = createWrapper({
+ wrapper = shallowMountNoteActions({
...props,
canDelete: false,
canEdit: false,
@@ -127,7 +141,7 @@ describe('noteActions', () => {
describe('for showReply = true', () => {
beforeEach(() => {
- wrapper = createWrapper({
+ wrapper = shallowMountNoteActions({
...props,
showReply: true,
});
@@ -142,7 +156,7 @@ describe('noteActions', () => {
describe('for showReply = false', () => {
beforeEach(() => {
- wrapper = createWrapper({
+ wrapper = shallowMountNoteActions({
...props,
showReply: false,
});
@@ -169,7 +183,7 @@ describe('noteActions', () => {
describe('for showReply = true', () => {
beforeEach(() => {
- wrapper = createWrapper({
+ wrapper = shallowMountNoteActions({
...props,
showReply: true,
});
@@ -184,7 +198,7 @@ describe('noteActions', () => {
describe('for showReply = false', () => {
beforeEach(() => {
- wrapper = createWrapper({
+ wrapper = shallowMountNoteActions({
...props,
showReply: false,
});
diff --git a/spec/lib/gitlab/git/repository_spec.rb b/spec/lib/gitlab/git/repository_spec.rb
index cf9e0cccc71..8a9e78ba3c3 100644
--- a/spec/lib/gitlab/git/repository_spec.rb
+++ b/spec/lib/gitlab/git/repository_spec.rb
@@ -283,6 +283,96 @@ describe Gitlab::Git::Repository, :seed_helper do
end
end
+ describe '#diverging_commit_count' do
+ it 'counts 0 for the same branch' do
+ expect(repository.diverging_commit_count('master', 'master', max_count: 1000)).to eq([0, 0])
+ end
+
+ context 'max count does not truncate results' do
+ where(:left, :right, :expected) do
+ 1 | 1 | [1, 1]
+ 4 | 4 | [4, 4]
+ 2 | 2 | [2, 2]
+ 2 | 4 | [2, 4]
+ 4 | 2 | [4, 2]
+ 10 | 10 | [10, 10]
+ end
+
+ with_them do
+ before do
+ repository.create_branch('left-branch', 'master')
+ repository.create_branch('right-branch', 'master')
+
+ left.times do
+ new_commit_edit_new_file_on_branch(repository_rugged, 'encoding/CHANGELOG', 'left-branch', 'some more content for a', 'some stuff')
+ end
+
+ right.times do
+ new_commit_edit_new_file_on_branch(repository_rugged, 'encoding/CHANGELOG', 'right-branch', 'some more content for b', 'some stuff')
+ end
+ end
+
+ after do
+ repository.delete_branch('left-branch')
+ repository.delete_branch('right-branch')
+ end
+
+ it 'returns the correct count bounding at max_count' do
+ branch_a_sha = repository_rugged.branches['left-branch'].target.oid
+ branch_b_sha = repository_rugged.branches['right-branch'].target.oid
+
+ count = repository.diverging_commit_count(branch_a_sha, branch_b_sha, max_count: 1000)
+
+ expect(count).to eq(expected)
+ end
+ end
+ end
+
+ context 'max count truncates results' do
+ where(:left, :right, :max_count) do
+ 1 | 1 | 1
+ 4 | 4 | 4
+ 2 | 2 | 3
+ 2 | 4 | 3
+ 4 | 2 | 5
+ 10 | 10 | 10
+ end
+
+ with_them do
+ before do
+ repository.create_branch('left-branch', 'master')
+ repository.create_branch('right-branch', 'master')
+
+ left.times do
+ new_commit_edit_new_file_on_branch(repository_rugged, 'encoding/CHANGELOG', 'left-branch', 'some more content for a', 'some stuff')
+ end
+
+ right.times do
+ new_commit_edit_new_file_on_branch(repository_rugged, 'encoding/CHANGELOG', 'right-branch', 'some more content for b', 'some stuff')
+ end
+ end
+
+ after do
+ repository.delete_branch('left-branch')
+ repository.delete_branch('right-branch')
+ end
+
+ it 'returns the correct count bounding at max_count' do
+ branch_a_sha = repository_rugged.branches['left-branch'].target.oid
+ branch_b_sha = repository_rugged.branches['right-branch'].target.oid
+
+ results = repository.diverging_commit_count(branch_a_sha, branch_b_sha, max_count: max_count)
+
+ expect(results[0] + results[1]).to eq(max_count)
+ end
+ end
+ end
+
+ it_behaves_like 'wrapping gRPC errors', Gitlab::GitalyClient::CommitService, :diverging_commit_count do
+ subject { repository.diverging_commit_count('master', 'master', max_count: 1000) }
+ end
+ end
+
describe '#has_local_branches?' do
context 'check for local branches' do
it { expect(repository.has_local_branches?).to eq(true) }
diff --git a/spec/lib/gitlab/github_import/importer/pull_request_importer_spec.rb b/spec/lib/gitlab/github_import/importer/pull_request_importer_spec.rb
index 0f21b8843b6..15e59718dce 100644
--- a/spec/lib/gitlab/github_import/importer/pull_request_importer_spec.rb
+++ b/spec/lib/gitlab/github_import/importer/pull_request_importer_spec.rb
@@ -89,7 +89,7 @@ describe Gitlab::GithubImport::Importer::PullRequestImporter, :clean_gitlab_redi
description: 'This is my pull request',
source_project_id: project.id,
target_project_id: project.id,
- source_branch: 'alice:feature',
+ source_branch: 'github/fork/alice/feature',
target_branch: 'master',
state: :merged,
milestone_id: milestone.id,
@@ -134,7 +134,7 @@ describe Gitlab::GithubImport::Importer::PullRequestImporter, :clean_gitlab_redi
description: "*Created by: alice*\n\nThis is my pull request",
source_project_id: project.id,
target_project_id: project.id,
- source_branch: 'alice:feature',
+ source_branch: 'github/fork/alice/feature',
target_branch: 'master',
state: :merged,
milestone_id: milestone.id,
@@ -259,6 +259,40 @@ describe Gitlab::GithubImport::Importer::PullRequestImporter, :clean_gitlab_redi
.and_return(user.id)
end
+ it 'does not create the source branch if merge request is merged' do
+ mr, exists = importer.create_merge_request
+
+ importer.insert_git_data(mr, exists)
+
+ expect(project.repository.branch_exists?(mr.source_branch)).to be_falsey
+ expect(project.repository.branch_exists?(mr.target_branch)).to be_truthy
+ end
+
+ it 'creates the source branch if merge request is open' do
+ mr, exists = importer.create_merge_request
+ mr.state = 'opened'
+ mr.save
+
+ importer.insert_git_data(mr, exists)
+
+ expect(project.repository.branch_exists?(mr.source_branch)).to be_truthy
+ expect(project.repository.branch_exists?(mr.target_branch)).to be_truthy
+ end
+
+ it 'ignores Git errors when creating a branch' do
+ mr, exists = importer.create_merge_request
+ mr.state = 'opened'
+ mr.save
+
+ expect(project.repository).to receive(:add_branch).and_raise(Gitlab::Git::CommandError)
+ expect(Gitlab::Sentry).to receive(:track_acceptable_exception).and_call_original
+
+ importer.insert_git_data(mr, exists)
+
+ expect(project.repository.branch_exists?(mr.source_branch)).to be_falsey
+ expect(project.repository.branch_exists?(mr.target_branch)).to be_truthy
+ end
+
it 'creates the merge request diffs' do
mr, exists = importer.create_merge_request
diff --git a/spec/lib/gitlab/github_import/representation/pull_request_spec.rb b/spec/lib/gitlab/github_import/representation/pull_request_spec.rb
index 33f6ff0ae6a..d478e5ae899 100644
--- a/spec/lib/gitlab/github_import/representation/pull_request_spec.rb
+++ b/spec/lib/gitlab/github_import/representation/pull_request_spec.rb
@@ -238,7 +238,7 @@ describe Gitlab::GithubImport::Representation::PullRequest do
target_repository_id: 2
)
- expect(pr.formatted_source_branch).to eq('foo:branch')
+ expect(pr.formatted_source_branch).to eq('github/fork/foo/branch')
end
end
diff --git a/spec/lib/gitlab/sql/recursive_cte_spec.rb b/spec/lib/gitlab/sql/recursive_cte_spec.rb
index 25146860615..7fe39dd5a96 100644
--- a/spec/lib/gitlab/sql/recursive_cte_spec.rb
+++ b/spec/lib/gitlab/sql/recursive_cte_spec.rb
@@ -31,6 +31,15 @@ describe Gitlab::SQL::RecursiveCTE, :postgresql do
expect(cte.alias_to(table).to_sql).to eq("#{source_name} AS #{alias_name}")
end
+
+ it 'replaces dots with an underscore' do
+ table = Arel::Table.new('gitlab.kittens')
+
+ source_name = ActiveRecord::Base.connection.quote_table_name(:cte_name)
+ alias_name = ActiveRecord::Base.connection.quote_table_name(:gitlab_kittens)
+
+ expect(cte.alias_to(table).to_sql).to eq("#{source_name} AS #{alias_name}")
+ end
end
describe '#apply_to' do
diff --git a/spec/lib/gitlab/usage_data_spec.rb b/spec/lib/gitlab/usage_data_spec.rb
index 4f5993ba226..d3eae80cc56 100644
--- a/spec/lib/gitlab/usage_data_spec.rb
+++ b/spec/lib/gitlab/usage_data_spec.rb
@@ -124,9 +124,15 @@ describe Gitlab::UsageData do
todos
uploads
web_hooks
+ user_preferences
))
end
+ it 'does not gather user preferences usage data when the feature is disabled' do
+ stub_feature_flags(group_overview_security_dashboard: false)
+ expect(subject[:counts].keys).not_to include(:user_preferences)
+ end
+
it 'gathers projects data correctly' do
count_data = subject[:counts]
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb
index 7b364395faf..1f9088c2e6b 100644
--- a/spec/models/project_spec.rb
+++ b/spec/models/project_spec.rb
@@ -4602,6 +4602,21 @@ describe Project do
end
end
+ describe '#has_pool_repsitory?' do
+ it 'returns false when it does not have a pool repository' do
+ subject = create(:project, :repository)
+
+ expect(subject.has_pool_repository?).to be false
+ end
+
+ it 'returns true when it has a pool repository' do
+ pool = create(:pool_repository, :ready)
+ subject = create(:project, :repository, pool_repository: pool)
+
+ expect(subject.has_pool_repository?).to be true
+ end
+ end
+
def rugged_config
rugged_repo(project.repository).config
end
diff --git a/spec/support/shared_examples/models/with_uploads_shared_examples.rb b/spec/support/shared_examples/models/with_uploads_shared_examples.rb
index 1d11b855459..43033a2d256 100644
--- a/spec/support/shared_examples/models/with_uploads_shared_examples.rb
+++ b/spec/support/shared_examples/models/with_uploads_shared_examples.rb
@@ -44,26 +44,6 @@ shared_examples_for 'model with uploads' do |supports_fileuploads|
model_object.destroy
end
end
-
- describe 'destroy strategy depending on feature flag' do
- let!(:upload) { create(:upload, uploader: FileUploader, model: model_object) }
-
- it 'does not destroy uploads by default' do
- expect(model_object).to receive(:delete_uploads)
- expect(model_object).not_to receive(:destroy_uploads)
-
- model_object.destroy
- end
-
- it 'uses before destroy callback if feature flag is disabled' do
- stub_feature_flags(fast_destroy_uploads: false)
-
- expect(model_object).to receive(:destroy_uploads)
- expect(model_object).not_to receive(:delete_uploads)
-
- model_object.destroy
- end
- end
end
end
end
diff --git a/yarn.lock b/yarn.lock
index 8bff9c59113..8ddcd305d48 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -653,10 +653,10 @@
eslint-plugin-promise "^4.0.1"
eslint-plugin-vue "^5.0.0"
-"@gitlab/svgs@^1.51.0":
- version "1.51.0"
- resolved "https://registry.yarnpkg.com/@gitlab/svgs/-/svgs-1.51.0.tgz#1b608f68dfb74284401b1cbdb823440f6e8b0091"
- integrity sha512-B1Wdhfy5ZClkHuaaCUUZyOBF8CFxxHqxGGhveRekOowtlMExa3tx+YkqNa5XPsEVMF6Aqnh8evQmmN4b+zrHVQ==
+"@gitlab/svgs@^1.52.0":
+ version "1.52.0"
+ resolved "https://registry.yarnpkg.com/@gitlab/svgs/-/svgs-1.52.0.tgz#870b0112a18b10d2cde5470a48b05025193cd207"
+ integrity sha512-xqDYIaSY1MJuCa7lRIDTTPoXn6x57So2qchxwmELE+SAJxlYlpYgDKCNWcGawhyTZRDZuG/qFBWp0sMeTQD//A==
"@gitlab/ui@^2.0.2":
version "2.0.2"