Commit aabf412b authored by GitLab Bot's avatar GitLab Bot

Add latest changes from gitlab-org/gitlab@master

parent 1cfd8874
...@@ -218,6 +218,12 @@ ActiveRecordAssociationReload: ...@@ -218,6 +218,12 @@ ActiveRecordAssociationReload:
- 'spec/**/*' - 'spec/**/*'
- 'ee/spec/**/*' - 'ee/spec/**/*'
Naming/PredicateName:
Enabled: true
Exclude:
- 'spec/**/*'
- 'ee/spec/**/*'
RSpec/FactoriesInMigrationSpecs: RSpec/FactoriesInMigrationSpecs:
Enabled: true Enabled: true
Include: Include:
......
...@@ -73,10 +73,6 @@ ...@@ -73,10 +73,6 @@
summary { summary {
margin-bottom: $gl-padding; margin-bottom: $gl-padding;
} }
*:first-child:not(summary) {
margin-top: $gl-padding;
}
} }
// Single code lines should wrap // Single code lines should wrap
......
...@@ -20,7 +20,6 @@ module NavHelper ...@@ -20,7 +20,6 @@ module NavHelper
def page_gutter_class def page_gutter_class
if page_has_markdown? if page_has_markdown?
if cookies[:collapsed_gutter] == 'true' if cookies[:collapsed_gutter] == 'true'
%w[page-gutter right-sidebar-collapsed] %w[page-gutter right-sidebar-collapsed]
else else
......
...@@ -23,11 +23,12 @@ module Clusters ...@@ -23,11 +23,12 @@ module Clusters
key: Settings.attr_encrypted_db_key_base_truncated, key: Settings.attr_encrypted_db_key_base_truncated,
algorithm: 'aes-256-cbc' algorithm: 'aes-256-cbc'
before_validation :nullify_blank_namespace
before_validation :enforce_namespace_to_lower_case before_validation :enforce_namespace_to_lower_case
before_validation :enforce_ca_whitespace_trimming before_validation :enforce_ca_whitespace_trimming
validates :namespace, validates :namespace,
allow_blank: true, allow_nil: true,
length: 1..63, length: 1..63,
format: { format: {
with: Gitlab::Regex.kubernetes_namespace_regex, with: Gitlab::Regex.kubernetes_namespace_regex,
...@@ -190,6 +191,10 @@ module Clusters ...@@ -190,6 +191,10 @@ module Clusters
true true
end end
def nullify_blank_namespace
self.namespace = nil if namespace.blank?
end
end end
end end
end end
......
...@@ -137,10 +137,9 @@ class JiraService < IssueTrackerService ...@@ -137,10 +137,9 @@ class JiraService < IssueTrackerService
return if issue.nil? || has_resolution?(issue) || !jira_issue_transition_id.present? return if issue.nil? || has_resolution?(issue) || !jira_issue_transition_id.present?
commit_id = if entity.is_a?(Commit) commit_id = case entity
entity.id when Commit then entity.id
elsif entity.is_a?(MergeRequest) when MergeRequest then entity.diff_head_sha
entity.diff_head_sha
end end
commit_url = build_entity_url(:commit, commit_id) commit_url = build_entity_url(:commit, commit_id)
...@@ -331,7 +330,6 @@ class JiraService < IssueTrackerService ...@@ -331,7 +330,6 @@ class JiraService < IssueTrackerService
# Handle errors when doing Jira API calls # Handle errors when doing Jira API calls
def jira_request def jira_request
yield yield
rescue Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, Errno::ECONNREFUSED, URI::InvalidURIError, JIRA::HTTPError, OpenSSL::SSL::SSLError => e rescue Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, Errno::ECONNREFUSED, URI::InvalidURIError, JIRA::HTTPError, OpenSSL::SSL::SSLError => e
@error = e.message @error = e.message
log_error("Error sending message", client_url: client_url, error: @error) log_error("Error sending message", client_url: client_url, error: @error)
......
...@@ -18,7 +18,7 @@ module Issues ...@@ -18,7 +18,7 @@ module Issues
# The code calling this method is responsible for ensuring that a user is # The code calling this method is responsible for ensuring that a user is
# allowed to close the given issue. # allowed to close the given issue.
def close_issue(issue, closed_via: nil, notifications: true, system_note: true) def close_issue(issue, closed_via: nil, notifications: true, system_note: true)
if project.jira_tracker? && project.jira_service.active && issue.is_a?(ExternalIssue) if project.jira_tracker_active? && issue.is_a?(ExternalIssue)
project.jira_service.close_issue(closed_via, issue) project.jira_service.close_issue(closed_via, issue)
todo_service.close_issue(issue, current_user) todo_service.close_issue(issue, current_user)
return issue return issue
......
---
title: Nullify platform Kubernetes namespace if blank
merge_request: 17657
author:
type: fixed
---
title: Fix css selector for details in issue description
merge_request: 17557
author:
type: fixed
---
title: Add columns for per project/group max pages/artifacts sizes
merge_request: 17231
author:
type: added
# frozen_string_literal: true
class AddProjectsMaxPagesSize < ActiveRecord::Migration[5.2]
DOWNTIME = false
def change
add_column :projects, :max_pages_size, :integer
end
end
# frozen_string_literal: true
class AddNamespacesMaxPagesSize < ActiveRecord::Migration[5.2]
DOWNTIME = false
def change
add_column :namespaces, :max_pages_size, :integer
end
end
# frozen_string_literal: true
class AddProjectsMaxArtifactsSize < ActiveRecord::Migration[5.2]
DOWNTIME = false
def change
add_column :projects, :max_artifacts_size, :integer
end
end
# frozen_string_literal: true
class AddNamespacesMaxArtifactsSize < ActiveRecord::Migration[5.2]
DOWNTIME = false
def change
add_column :namespaces, :max_artifacts_size, :integer
end
end
...@@ -2317,6 +2317,8 @@ ActiveRecord::Schema.define(version: 2019_09_19_162036) do ...@@ -2317,6 +2317,8 @@ ActiveRecord::Schema.define(version: 2019_09_19_162036) do
t.integer "last_ci_minutes_usage_notification_level" t.integer "last_ci_minutes_usage_notification_level"
t.integer "subgroup_creation_level", default: 1 t.integer "subgroup_creation_level", default: 1
t.boolean "emails_disabled" t.boolean "emails_disabled"
t.integer "max_pages_size"
t.integer "max_artifacts_size"
t.index ["created_at"], name: "index_namespaces_on_created_at" t.index ["created_at"], name: "index_namespaces_on_created_at"
t.index ["custom_project_templates_group_id", "type"], name: "index_namespaces_on_custom_project_templates_group_id_and_type", where: "(custom_project_templates_group_id IS NOT NULL)" t.index ["custom_project_templates_group_id", "type"], name: "index_namespaces_on_custom_project_templates_group_id_and_type", where: "(custom_project_templates_group_id IS NOT NULL)"
t.index ["file_template_project_id"], name: "index_namespaces_on_file_template_project_id" t.index ["file_template_project_id"], name: "index_namespaces_on_file_template_project_id"
...@@ -2909,6 +2911,8 @@ ActiveRecord::Schema.define(version: 2019_09_19_162036) do ...@@ -2909,6 +2911,8 @@ ActiveRecord::Schema.define(version: 2019_09_19_162036) do
t.boolean "merge_requests_disable_committers_approval" t.boolean "merge_requests_disable_committers_approval"
t.boolean "require_password_to_approve" t.boolean "require_password_to_approve"
t.boolean "emails_disabled" t.boolean "emails_disabled"
t.integer "max_pages_size"
t.integer "max_artifacts_size"
t.index ["archived", "pending_delete", "merge_requests_require_code_owner_approval"], name: "projects_requiring_code_owner_approval", where: "((pending_delete = false) AND (archived = false) AND (merge_requests_require_code_owner_approval = true))" t.index ["archived", "pending_delete", "merge_requests_require_code_owner_approval"], name: "projects_requiring_code_owner_approval", where: "((pending_delete = false) AND (archived = false) AND (merge_requests_require_code_owner_approval = true))"
t.index ["created_at"], name: "index_projects_on_created_at" t.index ["created_at"], name: "index_projects_on_created_at"
t.index ["creator_id"], name: "index_projects_on_creator_id" t.index ["creator_id"], name: "index_projects_on_creator_id"
......
...@@ -155,6 +155,7 @@ module API ...@@ -155,6 +155,7 @@ module API
def self.services def self.services
{ {
'alerts' => [],
'asana' => [ 'asana' => [
{ {
required: true, required: true,
...@@ -696,6 +697,7 @@ module API ...@@ -696,6 +697,7 @@ module API
def self.service_classes def self.service_classes
[ [
::AlertsService,
::AsanaService, ::AsanaService,
::AssemblaService, ::AssemblaService,
::BambooService, ::BambooService,
......
...@@ -143,6 +143,8 @@ excluded_attributes: ...@@ -143,6 +143,8 @@ excluded_attributes:
- :mirror_last_update_at - :mirror_last_update_at
- :mirror_last_successful_update_at - :mirror_last_successful_update_at
- :emails_disabled - :emails_disabled
- :max_pages_size
- :max_artifacts_size
namespaces: namespaces:
- :runners_token - :runners_token
- :runners_token_encrypted - :runners_token_encrypted
......
...@@ -4,7 +4,7 @@ module Gitlab ...@@ -4,7 +4,7 @@ module Gitlab
module Jira module Jira
# Gitlab JIRA HTTP client to be used with jira-ruby gem, this subclasses JIRA::HTTPClient. # Gitlab JIRA HTTP client to be used with jira-ruby gem, this subclasses JIRA::HTTPClient.
# Uses Gitlab::HTTP to make requests to JIRA REST API. # Uses Gitlab::HTTP to make requests to JIRA REST API.
# The parent class implementation can be found at: https://github.com/sumoheavy/jira-ruby/blob/v1.4.0/lib/jira/http_client.rb # The parent class implementation can be found at: https://github.com/sumoheavy/jira-ruby/blob/v1.7.0/lib/jira/http_client.rb
class HttpClient < JIRA::HttpClient class HttpClient < JIRA::HttpClient
extend ::Gitlab::Utils::Override extend ::Gitlab::Utils::Override
...@@ -24,7 +24,7 @@ module Gitlab ...@@ -24,7 +24,7 @@ module Gitlab
password: @options.delete(:password) password: @options.delete(:password)
}.to_json }.to_json
make_request(:post, @options[:context_path] + '/rest/auth/1/session', body, { 'Content-Type' => 'application/json' }) make_request(:post, @options[:context_path] + '/rest/auth/1/session', body, 'Content-Type' => 'application/json')
end end
override :make_request override :make_request
......
...@@ -1234,6 +1234,9 @@ msgstr "" ...@@ -1234,6 +1234,9 @@ msgstr ""
msgid "Alerts" msgid "Alerts"
msgstr "" msgstr ""
msgid "Alerts endpoint"
msgstr ""
msgid "All" msgid "All"
msgstr "" msgstr ""
...@@ -12760,6 +12763,9 @@ msgstr "" ...@@ -12760,6 +12763,9 @@ msgstr ""
msgid "Receive alerts from manually configured Prometheus servers." msgid "Receive alerts from manually configured Prometheus servers."
msgstr "" msgstr ""
msgid "Receive alerts on GitLab from any source"
msgstr ""
msgid "Receive notifications about your own activity" msgid "Receive notifications about your own activity"
msgstr "" msgstr ""
......
...@@ -411,6 +411,7 @@ project: ...@@ -411,6 +411,7 @@ project:
- project_aliases - project_aliases
- external_pull_requests - external_pull_requests
- pages_metadatum - pages_metadatum
- alerts_service
award_emoji: award_emoji:
- awardable - awardable
- user - user
......
...@@ -19,14 +19,23 @@ describe Clusters::Platforms::Kubernetes do ...@@ -19,14 +19,23 @@ describe Clusters::Platforms::Kubernetes do
it_behaves_like 'having unique enum values' it_behaves_like 'having unique enum values'
describe 'before_validation' do describe 'before_validation' do
let(:kubernetes) { create(:cluster_platform_kubernetes, :configured, namespace: namespace) }
context 'when namespace includes upper case' do context 'when namespace includes upper case' do
let(:kubernetes) { create(:cluster_platform_kubernetes, :configured, namespace: namespace) }
let(:namespace) { 'ABC' } let(:namespace) { 'ABC' }
it 'converts to lower case' do it 'converts to lower case' do
expect(kubernetes.namespace).to eq('abc') expect(kubernetes.namespace).to eq('abc')
end end
end end
context 'when namespace is blank' do
let(:namespace) { '' }
it 'nullifies the namespace' do
expect(kubernetes.namespace).to be_nil
end
end
end end
describe 'validation' do describe 'validation' do
...@@ -35,8 +44,8 @@ describe Clusters::Platforms::Kubernetes do ...@@ -35,8 +44,8 @@ describe Clusters::Platforms::Kubernetes do
context 'when validates namespace' do context 'when validates namespace' do
let(:kubernetes) { build(:cluster_platform_kubernetes, :configured, namespace: namespace) } let(:kubernetes) { build(:cluster_platform_kubernetes, :configured, namespace: namespace) }
context 'when namespace is blank' do context 'when namespace is nil' do
let(:namespace) { '' } let(:namespace) { nil }
it { is_expected.to be_truthy } it { is_expected.to be_truthy }
end end
......
...@@ -28,12 +28,17 @@ Service.available_services_names.each do |service| ...@@ -28,12 +28,17 @@ Service.available_services_names.each do |service|
end end
end end
let(:licensed_features) do
{
'github' => :github_project_service_integration,
'jenkins' => :jenkins_integration,
'jenkins_deprecated' => :jenkins_integration,
'alerts' => :incident_management
}
end
before do before do
if service == 'github' && respond_to?(:stub_licensed_features) enable_license_for_service(service)
stub_licensed_features(github_project_service_integration: true)
project.clear_memoization(:disabled_services)
project.clear_memoization(:licensed_feature_available)
end
end end
def initialize_service(service) def initialize_service(service)
...@@ -42,5 +47,18 @@ Service.available_services_names.each do |service| ...@@ -42,5 +47,18 @@ Service.available_services_names.each do |service|
service_item.save! service_item.save!
service_item service_item
end end
private
def enable_license_for_service(service)
return unless respond_to?(:stub_licensed_features)
licensed_feature = licensed_features[service]
return unless licensed_feature
stub_licensed_features(licensed_feature => true)
project.clear_memoization(:disabled_services)
project.clear_memoization(:licensed_feature_available)
end
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment