Commit fe8c2962 authored by GitLab Bot's avatar GitLab Bot

Automatic merge of gitlab-org/gitlab master

parents 6ba5573a 5781efdb
......@@ -223,33 +223,41 @@ Dangerfile @gl-quality/eng-prod
/ee/lib/gitlab/ci/reports/security/ @gitlab-org/secure/composition-analysis-be @gitlab-org/secure/dynamic-analysis-be @gitlab-org/secure/static-analysis-be @gitlab-org/secure/fuzzing-be
[Container Security]
/ee/app/views/projects/threat_monitoring/** @gitlab-org/threat-management/defend/container-security/frontend
/ee/app/assets/javascripts/pages/projects/threat_monitoring/** @gitlab-org/threat-management/defend/container-security/frontend
/ee/app/assets/javascripts/threat_monitoring/** @gitlab-org/threat-management/defend/container-security/frontend
/ee/spec/frontend/threat_monitoring/** @gitlab-org/threat-management/defend/container-security/frontend
/ee/app/views/projects/threat_monitoring/** @gitlab-org/protect/container-security-frontend
/ee/app/views/projects/security/policies/** @gitlab-org/protect/container-security-frontend
/ee/spec/views/projects/security/policies/** @gitlab-org/protect/container-security-frontend
/ee/app/assets/javascripts/pages/projects/threat_monitoring/** @gitlab-org/protect/container-security-frontend
/ee/app/assets/javascripts/threat_monitoring/** @gitlab-org/protect/container-security-frontend
/ee/spec/frontend/threat_monitoring/** @gitlab-org/protect/container-security-frontend
/ee/app/controllers/projects/threat_monitoring_controller.rb @gitlab-org/threat-management/defend/container-security/backend
/ee/spec/controllers/projects/threat_monitoring_controller_spec.rb @gitlab-org/threat-management/defend/container-security/backend
/lib/gitlab/kubernetes/cilium_network_policy.rb @gitlab-org/threat-management/defend/container-security/backend
/spec/lib/gitlab/kubernetes/cilium_network_policy_spec.rb @gitlab-org/threat-management/defend/container-security/backend
/lib/gitlab/kubernetes/network_policy_common.rb @gitlab-org/threat-management/defend/container-security/backend
/spec/support/shared_examples/lib/gitlab/kubernetes/network_policy_common_shared_examples.rb @gitlab-org/threat-management/defend/container-security/backend
/lib/gitlab/kubernetes/network_policy.rb @gitlab-org/threat-management/defend/container-security/backend
/spec/lib/gitlab/kubernetes/network_policy_spec.rb @gitlab-org/threat-management/defend/container-security/backend
/ee/app/services/network_policies/** @gitlab-org/threat-management/defend/container-security/backend
/ee/spec/services/network_policies/** @gitlab-org/threat-management/defend/container-security/backend
/ee/app/controllers/projects/security/waf_anomalies_controller.rb @gitlab-org/threat-management/defend/container-security/backend
/ee/spec/controllers/projects/security/waf_anomalies_controller_spec.rb @gitlab-org/threat-management/defend/container-security/backend
/app/models/clusters/applications/cilium.rb @gitlab-org/threat-management/defend/container-security/backend
/spec/models/clusters/applications/cilium_spec.rb @gitlab-org/threat-management/defend/container-security/backend
/ee/app/controllers/projects/security/network_policies_controller.rb @gitlab-org/threat-management/defend/container-security/backend
/ee/spec/controllers/projects/security/network_policies_controller_spec.rb @gitlab-org/threat-management/defend/container-security/backend
/ee/app/workers/network_policy_metrics_worker.rb @gitlab-org/threat-management/defend/container-security/backend
/ee/spec/workers/network_policy_metrics_worker_spec.rb @gitlab-org/threat-management/defend/container-security/backend
/ee/app/services/network_policies/** @gitlab-org/threat-management/defend/container-security/backend
/ee/spec/services/network_policies/** @gitlab-org/threat-management/defend/container-security/backend
/ee/lib/gitlab/usage_data_counters/network_policy_counter.rb @gitlab-org/threat-management/defend/container-security/backend
/ee/spec/lib/gitlab/usage_data_counters/network_policy_counter_spec.rb @gitlab-org/threat-management/defend/container-security/backend
/ee/app/controllers/projects/threat_monitoring_controller.rb @gitlab-org/protect/container-security-backend
/ee/spec/controllers/projects/threat_monitoring_controller_spec.rb @gitlab-org/protect/container-security-backend
/ee/app/controllers/projects/security/policies_controller.rb @gitlab-org/protect/container-security-backend
/ee/spec/requests/projects/security/policies_controller_spec.rb @gitlab-org/protect/container-security-backend
/ee/app/models/security/orchestration_policy_configuration.rb @gitlab-org/protect/container-security-backend
/ee/spec/models/security/orchestration_policy_configuration_spec.rb @gitlab-org/protect/container-security-backend
/lib/gitlab/kubernetes/cilium_network_policy.rb @gitlab-org/protect/container-security-backend
/spec/lib/gitlab/kubernetes/cilium_network_policy_spec.rb @gitlab-org/protect/container-security-backend
/lib/gitlab/kubernetes/network_policy_common.rb @gitlab-org/protect/container-security-backend
/spec/support/shared_examples/lib/gitlab/kubernetes/network_policy_common_shared_examples.rb @gitlab-org/protect/container-security-backend
/lib/gitlab/kubernetes/network_policy.rb @gitlab-org/protect/container-security-backend
/spec/lib/gitlab/kubernetes/network_policy_spec.rb @gitlab-org/protect/container-security-backend
/ee/app/services/network_policies/** @gitlab-org/protect/container-security-backend
/ee/spec/services/network_policies/** @gitlab-org/protect/container-security-backend
/ee/app/controllers/projects/security/waf_anomalies_controller.rb @gitlab-org/protect/container-security-backend
/ee/spec/controllers/projects/security/waf_anomalies_controller_spec.rb @gitlab-org/protect/container-security-backend
/app/models/clusters/applications/cilium.rb @gitlab-org/protect/container-security-backend
/spec/models/clusters/applications/cilium_spec.rb @gitlab-org/protect/container-security-backend
/ee/app/controllers/projects/security/network_policies_controller.rb @gitlab-org/protect/container-security-backend
/ee/spec/controllers/projects/security/network_policies_controller_spec.rb @gitlab-org/protect/container-security-backend
/ee/app/workers/network_policy_metrics_worker.rb @gitlab-org/protect/container-security-backend
/ee/spec/workers/network_policy_metrics_worker_spec.rb @gitlab-org/protect/container-security-backend
/ee/app/services/network_policies/** @gitlab-org/protect/container-security-backend
/ee/spec/services/network_policies/** @gitlab-org/protect/container-security-backend
/ee/app/services/security/orchestration/** @gitlab-org/protect/container-security-backend
/ee/spec/services/security/orchestration/** @gitlab-org/protect/container-security-backend
/ee/lib/gitlab/usage_data_counters/network_policy_counter.rb @gitlab-org/protect/container-security-backend
/ee/spec/lib/gitlab/usage_data_counters/network_policy_counter_spec.rb @gitlab-org/protect/container-security-backend
[Code Owners]
/ee/lib/gitlab/code_owners.rb @reprazent @kerrizor @garyh
......
......@@ -398,23 +398,6 @@ RSpec/EmptyLineAfterFinalLetItBe:
- ee/spec/features/markdown/metrics_spec.rb
- ee/spec/features/registrations/group_invites_during_signup_flow_spec.rb
- ee/spec/features/subscriptions_spec.rb
- ee/spec/graphql/ee/mutations/concerns/mutations/resolves_issuable_spec.rb
- ee/spec/graphql/mutations/boards/update_epic_user_preferences_spec.rb
- ee/spec/graphql/mutations/clusters/agent_tokens/create_spec.rb
- ee/spec/graphql/mutations/compliance_management/frameworks/create_spec.rb
- ee/spec/graphql/mutations/compliance_management/frameworks/destroy_spec.rb
- ee/spec/graphql/mutations/compliance_management/frameworks/update_spec.rb
- ee/spec/graphql/mutations/dast_scanner_profiles/delete_spec.rb
- ee/spec/graphql/mutations/epics/add_issue_spec.rb
- ee/spec/graphql/mutations/gitlab_subscriptions/activate_spec.rb
- ee/spec/graphql/mutations/incident_management/oncall_rotation/create_spec.rb
- ee/spec/graphql/mutations/incident_management/oncall_rotation/destroy_spec.rb
- ee/spec/graphql/mutations/incident_management/oncall_schedule/create_spec.rb
- ee/spec/graphql/mutations/incident_management/oncall_schedule/destroy_spec.rb
- ee/spec/graphql/mutations/incident_management/oncall_schedule/update_spec.rb
- ee/spec/graphql/mutations/issues/set_epic_spec.rb
- ee/spec/graphql/mutations/requirements_management/export_requirements_spec.rb
- ee/spec/graphql/mutations/vulnerabilities/create_external_issue_link_spec.rb
- ee/spec/graphql/types/issue_type_spec.rb
- ee/spec/helpers/ee/graph_helper_spec.rb
- ee/spec/helpers/ee/issues_helper_spec.rb
......
......@@ -859,20 +859,6 @@ Style/RedundantFetchBlock:
Style/RedundantInterpolation:
Enabled: false
# Offense count: 10
# Cop supports --auto-correct.
Style/RedundantRegexpCharacterClass:
Exclude:
- 'app/models/concerns/taskable.rb'
- 'ee/app/models/saml_provider.rb'
- 'lib/banzai/filter/markdown_pre_escape_filter.rb'
- 'lib/gitlab/authorized_keys.rb'
- 'lib/gitlab/fogbugz_import/repository.rb'
- 'lib/gitlab/quick_actions/substitution_definition.rb'
- 'lib/gitlab/regex.rb'
- 'spec/features/merge_request/user_views_open_merge_request_spec.rb'
- 'spec/tasks/gitlab/usage_data_rake_spec.rb'
# Offense count: 279
# Cop supports --auto-correct.
Style/RedundantRegexpEscape:
......
......@@ -12,7 +12,7 @@ module Taskable
COMPLETED = 'completed'
INCOMPLETE = 'incomplete'
COMPLETE_PATTERN = /(\[[xX]\])/.freeze
INCOMPLETE_PATTERN = /(\[[\s]\])/.freeze
INCOMPLETE_PATTERN = /(\[\s\])/.freeze
ITEM_PATTERN = %r{
^
(?:(?:>\s{0,4})*) # optional blockquote characters
......
---
title: Explicitly destroy webhooks and logs before the project deletion
merge_request: 60122
author:
type: fixed
---
title: Update GitLab Shell to v13.18.0
merge_request: 60288
author:
type: other
---
title: Resolve RuboCop offenses for Style/RedundantRegexpCharacterClass
merge_request: 57914
author: Shubham Kumar @imskr
type: fixed
......@@ -5,4 +5,4 @@ rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/328393
milestone: '13.12'
type: development
group: group::source code
default_enabled: false
default_enabled: true
......@@ -109,6 +109,6 @@ class SamlProvider < ApplicationRecord
end
def strip_left_to_right_chars(input)
input&.gsub(/[\u200E]/, '')
input&.gsub(/\u200E/, '')
end
end
---
title: Fix RSpec/EmptyLineAfterFinalLetItBe rubocop offenses in ee/spec/graphsql/mutations
merge_request: 58390
author: Abdul Wadood @abdulwd
type: fixed
......@@ -13,6 +13,7 @@ RSpec.describe Mutations::ResolvesIssuable do
let_it_be(:user) { create(:user) }
let_it_be(:context) { { current_user: user } }
let_it_be(:epic) { create(:epic, group: group) }
let(:mutation) { mutation_class.new(object: nil, context: context, field: nil) }
context 'with epics' do
......
......@@ -8,6 +8,7 @@ RSpec.describe Mutations::Boards::UpdateEpicUserPreferences do
let_it_be(:user) { create(:user) }
let_it_be(:board) { create(:board, project: project) }
let_it_be(:epic) { create(:epic, group: group) }
let(:context) { { current_user: user } }
subject(:mutation) { described_class.new(object: nil, context: context, field: nil).resolve(**mutation_params) }
......
......@@ -7,6 +7,7 @@ RSpec.describe Mutations::Clusters::AgentTokens::Create do
let_it_be(:cluster_agent) { create(:cluster_agent) }
let_it_be(:user) { create(:user) }
let(:context) do
GraphQL::Query::Context.new(
query: OpenStruct.new(schema: nil),
......
......@@ -5,6 +5,7 @@ require 'spec_helper'
RSpec.describe Mutations::ComplianceManagement::Frameworks::Create do
let_it_be(:current_user) { create(:user) }
let_it_be(:namespace) { create(:namespace) }
let(:params) { valid_params }
let(:mutation) { described_class.new(object: nil, context: { current_user: current_user }, field: nil) }
......
......@@ -6,6 +6,7 @@ RSpec.describe Mutations::ComplianceManagement::Frameworks::Destroy do
include GraphqlHelpers
let_it_be(:framework) { create(:compliance_framework) }
let(:user) { framework.namespace.owner }
let(:mutation) { described_class.new(object: nil, context: { current_user: user }, field: nil) }
......
......@@ -6,6 +6,7 @@ RSpec.describe Mutations::ComplianceManagement::Frameworks::Update do
include GraphqlHelpers
let_it_be(:framework) { create(:compliance_framework) }
let(:user) { framework.namespace.owner }
let(:mutation) { described_class.new(object: nil, context: { current_user: user }, field: nil) }
let(:params) do
......
......@@ -7,6 +7,7 @@ RSpec.describe Mutations::DastScannerProfiles::Delete do
let_it_be(:user) { create(:user) }
let_it_be(:full_path) { project.full_path }
let_it_be(:dast_scanner_profile) { create(:dast_scanner_profile, project: project) }
let(:dast_scanner_profile_id) { dast_scanner_profile.to_global_id }
subject(:mutation) { described_class.new(object: nil, context: { current_user: user }, field: nil) }
......
......@@ -6,6 +6,7 @@ RSpec.describe Mutations::Epics::AddIssue do
let_it_be(:group) { create(:group) }
let_it_be(:project) { create(:project, namespace: group) }
let_it_be(:epic) { create(:epic, group: group) }
let(:user) { issue.author }
let(:issue) { create(:issue, project: project) }
......
......@@ -9,6 +9,7 @@ RSpec.describe Mutations::GitlabSubscriptions::Activate do
let_it_be(:user) { create(:admin) }
let_it_be(:created_license) { License.last }
let(:activation_code) { 'activation_code' }
let(:result) { { success: true, license: created_license } }
......
......@@ -6,6 +6,7 @@ RSpec.describe Mutations::IncidentManagement::OncallRotation::Create do
let_it_be(:current_user) { create(:user) }
let_it_be(:project) { create(:project) }
let_it_be(:schedule) { create(:incident_management_oncall_schedule, project: project) }
let(:args) do
{
project_path: project.full_path,
......
......@@ -7,6 +7,7 @@ RSpec.describe Mutations::IncidentManagement::OncallRotation::Destroy do
let_it_be_with_refind(:project) { create(:project) }
let_it_be(:schedule) { create(:incident_management_oncall_schedule, project: project) }
let_it_be(:rotation) { create(:incident_management_oncall_rotation, schedule: schedule) }
let(:args) do
{
project_path: project.full_path,
......
......@@ -5,6 +5,7 @@ require 'spec_helper'
RSpec.describe Mutations::IncidentManagement::OncallSchedule::Create do
let_it_be(:current_user) { create(:user) }
let_it_be(:project) { create(:project) }
let(:args) do
{
project_path: project.full_path,
......
......@@ -5,6 +5,7 @@ require 'spec_helper'
RSpec.describe Mutations::IncidentManagement::OncallSchedule::Destroy do
let_it_be(:current_user) { create(:user) }
let_it_be(:project) { create(:project) }
let(:oncall_schedule) { create(:incident_management_oncall_schedule, project: project) }
let(:args) { { project_path: project.full_path, iid: oncall_schedule.iid.to_s } }
......
......@@ -6,6 +6,7 @@ RSpec.describe Mutations::IncidentManagement::OncallSchedule::Update do
let_it_be(:current_user) { create(:user) }
let_it_be(:project) { create(:project) }
let_it_be(:oncall_schedule) { create(:incident_management_oncall_schedule, project: project) }
let(:args) do
{
project_path: project.full_path,
......
......@@ -12,6 +12,7 @@ RSpec.describe Mutations::Issues::SetEpic do
describe '#resolve' do
let_it_be_with_reload(:epic) { create(:epic, group: group) }
let(:mutated_issue) { subject[:issue] }
subject { mutation.resolve(project_path: issue.project.full_path, iid: issue.iid, epic: epic) }
......
......@@ -5,6 +5,7 @@ require 'spec_helper'
RSpec.describe Mutations::RequirementsManagement::ExportRequirements do
let_it_be(:project) { create(:project) }
let_it_be(:user) { create(:user) }
let(:fields) { [] }
let(:args) do
{
......
......@@ -44,6 +44,7 @@ RSpec.describe Mutations::Vulnerabilities::CreateExternalIssueLink do
context 'when issue creation succeeds' do
let_it_be(:external_issue_link) { build(:vulnerabilities_external_issue_link) }
let(:result) { double(success?: true, payload: { record: external_issue_link }, errors: []) }
it 'returns empty external issue link' do
......
......@@ -26,7 +26,7 @@ module Banzai
class MarkdownPreEscapeFilter < HTML::Pipeline::TextFilter
# We just need to target those that are special GitLab references
REFERENCE_CHARACTERS = '@#!$&~%^'
ASCII_PUNCTUATION = %r{([\\][#{REFERENCE_CHARACTERS}])}.freeze
ASCII_PUNCTUATION = %r{(\\[#{REFERENCE_CHARACTERS}])}.freeze
LITERAL_KEYWORD = 'cmliteral'
def call
......
......@@ -161,7 +161,7 @@ module Gitlab
end
def strip(key)
key.split(/[ ]+/)[0, 2].join(' ')
key.split(/ +/)[0, 2].join(' ')
end
end
end
......@@ -64,6 +64,10 @@ module Gitlab
write_attribute(:batch_class_name, class_name.demodulize)
end
def migrated_tuple_count
batched_jobs.succeeded.sum(:batch_size)
end
def prometheus_labels
@prometheus_labels ||= {
migration_id: id,
......
......@@ -65,6 +65,7 @@ module Gitlab
metric_for(:gauge_interval).set(base_labels, tracking_record.batched_migration.interval)
metric_for(:gauge_job_duration).set(base_labels, (tracking_record.finished_at - tracking_record.started_at).to_i)
metric_for(:counter_updated_tuples).increment(base_labels, tracking_record.batch_size)
metric_for(:gauge_migrated_tuples).set(base_labels, tracking_record.batched_migration.migrated_tuple_count)
metric_for(:gauge_total_tuple_count).set(base_labels, tracking_record.batched_migration.total_tuple_count)
if metrics = tracking_record.metrics
......@@ -106,6 +107,10 @@ module Gitlab
:batched_migration_job_updated_tuples_total,
'Number of tuples updated by batched migration job'
),
gauge_migrated_tuples: Gitlab::Metrics.gauge(
:batched_migration_migrated_tuples_total,
'Total number of tuples migrated by a batched migration'
),
histogram_timings: Gitlab::Metrics.histogram(
:batched_migration_job_query_duration_seconds,
'Query timings for a batched migration job',
......
......@@ -26,7 +26,7 @@ module Gitlab
end
def path
safe_name.gsub(/[\s]/, '_')
safe_name.gsub(/\s/, '_')
end
end
end
......
......@@ -13,7 +13,7 @@ module Gitlab
return unless content
all_names.each do |a_name|
content = content.sub(%r{/#{a_name}(?![\S]) ?(.*)$}i, execute_block(action_block, context, '\1'))
content = content.sub(%r{/#{a_name}(?!\S) ?(.*)$}i, execute_block(action_block, context, '\1'))
end
content
......
......@@ -237,7 +237,7 @@ module Gitlab
# used as a routing constraint.
#
def container_registry_tag_regex
@container_registry_tag_regex ||= /[\w][\w.-]{0,127}/
@container_registry_tag_regex ||= /\w[\w.-]{0,127}/
end
def environment_name_regex_chars
......
......@@ -76,7 +76,7 @@ RSpec.describe 'User views an open merge request' do
it 'does not show diverged commits count' do
page.within('.mr-source-target') do
expect(page).not_to have_content(/([0-9]+ commit[s]? behind)/)
expect(page).not_to have_content(/([0-9]+ commits? behind)/)
end
end
end
......
......@@ -204,6 +204,22 @@ RSpec.describe Gitlab::Database::BackgroundMigration::BatchedMigration, type: :m
it_behaves_like 'an attr_writer that demodulizes assigned class names', :batch_class_name
end
describe '#migrated_tuple_count' do
subject { batched_migration.migrated_tuple_count }
let(:batched_migration) { create(:batched_background_migration) }
before do
create_list(:batched_background_migration_job, 5, status: :succeeded, batch_size: 1_000, batched_migration: batched_migration)
create_list(:batched_background_migration_job, 1, status: :running, batch_size: 1_000, batched_migration: batched_migration)
create_list(:batched_background_migration_job, 1, status: :failed, batch_size: 1_000, batched_migration: batched_migration)
end
it 'sums the batch_size of succeeded jobs' do
expect(subject).to eq(5_000)
end
end
describe '#prometheus_labels' do
let(:batched_migration) { create(:batched_background_migration, job_class_name: 'TestMigration', table_name: 'foo', column_name: 'bar') }
......
......@@ -80,6 +80,14 @@ RSpec.describe Gitlab::Database::BackgroundMigration::BatchedMigrationWrapper, '
subject
end
it 'reports migrated tuples' do
count = double
expect(job_record.batched_migration).to receive(:migrated_tuple_count).and_return(count)
expect(described_class.metrics[:gauge_migrated_tuples]).to receive(:set).with(labels, count)
subject
end
it 'reports summary of query timings' do
metrics = { 'timings' => { 'update_all' => [1, 2, 3, 4, 5] } }
......
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