Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2020-08-25 00:10:16 +00:00
parent 39a4ea6124
commit 06528399ad
21 changed files with 59 additions and 38 deletions

View File

@ -1033,8 +1033,6 @@ Rails/SaveBang:
- 'ee/spec/support/shared_examples/models/member_shared_examples.rb'
- 'ee/spec/support/shared_examples/models/mentionable_shared_examples.rb'
- 'ee/spec/support/shared_examples/policies/protected_environments_shared_examples.rb'
- 'ee/spec/support/shared_examples/requests/api/graphql/geo/registries_shared_examples.rb'
- 'ee/spec/support/shared_examples/requests/api/project_approval_rules_api_shared_examples.rb'
- 'ee/spec/support/shared_examples/services/build_execute_shared_examples.rb'
- 'ee/spec/support/shared_examples/services/issue_epic_shared_examples.rb'
- 'ee/spec/workers/adjourned_project_deletion_worker_spec.rb'
@ -1489,11 +1487,6 @@ Rails/SaveBang:
- 'spec/support/shared_examples/policies/project_policy_shared_examples.rb'
- 'spec/support/shared_examples/quick_actions/issuable/issuable_quick_actions_shared_examples.rb'
- 'spec/support/shared_examples/quick_actions/merge_request/merge_quick_action_shared_examples.rb'
- 'spec/support/shared_examples/requests/api/award_emoji_todo_shared_examples.rb'
- 'spec/support/shared_examples/requests/api/boards_shared_examples.rb'
- 'spec/support/shared_examples/requests/api/custom_attributes_shared_examples.rb'
- 'spec/support/shared_examples/requests/api/nuget_packages_shared_examples.rb'
- 'spec/support/shared_examples/requests/api/pypi_packages_shared_examples.rb'
- 'spec/support/shared_examples/serializers/note_entity_shared_examples.rb'
- 'spec/support/shared_examples/services/common_system_notes_shared_examples.rb'
- 'spec/support/shared_examples/services/issuable_shared_examples.rb'

View File

@ -873,7 +873,6 @@ $mr-widget-min-height: 69px;
.merge-request-tabs-container,
.epic-tabs-container {
flex-direction: column-reverse;
padding-top: $gl-padding-8;
}
}
@ -883,7 +882,6 @@ $mr-widget-min-height: 69px;
.epic-tabs-container {
flex-direction: column-reverse;
align-items: flex-start;
padding-top: $gl-padding-8;
}
}
}

View File

@ -5,7 +5,7 @@ class AuditEvent < ApplicationRecord
include IgnorableColumns
include BulkInsertSafe
PARALLEL_PERSISTENCE_COLUMNS = [:author_name, :entity_path, :target_details].freeze
PARALLEL_PERSISTENCE_COLUMNS = [:author_name, :entity_path, :target_details, :target_type].freeze
ignore_column :type, remove_with: '13.6', remove_after: '2020-11-22'
ignore_column :updated_at, remove_with: '13.4', remove_after: '2020-09-22'

View File

@ -106,7 +106,9 @@ module Clusters
proxy_url = kube_client.proxy_url('service', service_name, service_port, Gitlab::Kubernetes::Helm::NAMESPACE)
# ensures headers containing auth data are appended to original k8s client options
options = kube_client.rest_client.options.merge(headers: kube_client.headers)
options = kube_client.rest_client.options
.merge(prometheus_client_default_options)
.merge(headers: kube_client.headers)
Gitlab::PrometheusClient.new(proxy_url, options)
rescue Kubeclient::HttpError, Errno::ECONNRESET, Errno::ECONNREFUSED, Errno::ENETUNREACH
# If users have mistakenly set parameters or removed the depended clusters,

View File

@ -3,6 +3,11 @@
module PrometheusAdapter
extend ActiveSupport::Concern
# We should choose more conservative timeouts, but some queries we run are now busting our
# default timeouts, which are stricter. We should make those queries faster instead.
# See https://gitlab.com/gitlab-org/gitlab/-/issues/232786
DEFAULT_PROMETHEUS_REQUEST_TIMEOUT_SEC = 60.seconds
included do
include ReactiveCaching
@ -15,6 +20,12 @@ module PrometheusAdapter
raise NotImplementedError
end
def prometheus_client_default_options
{
timeout: DEFAULT_PROMETHEUS_REQUEST_TIMEOUT_SEC
}
end
# This is a light-weight check if a prometheus client is properly configured.
def configured?
raise NotImplemented

View File

@ -97,13 +97,9 @@ class PrometheusService < MonitoringService
def prometheus_client
return unless should_return_client?
options = {
allow_local_requests: allow_local_api_url?,
# We should choose more conservative timeouts, but some queries we run are now busting our
# default timeouts, which are stricter. We should make those queries faster instead.
# See https://gitlab.com/gitlab-org/gitlab/-/issues/233109
timeout: 60
}
options = prometheus_client_default_options.merge(
allow_local_requests: allow_local_api_url?
)
if behind_iap?
# Adds the Authorization header

View File

@ -0,0 +1,5 @@
---
title: Reinstate 60s timeout in Cluster Prometheus
merge_request: 39595
author:
type: other

View File

@ -0,0 +1,5 @@
---
title: Removes extra spaces on MR/Epic tabs-containers on mobile
merge_request: 39549
author: Takuya Noguchi
type: fixed

View File

@ -0,0 +1,5 @@
---
title: Refactor ee/spec/support/shared_examples/requests/* and spec/support/shared_examples/requests/* to fix Rails/SaveBang Cop
merge_request: 40185
author: Rajendra Kadam
type: fixed

View File

@ -17,9 +17,8 @@ Omnibus GitLab package.
The following are the requirements for providing your own Redis instance:
- Redis version 5.0 or higher is recommended, as this is what ships with
Omnibus GitLab packages starting with GitLab 12.7.
- GitLab 13.0 and later requires Redis version 4.0 or higher.
- Find the minimum Redis version that is required in the
[requirements page](../../install/requirements.md).
- Standalone Redis or Redis high availability with Sentinel are supported. Redis
Cluster is not supported.
- Managed Redis from cloud providers such as AWS ElastiCache will work. If these

View File

@ -21,7 +21,7 @@ To request access to Chatops on GitLab.com:
1. Log into <https://ops.gitlab.net/users/sign_in> **using the same username** as for GitLab.com (you may have to rename it).
1. You could also use the "Sign in with" Google button to sign in, with your GitLab.com email address.
1. Ask in the [#production](https://gitlab.slack.com/messages/production) channel for an existing member to add you to the `chatops` project in Ops. They can do it by running `/chatops run member add <username> gitlab-com/chatops --ops` command in that channel.
1. Ask one of your team members to add you to the `chatops` project in Ops. They can do it by running `/chatops run member add <username> gitlab-com/chatops --ops` command in the `#chat-ops-test` Slack channel.
NOTE: **Note:**
If you had to change your username for GitLab.com on the first step, make sure [to reflect this information](https://gitlab.com/gitlab-com/www-gitlab-com#adding-yourself-to-the-team-page) on [the team page](https://about.gitlab.com/company/team/).

View File

@ -346,9 +346,9 @@ To avoid this error, use the applicable HTML entity code (`&lt;` or `&gt;`) inst
- In JavaScript:
```javascript
import sanitize from 'sanitize-html';
import { sanitize } from 'dompurify';
const i18n = { LESS_THAN_ONE_HOUR: sanitize(__('In &lt; 1 hours'), { allowedTags: [] }) };
const i18n = { LESS_THAN_ONE_HOUR: sanitize(__('In &lt; 1 hour'), { ALLOWED_TAGS: [] }) };
// ... using the string
element.innerHTML = i18n.LESS_THAN_ONE_HOUR;

View File

@ -401,10 +401,11 @@ Starting from GitLab 12.1, only PostgreSQL is supported. Since GitLab 13.0, we r
## 7. Redis
GitLab requires at least Redis 5.0.
NOTE: **Note:**
See the [requirements page](requirements.md#redis-versions) for the minimum
Redis requirements.
If you are using Debian 10 or Ubuntu 20.04 and up, you can install
Redis 5.0 with:
Install Redis with:
```shell
sudo apt-get install redis-server

View File

@ -74,9 +74,12 @@ a version older than `v10.13.0`, you need to update it to a newer version. You
can find instructions to install from community maintained packages or compile
from source at the [Node.js website](https://nodejs.org/en/download/).
## Redis versions
### Redis versions
GitLab requires Redis 5.0+. Beginning in GitLab 13.0, lower versions are not supported.
GitLab 13.0 and later requires Redis version 4.0 or higher.
Redis version 5.0 or higher is recommended, as this is what ships with
[Omnibus GitLab](https://docs.gitlab.com/omnibus/) packages starting with GitLab 12.7.
## Hardware requirements

View File

@ -3,7 +3,7 @@
require 'airborne'
module QA
RSpec.describe 'Manage with IP rate limits', :requires_admin do
RSpec.describe 'Manage with IP rate limits', :requires_admin, quarantine: { only: { subdomain: :staging }, issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/240936', type: :investigating } do
describe 'Users API' do
let(:api_client) { Runtime::API::Client.new(:gitlab, ip_limits: true) }
let(:request) { Runtime::API::Request.new(api_client, '/users') }

View File

@ -109,10 +109,13 @@ RSpec.describe Clusters::Applications::Prometheus do
expect(subject.prometheus_client).to be_instance_of(Gitlab::PrometheusClient)
end
it 'copies proxy_url, options and headers from kube client to prometheus_client' do
it 'merges proxy_url, options and headers from kube client with prometheus_client options' do
expect(Gitlab::PrometheusClient)
.to(receive(:new))
.with(a_valid_url, kube_client.rest_client.options.merge(headers: kube_client.headers))
.with(a_valid_url, kube_client.rest_client.options.merge({
headers: kube_client.headers,
timeout: PrometheusAdapter::DEFAULT_PROMETHEUS_REQUEST_TIMEOUT_SEC
}))
subject.prometheus_client
end

View File

@ -22,7 +22,7 @@ RSpec.shared_examples 'creating award emojis marks Todos as done' do
with_them do
let(:project) { awardable.project }
let(:awardable) { create(type) }
let(:awardable) { create(type) } # rubocop:disable Rails/SaveBang
let!(:todo) { create(:todo, target: awardable, project: project, user: user) }
specify do

View File

@ -169,7 +169,7 @@ RSpec.shared_examples 'group and project boards' do |route_definition, ee = fals
before do
if board_parent.try(:namespace)
board_parent.update(namespace: owner.namespace)
board_parent.update!(namespace: owner.namespace)
else
board.resource_parent.add_owner(owner)
end

View File

@ -1,8 +1,8 @@
# frozen_string_literal: true
RSpec.shared_examples 'custom attributes endpoints' do |attributable_name|
let!(:custom_attribute1) { attributable.custom_attributes.create key: 'foo', value: 'foo' }
let!(:custom_attribute2) { attributable.custom_attributes.create key: 'bar', value: 'bar' }
let!(:custom_attribute1) { attributable.custom_attributes.create! key: 'foo', value: 'foo' }
let!(:custom_attribute2) { attributable.custom_attributes.create! key: 'bar', value: 'bar' }
describe "GET /#{attributable_name} with custom attributes filter" do
before do

View File

@ -175,7 +175,7 @@ RSpec.shared_examples 'process nuget upload' do |user_type, status, add_member =
context 'with object storage enabled' do
let(:tmp_object) do
fog_connection.directories.new(key: 'packages').files.create(
fog_connection.directories.new(key: 'packages').files.create( # rubocop:disable Rails/SaveBang
key: "tmp/uploads/#{file_name}",
body: 'content'
)

View File

@ -58,7 +58,7 @@ RSpec.shared_examples 'PyPi package creation' do |user_type, status, add_member
context 'with object storage enabled' do
let(:tmp_object) do
fog_connection.directories.new(key: 'packages').files.create(
fog_connection.directories.new(key: 'packages').files.create( # rubocop:disable Rails/SaveBang
key: "tmp/uploads/#{file_name}",
body: 'content'
)