Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2019-12-20 09:24:38 +00:00
parent b5571e6e22
commit 898e2cc1df
148 changed files with 1919 additions and 1261 deletions

View File

@ -45,7 +45,6 @@ rules:
vue/no-use-v-if-with-v-for: off
vue/no-v-html: off
vue/use-v-on-exact: off
no-jquery/no-animate: off
# all offenses of no-jquery/no-animate-toggle are false positives ( $toast.show() )
no-jquery/no-animate-toggle: off
no-jquery/no-event-shorthand: off

View File

@ -43,6 +43,7 @@ include:
- local: .gitlab/ci/rails.gitlab-ci.yml
- local: .gitlab/ci/review.gitlab-ci.yml
- local: .gitlab/ci/setup.gitlab-ci.yml
- local: .gitlab/ci/dev-fixtures.gitlab-ci.yml
- local: .gitlab/ci/test-metadata.gitlab-ci.yml
- local: .gitlab/ci/yaml.gitlab-ci.yml
- local: .gitlab/ci/releases.gitlab-ci.yml

View File

@ -0,0 +1,30 @@
.run-dev-fixtures:
extends:
- .only-code-rails-job-base
- .use-pg9
stage: test
needs: ["setup-test-env"]
dependencies: ["setup-test-env"]
variables:
FIXTURE_PATH: "db/fixtures/development"
SEED_CYCLE_ANALYTICS: "true"
SEED_PRODUCTIVITY_ANALYTICS: "true"
CYCLE_ANALYTICS_ISSUE_COUNT: 1
SIZE: 0 # number of external projects to fork, requires network connection
# SEED_NESTED_GROUPS: "false" # requires network connection
run-dev-fixtures-foss:
extends: .run-dev-fixtures
script:
- scripts/gitaly-test-spawn
- RAILS_ENV=test bundle exec rake db:seed_fu
run-dev-fixtures-ee:
extends:
- .only-ee
- .use-pg9-ee
- .run-dev-fixtures
script:
- scripts/gitaly-test-spawn
- cp ee/db/fixtures/development/* $FIXTURE_PATH
- RAILS_ENV=test bundle exec rake db:seed_fu

View File

@ -299,3 +299,76 @@ Graphql/Descriptions:
RSpec/AnyInstanceOf:
Enabled: false
# Cops for upgrade to gitlab-styles 3.1.0
FactoryBot/FactoryClassName:
Enabled: false
FactoryBot/CreateList:
Enabled: false
Rails/SafeNavigationWithBlank:
Enabled: false
Rails/ApplicationController:
Enabled: false
Rails/ApplicationMailer:
Enabled: false
Rails/RakeEnvironment:
Enabled: false
Rails/HelperInstanceVariable:
Enabled: false
Rails/EnumHash:
Enabled: false
RSpec/ReceiveCounts:
Enabled: false
RSpec/ContextMethod:
Enabled: false
RSpec/ImplicitSubject:
Enabled: false
RSpec/LeakyConstantDeclaration:
Enabled: false
RSpec/EmptyLineAfterHook:
Enabled: false
RSpec/HooksBeforeExamples:
Enabled: false
RSpec/EmptyLineAfterExample:
Enabled: false
RSpec/Be:
Enabled: false
RSpec/DescribedClass:
Enabled: false
RSpec/SharedExamples:
Enabled: false
RSpec/EmptyLineAfterExampleGroup:
Enabled: false
RSpec/ReceiveNever:
Enabled: false
RSpec/MissingExampleGroupArgument:
Enabled: false
RSpec/UnspecifiedException:
Enabled: false
Style/MultilineWhenThen:
Enabled: false
Style/FloatDivision:
Enabled: false

View File

@ -366,11 +366,11 @@ group :development, :test do
gem 'spring', '~> 2.0.0'
gem 'spring-commands-rspec', '~> 1.0.4'
gem 'gitlab-styles', '~> 2.7', require: false
gem 'gitlab-styles', '~> 3.1.0', require: false
# Pin these dependencies, otherwise a new rule could break the CI pipelines
gem 'rubocop', '~> 0.69.0'
gem 'rubocop-performance', '~> 1.1.0'
gem 'rubocop-rspec', '~> 1.22.1'
gem 'rubocop', '~> 0.74.0'
gem 'rubocop-performance', '~> 1.4.1'
gem 'rubocop-rspec', '~> 1.37.0'
gem 'scss_lint', '~> 0.56.0', require: false
gem 'haml_lint', '~> 0.34.0', require: false

View File

@ -379,11 +379,12 @@ GEM
gitlab-puma (>= 2.7, < 5)
gitlab-sidekiq-fetcher (0.5.2)
sidekiq (~> 5)
gitlab-styles (2.8.0)
rubocop (~> 0.69.0)
gitlab-styles (3.1.0)
rubocop (~> 0.74.0)
rubocop-gitlab-security (~> 0.1.0)
rubocop-performance (~> 1.1.0)
rubocop-rspec (~> 1.19)
rubocop-performance (~> 1.4.1)
rubocop-rails (~> 2.0)
rubocop-rspec (~> 1.36)
gitlab_chronic_duration (0.10.6.2)
numerizer (~> 0.2)
gitlab_omniauth-ldap (2.1.1)
@ -519,7 +520,7 @@ GEM
jaeger-client (0.10.0)
opentracing (~> 0.3)
thrift
jaro_winkler (1.5.3)
jaro_winkler (1.5.4)
jira-ruby (1.7.1)
activesupport
atlassian-jwt
@ -726,8 +727,8 @@ GEM
rubypants (~> 0.2)
orm_adapter (0.5.0)
os (1.0.0)
parallel (1.17.0)
parser (2.6.3.0)
parallel (1.19.1)
parser (2.6.5.0)
ast (~> 2.4.0)
parslet (1.8.2)
peek (1.1.0)
@ -904,7 +905,7 @@ GEM
pg
rails
sqlite3
rubocop (0.69.0)
rubocop (0.74.0)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
parser (>= 2.6)
@ -913,10 +914,13 @@ GEM
unicode-display_width (>= 1.4.0, < 1.7)
rubocop-gitlab-security (0.1.1)
rubocop (>= 0.51)
rubocop-performance (1.1.0)
rubocop (>= 0.67.0)
rubocop-rspec (1.22.2)
rubocop (>= 0.52.1)
rubocop-performance (1.4.1)
rubocop (>= 0.71.0)
rubocop-rails (2.4.0)
rack (>= 1.1)
rubocop (>= 0.72.0)
rubocop-rspec (1.37.0)
rubocop (>= 0.68.1)
ruby-enum (0.7.2)
i18n
ruby-fogbugz (0.2.1)
@ -1207,7 +1211,7 @@ DEPENDENCIES
gitlab-puma (~> 4.3.1.gitlab.2)
gitlab-puma_worker_killer (~> 0.1.1.gitlab.1)
gitlab-sidekiq-fetcher (= 0.5.2)
gitlab-styles (~> 2.7)
gitlab-styles (~> 3.1.0)
gitlab_chronic_duration (~> 0.10.6.2)
gitlab_omniauth-ldap (~> 2.1.1)
gon (~> 6.2)
@ -1318,9 +1322,9 @@ DEPENDENCIES
rspec-set (~> 0.1.3)
rspec_junit_formatter
rspec_profiling (~> 0.0.5)
rubocop (~> 0.69.0)
rubocop-performance (~> 1.1.0)
rubocop-rspec (~> 1.22.1)
rubocop (~> 0.74.0)
rubocop-performance (~> 1.4.1)
rubocop-rspec (~> 1.37.0)
ruby-fogbugz (~> 0.2.1)
ruby-prof (~> 1.0.0)
ruby-progressbar

View File

@ -506,6 +506,8 @@ export class AwardsHandler {
const options = {
scrollTop: $('.awards').offset().top - 110,
};
// eslint-disable-next-line no-jquery/no-animate
return $('body, html').animate(options, 200);
}

View File

@ -290,6 +290,7 @@ export default {
disabled && 'cluster-application-disabled',
]"
class="cluster-application-row gl-responsive-table-row gl-responsive-table-row-col-span"
:data-qa-selector="id"
>
<div class="gl-responsive-table-row-layout" role="row">
<div class="table-section append-right-8 section-align-top" role="gridcell">
@ -381,12 +382,16 @@ export default {
:disabled="disabled || installButtonDisabled"
:label="installButtonLabel"
class="js-cluster-application-install-button"
data-qa-selector="install_button"
:data-qa-application="id"
@click="installClicked"
/>
<uninstall-application-button
v-if="displayUninstallButton"
v-gl-modal-directive="'uninstall-' + id"
:status="status"
data-qa-selector="uninstall_button"
:data-qa-application="id"
class="js-cluster-application-uninstall-button"
/>
<uninstall-application-confirmation-modal

View File

@ -135,7 +135,9 @@ export const handleLocationHash = () => {
adjustment -= topPadding;
}
window.scrollBy(0, adjustment);
setTimeout(() => {
window.scrollBy(0, adjustment);
});
};
// Check if element scrolled into viewport from above or below
@ -247,6 +249,7 @@ export const scrollToElement = element => {
}
const { top } = $el.offset();
// eslint-disable-next-line no-jquery/no-animate
return $('body, html').animate(
{
scrollTop: top - contentTop(),

View File

@ -10,6 +10,6 @@ export default {
</script>
<template>
<div class="prometheus-graph-header">
<h5 class="prometheus-graph-title js-graph-title">{{ graphTitle }}</h5>
<h5 ref="title" class="prometheus-graph-title">{{ graphTitle }}</h5>
</div>
</template>

View File

@ -36,6 +36,8 @@ export default function adminInit() {
$('.log-bottom').on('click', e => {
e.preventDefault();
const $visibleLog = $('.file-content:visible');
// eslint-disable-next-line no-jquery/no-animate
$visibleLog.animate(
{
scrollTop: $visibleLog.find('ol').height(),

View File

@ -207,6 +207,14 @@
border-left-color: mix($blame-gray, $blame-cyan, $i / 4 * 100%);
}
}
.doc-versions {
color: $gray-600;
&:hover {
color: $gray-900;
}
}
}
&.logs {

View File

@ -133,6 +133,7 @@
.issue-count-badge {
border: 0;
white-space: nowrap;
padding: 0;
}
.board-title-text > span,

View File

@ -1,10 +1,10 @@
# frozen_string_literal: true
class Admin::SystemInfoController < Admin::ApplicationController
EXCLUDED_MOUNT_OPTIONS = [
'nobrowse',
'read-only',
'ro'
EXCLUDED_MOUNT_OPTIONS = %w[
nobrowse
read-only
ro
].freeze
EXCLUDED_MOUNT_TYPES = [

View File

@ -31,7 +31,7 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController
# Extend the standard message generation to accept our custom exception
def failure_message
exception = request.env["omniauth.error"]
error = exception.error_reason if exception.respond_to?(:error_reason)
error = exception.error_reason if exception.respond_to?(:error_reason)
error ||= exception.error if exception.respond_to?(:error)
error ||= exception.message if exception.respond_to?(:message)
error ||= request.env["omniauth.error.type"].to_s

View File

@ -34,7 +34,7 @@ class Projects::PagesController < Projects::ApplicationController
if result[:status] == :success
flash[:notice] = 'Your changes have been saved'
else
flash[:alert] = 'Something went wrong on our end'
flash[:alert] = result[:message]
end
redirect_to project_pages_path(@project)
@ -45,6 +45,12 @@ class Projects::PagesController < Projects::ApplicationController
private
def project_params
params.require(:project).permit(:pages_https_only)
params.require(:project).permit(project_params_attributes)
end
def project_params_attributes
%i[pages_https_only]
end
end
Projects::PagesController.prepend_if_ee('EE::Projects::PagesController')

View File

@ -7,8 +7,8 @@ class Projects::StarrersController < Projects::ApplicationController
@starrers = UsersStarProjectsFinder.new(@project, params, current_user: @current_user).execute
@sort = params[:sort].presence || sort_value_name
@starrers = @starrers.preload_users.sort_by_attribute(@sort).page(params[:page])
@public_count = @project.starrers.with_public_profile.size
@total_count = @project.starrers.size
@public_count = @project.starrers.with_public_profile.size
@total_count = @project.starrers.size
@private_count = @total_count - @public_count
end

View File

@ -17,16 +17,16 @@ module Types
field :sha, GraphQL::STRING_TYPE, null: false,
description: "SHA of the pipeline's commit"
field :before_sha, GraphQL::STRING_TYPE, null: true,
description: "Base SHA of the source branch"
description: 'Base SHA of the source branch'
field :status, PipelineStatusEnum, null: false,
description: "Status of the pipeline (#{::Ci::Pipeline.all_state_names.compact.join(', ').upcase})"
field :detailed_status, Types::Ci::DetailedStatusType, null: false,
description: 'Detailed status of the pipeline',
resolve: -> (obj, _args, ctx) { obj.detailed_status(ctx[:current_user]) }
field :duration, GraphQL::INT_TYPE, null: true,
description: "Duration of the pipeline in seconds"
description: 'Duration of the pipeline in seconds'
field :coverage, GraphQL::FLOAT_TYPE, null: true,
description: "Coverage percentage"
description: 'Coverage percentage'
field :created_at, Types::TimeType, null: false,
description: "Timestamp of the pipeline's creation"
field :updated_at, Types::TimeType, null: false,

View File

@ -3,19 +3,25 @@
module ContainerExpirationPoliciesHelper
def cadence_options
ContainerExpirationPolicy.cadence_options.map do |key, val|
{ key: key.to_s, label: val }
{ key: key.to_s, label: val }.tap do |base|
base[:default] = true if key.to_s == '1d'
end
end
end
def keep_n_options
ContainerExpirationPolicy.keep_n_options.map do |key, val|
{ key: key, label: val }
{ key: key, label: val }.tap do |base|
base[:default] = true if key == 10
end
end
end
def older_than_options
ContainerExpirationPolicy.older_than_options.map do |key, val|
{ key: key.to_s, label: val }
{ key: key.to_s, label: val }.tap do |base|
base[:default] = true if key.to_s == '30d'
end
end
end
end

View File

@ -35,7 +35,7 @@ module DashboardHelper
tag.p(aria: { label: label }) do
concat(link_or_title)
concat(tag.span(class: ['light', 'float-right']) do
concat(tag.span(class: %w[light float-right]) do
boolean_to_icon(enabled)
end)

View File

@ -127,7 +127,7 @@ module SnippetsHelper
return unless attrs = snippet_badge_attributes(snippet)
css_class, text = attrs
tag.span(class: ['badge', 'badge-gray']) do
tag.span(class: %w[badge badge-gray]) do
concat(tag.i(class: ['fa', css_class]))
concat(' ')
concat(text)

View File

@ -121,6 +121,11 @@ class ApplicationSetting < ApplicationRecord
presence: true,
numericality: { only_integer: true, greater_than: 0 }
validates :max_pages_size,
presence: true,
numericality: { only_integer: true, greater_than: 0,
less_than: ::Gitlab::Pages::MAX_SIZE / 1.megabyte }
validates :default_artifacts_expire_in, presence: true, duration: true
validates :container_registry_token_expire_delay,

View File

@ -5,7 +5,7 @@ module Clusters
class Prometheus < ApplicationRecord
include PrometheusAdapter
VERSION = '6.7.3'
VERSION = '9.5.2'
self.table_name = 'clusters_applications_prometheus'

View File

@ -122,6 +122,9 @@ module ErrorTracking
{ error: e.message, error_type: SENTRY_API_ERROR_INVALID_SIZE }
rescue Sentry::Client::BadRequestError => e
{ error: e.message, error_type: SENTRY_API_ERROR_TYPE_BAD_REQUEST }
rescue StandardError => e
Gitlab::ErrorTracking.track_exception(e)
{ error: 'Unexpected Error' }
end
# http://HOST/api/0/projects/ORG/PROJECT

View File

@ -46,6 +46,8 @@ class Namespace < ApplicationRecord
length: { maximum: 255 },
namespace_path: true
validates :max_artifacts_size, numericality: { only_integer: true, greater_than: 0, allow_nil: true }
validate :nesting_level_allowed
validates_associated :runners

View File

@ -375,6 +375,7 @@ class Project < ApplicationRecord
inclusion: { in: ->(_object) { Gitlab.config.repositories.storages.keys } }
validates :variables, variable_duplicates: { scope: :environment_scope }
validates :bfg_object_map, file_size: { maximum: :max_attachment_size }
validates :max_artifacts_size, numericality: { only_integer: true, greater_than: 0, allow_nil: true }
# Scopes
scope :pending_delete, -> { where(pending_delete: true) }

View File

@ -10,11 +10,11 @@ module Clusters
# We do not want to show the group path for clusters belonging to the
# clusterable, only for the ancestor clusters.
def item_link(clusterable_presenter)
def item_link(clusterable_presenter, *html_options)
if cluster.group_type? && clusterable != clusterable_presenter.subject
contracted_group_name(cluster.group) + ' / ' + link_to_cluster
else
link_to_cluster
link_to_cluster(*html_options)
end
end
@ -84,8 +84,8 @@ module Clusters
sprite_icon('ellipsis_h', size: 12, css_class: 'vertical-align-middle')
end
def link_to_cluster
link_to_if(can_read_cluster?, cluster.name, show_path)
def link_to_cluster(html_options: {})
link_to_if(can_read_cluster?, cluster.name, show_path, html_options)
end
end
end

View File

@ -6,7 +6,6 @@ module Projects
FailedToExtractError = Class.new(StandardError)
BLOCK_SIZE = 32.kilobytes
MAX_SIZE = 1.terabyte
PUBLIC_DIR = 'public'
# this has to be invalid group name,
@ -130,12 +129,16 @@ module Projects
1 + max_size / BLOCK_SIZE
end
def max_size_from_settings
Gitlab::CurrentSettings.max_pages_size.megabytes
end
def max_size
max_pages_size = Gitlab::CurrentSettings.max_pages_size.megabytes
max_pages_size = max_size_from_settings
return MAX_SIZE if max_pages_size.zero?
return ::Gitlab::Pages::MAX_SIZE if max_pages_size.zero?
[max_pages_size, MAX_SIZE].min
max_pages_size
end
def tmp_path
@ -200,3 +203,5 @@ module Projects
end
end
end
Projects::UpdatePagesService.prepend_if_ee('EE::Projects::UpdatePagesService')

View File

@ -3,7 +3,7 @@
.table-section.section-60
.table-mobile-header{ role: "rowheader" }= s_("ClusterIntegration|Kubernetes cluster")
.table-mobile-content
= cluster.item_link(clusterable)
= cluster.item_link(clusterable, html_options: { data: { qa_selector: 'cluster', qa_cluster_name: cluster.name } })
- unless cluster.enabled?
%span.badge.badge-danger Connection disabled
.table-section.section-25

View File

@ -11,6 +11,6 @@
'role-arn' => @aws_role.role_arn,
'instance-types' => @instance_types,
'kubernetes-integration-help-path' => help_page_path('user/project/clusters/index'),
'account-and-external-ids-help-path' => help_page_path('user/project/clusters/add_remove_clusters.md', anchor: 'eks-cluster'),
'create-role-arn-help-path' => help_page_path('user/project/clusters/add_remove_clusters.md', anchor: 'eks-cluster'),
'account-and-external-ids-help-path' => help_page_path('user/project/clusters/add_remove_clusters.md', anchor: 'new-eks-cluster'),
'create-role-arn-help-path' => help_page_path('user/project/clusters/add_remove_clusters.md', anchor: 'new-eks-cluster'),
'external-link-icon' => icon('external-link') } }

View File

@ -20,8 +20,14 @@
.commit-row-title
%span.item-title.str-truncated-100
= link_to commit.title, project_commit_path(@project, commit.id), class: "cdark", title: commit.title
.float-right
= link_to commit.short_id, project_commit_path(@project, commit), class: "commit-sha"
%span
- previous_commit_id = commit.parent_id
- if previous_commit_id
= link_to project_blame_path(@project, tree_join(previous_commit_id, @path)),
title: _('View blame prior to this change'),
aria: { label: _('View blame prior to this change') },
data: { toggle: 'tooltip', placement: 'right', container: 'body' } do
= sprite_icon('doc-versions', size: 16, css_class: 'doc-versions align-text-bottom')
&nbsp;
.light
= commit_author_link(commit, avatar: false)

View File

@ -0,0 +1,5 @@
---
title: Fix pages size limit setting in database if it is above the hard limit
merge_request: 20154
author:
type: fixed

View File

@ -0,0 +1,5 @@
---
title: Fix bug when clicking on same note twice in Firefox
merge_request: 21699
author: Jan Beckmann
type: fixed

View File

@ -0,0 +1,5 @@
---
title: Add previous revision link to blame
merge_request: 17088
author: Hiroyuki Sato
type: added

View File

@ -0,0 +1,5 @@
---
title: fix CSS when board issue is collapsed
merge_request: 21940
author: allenlai18
type: fixed

View File

@ -0,0 +1,5 @@
---
title: Add index to optimize loading pipeline charts
merge_request: 22052
author:
type: performance

View File

@ -0,0 +1,5 @@
---
title: Update prometheus chart version to 9.5.2
merge_request: 21935
author:
type: changed

View File

@ -234,7 +234,7 @@ module Gitlab
credentials: true,
headers: :any,
methods: :any,
expose: ['Link', 'X-Total', 'X-Total-Pages', 'X-Per-Page', 'X-Page', 'X-Next-Page', 'X-Prev-Page']
expose: %w[Link X-Total X-Total-Pages X-Per-Page X-Page X-Next-Page X-Prev-Page]
end
# Cross-origin requests must not have the session cookie available
@ -244,7 +244,7 @@ module Gitlab
credentials: false,
headers: :any,
methods: :any,
expose: ['Link', 'X-Total', 'X-Total-Pages', 'X-Per-Page', 'X-Page', 'X-Next-Page', 'X-Prev-Page']
expose: %w[Link X-Total X-Total-Pages X-Per-Page X-Page X-Next-Page X-Prev-Page]
end
end

View File

@ -162,8 +162,8 @@ Settings.gitlab['default_projects_limit'] ||= 100000
Settings.gitlab['default_branch_protection'] ||= 2
Settings.gitlab['default_can_create_group'] = true if Settings.gitlab['default_can_create_group'].nil?
Settings.gitlab['default_theme'] = Gitlab::Themes::APPLICATION_DEFAULT if Settings.gitlab['default_theme'].nil?
Settings.gitlab['host'] ||= ENV['GITLAB_HOST'] || 'localhost'
Settings.gitlab['ssh_host'] ||= Settings.gitlab.host
Settings.gitlab['host'] ||= ENV['GITLAB_HOST'] || 'localhost'
Settings.gitlab['ssh_host'] ||= Settings.gitlab.host
Settings.gitlab['https'] = false if Settings.gitlab['https'].nil?
Settings.gitlab['port'] ||= ENV['GITLAB_PORT'] || (Settings.gitlab.https ? 443 : 80)
Settings.gitlab['relative_url_root'] ||= ENV['RAILS_RELATIVE_URL_ROOT'] || ''
@ -176,10 +176,10 @@ Settings.gitlab['email_display_name'] ||= ENV['GITLAB_EMAIL_DISPLAY_NAME'] || 'G
Settings.gitlab['email_reply_to'] ||= ENV['GITLAB_EMAIL_REPLY_TO'] || "noreply@#{Settings.gitlab.host}"
Settings.gitlab['email_subject_suffix'] ||= ENV['GITLAB_EMAIL_SUBJECT_SUFFIX'] || ""
Settings.gitlab['email_smime'] = SmimeSignatureSettings.parse(Settings.gitlab['email_smime'])
Settings.gitlab['base_url'] ||= Settings.__send__(:build_base_gitlab_url)
Settings.gitlab['url'] ||= Settings.__send__(:build_gitlab_url)
Settings.gitlab['user'] ||= 'git'
Settings.gitlab['user_home'] ||= begin
Settings.gitlab['base_url'] ||= Settings.__send__(:build_base_gitlab_url)
Settings.gitlab['url'] ||= Settings.__send__(:build_gitlab_url)
Settings.gitlab['user'] ||= 'git'
Settings.gitlab['user_home'] ||= begin
Etc.getpwnam(Settings.gitlab['user']).dir
rescue ArgumentError # no user configured
'/home/' + Settings.gitlab['user']
@ -257,13 +257,13 @@ Settings.artifacts['object_store'] = ObjectStoreSettings.parse(Settings.artifact
# Registry
#
Settings['registry'] ||= Settingslogic.new({})
Settings.registry['enabled'] ||= false
Settings.registry['host'] ||= "example.com"
Settings.registry['port'] ||= nil
Settings.registry['api_url'] ||= "http://localhost:5000/"
Settings.registry['key'] ||= nil
Settings.registry['issuer'] ||= nil
Settings.registry['host_port'] ||= [Settings.registry['host'], Settings.registry['port']].compact.join(':')
Settings.registry['enabled'] ||= false
Settings.registry['host'] ||= "example.com"
Settings.registry['port'] ||= nil
Settings.registry['api_url'] ||= "http://localhost:5000/"
Settings.registry['key'] ||= nil
Settings.registry['issuer'] ||= nil
Settings.registry['host_port'] ||= [Settings.registry['host'], Settings.registry['port']].compact.join(':')
Settings.registry['path'] = Settings.absolute(Settings.registry['path'] || File.join(Settings.shared['path'], 'registry'))
Settings.registry['notifications'] ||= []
@ -284,13 +284,13 @@ Settings.pages['enabled'] = false if Settings.pages['enabled'].nil?
Settings.pages['access_control'] = false if Settings.pages['access_control'].nil?
Settings.pages['path'] = Settings.absolute(Settings.pages['path'] || File.join(Settings.shared['path'], "pages"))
Settings.pages['https'] = false if Settings.pages['https'].nil?
Settings.pages['host'] ||= "example.com"
Settings.pages['port'] ||= Settings.pages.https ? 443 : 80
Settings.pages['protocol'] ||= Settings.pages.https ? "https" : "http"
Settings.pages['url'] ||= Settings.__send__(:build_pages_url)
Settings.pages['external_http'] ||= false unless Settings.pages['external_http'].present?
Settings.pages['external_https'] ||= false unless Settings.pages['external_https'].present?
Settings.pages['artifacts_server'] ||= Settings.pages['enabled'] if Settings.pages['artifacts_server'].nil?
Settings.pages['host'] ||= "example.com"
Settings.pages['port'] ||= Settings.pages.https ? 443 : 80
Settings.pages['protocol'] ||= Settings.pages.https ? "https" : "http"
Settings.pages['url'] ||= Settings.__send__(:build_pages_url)
Settings.pages['external_http'] ||= false unless Settings.pages['external_http'].present?
Settings.pages['external_https'] ||= false unless Settings.pages['external_https'].present?
Settings.pages['artifacts_server'] ||= Settings.pages['enabled'] if Settings.pages['artifacts_server'].nil?
Settings.pages['secret_file'] ||= Rails.root.join('.gitlab_pages_secret')
#
@ -590,7 +590,7 @@ end
# Backup
#
Settings['backup'] ||= Settingslogic.new({})
Settings.backup['keep_time'] ||= 0
Settings.backup['keep_time'] ||= 0
Settings.backup['pg_schema'] = nil
Settings.backup['path'] = Settings.absolute(Settings.backup['path'] || "tmp/backups/")
Settings.backup['archive_permissions'] ||= 0600

View File

@ -45,7 +45,6 @@ namespace :admin do
scope(path: 'groups/*id',
controller: :groups,
constraints: { id: Gitlab::PathRegex.full_namespace_route_regex, format: /(html|json|atom)/ }) do
scope(as: :group) do
put :members_update
get :edit, action: :edit
@ -90,7 +89,6 @@ namespace :admin do
path: '/',
constraints: { id: Gitlab::PathRegex.project_route_regex },
only: [:show, :destroy]) do
member do
put :transfer
post :repository_check

View File

@ -29,7 +29,6 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
constraints: { project_id: Gitlab::PathRegex.project_route_regex },
module: :projects,
as: :project) do
# Begin of the /-/ scope.
# Use this scope for all new project routes.
scope '-' do

View File

@ -47,7 +47,7 @@ Gitlab::Seeder.quiet do
project = Project.find_by_full_path('gitlab-org/gitlab-test')
next if project.empty_repo? # We don't have repository on CI
next if !project || project.empty_repo? # We don't have repository on CI
params = {
source_branch: 'feature',

View File

@ -5,7 +5,7 @@ class Gitlab::Seeder::CycleAnalytics
def initialize(project, perf: false)
@project = project
@user = User.admins.first
@issue_count = perf ? 1000 : 5
@issue_count = perf ? 1000 : ENV.fetch('CYCLE_ANALYTICS_ISSUE_COUNT', 5).to_i
end
def seed_metrics!

View File

@ -0,0 +1,20 @@
# frozen_string_literal: true
class FixMaxPagesSize < ActiveRecord::Migration[5.2]
DOWNTIME = false
MAX_SIZE = 1.terabyte / 1.megabyte
class ApplicationSetting < ActiveRecord::Base
self.table_name = 'application_settings'
self.inheritance_column = :_type_disabled
end
def up
table = ApplicationSetting.arel_table
ApplicationSetting.where(table[:max_pages_size].gt(MAX_SIZE)).update_all(max_pages_size: MAX_SIZE)
end
def down
# no-op
end
end

View File

@ -0,0 +1,18 @@
# frozen_string_literal: true
class AddIndexOnProjectIdToCiPipelines < ActiveRecord::Migration[5.2]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
INDEX_NAME = 'index_ci_pipelines_on_project_id_and_id_desc'
disable_ddl_transaction!
def up
add_concurrent_index :ci_pipelines, [:project_id, :id], name: INDEX_NAME, order: { id: :desc }
end
def down
remove_concurrent_index :ci_pipelines, [:project_id, :id], name: INDEX_NAME, order: { id: :desc }
end
end

View File

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2019_12_16_183532) do
ActiveRecord::Schema.define(version: 2019_12_18_225624) do
# These are extensions that must be enabled in order to support this database
enable_extension "pg_trgm"
@ -863,6 +863,7 @@ ActiveRecord::Schema.define(version: 2019_12_16_183532) do
t.index ["external_pull_request_id"], name: "index_ci_pipelines_on_external_pull_request_id", where: "(external_pull_request_id IS NOT NULL)"
t.index ["merge_request_id"], name: "index_ci_pipelines_on_merge_request_id", where: "(merge_request_id IS NOT NULL)"
t.index ["pipeline_schedule_id"], name: "index_ci_pipelines_on_pipeline_schedule_id"
t.index ["project_id", "id"], name: "index_ci_pipelines_on_project_id_and_id_desc", order: { id: :desc }
t.index ["project_id", "iid"], name: "index_ci_pipelines_on_project_id_and_iid", unique: true, where: "(iid IS NOT NULL)"
t.index ["project_id", "ref", "id"], name: "index_ci_pipelines_on_project_idandrefandiddesc", order: { id: :desc }
t.index ["project_id", "ref", "status", "id"], name: "index_ci_pipelines_on_project_id_and_ref_and_status_and_id"

View File

@ -47,10 +47,11 @@ But since 11.8 the indexer uses Gitaly for data access as well. NFS can still
be leveraged for redudancy on block level of the Git data. But only has to
be mounted on the Gitaly server.
Starting with GitLab 11.8, it is possible to use Elasticsearch in conjunction with
From GitLab v11.8 to v12.2, it is possible to use Elasticsearch in conjunction with
a Gitaly setup that isn't utilising NFS. In order to use Elasticsearch in this
scenario, the [new repository indexer](../../integration/elasticsearch.md#elasticsearch-repository-indexer-beta)
needs to be enabled in your GitLab configuration.
scenario, the [new repository indexer](../../integration/elasticsearch.md#elasticsearch-repository-indexer)
needs to be enabled in your GitLab configuration. [Since GitLab v12.3](https://gitlab.com/gitlab-org/gitlab/issues/6481),
the new indexer becomes the default and no configuration is required.
NOTE: **Note:** While Gitaly can be used as a replacement for NFS, it's not recommended
to use EFS as it may impact GitLab's performance. Review the [relevant documentation](../high_availability/nfs.md#avoid-using-awss-elastic-file-system-efs)

View File

@ -32,7 +32,7 @@ have been performed.
Read more on:
- [Introduction to GitLab Performance Monitoring](introduction.md)
- [Introduction to GitLab Performance Monitoring](index.md)
- [InfluxDB Configuration](influxdb_configuration.md)
- [InfluxDB Schema](influxdb_schema.md)
- [Grafana Install/Configuration](grafana_configuration.md)

View File

@ -1,5 +1,9 @@
# Grafana Configuration
CAUTION: **InfluxDB is deprecated in favor of Prometheus:**
InfluxDB support is scheduled to be removed in GitLab 13.0.
You are advised to use [Prometheus](../prometheus/index.md) instead.
[Grafana](https://grafana.com/) is a tool that allows you to visualize time
series metrics through graphs and dashboards. It supports several backend
data stores, including InfluxDB. GitLab writes performance data to InfluxDB
@ -152,7 +156,7 @@ For more information and further mitigation details, please refer to our [blog p
Read more on:
- [Introduction to GitLab Performance Monitoring](introduction.md)
- [Introduction to GitLab Performance Monitoring](index.md)
- [GitLab Configuration](gitlab_configuration.md)
- [InfluxDB Installation/Configuration](influxdb_configuration.md)
- [InfluxDB Schema](influxdb_schema.md)

View File

@ -1,7 +1,7 @@
# InfluxDB Configuration
CAUTION: **InfluxDB is being deprecated in favor of Prometheus:**
InfluxDB support is scheduled to be dropped in GitLab 13.0.
CAUTION: **InfluxDB is deprecated in favor of Prometheus:**
InfluxDB support is scheduled to be removed in GitLab 13.0.
You are advised to use [Prometheus](../prometheus/index.md) instead.
The default settings provided by [InfluxDB] are not sufficient for a high traffic
@ -182,7 +182,7 @@ That's it! Now your GitLab instance should send data to InfluxDB.
Read more on:
- [Introduction to GitLab Performance Monitoring](introduction.md)
- [Introduction to GitLab Performance Monitoring](index.md)
- [GitLab Configuration](gitlab_configuration.md)
- [InfluxDB Schema](influxdb_schema.md)
- [Grafana Install/Configuration](grafana_configuration.md)

View File

@ -95,7 +95,7 @@ Depending on the event type additional tags may be available as well.
Read more on:
- [Introduction to GitLab Performance Monitoring](introduction.md)
- [Introduction to GitLab Performance Monitoring](index.md)
- [GitLab Configuration](gitlab_configuration.md)
- [InfluxDB Configuration](influxdb_configuration.md)
- [Grafana Install/Configuration](grafana_configuration.md)

View File

@ -106,7 +106,7 @@ graph TD;
D2 --> |Yes| D4
D4 --> |No| D5
D4 --> |Yes| D6
D{Is the error concerning<br>the beta indexer?}
D{Is the error concerning<br>the Go indexer?}
D1[It would be best<br>to speak with an<br>Elasticsearch admin.]
D2{Is the ICU development<br>package installed?}
D3>This package is required.<br>Install the package<br>and retry.]
@ -245,12 +245,13 @@ much to "integrate" here.
If the issue is:
- Not concerning the beta indexer, it is almost always an
- With the Go indexer, check if the ICU development package is installed.
This is a required package so make sure you install it.
Go indexer was a beta indexer which can be optionally turned on/off, but in 12.3 it reached stable status and is now the default.
- Not concerning the Go indexer, it is almost always an
Elasticsearch-side issue. This means you should reach out to your Elasticsearch admin
regarding the error(s) you are seeing. If you are unsure here, it never hurts to reach
out to GitLab support.
- With the beta indexer, check if the ICU development package is installed.
This is a required package so make sure you install it.
Beyond that, you will want to review the error. If it is:

View File

@ -503,6 +503,9 @@ type CreateSnippetPayload {
}
type Design implements Noteable {
"""
Diff refs of the design
"""
diffRefs: DiffRefs!
"""
@ -531,13 +534,34 @@ type Design implements Noteable {
): DiscussionConnection!
"""
The change that happened to the design at this version
Type of change made to the design at the version specified by the `atVersion`
argument if supplied. Defaults to the latest version
"""
event: DesignVersionEvent!
"""
Filename of the design file
"""
filename: String!
"""
Full path of the design file
"""
fullPath: String!
"""
ID of the design
"""
id: ID!
"""
Image of the design
"""
image: String!
"""
Issue associated with the design
"""
issue: Issue!
"""
@ -566,13 +590,17 @@ type Design implements Noteable {
): NoteConnection!
"""
The total count of user-created notes for this design
Total count of user-created notes for the design
"""
notesCount: Int!
"""
Project associated with the design
"""
project: Project!
"""
All versions related to this design ordered newest first
All versions related to the design, ordered newest first
"""
versions(
"""
@ -599,7 +627,7 @@ type Design implements Noteable {
type DesignCollection {
"""
All designs for this collection
All designs for the design collection
"""
designs(
"""
@ -638,11 +666,19 @@ type DesignCollection {
"""
last: Int
): DesignConnection!
"""
Issue associated with the design collection
"""
issue: Issue!
"""
Project associated with the design collection
"""
project: Project!
"""
All versions related to all designs ordered newest first
All versions related to all designs, ordered newest first
"""
versions(
"""
@ -799,7 +835,7 @@ type DesignManagementUploadPayload {
type DesignVersion {
"""
All designs that were changed in this version
All designs that were changed in the version
"""
designs(
"""
@ -822,7 +858,15 @@ type DesignVersion {
"""
last: Int
): DesignConnection!
"""
ID of the design version
"""
id: ID!
"""
SHA of the design version
"""
sha: ID!
}

View File

@ -9206,7 +9206,7 @@
"fields": [
{
"name": "designs",
"description": "All designs for this collection",
"description": "All designs for the design collection",
"args": [
{
"name": "ids",
@ -9309,7 +9309,7 @@
},
{
"name": "issue",
"description": null,
"description": "Issue associated with the design collection",
"args": [
],
@ -9327,7 +9327,7 @@
},
{
"name": "project",
"description": null,
"description": "Project associated with the design collection",
"args": [
],
@ -9345,7 +9345,7 @@
},
{
"name": "versions",
"description": "All versions related to all designs ordered newest first",
"description": "All versions related to all designs, ordered newest first",
"args": [
{
"name": "after",
@ -10322,7 +10322,7 @@
"fields": [
{
"name": "diffRefs",
"description": null,
"description": "Diff refs of the design",
"args": [
],
@ -10397,7 +10397,7 @@
},
{
"name": "event",
"description": "The change that happened to the design at this version",
"description": "Type of change made to the design at the version specified by the `atVersion` argument if supplied. Defaults to the latest version",
"args": [
],
@ -10415,7 +10415,7 @@
},
{
"name": "filename",
"description": null,
"description": "Filename of the design file",
"args": [
],
@ -10433,7 +10433,7 @@
},
{
"name": "fullPath",
"description": null,
"description": "Full path of the design file",
"args": [
],
@ -10451,7 +10451,7 @@
},
{
"name": "id",
"description": null,
"description": "ID of the design",
"args": [
],
@ -10469,7 +10469,7 @@
},
{
"name": "image",
"description": null,
"description": "Image of the design",
"args": [
],
@ -10487,7 +10487,7 @@
},
{
"name": "issue",
"description": null,
"description": "Issue associated with the design",
"args": [
],
@ -10562,7 +10562,7 @@
},
{
"name": "notesCount",
"description": "The total count of user-created notes for this design",
"description": "Total count of user-created notes for the design",
"args": [
],
@ -10580,7 +10580,7 @@
},
{
"name": "project",
"description": null,
"description": "Project associated with the design",
"args": [
],
@ -10598,7 +10598,7 @@
},
{
"name": "versions",
"description": "All versions related to this design ordered newest first",
"description": "All versions related to the design, ordered newest first",
"args": [
{
"name": "after",
@ -10819,7 +10819,7 @@
"fields": [
{
"name": "designs",
"description": "All designs that were changed in this version",
"description": "All designs that were changed in the version",
"args": [
{
"name": "after",
@ -10876,7 +10876,7 @@
},
{
"name": "id",
"description": null,
"description": "ID of the design version",
"args": [
],
@ -10894,7 +10894,7 @@
},
{
"name": "sha",
"description": null,
"description": "SHA of the design version",
"args": [
],

View File

@ -104,22 +104,22 @@ The API can be explored interactively using the [GraphiQL IDE](../index.md#graph
| Name | Type | Description |
| --- | ---- | ---------- |
| `id` | ID! | |
| `project` | Project! | |
| `issue` | Issue! | |
| `notesCount` | Int! | The total count of user-created notes for this design |
| `filename` | String! | |
| `fullPath` | String! | |
| `event` | DesignVersionEvent! | The change that happened to the design at this version |
| `image` | String! | |
| `diffRefs` | DiffRefs! | |
| `id` | ID! | ID of the design |
| `project` | Project! | Project associated with the design |
| `issue` | Issue! | Issue associated with the design |
| `notesCount` | Int! | Total count of user-created notes for the design |
| `filename` | String! | Filename of the design file |
| `fullPath` | String! | Full path of the design file |
| `event` | DesignVersionEvent! | Type of change made to the design at the version specified by the `atVersion` argument if supplied. Defaults to the latest version |
| `image` | String! | Image of the design |
| `diffRefs` | DiffRefs! | Diff refs of the design |
### DesignCollection
| Name | Type | Description |
| --- | ---- | ---------- |
| `project` | Project! | |
| `issue` | Issue! | |
| `project` | Project! | Project associated with the design collection |
| `issue` | Issue! | Issue associated with the design collection |
### DesignManagementDeletePayload
@ -142,8 +142,8 @@ The API can be explored interactively using the [GraphiQL IDE](../index.md#graph
| Name | Type | Description |
| --- | ---- | ---------- |
| `id` | ID! | |
| `sha` | ID! | |
| `id` | ID! | ID of the design version |
| `sha` | ID! | SHA of the design version |
### DestroyNotePayload

View File

@ -86,7 +86,6 @@ curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitla
"value": "new value",
"protected": false,
"variable_type": "env_var",
"protected": false,
"masked": false,
"environment_scope": "*"
}

View File

@ -37,20 +37,6 @@ brew install elasticsearch@5.6
There is no need to install any plugins
## New repo indexer (beta)
If you're interested on working with the new beta repo indexer, all you need to do is:
```sh
git clone git@gitlab.com:gitlab-org/gitlab-elasticsearch-indexer.git
make
make install
```
this adds `gitlab-elasticsearch-indexer` to `$GOPATH/bin`, please make sure that is in your `$PATH`. After that GitLab will find it and you'll be able to enable it in the admin settings area.
**note:** `make` will not recompile the executable unless you do `make clean` beforehand
## Helpful rake tasks
- `gitlab:elastic:test:index_size`: Tells you how much space the current index is using, as well as how many documents are in the index.

View File

@ -313,7 +313,7 @@ git merge master
### Synchronize changes in a forked repository with the upstream
[Forking a repository](../user/project/repository/forking_workflow.md lets you create
[Forking a repository](../user/project/repository/forking_workflow.md) lets you create
a copy of a repository in your namespace. Changes made to your copy of the repository
are not synchronized automatically with the original.
Your local fork (copy) contains changes made by you only, so to keep the project

View File

@ -40,14 +40,13 @@ Once the data is added to the database or repository and [Elasticsearch is
enabled in the admin area](#enabling-elasticsearch) the search index will be
updated automatically.
## Elasticsearch repository indexer (beta)
## Elasticsearch repository indexer
In order to improve Elasticsearch indexing performance, GitLab has made available a [new indexer written in Go](https://gitlab.com/gitlab-org/gitlab-elasticsearch-indexer).
This will replace the included Ruby indexer in the future but should be considered beta software for now, so there may be some bugs.
For indexing Git repository data, GitLab uses an [indexer written in Go](https://gitlab.com/gitlab-org/gitlab-elasticsearch-indexer).
The Elasticsearch Go indexer is included in Omnibus for GitLab 11.8 and newer.
To use the new Elasticsearch indexer included in Omnibus, check the box "Use the new repository indexer (beta)" when [enabling the Elasticsearch integration](#enabling-elasticsearch).
The Go indexer was included in Omnibus GitLab 11.8 as an optional replacement to a
Ruby-based indexer. [Since GitLab v12.3](https://gitlab.com/gitlab-org/gitlab/issues/6481),
all indexing is done by the Go indexer, and the Ruby indexer is removed.
If you would like to use the Elasticsearch Go indexer with a source installation or an older version of GitLab, please follow the instructions below.
@ -139,7 +138,6 @@ The following Elasticsearch settings are available:
| Parameter | Description |
| ----------------------------------------------------- | ----------- |
| `Elasticsearch indexing` | Enables/disables Elasticsearch indexing. You may want to enable indexing but disable search in order to give the index time to be fully completed, for example. Also, keep in mind that this option doesn't have any impact on existing data, this only enables/disables background indexer which tracks data changes. So by enabling this you will not get your existing data indexed, use special rake task for that as explained in [Adding GitLab's data to the Elasticsearch index](#adding-gitlabs-data-to-the-elasticsearch-index). |
| `Use the new repository indexer (beta)` | Perform repository indexing using [GitLab Elasticsearch Indexer](https://gitlab.com/gitlab-org/gitlab-elasticsearch-indexer). |
| `Search with Elasticsearch enabled` | Enables/disables using Elasticsearch in search. |
| `URL` | The URL to use for connecting to Elasticsearch. Use a comma-separated list to support clustering (e.g., `http://host1, https://host2:9200`). If your Elasticsearch instance is password protected, pass the `username:password` in the URL (e.g., `http://<username>:<password>@<elastic_host>:9200/`). |
| `Number of Elasticsearch shards` | Elasticsearch indexes are split into multiple shards for performance reasons. In general, larger indexes need to have more shards. Changes to this value do not take effect until the index is recreated. You can read more about tradeoffs in the [Elasticsearch documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html#create-index-settings) |

View File

@ -94,11 +94,9 @@ sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_PAGES_VERSION)
sudo -u git -H make
```
### 8. Install/Update `gitlab-elasticsearch-indexer` (optional) **(STARTER ONLY)**
### 8. Install/Update `gitlab-elasticsearch-indexer` **(STARTER ONLY)**
If you're interested in using GitLab's new [Elasticsearch repository indexer](../integration/elasticsearch.md#elasticsearch-repository-indexer-beta) (currently in beta)
please follow the instructions on the document linked above and enable the
indexer usage in the GitLab admin settings.
Please follow the [install instruction](../integration/elasticsearch.md#installation).
### 9. Start application

View File

@ -77,11 +77,9 @@ sudo -u git -H bundle exec rake yarn:install gitlab:assets:clean gitlab:assets:c
sudo -u git -H bundle exec rake cache:clear RAILS_ENV=production
```
### 4. Install `gitlab-elasticsearch-indexer` (optional) **(STARTER ONLY)**
### 4. Install `gitlab-elasticsearch-indexer` **(STARTER ONLY)**
If you're interested in using GitLab's new [Elasticsearch repository indexer](../integration/elasticsearch.md)
(currently in beta) please follow the instructions on the
document linked above and enable the indexer usage in the GitLab admin settings.
Please follow the [install instruction](../integration/elasticsearch.md#installation).
### 5. Start application

View File

@ -27,6 +27,7 @@ The Admin Area is made up of the following sections:
| Applications | Create system [OAuth applications](../../integration/oauth_provider.md) for integrations with other services. |
| Abuse Reports | Manage [abuse reports](abuse_reports.md) submitted by your users. |
| License **(STARTER ONLY)** | Upload, display, and remove [licenses](license.md). |
| Kubernetes | Create and manage instance-level [Kubernetes clusters](../instance/clusters/index.md). |
| Push Rules **(STARTER)** | Configure pre-defined Git [push rules](../../push_rules/push_rules.md) for projects. |
| Geo **(PREMIUM ONLY)** | Configure and maintain [Geo nodes](geo_nodes.md). |
| Deploy Keys | Create instance-wide [SSH deploy keys](../../ssh/README.md#deploy-keys). |

View File

@ -454,6 +454,10 @@ Supported applications:
### Usage
You can find and import all the files referenced below
in the [example cluster applications
project](https://gitlab.com/gitlab-org/cluster-integration/example-cluster-applications/).
To install applications using GitLab CI:
1. Connect the cluster to a [cluster management project](management_project.md).

View File

@ -53,8 +53,8 @@ differentiate the new cluster from the rest.
## GitLab-managed clusters
> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/22011) in GitLab 11.5.
> Became [optional](https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/26565) in GitLab 11.11.
> - [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/22011) in GitLab 11.5.
> - Became [optional](https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/26565) in GitLab 11.11.
You can choose to allow GitLab to manage your cluster for you. If your cluster is
managed by GitLab, resources for your projects will be automatically created. See the
@ -170,6 +170,11 @@ For important information about securely configuring GitLab Runners, see
Runners](../../project/clusters/add_remove_clusters.md#security-of-gitlab-runners)
documentation for project-level clusters.
## More information
For information on integrating GitLab and Kubernetes, see
[Kubernetes clusters](../../project/clusters/index.md).
<!-- ## Troubleshooting
Include any troubleshooting steps that you can foresee. If you know beforehand what issues

View File

@ -12,11 +12,12 @@ projects.
## Cluster precedence
GitLab will try match to clusters in the following order:
GitLab will try [to match](../../../ci/environments.md#scoping-environments-with-specs) clusters in
the following order:
- Project-level clusters
- Group-level clusters
- Instance level
- Project-level clusters.
- Group-level clusters.
- Instance-level clusters.
To be selected, the cluster must be enabled and
match the [environment selector](../../../ci/environments.md#scoping-environments-with-specs).
@ -26,3 +27,8 @@ match the [environment selector](../../../ci/environments.md#scoping-environment
For a consolidated view of which CI [environments](../../../ci/environments.md)
are deployed to the Kubernetes cluster, see the documentation for
[cluster environments](../../clusters/environments.md).
## More information
For information on integrating GitLab and Kubernetes, see
[Kubernetes clusters](../../project/clusters/index.md).

View File

@ -10,6 +10,74 @@ Every new Google Cloud Platform (GCP) account receives [$300 in credit upon sign
and in partnership with Google, GitLab is able to offer an additional $200 for new GCP accounts to get started with GitLab's
Google Kubernetes Engine Integration. All you have to do is [follow this link](https://cloud.google.com/partners/partnercredit/?pcn_code=0014M00001h35gDQAQ#contact-form) and apply for credit.
## Before you begin
Before [adding a Kubernetes cluster](#add-new-cluster) using GitLab, you need:
- GitLab itself. Either:
- A GitLab.com [account](https://about.gitlab.com/pricing/#gitlab-com).
- A [self-managed installation](https://about.gitlab.com/pricing/#self-managed) with GitLab version
12.5 or later. This will ensure the GitLab UI can be used for cluster creation.
- The following GitLab access:
- [Maintainer access to a project](../../permissions.md#project-members-permissions) for a
project-level cluster.
- [Maintainer access to a group](../../permissions.md#group-members-permissions) for a
group-level cluster.
- [Admin Area access](../../admin_area/index.md) for a self-managed instance-level
cluster. **(CORE ONLY)**
### GKE requirements
Before creating your first cluster on Google GKE with GitLab's integration, make sure the following
requirements are met:
- A [billing account](https://cloud.google.com/billing/docs/how-to/manage-billing-account)
set up with access.
- The Kubernetes Engine API and related service are enabled. It should work immediately but may
take up to 10 minutes after you create a project. For more information see the
["Before you begin" section of the Kubernetes Engine docs](https://cloud.google.com/kubernetes-engine/docs/quickstart#before-you-begin).
### EKS requirements
Before creating your first cluster on Amazon EKS with GitLab's integration, make sure the following
requirements are met:
- An [Amazon Web Services](https://aws.amazon.com/) account is set up and you are able to log in.
- You have permissions to manage IAM resources.
- If you want to use an [existing EKS cluster](#existing-eks-cluster):
- An Amazon EKS cluster with worker nodes properly configured.
- `kubectl` [installed and configured](https://docs.aws.amazon.com/eks/latest/userguide/getting-started.html#get-started-kubectl)
for access to the EKS cluster.
#### Additional requirements for self-managed instances **(CORE ONLY)**
If you are using a self-managed GitLab instance, GitLab must first be configured with a set of
Amazon credentials. These credentials will be used to assume an Amazon IAM role provided by the user
creating the cluster. Create an IAM user and ensure it has permissions to assume the role(s) that
your users will use to create EKS clusters.
For example, the following policy document allows assuming a role whose name starts with
`gitlab-eks-` in account `123456789012`:
```json
{
"Version": "2012-10-17",
"Statement": {
"Effect": "Allow",
"Action": "sts:AssumeRole",
"Resource": "arn:aws:iam::123456789012:role/gitlab-eks-*"
}
}
```
Generate an access key for the IAM user, and configure GitLab with the credentials:
1. Navigate to **Admin Area > Settings > Integrations** and expand the **Amazon EKS** section.
1. Check **Enable Amazon EKS integration**.
1. Enter the account ID and access key credentials into the respective
`Account ID`, `Access key ID` and `Secret access key` fields.
1. Click **Save changes**.
## Access controls
When creating a cluster in GitLab, you will be asked if you would like to create either:
@ -116,57 +184,39 @@ New clusters can be added using GitLab for:
- Google Kubernetes Engine.
- Amazon Elastic Kubernetes Service.
### GKE cluster
### New GKE cluster
GitLab supports:
Starting from [GitLab 12.4](https://gitlab.com/gitlab-org/gitlab/issues/25925), all the GKE clusters
provisioned by GitLab are [VPC-native](https://cloud.google.com/kubernetes-engine/docs/how-to/alias-ips).
- Creating a new GKE cluster using the GitLab UI.
- Providing credentials to add an [existing Kubernetes cluster](#add-existing-cluster).
#### Important notes
Starting from [GitLab 12.4](https://gitlab.com/gitlab-org/gitlab/issues/25925), all the GKE clusters provisioned by GitLab are [VPC-native](https://cloud.google.com/kubernetes-engine/docs/how-to/alias-ips).
NOTE: **Note:**
The [Google authentication integration](../../../integration/google.md) must
be enabled in GitLab at the instance level. If that's not the case, ask your
GitLab administrator to enable it. On GitLab.com, this is enabled.
#### GKE Requirements
Before creating your first cluster on Google Kubernetes Engine with GitLab's
integration, make sure the following requirements are met:
- A [billing account](https://cloud.google.com/billing/docs/how-to/manage-billing-account)
is set up and you have permissions to access it.
- The Kubernetes Engine API and related service are enabled. It should work immediately but may take up to 10 minutes after you create a project. For more information see the
["Before you begin" section of the Kubernetes Engine docs](https://cloud.google.com/kubernetes-engine/docs/quickstart#before-you-begin).
Also note the following:
Note the following:
- The [Google authentication integration](../../../integration/google.md) must be enabled in GitLab
at the instance level. If that's not the case, ask your GitLab administrator to enable it. On
GitLab.com, this is enabled.
- Starting from [GitLab 12.1](https://gitlab.com/gitlab-org/gitlab-foss/issues/55902), all GKE clusters
created by GitLab are RBAC-enabled. Take a look at the [RBAC section](#rbac-cluster-resources) for
more information.
- Starting from [GitLab 12.5](https://gitlab.com/gitlab-org/gitlab/merge_requests/18341), the
cluster's pod address IP range will be set to /16 instead of the regular /14. /16 is a CIDR
notation.
NOTE: **Note:**
GitLab requires basic authentication enabled and a client certificate issued for the cluster in
order to setup an [initial service account](#access-controls). Starting from [GitLab
11.10](https://gitlab.com/gitlab-org/gitlab-foss/issues/58208), the cluster creation process will
explicitly request that basic authentication and client certificate is enabled.
- GitLab requires basic authentication enabled and a client certificate issued for the cluster to
set up an [initial service account](#access-controls). Starting from [GitLab
11.10](https://gitlab.com/gitlab-org/gitlab-foss/issues/58208), the cluster creation process will
explicitly request that basic authentication and client certificate is enabled.
#### Creating the cluster on GKE
If all of the above requirements are met, you can proceed to create and add a
new Kubernetes cluster to your project:
1. Navigate to your project's **Operations > Kubernetes** page.
NOTE: **Note:**
You need Maintainer [permissions](../../permissions.md) and above to access the Kubernetes page.
To create and add a new Kubernetes cluster to your project, group, or instance:
1. Navigate to your:
- Project's **Operations > Kubernetes** page, for a project-level cluster.
- Group's **Kubernetes** page, for a group-level cluster.
- **Admin Area > Kubernetes** page, for an instance-level cluster.
1. Click **Add Kubernetes cluster**.
1. Click **Create with Google Kubernetes Engine**.
1. Under the **Create new cluster** tab, click **Google GKE**.
1. Connect your Google account if you haven't done already by clicking the
**Sign in with Google** button.
1. Choose your cluster's settings:
@ -198,64 +248,19 @@ separately after the cluster has been created. This means that Cloud Run
(Knative), Istio, and HTTP Load Balancing will be enabled on the cluster at
create time and cannot be [installed or uninstalled](../../clusters/applications.md) separately.
### EKS Cluster
### New EKS cluster
GitLab supports:
> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/22392) in GitLab 12.5.
- Creating a new EKS cluster using the GitLab UI
([Introduced](https://gitlab.com/gitlab-org/gitlab/issues/22392) in GitLab 12.5).
- Providing credentials to add an [existing Kubernetes cluster](#add-existing-cluster).
#### EKS Requirements
Before creating your first cluster on Amazon EKS with GitLab's integration,
make sure the following requirements are met:
- An [Amazon Web Services](https://aws.amazon.com/) account is set up and you are able to log in.
- You have permissions to manage IAM resources.
##### Additional requirements for self-managed instances
If you are using a self-managed GitLab instance, GitLab must first
be configured with a set of Amazon credentials. These credentials
will be used to assume an Amazon IAM role provided by the user
creating the cluster. Create an IAM user and ensure it has permissions
to assume the role(s) that your users will use to create EKS clusters.
For example, the following policy document allows assuming a role whose name starts with
`gitlab-eks-` in account `123456789012`:
```json
{
"Version": "2012-10-17",
"Statement": {
"Effect": "Allow",
"Action": "sts:AssumeRole",
"Resource": "arn:aws:iam::123456789012:role/gitlab-eks-*"
}
}
```
Generate an access key for the IAM user, and configure GitLab with the credentials:
1. Navigate to **Admin Area > Settings > Integrations** and expand the **Amazon EKS** section.
1. Check **Enable Amazon EKS integration**.
1. Enter the account ID and access key credentials into the respective
`Account ID`, `Access key ID` and `Secret access key` fields.
1. Click **Save changes**.
#### Creating the cluster on EKS
If all of the above requirements are met, you can proceed to create and add a
new Kubernetes cluster to your project:
1. Navigate to your project's **Operations > Kubernetes** page.
NOTE: **Note:**
You need Maintainer [permissions](../../permissions.md) and above to access the Kubernetes page.
To create and add a new Kubernetes cluster to your project, group, or instance:
1. Navigate to your:
- Project's **Operations > Kubernetes** page, for a project-level cluster.
- Group's **Kubernetes** page, for a group-level cluster.
- **Admin Area > Kubernetes** page, for an instance-level cluster.
1. Click **Add Kubernetes cluster**.
1. Click **Amazon EKS**. You will be provided with an `Account ID` and `External ID` to use in the next step.
1. Under the **Create new cluster** tab, click **Amazon EKS**. You will be provided with an
`Account ID` and `External ID` to use in the next step.
1. In the [IAM Management Console](https://console.aws.amazon.com/iam/home), create an IAM role:
1. From the left panel, select **Roles**.
1. Click **Create role**.
@ -356,24 +361,23 @@ to install some [pre-defined applications](index.md#installing-applications).
If you have either of the following types of clusters already, you can add them to a project:
- [Google Kubernetes Engine cluster](#add-existing-gke-cluster).
- [Amazon Elastic Kubernetes Service](#add-existing-eks-cluster).
- [Google Kubernetes Engine cluster](#existing-gke-cluster).
- [Amazon Elastic Kubernetes Service](#existing-eks-cluster).
NOTE: **Note:**
Kubernetes integration is not supported for arm64 clusters. See the issue
[Helm Tiller fails to install on arm64 cluster](https://gitlab.com/gitlab-org/gitlab-foss/issues/64044) for details.
### Add existing GKE cluster
### Existing GKE cluster
To add an existing Kubernetes cluster to your project:
1. Navigate to your project's **Operations > Kubernetes** page.
NOTE: **Note:**
You need Maintainer [permissions](../../permissions.md) and above to access the Kubernetes page.
To add an existing GKE cluster to your project, group, or instance:
1. Navigate to your:
- Project's **Operations > Kubernetes** page, for a project-level cluster.
- Group's **Kubernetes** page, for a group-level cluster.
- **Admin Area > Kubernetes** page, for an instance-level cluster.
1. Click **Add Kubernetes cluster**.
1. Click **Add an existing Kubernetes cluster** and fill in the details:
1. Click the **Add existing cluster** tab and fill in the details:
- **Kubernetes cluster name** (required) - The name you wish to give the cluster.
- **Environment scope** (required) - The
[associated environment](index.md#setting-the-environment-scope-premium) to this cluster.
@ -389,7 +393,7 @@ To add an existing Kubernetes cluster to your project:
```
- **CA certificate** (required) - A valid Kubernetes certificate is needed to authenticate to the cluster. We will use the certificate created by default.
- List the secrets with `kubectl get secrets`, and one should named similar to
- List the secrets with `kubectl get secrets`, and one should be named similar to
`default-token-xxxxx`. Copy that token name for use below.
- Get the certificate by running this command:
@ -508,136 +512,110 @@ To add an existing Kubernetes cluster to your project:
After a couple of minutes, your cluster will be ready to go. You can now proceed
to install some [pre-defined applications](index.md#installing-applications).
### Add existing EKS cluster
### Existing EKS cluster
In this section, we will show how to integrate an [Amazon EKS](https://aws.amazon.com/eks/) cluster with GitLab and begin
deploying applications.
To add an existing EKS cluster to your project, group, or instance:
#### Requirements
1. Perform the following steps on the EKS cluster:
1. Retrieve the certificate. A valid Kubernetes certificate is needed to authenticate to the
EKS cluster. We will use the certificate created by default.
Open a shell and use `kubectl` to retrieve it:
To integrate with with EKS, you will need:
1. List the secrets with `kubectl get secrets`, and one should named similar to
`default-token-xxxxx`. Copy that token name for use below.
1. Get the certificate with:
- An account on GitLab, like [GitLab.com](https://gitlab.com).
- An Amazon EKS cluster (with worker nodes properly configured).
- `kubectl` [installed and configured for access to the EKS cluster](https://docs.aws.amazon.com/eks/latest/userguide/getting-started.html#get-started-kubectl).
```sh
kubectl get secret <secret name> -o jsonpath="{['data']['ca\.crt']}" | base64 --decode
```
If you don't have an Amazon EKS cluster, one can be created by following the
[EKS getting started guide](https://docs.aws.amazon.com/eks/latest/userguide/getting-started.html).
1. Create admin token. A `cluster-admin` token is required to install and manage Helm Tiller.
GitLab establishes mutual SSL authentication with Helm Tiller and creates limited service
accounts for each application. To create the token we will create an admin service account as
follows:
#### Configuring and connecting the EKS cluster
1. Create a file called `eks-admin-service-account.yaml` with contents:
From the left side bar, hover over **Operations > Kubernetes > Add Kubernetes cluster**,
then click **Add an existing Kubernetes cluster**.
```yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: eks-admin
namespace: kube-system
```
A few details from the EKS cluster will be required to connect it to GitLab:
1. Apply the service account to your cluster:
1. **Retrieve the certificate**: A valid Kubernetes certificate is needed to
authenticate to the EKS cluster. We will use the certificate created by default.
Open a shell and use `kubectl` to retrieve it:
```shell
$ kubectl apply -f eks-admin-service-account.yaml
serviceaccount "eks-admin" created
```
- List the secrets with `kubectl get secrets`, and one should named similar to
`default-token-xxxxx`. Copy that token name for use below.
- Get the certificate with:
1. Create a file called `eks-admin-cluster-role-binding.yaml` with contents:
```sh
kubectl get secret <secret name> -o jsonpath="{['data']['ca\.crt']}" | base64 --decode
```
```yaml
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: eks-admin
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: eks-admin
namespace: kube-system
```
1. **Create admin token**: A `cluster-admin` token is required to install and
manage Helm Tiller. GitLab establishes mutual SSL auth with Helm Tiller
and creates limited service accounts for each application. To create the
token we will create an admin service account as follows:
1. Apply the cluster role binding to your cluster:
1. Create a file called `eks-admin-service-account.yaml` with contents:
```shell
$ kubectl apply -f eks-admin-cluster-role-binding.yaml
clusterrolebinding "eks-admin" created
```
```yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: eks-admin
namespace: kube-system
```
1. Retrieve the token for the `eks-admin` service account:
1. Apply the service account to your cluster:
```bash
kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep eks-admin | awk '{print $1}')
```
```bash
kubectl apply -f eks-admin-service-account.yaml
```
Copy the `<authentication_token>` value from the output:
Output:
```bash
serviceaccount "eks-admin" created
```
1. Create a file called `eks-admin-cluster-role-binding.yaml` with contents:
```yaml
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: eks-admin
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: eks-admin
namespace: kube-system
```
1. Apply the cluster role binding to your cluster:
```bash
kubectl apply -f eks-admin-cluster-role-binding.yaml
```
Output:
```bash
clusterrolebinding "eks-admin" created
```
1. Retrieve the token for the `eks-admin` service account:
```bash
kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep eks-admin | awk '{print $1}')
```
Copy the `<authentication_token>` value from the output:
```yaml
Name: eks-admin-token-b5zv4
Namespace: kube-system
Labels: <none>
Annotations: kubernetes.io/service-account.name=eks-admin
```yaml
Name: eks-admin-token-b5zv4
Namespace: kube-system
Labels: <none>
Annotations: kubernetes.io/service-account.name=eks-admin
kubernetes.io/service-account.uid=bcfe66ac-39be-11e8-97e8-026dce96b6e8
Type: kubernetes.io/service-account-token
Type: kubernetes.io/service-account-token
Data
====
ca.crt: 1025 bytes
namespace: 11 bytes
token: <authentication_token>
```
Data
====
ca.crt: 1025 bytes
namespace: 11 bytes
token: <authentication_token>
```
1. The API server endpoint is also required, so GitLab can connect to the cluster.
This is displayed on the AWS EKS console, when viewing the EKS cluster details.
1. Locate the the API server endpoint so GitLab can connect to the cluster. This is displayed on
the AWS EKS console, when viewing the EKS cluster details.
1. Navigate to your:
- Project's **Operations > Kubernetes** page, for a project-level cluster.
- Group's **Kubernetes** page, for a group-level cluster.
- **Admin Area > Kubernetes** page, for an instance-level cluster.
1. Click **Add Kubernetes cluster**.
1. Click the **Add existing cluster** tab and fill in the details:
- **Kubernetes cluster name**: A name for the cluster to identify it within GitLab.
- **Environment scope**: Leave this as `*` for now, since we are only connecting a single cluster.
- **API URL**: The API server endpoint retrieved earlier.
- **CA Certificate**: The certificate data from the earlier step, as-is.
- **Service Token**: The admin token value.
- For project-level clusters, **Project namespace prefix**: This can be left blank to accept the
default namespace, based on the project name.
1. Click on **Add Kubernetes cluster**. The cluster is now connected to GitLab.
You now have all the information needed to connect the EKS cluster:
- Kubernetes cluster name: Provide a name for the cluster to identify it within GitLab.
- Environment scope: Leave this as `*` for now, since we are only connecting a single cluster.
- API URL: Paste in the API server endpoint retrieved above.
- CA Certificate: Paste the certificate data from the earlier step, as-is.
- Paste the admin token value.
- Project namespace: This can be left blank to accept the default namespace, based on the project name.
![Add Cluster](img/add_cluster.png)
Click on **Add Kubernetes cluster**, the cluster is now connected to GitLab.
At this point, [Kubernetes deployment variables](index.md#deployment-variables) will
automatically be available during CI/CD jobs, making it easy to interact with the cluster.

View File

@ -1,5 +1,5 @@
---
redirect_to: '../add_remove_clusters.md#add-existing-eks-cluster'
redirect_to: '../add_remove_clusters.md#existing-eks-cluster'
---
This document was moved to [another location](../add_remove_clusters.md#add-existing-eks-cluster).
This document was moved to [another location](../add_remove_clusters.md#existing-eks-cluster).

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

View File

@ -30,9 +30,6 @@ Using the GitLab project Kubernetes integration, you can:
- View [Pod logs](#pod-logs-ultimate). **(ULTIMATE)**
- Run serverless workloads on [Kubernetes with Knative](serverless/index.md).
See [Adding and removing Kubernetes clusters](add_remove_clusters.md) for details on how to
set up integrations.
### Deploy Boards **(PREMIUM)**
GitLab's Deploy Boards offer a consolidated view of the current health and
@ -79,10 +76,7 @@ Kubernetes clusters can be used without Auto DevOps.
### Web terminals
NOTE: **Note:**
Introduced in GitLab 8.15. You must be the project owner or have `maintainer` permissions
to use terminals. Support is limited to the first container in the
first pod of your environment.
> Introduced in GitLab 8.15.
When enabled, the Kubernetes service adds [web terminal](../../../ci/environments.md#web-terminals)
support to your [environments](../../../ci/environments.md). This is based on the `exec` functionality found in
@ -97,6 +91,14 @@ pods are annotated with:
`$CI_ENVIRONMENT_SLUG` and `$CI_PROJECT_PATH_SLUG` are the values of
the CI variables.
You must be the project owner or have `maintainer` permissions to use terminals. Support is limited
to the first container in the first pod of your environment.
## Adding and removing clusters
See [Adding and removing Kubernetes clusters](add_remove_clusters.md) for details on how to
set up integrations with Google Cloud Platform (GCP) and Amazon Elastic Kubernetes Service (EKS).
## Cluster configuration
After [adding a Kubernetes cluster](add_remove_clusters.md) to GitLab, read this section that covers
@ -115,8 +117,8 @@ applications running on the cluster.
### GitLab-managed clusters
> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/22011) in GitLab 11.5.
> Became [optional](https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/26565) in GitLab 11.11.
> - [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/22011) in GitLab 11.5.
> - Became [optional](https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/26565) in GitLab 11.11.
You can choose to allow GitLab to manage your cluster for you. If your cluster is
managed by GitLab, resources for your projects will be automatically created. See the

View File

@ -43,7 +43,7 @@ To run Knative on GitLab, you will need:
clone the sample [Knative Ruby App](https://gitlab.com/knative-examples/knative-ruby-app) to get
started.
1. **Kubernetes Cluster:** An RBAC-enabled Kubernetes cluster is required to deploy Knative.
The simplest way to get started is to add a cluster using [GitLab's GKE integration](../add_remove_clusters.md#gke-cluster).
The simplest way to get started is to add a cluster using GitLab's [GKE integration](../add_remove_clusters.md).
The set of minimum recommended cluster specifications to run Knative is 3 nodes, 6 vCPUs, and 22.50 GB memory.
1. **Helm Tiller:** Helm is a package manager for Kubernetes and is required to install
Knative.

View File

@ -23,6 +23,11 @@ noted information:
If you hover over a commit in the UI, you'll see a precise date and time
for that commit.
![Blame previous commit](img/file_blame_previous_commit_v12_7.png "Blame previous commit")
To see earlier revisions of a specific line, click **View blame prior to this change**
until you've found the changes you're interested in viewing.
## Associated `git` command
If you're running `git` from the command line, the equivalent command is

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

View File

@ -27,7 +27,6 @@ module API
":id/#{awardable_string}/:#{awardable_id_string}/award_emoji",
":id/#{awardable_string}/:#{awardable_id_string}/notes/:note_id/award_emoji"
].each do |endpoint|
desc 'Get a list of project +awardable+ award emoji' do
detail 'This feature was introduced in 8.9'
success Entities::AwardEmoji

View File

@ -11,7 +11,6 @@ module Gitlab
# So we chose a way to use ::Ci::Build directly and we don't change the `archive!` method until 11.1
::Ci::Build.finished.without_archived_trace
.where(id: start_id..stop_id).find_each do |build|
build.trace.archive!
rescue => e
Rails.logger.error "Failed to archive live trace. id: #{build.id} message: #{e.message}" # rubocop:disable Gitlab/RailsLogger

View File

@ -10,7 +10,7 @@ module Gitlab
def initialize(user:, shared:, project:)
@path = File.join(shared.export_path, 'project.json')
@user = user
@shared = shared
@shared = shared
@project = project
end

View File

@ -36,7 +36,7 @@ module Gitlab
end
def relative_path(path)
path.gsub(%r{^#{Rails.root.to_s}/?}, '')
path.gsub(%r{^#{Rails.root}/?}, '')
end
def values_for(event)

View File

@ -4,6 +4,7 @@ module Gitlab
class Pages
VERSION = File.read(Rails.root.join("GITLAB_PAGES_VERSION")).strip.freeze
INTERNAL_API_REQUEST_HEADER = 'Gitlab-Pages-Api-Request'.freeze
MAX_SIZE = 1.terabyte
include JwtAuthenticatable

View File

@ -18,7 +18,7 @@ module Gitlab
end
def relative_path
@relative_path ||= @file.gsub(%r{^#{Rails.root.to_s}/?}, '')
@relative_path ||= @file.gsub(%r{^#{Rails.root}/?}, '')
end
def to_param

View File

@ -45,7 +45,7 @@ module Gitlab
require 'rblineprof'
retval = nil
samples = lineprof(/^#{Rails.root.to_s}/) { retval = yield }
samples = lineprof(/^#{Rails.root}/) { retval = yield }
file_samples = aggregate_rblineprof(samples)

View File

@ -206,7 +206,6 @@ module Gitlab
.by_type(:JiraService)
.includes(:jira_tracker_data)
.find_in_batches(batch_size: BATCH_SIZE) do |services|
counts = services.group_by do |service|
# TODO: Simplify as part of https://gitlab.com/gitlab-org/gitlab/issues/29404
service_url = service.data_fields&.url || (service.properties && service.properties['url'])

View File

@ -9,7 +9,6 @@ namespace :gitlab do
LfsObject.with_files_stored_locally
.find_each(batch_size: 10) do |lfs_object|
lfs_object.file.migrate!(LfsObjectUploader::Store::REMOTE)
logger.info("Transferred LFS object #{lfs_object.oid} of size #{lfs_object.size.to_i.bytes} to object storage")
@ -24,7 +23,6 @@ namespace :gitlab do
LfsObject.with_files_stored_remotely
.find_each(batch_size: 10) do |lfs_object|
lfs_object.file.migrate!(LfsObjectUploader::Store::LOCAL)
logger.info("Transferred LFS object #{lfs_object.oid} of size #{lfs_object.size.to_i.bytes} to local storage")

View File

@ -5045,12 +5045,18 @@ msgstr ""
msgid "Could not create project"
msgstr ""
msgid "Could not delete %{design}. Please try again."
msgstr ""
msgid "Could not delete chat nickname %{chat_name}."
msgstr ""
msgid "Could not fetch projects"
msgstr ""
msgid "Could not find design"
msgstr ""
msgid "Could not remove the trigger."
msgstr ""
@ -6062,15 +6068,12 @@ msgstr ""
msgid "DesignManagement|Are you sure you want to delete the selected designs?"
msgstr ""
msgid "DesignManagement|Could not add a new comment. Please try again"
msgid "DesignManagement|Could not add a new comment. Please try again."
msgstr ""
msgid "DesignManagement|Could not create new discussion. Please try again."
msgstr ""
msgid "DesignManagement|Could not find design, please try again."
msgstr ""
msgid "DesignManagement|Delete"
msgstr ""
@ -6083,7 +6086,7 @@ msgstr ""
msgid "DesignManagement|Deselect all"
msgstr ""
msgid "DesignManagement|Error uploading a new design. Please try again"
msgid "DesignManagement|Error uploading a new design. Please try again."
msgstr ""
msgid "DesignManagement|Go back to designs"
@ -6095,9 +6098,6 @@ msgstr ""
msgid "DesignManagement|Go to previous design"
msgstr ""
msgid "DesignManagement|Requested design version does not exist"
msgstr ""
msgid "DesignManagement|Requested design version does not exist. Showing latest version instead"
msgstr ""
@ -6113,9 +6113,6 @@ msgstr ""
msgid "DesignManagement|Upload and view the latest designs for this issue. Consistent and easy to find, so everyone is up to date."
msgstr ""
msgid "DesignManagement|We could not delete %{design}. Please try again."
msgstr ""
msgid "Designs"
msgstr ""
@ -8212,13 +8209,13 @@ msgstr ""
msgid "GeoNodes|Out of sync"
msgstr ""
msgid "GeoNodes|Pausing replication stops the sync process."
msgid "GeoNodes|Pausing replication stops the sync process. Are you sure?"
msgstr ""
msgid "GeoNodes|Removing a primary node stops the sync process for all nodes. Syncing cannot be resumed without losing some data on all secondaries. In this case we would recommend setting up all nodes from scratch. Are you sure?"
msgid "GeoNodes|Removing a Geo primary node stops the synchronization to that node. Are you sure?"
msgstr ""
msgid "GeoNodes|Removing a secondary node stops the sync process. It is not currently possible to add back the same node without losing some data. We only recommend setting up a new secondary node in this case. Are you sure?"
msgid "GeoNodes|Removing a Geo secondary node stops the synchronization to that node. Are you sure?"
msgstr ""
msgid "GeoNodes|Replication slot WAL"
@ -14964,15 +14961,24 @@ msgstr ""
msgid "Remove milestone"
msgstr ""
msgid "Remove node"
msgstr ""
msgid "Remove parent epic from an epic"
msgstr ""
msgid "Remove primary node"
msgstr ""
msgid "Remove priority"
msgstr ""
msgid "Remove project"
msgstr ""
msgid "Remove secondary node"
msgstr ""
msgid "Remove spent time"
msgstr ""
@ -15237,6 +15243,9 @@ msgstr ""
msgid "Requested %{time_ago}"
msgstr ""
msgid "Requested design version does not exist"
msgstr ""
msgid "Requests Profiles"
msgstr ""
@ -20048,6 +20057,9 @@ msgstr ""
msgid "View app"
msgstr ""
msgid "View blame prior to this change"
msgstr ""
msgid "View dependency details for your project"
msgstr ""

View File

@ -38,6 +38,12 @@ RUN apt-get update -q && apt-get install -y google-chrome-stable && apt-get clea
RUN wget -q https://chromedriver.storage.googleapis.com/$(wget -q -O - https://chromedriver.storage.googleapis.com/LATEST_RELEASE)/chromedriver_linux64.zip
RUN unzip chromedriver_linux64.zip -d /usr/local/bin
##
# Install K3d local cluster support
# https://github.com/rancher/k3d
#
RUN curl -s https://raw.githubusercontent.com/rancher/k3d/master/install.sh | TAG=v1.3.4 bash
##
# Install gcloud and kubectl CLI used in Auto DevOps test to create K8s
# clusters

View File

@ -37,6 +37,7 @@ module QA
autoload :MailHog, 'qa/runtime/mail_hog'
autoload :IPAddress, 'qa/runtime/ip_address'
autoload :Search, 'qa/runtime/search'
autoload :ApplicationSettings, 'qa/runtime/application_settings'
module API
autoload :Client, 'qa/runtime/api/client'

View File

@ -13,6 +13,10 @@ module QA
def add_kubernetes_cluster
click_on 'Add Kubernetes cluster'
end
def has_cluster?(cluster)
has_element?(:cluster, cluster_name: cluster.to_s)
end
end
end
end

View File

@ -6,12 +6,6 @@ module QA
module Operations
module Kubernetes
class Show < Page::Base
view 'app/assets/javascripts/clusters/components/application_row.vue' do
element :application_row, 'js-cluster-application-row-${this.id}' # rubocop:disable QA/ElementWithPattern
element :install_button, "__('Install')" # rubocop:disable QA/ElementWithPattern
element :installed_button, "__('Installed')" # rubocop:disable QA/ElementWithPattern
end
view 'app/assets/javascripts/clusters/components/applications.vue' do
element :ingress_ip_address, 'id="ingress-endpoint"' # rubocop:disable QA/ElementWithPattern
end
@ -22,15 +16,21 @@ module QA
end
def install!(application_name)
within(".js-cluster-application-row-#{application_name}") do
page.has_button?('Install', wait: 30)
click_on 'Install'
within_element(application_name) do
has_element?(:install_button, application: application_name, wait: 30)
click_on 'Install' # TODO replace with click_element
end
end
def await_installed(application_name)
within(".js-cluster-application-row-#{application_name}") do
page.has_text?(/Installed|Uninstall/, wait: 300)
within_element(application_name) do
has_element?(:uninstall_button, application: application_name, wait: 300)
end
end
def has_application_installed?(application_name)
within_element(application_name) do
has_element?(:uninstall_button, application: application_name, wait: 300)
end
end

View File

@ -0,0 +1,46 @@
# frozen_string_literal: true
module QA
module Runtime
module ApplicationSettings
extend self
extend Support::Api
APPLICATION_SETTINGS_PATH = '/application/settings'
# Set a GitLab application setting
# Example:
# #set({ allow_local_requests_from_web_hooks_and_services: true })
# #set(allow_local_requests_from_web_hooks_and_services: true)
# https://docs.gitlab.com/ee/api/settings.html
def set_application_settings(**application_settings)
QA::Runtime::Logger.info("Setting application settings: #{application_settings}")
r = put(Runtime::API::Request.new(api_client, APPLICATION_SETTINGS_PATH).url, **application_settings)
raise "Couldn't set application settings #{application_settings.inspect}" unless r.code == QA::Support::Api::HTTP_STATUS_OK
end
def get_application_settings
parse_body(get(Runtime::API::Request.new(api_client, APPLICATION_SETTINGS_PATH).url))
end
private
def api_client
@api_client ||= begin
return Runtime::API::Client.new(:gitlab, personal_access_token: Runtime::Env.admin_personal_access_token) if Runtime::Env.admin_personal_access_token
user = Resource::User.fabricate_via_api! do |user|
user.username = Runtime::User.admin_username
user.password = Runtime::User.admin_password
end
unless user.admin?
raise "Administrator access is required to set application settings. User '#{user.username}' is not an administrator."
end
Runtime::API::Client.new(:gitlab, user: user)
end
end
end
end
end

View File

@ -248,6 +248,10 @@ module QA
raise ArgumentError, "Please provide GITHUB_ACCESS_TOKEN"
end
def require_admin_access_token!
admin_personal_access_token || (raise ArgumentError, "GITLAB_QA_ADMIN_ACCESS_TOKEN is required!")
end
# Returns true if there is an environment variable that indicates that
# the feature is supported in the environment under test.
# All features are supported by default.

View File

@ -6,6 +6,8 @@ module QA
class K3d < Base
def validate_dependencies
find_executable('k3d') || raise("You must first install `k3d` executable to run these tests.")
Runtime::Env.require_admin_access_token!
Runtime::ApplicationSettings.set_application_settings(allow_local_requests_from_web_hooks_and_services: true)
end
def set_credentials(admin_user)
@ -24,6 +26,7 @@ module QA
def teardown
ENV['KUBECONFIG'] = @old_kubeconfig
shell "k3d delete --name #{cluster_name}"
Runtime::ApplicationSettings.set_application_settings(allow_local_requests_from_web_hooks_and_services: false)
end
# Fetch "real" certificate

View File

@ -39,6 +39,10 @@ module QA
@provider.cluster_name
end
def to_s
cluster_name
end
private
def fetch_api_url

View File

@ -0,0 +1,53 @@
# frozen_string_literal: true
module QA
context 'Configure' do
# This test requires GITLAB_QA_ADMIN_ACCESS_TOKEN to be specified
describe 'Kubernetes Cluster Integration', :orchestrated, :kubernetes, :requires_admin, :skip do
context 'Project Clusters' do
let(:cluster) { Service::KubernetesCluster.new(provider_class: Service::ClusterProvider::K3d).create! }
let(:project) do
Resource::Project.fabricate_via_api! do |project|
project.name = 'project-with-k8s'
project.description = 'Project with Kubernetes cluster integration'
end
end
before do
Flow::Login.sign_in
end
after do
cluster.remove!
end
it 'can create and associate a project cluster', :smoke do
Resource::KubernetesCluster.fabricate_via_browser_ui! do |k8s_cluster|
k8s_cluster.project = project
k8s_cluster.cluster = cluster
end
project.visit!
Page::Project::Menu.perform(&:go_to_operations_kubernetes)
Page::Project::Operations::Kubernetes::Index.perform do |index|
expect(index).to have_cluster(cluster)
end
end
it 'installs helm and tiller on a gitlab managed app' do
Resource::KubernetesCluster.fabricate_via_browser_ui! do |k8s_cluster|
k8s_cluster.project = project
k8s_cluster.cluster = cluster
k8s_cluster.install_helm_tiller = true
end
Page::Project::Operations::Kubernetes::Show.perform do |show|
expect(show).to have_application_installed(:helm)
end
end
end
end
end
end

View File

@ -0,0 +1,43 @@
# frozen_string_literal: true
describe QA::Runtime::ApplicationSettings do
let(:api_client) { double('QA::Runtime::API::Client') }
let(:request) { Struct.new(:url).new('http://api') }
let(:get_response) { Struct.new(:body).new("{}") }
before do
allow(described_class).to receive(:api_client).and_return(api_client)
end
describe '.set_application_settings' do
it 'sets application settings' do
expect(QA::Runtime::API::Request)
.to receive(:new)
.with(api_client, '/application/settings')
.and_return(request)
expect(described_class)
.to receive(:put)
.with(request.url, { allow_local_requests_from_web_hooks_and_services: true })
.and_return(Struct.new(:code).new(200))
subject.set_application_settings(allow_local_requests_from_web_hooks_and_services: true)
end
end
describe '.get_application_settings' do
it 'gets application settings' do
expect(QA::Runtime::API::Request)
.to receive(:new)
.with(api_client, '/application/settings')
.and_return(request)
expect(described_class)
.to receive(:get)
.with(request.url)
.and_return(get_response)
subject.get_application_settings
end
end
end

View File

@ -230,6 +230,20 @@ describe QA::Runtime::Env do
end
end
describe '.require_admin_access_token!' do
it 'raises ArgumentError if GITLAB_QA_ADMIN_ACCESS_TOKEN is not specified' do
stub_env('GITLAB_QA_ADMIN_ACCESS_TOKEN', nil)
expect { described_class.require_admin_access_token! }.to raise_error(ArgumentError)
end
it 'does not raise exception if GITLAB_QA_ADMIN_ACCESS_TOKEN is specified' do
stub_env('GITLAB_QA_ADMIN_ACCESS_TOKEN', 'foobar123')
expect { described_class.require_admin_access_token! }.not_to raise_error
end
end
describe '.log_destination' do
it 'returns $stdout if QA_LOG_PATH is not defined' do
stub_env('QA_LOG_PATH', nil)

View File

@ -10,7 +10,7 @@ describe ConfirmEmailWarning do
controller(ApplicationController) do
# `described_class` is not available in this context
include ConfirmEmailWarning # rubocop:disable RSpec/DescribedClass
include ConfirmEmailWarning
def index
head :ok

View File

@ -22,7 +22,7 @@ describe ControllerWithCrossProjectAccessCheck do
describe '#requires_cross_project_access' do
controller(ApplicationController) do
# `described_class` is not available in this context
include ControllerWithCrossProjectAccessCheck # rubocop:disable RSpec/DescribedClass
include ControllerWithCrossProjectAccessCheck
requires_cross_project_access :index, show: false,
unless: -> { unless_condition },
@ -81,7 +81,7 @@ describe ControllerWithCrossProjectAccessCheck do
describe '#skip_cross_project_access_check' do
controller(ApplicationController) do
# `described_class` is not available in this context
include ControllerWithCrossProjectAccessCheck # rubocop:disable RSpec/DescribedClass
include ControllerWithCrossProjectAccessCheck
requires_cross_project_access

View File

@ -8,7 +8,7 @@ describe GroupTree do
controller(ApplicationController) do
# `described_class` is not available in this context
include GroupTree # rubocop:disable RSpec/DescribedClass
include GroupTree
def index
render_group_tree GroupsFinder.new(current_user).execute

View File

@ -7,7 +7,7 @@ describe LfsRequest do
controller(Projects::GitHttpClientController) do
# `described_class` is not available in this context
include LfsRequest # rubocop:disable RSpec/DescribedClass
include LfsRequest
def show
storage_project

View File

@ -16,7 +16,7 @@ describe MetricsDashboard do
end
controller(::ApplicationController) do
include MetricsDashboard # rubocop:disable RSpec/DescribedClass
include MetricsDashboard
end
let(:json_response) do

View File

@ -9,7 +9,7 @@ describe RendersCommits do
controller(ApplicationController) do
# `described_class` is not available in this context
include RendersCommits # rubocop:disable RSpec/DescribedClass
include RendersCommits
def index
@merge_request = MergeRequest.find(params[:id])

View File

@ -4,7 +4,7 @@ require 'spec_helper'
describe RoutableActions do
controller(::ApplicationController) do
include RoutableActions # rubocop:disable RSpec/DescribedClass
include RoutableActions
before_action :routable

Some files were not shown because too many files have changed in this diff Show More