Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2023-10-05 03:08:14 +00:00
parent f11cce04ca
commit fdb5a6d73c
62 changed files with 417 additions and 560 deletions

View File

@ -990,8 +990,6 @@ Gitlab/NamespacedClass:
- 'ee/app/serializers/file_lock_entity.rb'
- 'ee/app/serializers/geo_node_serializer.rb'
- 'ee/app/serializers/geo_node_status_serializer.rb'
- 'ee/app/serializers/geo_project_registry_entity.rb'
- 'ee/app/serializers/geo_project_registry_serializer.rb'
- 'ee/app/serializers/group_analytics_serializer.rb'
- 'ee/app/serializers/group_vulnerability_autocomplete_entity.rb'
- 'ee/app/serializers/group_vulnerability_autocomplete_serializer.rb'

View File

@ -114,7 +114,6 @@ Gitlab/StrongMemoizeAttr:
- 'app/models/event_collection.rb'
- 'app/models/group.rb'
- 'app/models/incident_management/project_incident_management_setting.rb'
- 'app/models/integrations/jira.rb'
- 'app/models/internal_id.rb'
- 'app/models/member.rb'
- 'app/models/merge_request.rb'
@ -305,7 +304,6 @@ Gitlab/StrongMemoizeAttr:
- 'ee/app/models/ee/deployment.rb'
- 'ee/app/models/ee/environment.rb'
- 'ee/app/models/ee/group.rb'
- 'ee/app/models/ee/integrations/jira.rb'
- 'ee/app/models/ee/list.rb'
- 'ee/app/models/ee/merge_request.rb'
- 'ee/app/models/ee/namespace.rb'

View File

@ -360,7 +360,6 @@ Layout/LineLength:
- 'app/models/integrations/hangouts_chat.rb'
- 'app/models/integrations/harbor.rb'
- 'app/models/integrations/jenkins.rb'
- 'app/models/integrations/jira.rb'
- 'app/models/integrations/mattermost.rb'
- 'app/models/integrations/microsoft_teams.rb'
- 'app/models/integrations/pipelines_email.rb'
@ -896,7 +895,6 @@ Layout/LineLength:
- 'ee/app/models/ee/container_repository.rb'
- 'ee/app/models/ee/epic.rb'
- 'ee/app/models/ee/group.rb'
- 'ee/app/models/ee/integrations/jira.rb'
- 'ee/app/models/ee/issue.rb'
- 'ee/app/models/ee/key.rb'
- 'ee/app/models/ee/lfs_object.rb'

View File

@ -33,7 +33,6 @@ Lint/AmbiguousOperatorPrecedence:
- 'config/initializers/carrierwave_s3_encryption_headers_patch.rb'
- 'config/initializers/kaminari_active_record_relation_methods_with_limit.rb'
- 'danger/roulette/Dangerfile'
- 'ee/app/models/ee/integrations/jira.rb'
- 'ee/app/models/geo/upload_registry.rb'
- 'ee/app/models/iterations/cadence.rb'
- 'ee/app/models/license.rb'

View File

@ -123,7 +123,6 @@ Lint/UnusedMethodArgument:
- 'app/models/integrations/discord.rb'
- 'app/models/integrations/ewm.rb'
- 'app/models/integrations/hangouts_chat.rb'
- 'app/models/integrations/jira.rb'
- 'app/models/integrations/microsoft_teams.rb'
- 'app/models/integrations/mock_ci.rb'
- 'app/models/integrations/mock_monitoring.rb'

View File

@ -151,7 +151,6 @@ RSpec/FactoryBot/AvoidCreate:
- 'ee/spec/serializers/epic_note_entity_spec.rb'
- 'ee/spec/serializers/epics/related_epic_entity_spec.rb'
- 'ee/spec/serializers/fork_namespace_entity_spec.rb'
- 'ee/spec/serializers/geo_project_registry_entity_spec.rb'
- 'ee/spec/serializers/incident_management/escalation_policy_entity_spec.rb'
- 'ee/spec/serializers/incident_management/oncall_schedule_entity_spec.rb'
- 'ee/spec/serializers/integrations/field_entity_spec.rb'

View File

@ -91,7 +91,6 @@ Style/FormatString:
- 'app/models/integrations/hangouts_chat.rb'
- 'app/models/integrations/irker.rb'
- 'app/models/integrations/jenkins.rb'
- 'app/models/integrations/jira.rb'
- 'app/models/integrations/mattermost.rb'
- 'app/models/integrations/pipelines_email.rb'
- 'app/models/integrations/pivotaltracker.rb'

View File

@ -112,7 +112,6 @@ Style/GuardClause:
- 'app/models/integrations/confluence.rb'
- 'app/models/integrations/datadog.rb'
- 'app/models/integrations/emails_on_push.rb'
- 'app/models/integrations/jira.rb'
- 'app/models/integrations/pipelines_email.rb'
- 'app/models/internal_id.rb'
- 'app/models/issue.rb'

View File

@ -161,7 +161,6 @@ Style/IfUnlessModifier:
- 'app/models/integrations/asana.rb'
- 'app/models/integrations/base_chat_notification.rb'
- 'app/models/integrations/datadog.rb'
- 'app/models/integrations/jira.rb'
- 'app/models/integrations/pushover.rb'
- 'app/models/issue.rb'
- 'app/models/issue_email_participant.rb'

View File

@ -87,7 +87,6 @@ Style/RedundantSelf:
- 'app/models/integrations/base_issue_tracker.rb'
- 'app/models/integrations/base_slash_commands.rb'
- 'app/models/integrations/emails_on_push.rb'
- 'app/models/integrations/jira.rb'
- 'app/models/integrations/pipelines_email.rb'
- 'app/models/integrations/zentao.rb'
- 'app/models/internal_id.rb'

View File

@ -6,7 +6,6 @@ Style/StringLiteralsInInterpolation:
- 'app/helpers/colors_helper.rb'
- 'app/models/application_setting_implementation.rb'
- 'app/models/ci/namespace_mirror.rb'
- 'app/models/integrations/jira.rb'
- 'app/services/draft_notes/publish_service.rb'
- 'app/services/projects/create_service.rb'
- 'app/validators/nested_attributes_duplicates_validator.rb'

View File

@ -69,7 +69,6 @@ Style/SymbolProc:
- 'ee/app/helpers/ee/mirror_helper.rb'
- 'ee/app/helpers/ee/registrations_helper.rb'
- 'ee/app/models/concerns/epic_tree_sorting.rb'
- 'ee/app/models/ee/integrations/jira.rb'
- 'ee/app/models/ee/issue.rb'
- 'ee/app/serializers/ee/fork_namespace_entity.rb'
- 'ee/app/serializers/ee/group_child_entity.rb'

View File

@ -1 +1 @@
5763976d9d8ec1559fc17b1b236c82089c369c4c
3e0b54959f433192b6147792427fa4521e5724b5

View File

@ -1,22 +1,26 @@
%section.gl-banner{ @banner_options, class: banner_class }
- if illustration?
.gl-banner-illustration
= illustration
- elsif @svg_path.present?
.gl-banner-illustration
= image_tag @svg_path, alt: ""
-# This is using gl-card classes to match Vue component
-# Here's the issue to refactor away from gl-card
-# https://gitlab.com/gitlab-org/gitlab-ui/-/issues/2324
.gl-banner.gl-card.gl-pl-6.gl-pr-8.gl-py-6{ @banner_options, class: banner_class }
.gl-display-flex
- if illustration?
.gl-banner-illustration
= illustration
- elsif @svg_path.present?
.gl-banner-illustration
= image_tag @svg_path, alt: ""
.gl-banner-content
%h1.gl-banner-title= title
.gl-banner-content
%h1.gl-banner-title= title
= content
= content
- if primary_action?
= primary_action
- else
= link_button_to @button_text, @button_link, **@button_options, class: 'js-close-callout', variant: :confirm
- if primary_action?
= primary_action
- else
= link_button_to @button_text, @button_link, **@button_options, class: 'js-close-callout', variant: :confirm
- actions.each do |action|
= action
- actions.each do |action|
= action
= render Pajamas::ButtonComponent.new(category: :tertiary, variant: close_button_variant, size: :small, icon: 'close', button_options: @close_options)

View File

@ -85,7 +85,7 @@ class Projects::ApplicationController < ApplicationController
end
def require_pages_enabled!
not_found unless @project.pages_available?
not_found unless ::Gitlab::Pages.enabled?
end
def check_issues_available!

View File

@ -11,8 +11,12 @@ module Integrations
PROJECTS_PER_PAGE = 50
JIRA_CLOUD_HOST = '.atlassian.net'
ATLASSIAN_REFERRER_GITLAB_COM = { atlOrigin: 'eyJpIjoiY2QyZTJiZDRkNGZhNGZlMWI3NzRkNTBmZmVlNzNiZTkiLCJwIjoianN3LWdpdGxhYi1pbnQifQ' }.freeze
ATLASSIAN_REFERRER_SELF_MANAGED = { atlOrigin: 'eyJpIjoiYjM0MTA4MzUyYTYxNDVkY2IwMzVjOGQ3ZWQ3NzMwM2QiLCJwIjoianN3LWdpdGxhYlNNLWludCJ9' }.freeze
ATLASSIAN_REFERRER_GITLAB_COM = {
atlOrigin: 'eyJpIjoiY2QyZTJiZDRkNGZhNGZlMWI3NzRkNTBmZmVlNzNiZTkiLCJwIjoianN3LWdpdGxhYi1pbnQifQ'
}.freeze
ATLASSIAN_REFERRER_SELF_MANAGED = {
atlOrigin: 'eyJpIjoiYjM0MTA4MzUyYTYxNDVkY2IwMzVjOGQ3ZWQ3NzMwM2QiLCJwIjoianN3LWdpdGxhYlNNLWludCJ9'
}.freeze
API_ENDPOINTS = {
find_issue: "/rest/api/2/issue/%s",
@ -28,11 +32,13 @@ module Integrations
AUTH_TYPE_BASIC = 0
AUTH_TYPE_PAT = 1
SNOWPLOW_EVENT_CATEGORY = self.name
SNOWPLOW_EVENT_CATEGORY = name
validates :url, public_url: true, presence: true, if: :activated?
validates :api_url, public_url: true, allow_blank: true
validates :username, presence: true, if: ->(object) { object.activated? && !object.personal_access_token_authorization? }
validates :username, presence: true, if: ->(object) {
object.activated? && !object.personal_access_token_authorization?
}
validates :password, presence: true, if: :activated?
validates :jira_auth_type, presence: true, inclusion: { in: [AUTH_TYPE_BASIC, AUTH_TYPE_PAT] }, if: :activated?
validates :jira_issue_prefix, untrusted_regexp: true, length: { maximum: 255 }, if: :activated?
@ -130,7 +136,7 @@ module Integrations
end
# {PROJECT-KEY}-{NUMBER} Examples: JIRA-1, PROJECT-1
def reference_pattern(only_long: true)
def reference_pattern(*)
@reference_pattern ||= jira_issue_match_regex
end
@ -144,7 +150,7 @@ module Integrations
end
def data_fields
jira_tracker_data || self.build_jira_tracker_data
jira_tracker_data || build_jira_tracker_data
end
def set_default_data
@ -186,8 +192,13 @@ module Integrations
end
def help
jira_doc_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: help_page_path('integration/jira/index') }
s_("JiraService|You must configure Jira before enabling this integration. %{jira_doc_link_start}Learn more.%{link_end}") % { jira_doc_link_start: jira_doc_link_start, link_end: '</a>'.html_safe }
jira_doc_link_start = format('<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe,
url: help_page_path('integration/jira/index'))
format(
s_("JiraService|You must configure Jira before enabling this integration. " \
"%{jira_doc_link_start}Learn more.%{link_end}"),
jira_doc_link_start: jira_doc_link_start,
link_end: '</a>'.html_safe)
end
def title
@ -212,7 +223,8 @@ module Integrations
{
type: SECTION_TYPE_JIRA_TRIGGER,
title: _('Trigger'),
description: s_('JiraService|When a Jira issue is mentioned in a commit or merge request, a remote link and comment (if enabled) will be created.')
description: s_('JiraService|When a Jira issue is mentioned in a commit or merge request, a remote link ' \
'and comment (if enabled) will be created.')
},
{
type: SECTION_TYPE_CONFIGURATION,
@ -313,7 +325,8 @@ module Integrations
override :create_cross_reference_note
def create_cross_reference_note(external_issue, mentioned_in, author)
unless can_cross_reference?(mentioned_in)
return s_("JiraService|Events for %{noteable_model_name} are disabled.") % { noteable_model_name: mentioned_in.model_name.plural.humanize(capitalize: false) }
return format(s_("JiraService|Events for %{noteable_model_name} are disabled."),
noteable_model_name: mentioned_in.model_name.plural.humanize(capitalize: false))
end
jira_issue = find_issue(external_issue.id)
@ -398,10 +411,9 @@ module Integrations
end
def server_info
strong_memoize(:server_info) do
client_url.present? ? jira_request(API_ENDPOINTS[:server_info]) { client.ServerInfo.all.attrs } : nil
end
client_url.present? ? jira_request(API_ENDPOINTS[:server_info]) { client.ServerInfo.all.attrs } : nil
end
strong_memoize_attr :server_info
def can_cross_reference?(mentioned_in)
case mentioned_in
@ -430,7 +442,8 @@ module Integrations
true
rescue StandardError => e
path = API_ENDPOINTS[:transition_issue] % issue.id
log_exception(e, message: 'Issue transition failed', client_url: client_url, client_path: path, client_status: '400')
log_exception(e, message: 'Issue transition failed', client_url: client_url, client_path: path,
client_status: '400')
false
end
@ -488,9 +501,9 @@ module Integrations
link_title = "#{entity_name.capitalize} - #{entity_title}"
link_props = build_remote_link_props(url: entity_url, title: link_title)
unless comment_exists?(issue, message)
send_message(issue, message, link_props)
end
return if comment_exists?(issue, message)
send_message(issue, message, link_props)
end
def comment_message(data)
@ -503,21 +516,22 @@ module Integrations
project_link = build_jira_link(project.full_name, Gitlab::Routing.url_helpers.project_url(project))
branch =
if entity[:branch].present?
s_('JiraService| on branch %{branch_link}') % {
branch_link: build_jira_link(entity[:branch], project_tree_url(project, entity[:branch]))
}
format(s_('JiraService| on branch %{branch_link}'),
branch_link: build_jira_link(entity[:branch], project_tree_url(project, entity[:branch])))
end
entity_message = entity[:description].presence if all_details?
entity_message ||= entity[:title].chomp
s_('JiraService|%{user_link} mentioned this issue in %{entity_link} of %{project_link}%{branch}:{quote}%{entity_message}{quote}') % {
format(
s_('JiraService|%{user_link} mentioned this issue in %{entity_link} of ' \
'%{project_link}%{branch}:{quote}%{entity_message}{quote}'),
user_link: user_link,
entity_link: entity_link,
project_link: project_link,
branch: branch,
entity_message: entity_message
}
)
end
def build_jira_link(title, url)
@ -586,13 +600,13 @@ module Integrations
end
def resource_url(resource)
"#{Settings.gitlab.base_url.chomp("/")}#{resource}"
"#{Settings.gitlab.base_url.chomp('/')}#{resource}"
end
def build_entity_url(entity_type, entity_id)
polymorphic_url(
[
self.project,
project,
entity_type.to_sym
],
id: entity_id,
@ -631,7 +645,8 @@ module Integrations
yield
rescue StandardError => e
@error = e
log_exception(e, message: 'Error sending message', client_url: client_url, client_path: path, client_status: e.try(:code))
log_exception(e, message: 'Error sending message', client_url: client_url, client_path: path,
client_status: e.try(:code))
nil
end
@ -648,7 +663,8 @@ module Integrations
results = server_info
unless results.present?
Gitlab::AppLogger.warn(message: "Jira API returned no ServerInfo, setting deployment_type from URL", server_info: results, url: client_url)
Gitlab::AppLogger.warn(message: "Jira API returned no ServerInfo, setting deployment_type from URL",
server_info: results, url: client_url)
return set_deployment_type_from_url
end
@ -681,13 +697,25 @@ module Integrations
end
def jira_issues_section_description
jira_issues_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: help_page_path('integration/jira/issues') }
description = s_('JiraService|Work on Jira issues without leaving GitLab. Add a Jira menu to access a read-only list of your Jira issues. %{jira_issues_link_start}Learn more.%{link_end}') % { jira_issues_link_start: jira_issues_link_start, link_end: '</a>'.html_safe }
jira_issues_link_start = format('<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe,
url: help_page_path('integration/jira/issues'))
description = format(
s_('JiraService|Work on Jira issues without leaving GitLab. Add a Jira menu to access a read-only list of ' \
'your Jira issues. %{jira_issues_link_start}Learn more.%{link_end}'),
jira_issues_link_start: jira_issues_link_start,
link_end: '</a>'.html_safe
)
if project&.issues_enabled?
gitlab_issues_link_start = '<a href="%{url}">'.html_safe % { url: edit_project_path(project, anchor: 'js-shared-permissions') }
gitlab_issues_link_start = format('<a href="%{url}">'.html_safe, url: edit_project_path(project,
anchor: 'js-shared-permissions'))
description += '<br><br>'.html_safe
description += s_("JiraService|Displaying Jira issues while leaving GitLab issues also enabled might be confusing. Consider %{gitlab_issues_link_start}disabling GitLab issues%{link_end} if they won't otherwise be used.") % { gitlab_issues_link_start: gitlab_issues_link_start, link_end: '</a>'.html_safe }
description += format(
s_("JiraService|Displaying Jira issues while leaving GitLab issues also enabled might be confusing. " \
"Consider %{gitlab_issues_link_start}disabling GitLab issues%{link_end} if they won't otherwise be used."),
gitlab_issues_link_start: gitlab_issues_link_start,
link_end: '</a>'.html_safe
)
end
description

View File

@ -36,34 +36,24 @@ class LooseForeignKeys::DeletedRecord < Gitlab::Database::SharedModel
enum status: { pending: 1, processed: 2 }, _prefix: :status
def self.load_batch_for_table(table, batch_size)
if Feature.enabled?("loose_foreign_keys_batch_load_using_union")
partition_names = Gitlab::Database::PostgresPartitionedTable.each_partition(table_name).map(&:name)
partition_names = Gitlab::Database::PostgresPartitionedTable.each_partition(table_name).map(&:name)
unions = partition_names.map do |partition_name|
partition_number = partition_name[/\d+/].to_i
unions = partition_names.map do |partition_name|
partition_number = partition_name[/\d+/].to_i
select(arel_table[Arel.star], arel_table[:partition].as('partition_number'))
.from("#{Gitlab::Database::DYNAMIC_PARTITIONS_SCHEMA}.#{partition_name} AS #{table_name}")
.for_table(table)
.where(partition: partition_number)
.status_pending
.consume_order
.limit(batch_size)
end
select(arel_table[Arel.star])
.from_union(unions, remove_duplicates: false, remove_order: false)
.limit(batch_size)
.to_a
else
# selecting partition as partition_number to workaround the sliding partitioning column ignore
select(arel_table[Arel.star], arel_table[:partition].as('partition_number'))
.from("#{Gitlab::Database::DYNAMIC_PARTITIONS_SCHEMA}.#{partition_name} AS #{table_name}")
.for_table(table)
.where(partition: partition_number)
.status_pending
.consume_order
.limit(batch_size)
.to_a
end
select(arel_table[Arel.star])
.from_union(unions, remove_duplicates: false, remove_order: false)
.limit(batch_size)
.to_a
end
def self.mark_records_processed(records)

View File

@ -2244,10 +2244,6 @@ class Project < ApplicationRecord
File.join(Settings.pages.path, full_path)
end
def pages_available?
Gitlab.config.pages.enabled
end
def pages_show_onboarding?
!(pages_metadatum&.onboarding_complete || pages_metadatum&.deployed)
end

View File

@ -147,5 +147,3 @@ module Projects
end
end
end
Projects::AfterRenameService.prepend_mod_with('Projects::AfterRenameService')

View File

@ -51,5 +51,3 @@ module Projects
end
end
end
Projects::HashedStorage::MigrateRepositoryService.prepend_mod_with('Projects::HashedStorage::MigrateRepositoryService')

View File

@ -2973,15 +2973,6 @@
:weight: 1
:idempotent: true
:tags: []
- :name: gitlab_shell
:worker_name: GitlabShellWorker
:feature_category: :source_code_management
:has_external_dependencies: false
:urgency: :high
:resource_boundary: :unknown
:weight: 2
:idempotent: false
:tags: []
- :name: google_cloud_create_cloudsql_instance
:worker_name: GoogleCloud::CreateCloudsqlInstanceWorker
:feature_category: :not_owned

View File

@ -1,23 +0,0 @@
# frozen_string_literal: true
class GitlabShellWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker
data_consistency :always
sidekiq_options retry: 3
include Gitlab::ShellAdapter
feature_category :source_code_management
urgency :high
weight 2
loggable_arguments 0
def perform(action, *arg)
if Gitlab::Shell::PERMITTED_ACTIONS.exclude?(action)
raise(ArgumentError, "#{action} not allowed for #{self.class.name}")
end
gitlab_shell.public_send(action, *arg) # rubocop:disable GitlabSecurity/PublicSend
end
end

View File

@ -1,8 +0,0 @@
---
name: loose_foreign_keys_batch_load_using_union
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/128759
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/421422
milestone: '16.3'
type: development
group: group::tenant scale
default_enabled: true

View File

@ -745,18 +745,9 @@ Gitlab.ee do
Settings.cron_jobs['geo_prune_event_log_worker'] ||= {}
Settings.cron_jobs['geo_prune_event_log_worker']['cron'] ||= '*/5 * * * *'
Settings.cron_jobs['geo_prune_event_log_worker']['job_class'] ||= 'Geo::PruneEventLogWorker'
Settings.cron_jobs['geo_repository_sync_worker'] ||= {}
Settings.cron_jobs['geo_repository_sync_worker']['cron'] ||= '*/1 * * * *'
Settings.cron_jobs['geo_repository_sync_worker']['job_class'] ||= 'Geo::RepositorySyncWorker'
Settings.cron_jobs['geo_secondary_registry_consistency_worker'] ||= {}
Settings.cron_jobs['geo_secondary_registry_consistency_worker']['cron'] ||= '* * * * *'
Settings.cron_jobs['geo_secondary_registry_consistency_worker']['job_class'] ||= 'Geo::Secondary::RegistryConsistencyWorker'
Settings.cron_jobs['geo_repository_verification_primary_batch_worker'] ||= {}
Settings.cron_jobs['geo_repository_verification_primary_batch_worker']['cron'] ||= '*/1 * * * *'
Settings.cron_jobs['geo_repository_verification_primary_batch_worker']['job_class'] ||= 'Geo::RepositoryVerification::Primary::BatchWorker'
Settings.cron_jobs['geo_repository_verification_secondary_scheduler_worker'] ||= {}
Settings.cron_jobs['geo_repository_verification_secondary_scheduler_worker']['cron'] ||= '*/1 * * * *'
Settings.cron_jobs['geo_repository_verification_secondary_scheduler_worker']['job_class'] ||= 'Geo::RepositoryVerification::Secondary::SchedulerWorker'
Settings.cron_jobs['historical_data_worker'] ||= {}
Settings.cron_jobs['historical_data_worker']['cron'] ||= '0 12 * * *'
Settings.cron_jobs['historical_data_worker']['job_class'] = 'HistoricalDataWorker'

View File

@ -303,8 +303,6 @@
- 1
- - gitlab_performance_bar_stats
- 1
- - gitlab_shell
- 2
- - gitlab_subscriptions_add_on_purchases_bulk_refresh_user_assignments
- 1
- - gitlab_subscriptions_add_on_purchases_cleanup_user_add_on_assignment

View File

@ -60,6 +60,10 @@ class SwapNotesIdToBigintForSelfManaged < Gitlab::Database::Migration[2.1]
[:timelogs, :fk_timelogs_note_id, :note_id, :nullify]
]
class PgForeignKeys < MigrationRecord
self.table_name = :postgres_foreign_keys
end
def up
return if com_or_dev_or_test_but_not_jh?
@ -89,6 +93,8 @@ class SwapNotesIdToBigintForSelfManaged < Gitlab::Database::Migration[2.1]
replace_referencing_foreign_keys
find_and_drop_faulting_foreign_keys(:system_note_metadata, :fk_d83a918cb1)
with_lock_retries(raise_on_exhaustion: true) do
# Swap the original and new column names
execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN id TO id_tmp"
@ -180,4 +186,24 @@ class SwapNotesIdToBigintForSelfManaged < Gitlab::Database::Migration[2.1]
end
end
end
# Customers reported that some FKs are blocking the +notes_pkey+ to be dropped. This is happening, because some
# foreign keys listed in +REFERENCING_FOREIGN_KEYS+ have different names in customers instances.
# We need to find and remove this FKs to finish the swapping process.
#
# @info https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/8227
def find_and_drop_faulting_foreign_keys(constrained_table, referenced_fk_name)
foreign_keys = PgForeignKeys.select(:name)
.where(constrained_table_name: constrained_table)
.where(referenced_table_name: TABLE_NAME)
.where.not(name: referenced_fk_name)
with_lock_retries(raise_on_exhaustion: true) do
execute "LOCK TABLE #{TABLE_NAME}, #{constrained_table} IN ACCESS EXCLUSIVE MODE"
foreign_keys.each do |foreign_key|
remove_foreign_key_if_exists(constrained_table, name: foreign_key.name)
end
end
end
end

View File

@ -23,28 +23,6 @@ these failures, so you should follow [these instructions](background_verificatio
If verification is lagging significantly behind replication, consider giving
the site more time before scheduling a planned failover.
## Disabling or enabling the automatic background verification
Run the following commands in a [Rails console](../../operations/rails_console.md) on a **Rails node on the primary** site.
To check if automatic background verification is enabled:
```ruby
Gitlab::Geo.repository_verification_enabled?
```
To disable automatic background verification:
```ruby
Feature.disable('geo_repository_verification')
```
To enable automatic background verification:
```ruby
Feature.enable('geo_repository_verification')
```
## Repository verification
On the **primary** site:
@ -97,21 +75,6 @@ On the **primary** site:
![Re-verification interval](img/reverification-interval.png)
The automatic background re-verification is enabled by default, but you can
disable if you need. Run the following commands in a [Rails console](../../operations/rails_console.md) on a **Rails node on the primary** site:
To disable automatic background re-verification:
```ruby
Feature.disable('geo_repository_reverification')
```
To enable automatic background re-verification:
```ruby
Feature.enable('geo_repository_reverification')
```
## Reset verification for projects where verification has failed
Geo actively tries to correct verification failures marking the repository to

View File

@ -172,8 +172,7 @@ http://secondary.example.com/
GitLab Version: 14.9.2-ee
Geo Role: Secondary
Health Status: Healthy
Repositories: succeeded 12345 / total 12345 (100%)
Verified Repositories: succeeded 12345 / total 12345 (100%)
Project Repositories: succeeded 12345 / total 12345 (100%)
Project Wiki Repositories: succeeded 6789 / total 6789 (100%)
Attachments: succeeded 4 / total 4 (100%)
CI job artifacts: succeeded 0 / total 0 (0%)
@ -191,6 +190,7 @@ http://secondary.example.com/
Terraform State Versions Verified: succeeded 0 / total 10 (0%)
Snippet Repositories Verified: succeeded 99 / total 100 (99%)
Pipeline Artifacts Verified: succeeded 0 / total 10 (0%)
Project Repositories Verified: succeeded 12345 / total 12345 (100%)
Project Wiki Repositories Verified: succeeded 6789 / total 6789 (100%)
Sync Settings: Full
Database replication lag: 0 seconds
@ -199,19 +199,19 @@ http://secondary.example.com/
Last status report was: 1 minute ago
```
There are up to three statuses for each item. For example, for `Repositories`, you see the following lines:
There are up to three statuses for each item. For example, for `Project Repositories`, you see the following lines:
```plaintext
Repositories: succeeded 12345 / total 12345 (100%)
Verified Repositories: succeeded 12345 / total 12345 (100%)
Project Repositories: succeeded 12345 / total 12345 (100%)
Project Repositories Verified: succeeded 12345 / total 12345 (100%)
Repositories Checked: failed 5 / succeeded 0 / total 5 (0%)
```
The 3 status items are defined as follows:
- The `Repositories` output shows how many repositories are synced from the primary to the secondary.
- The `Verified Repositories` output shows how many repositories on this secondary have a matching repository checksum with the Primary.
- The `Repositories Checked` output shows how many repositories have passed a local Git repository check (`git fsck`) on the secondary.
- The `Project Repositories` output shows how many project repositories are synced from the primary to the secondary.
- The `Project Verified Repositories` output shows how many project repositories on this secondary have a matching repository checksum with the Primary.
- The `Repositories Checked` output shows how many project repositories have passed a local Git repository check (`git fsck`) on the secondary.
To find more details about failed items, check
[the `gitlab-rails/geo.log` file](../../logs/log_parsing.md#find-most-common-geo-sync-errors)

View File

@ -37,10 +37,10 @@ The following metrics are available:
| Metric | Type | Since | Description | Labels |
| :--------------------------------------------------------------- | :---------- | ------: | :-------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------- |
| `gitlab_cache_misses_total` | Counter | 10.2 | Cache read miss | `controller`, `action`, `store` |
| `gitlab_cache_operation_duration_seconds` | Histogram | 10.2 | Cache access time | `operation`, `store` |
| `gitlab_cache_operations_total` | Counter | 12.2 | Cache operations by controller or action | `controller`, `action`, `operation`, `store` |
| `gitlab_cache_read_multikey_count` | Histogram | 15.7 | Count of keys in multi-key cache read operations | `controller`, `action`, `store` |
| `gitlab_cache_misses_total` | Counter | 10.2 | Cache read miss | `controller`, `action`, `store`, `endpoint_id` |
| `gitlab_cache_operation_duration_seconds` | Histogram | 10.2 | Cache access time | `operation`, `store`, `endpoint_id` |
| `gitlab_cache_operations_total` | Counter | 12.2 | Cache operations by controller or action | `controller`, `action`, `operation`, `store`, `endpoint_id` |
| `gitlab_cache_read_multikey_count` | Histogram | 15.7 | Count of keys in multi-key cache read operations | `controller`, `action`, `store`, `endpoint_id` |
| `gitlab_ci_pipeline_builder_scoped_variables_duration` | Histogram | 14.5 | Time in seconds it takes to create the scoped variables for a CI/CD job
| `gitlab_ci_pipeline_creation_duration_seconds` | Histogram | 13.0 | Time in seconds it takes to create a CI/CD pipeline | `gitlab` |
| `gitlab_ci_pipeline_size_builds` | Histogram | 13.1 | Total number of builds within a pipeline grouped by a pipeline source | `source` |
@ -65,9 +65,9 @@ The following metrics are available:
| `gitlab_transaction_cache_<key>_duration_total` | Counter | 10.2 | Counter for total time (seconds) spent in Rails cache calls (per key) | |
| `gitlab_transaction_cache_count_total` | Counter | 10.2 | Counter for total Rails cache calls (aggregate) | |
| `gitlab_transaction_cache_duration_total` | Counter | 10.2 | Counter for total time (seconds) spent in Rails cache calls (aggregate) | |
| `gitlab_transaction_cache_read_hit_count_total` | Counter | 10.2 | Counter for cache hits for Rails cache calls | `controller`, `action`, `store` |
| `gitlab_transaction_cache_read_miss_count_total` | Counter | 10.2 | Counter for cache misses for Rails cache calls | `controller`, `action`, `store` |
| `gitlab_transaction_duration_seconds` | Histogram | 10.2 | Duration for successful requests (`gitlab_transaction_*` metrics) | `controller`, `action` |
| `gitlab_transaction_cache_read_hit_count_total` | Counter | 10.2 | Counter for cache hits for Rails cache calls | `controller`, `action`, `store`, `endpoint_id` |
| `gitlab_transaction_cache_read_miss_count_total` | Counter | 10.2 | Counter for cache misses for Rails cache calls | `controller`, `action`, `store`, `endpoint_id` |
| `gitlab_transaction_duration_seconds` | Histogram | 10.2 | Duration for successful requests (`gitlab_transaction_*` metrics) | `controller`, `action`, `endpoint_id` |
| `gitlab_transaction_event_build_found_total` | Counter | 9.4 | Counter for build found for API /jobs/request | |
| `gitlab_transaction_event_build_invalid_total` | Counter | 9.4 | Counter for build invalid due to concurrency conflict for API /jobs/request | |
| `gitlab_transaction_event_build_not_found_cached_total` | Counter | 9.4 | Counter for cached response of build not found for API /jobs/request | |
@ -95,20 +95,20 @@ The following metrics are available:
| `gitlab_transaction_event_stuck_import_jobs_total` | Counter | 9.4 | Count of stuck import jobs | `projects_without_jid_count`, `projects_with_jid_count` |
| `gitlab_transaction_event_update_build_total` | Counter | 9.4 | Counter for update build for API `/jobs/request/:id` | |
| `gitlab_transaction_new_redis_connections_total` | Counter | 9.4 | Counter for new Redis connections | |
| `gitlab_transaction_rails_queue_duration_total` | Counter | 9.4 | Measures latency between GitLab Workhorse forwarding a request to Rails | `controller`, `action` |
| `gitlab_transaction_view_duration_total` | Counter | 9.4 | Duration for views | `controller`, `action`, `view` |
| `gitlab_view_rendering_duration_seconds` | Histogram | 10.2 | Duration for views (histogram) | `controller`, `action`, `view` |
| `gitlab_transaction_rails_queue_duration_total` | Counter | 9.4 | Measures latency between GitLab Workhorse forwarding a request to Rails | `controller`, `action`, `endpoint_id` |
| `gitlab_transaction_view_duration_total` | Counter | 9.4 | Duration for views | `controller`, `action`, `view`, `endpoint_id` |
| `gitlab_view_rendering_duration_seconds` | Histogram | 10.2 | Duration for views (histogram) | `controller`, `action`, `view`, `endpoint_id` |
| `http_requests_total` | Counter | 9.4 | Rack request count | `method`, `status` |
| `http_request_duration_seconds` | Histogram | 9.4 | HTTP response time from rack middleware for successful requests | `method` |
| `gitlab_transaction_db_count_total` | Counter | 13.1 | Counter for total number of SQL calls | `controller`, `action` |
| `gitlab_transaction_db_<role>_count_total` | Counter | 13.10 | Counter for total number of SQL calls, grouped by database roles (primary/replica) | `controller`, `action` |
| `gitlab_transaction_db_write_count_total` | Counter | 13.1 | Counter for total number of write SQL calls | `controller`, `action` |
| `gitlab_transaction_db_cached_count_total` | Counter | 13.1 | Counter for total number of cached SQL calls | `controller`, `action` |
| `gitlab_transaction_db_<role>_cached_count_total` | Counter | 13.1 | Counter for total number of cached SQL calls, grouped by database roles (primary/replica) | `controller`, `action` |
| `gitlab_transaction_db_<role>_wal_count_total` | Counter | 14.0 | Counter for total number of WAL (write ahead log location) queries, grouped by database roles (primary/replica) | `controller`, `action` |
| `gitlab_transaction_db_<role>_wal_cached_count_total` | Counter | 14.1 | Counter for total number of cached WAL (write ahead log location) queries, grouped by database roles (primary/replica)| `controller`, `action` |
| `http_elasticsearch_requests_duration_seconds` **(PREMIUM ALL)** | Histogram | 13.1 | Elasticsearch requests duration during web transactions | `controller`, `action` |
| `http_elasticsearch_requests_total` **(PREMIUM ALL)** | Counter | 13.1 | Elasticsearch requests count during web transactions | `controller`, `action` |
| `gitlab_transaction_db_count_total` | Counter | 13.1 | Counter for total number of SQL calls | `controller`, `action`, `endpoint_id` |
| `gitlab_transaction_db_<role>_count_total` | Counter | 13.10 | Counter for total number of SQL calls, grouped by database roles (primary/replica) | `controller`, `action`, `endpoint_id` |
| `gitlab_transaction_db_write_count_total` | Counter | 13.1 | Counter for total number of write SQL calls | `controller`, `action`, `endpoint_id` |
| `gitlab_transaction_db_cached_count_total` | Counter | 13.1 | Counter for total number of cached SQL calls | `controller`, `action`, `endpoint_id` |
| `gitlab_transaction_db_<role>_cached_count_total` | Counter | 13.1 | Counter for total number of cached SQL calls, grouped by database roles (primary/replica) | `controller`, `action`, `endpoint_id` |
| `gitlab_transaction_db_<role>_wal_count_total` | Counter | 14.0 | Counter for total number of WAL (write ahead log location) queries, grouped by database roles (primary/replica) | `controller`, `action`, `endpoint_id` |
| `gitlab_transaction_db_<role>_wal_cached_count_total` | Counter | 14.1 | Counter for total number of cached WAL (write ahead log location) queries, grouped by database roles (primary/replica)| `controller`, `action`, `endpoint_id` |
| `http_elasticsearch_requests_duration_seconds` **(PREMIUM ALL)** | Histogram | 13.1 | Elasticsearch requests duration during web transactions | `controller`, `action`, `endpoint_id` |
| `http_elasticsearch_requests_total` **(PREMIUM ALL)** | Counter | 13.1 | Elasticsearch requests count during web transactions | `controller`, `action`, `endpoint_id` |
| `pipelines_created_total` | Counter | 9.4 | Counter of pipelines created | |
| `rack_uncaught_errors_total` | Counter | 9.4 | Rack connections handling uncaught errors count | |
| `user_session_logins_total` | Counter | 9.4 | Counter of how many users have logged in since GitLab was started or restarted | |
@ -137,7 +137,7 @@ The following metrics are available:
| `gitlab_ci_trace_finalize_duration_seconds` | Histogram | 13.6 | Duration of build trace chunks migration to object storage | |
| `gitlab_vulnerability_report_branch_comparison_real_duration_seconds` | Histogram | 15.11 | Execution duration of vulnerability report present on default branch SQL query | |
| `gitlab_vulnerability_report_branch_comparison_cpu_duration_seconds` | Histogram | 15.11 | Execution duration of vulnerability report present on default branch SQL query | |
| `gitlab_external_http_total` | Counter | 13.8 | Total number of HTTP calls to external systems | `controller`, `action` |
| `gitlab_external_http_total` | Counter | 13.8 | Total number of HTTP calls to external systems | `controller`, `action`, `endpoint_id` |
| `gitlab_external_http_duration_seconds` | Counter | 13.8 | Duration in seconds spent on each HTTP call to external systems | |
| `gitlab_external_http_exception_total` | Counter | 13.8 | Total number of exceptions raised when making external HTTP calls | |
| `ci_report_parser_duration_seconds` | Histogram | 13.9 | Time to parse CI/CD report artifacts | `parser` |
@ -153,18 +153,18 @@ The following metrics are available:
| `gitlab_snowplow_failed_events_total` | Counter | 14.1 | Total number of GitLab Snowplow Analytics Instrumentation events emission failures | |
| `gitlab_snowplow_successful_events_total` | Counter | 14.1 | Total number of GitLab Snowplow Analytics Instrumentation events emission successes | |
| `gitlab_ci_build_trace_errors_total` | Counter | 14.4 | Total amount of different error types on a build trace | `error_reason` |
| `gitlab_presentable_object_cacheless_render_real_duration_seconds` | Histogram | 15.3 | Duration of real time spent caching and representing specific web request objects | `controller`, `action` |
| `cached_object_operations_total` | Counter | 15.3 | Total number of objects cached for specific web requests | `controller`, `action` |
| `gitlab_presentable_object_cacheless_render_real_duration_seconds` | Histogram | 15.3 | Duration of real time spent caching and representing specific web request objects | `controller`, `action`, `endpoint_id` |
| `cached_object_operations_total` | Counter | 15.3 | Total number of objects cached for specific web requests | `controller`, `action`, `endpoint_id` |
| `redis_hit_miss_operations_total` | Counter | 15.6 | Total number of Redis cache hits and misses | `cache_hit`, `cache_identifier`, `feature_category`, `backing_resource` |
| `redis_cache_generation_duration_seconds` | Histogram | 15.6 | Time to generate Redis cache | `cache_hit`, `cache_identifier`, `feature_category`, `backing_resource` |
| `gitlab_diffs_reorder_real_duration_seconds` | Histogram | 15.8 | Duration in seconds spend on reordering of diff files on diffs batch request | `controller`, `action` |
| `gitlab_diffs_collection_real_duration_seconds` | Histogram | 15.8 | Duration in seconds spent on querying merge request diff files on diffs batch request | `controller`, `action` |
| `gitlab_diffs_comparison_real_duration_seconds` | Histogram | 15.8 | Duration in seconds spent on getting comparison data on diffs batch request | `controller`, `action` |
| `gitlab_diffs_reorder_real_duration_seconds` | Histogram | 15.8 | Duration in seconds spend on reordering of diff files on diffs batch request | `controller`, `action`, `endpoint_id` |
| `gitlab_diffs_collection_real_duration_seconds` | Histogram | 15.8 | Duration in seconds spent on querying merge request diff files on diffs batch request | `controller`, `action`, `endpoint_id` |
| `gitlab_diffs_comparison_real_duration_seconds` | Histogram | 15.8 | Duration in seconds spent on getting comparison data on diffs batch request | `controller`, `action`, `endpoint_id` |
| `gitlab_diffs_unfoldable_positions_real_duration_seconds` | Histogram | 15.8 | Duration in seconds spent on getting unfoldable note positions on diffs batch request | `controller`, `action` |
| `gitlab_diffs_unfold_real_duration_seconds` | Histogram | 15.8 | Duration in seconds spent on unfolding positions on diffs batch request | `controller`, `action` |
| `gitlab_diffs_write_cache_real_duration_seconds` | Histogram | 15.8 | Duration in seconds spent on caching highlighted lines and stats on diffs batch request | `controller`, `action` |
| `gitlab_diffs_highlight_cache_decorate_real_duration_seconds` | Histogram | 15.8 | Duration in seconds spent on setting highlighted lines from cache on diffs batch request | `controller`, `action` |
| `gitlab_diffs_render_real_duration_seconds` | Histogram | 15.8 | Duration in seconds spent on serializing and rendering diffs on diffs batch request | `controller`, `action` |
| `gitlab_diffs_unfold_real_duration_seconds` | Histogram | 15.8 | Duration in seconds spent on unfolding positions on diffs batch request | `controller`, `action`, `endpoint_id` |
| `gitlab_diffs_write_cache_real_duration_seconds` | Histogram | 15.8 | Duration in seconds spent on caching highlighted lines and stats on diffs batch request | `controller`, `action`, `endpoint_id` |
| `gitlab_diffs_highlight_cache_decorate_real_duration_seconds` | Histogram | 15.8 | Duration in seconds spent on setting highlighted lines from cache on diffs batch request | `controller`, `action`, `endpoint_id` |
| `gitlab_diffs_render_real_duration_seconds` | Histogram | 15.8 | Duration in seconds spent on serializing and rendering diffs on diffs batch request | `controller`, `action`, `endpoint_id` |
| `gitlab_memwd_violations_total` | Counter | 15.9 | Total number of times a Ruby process violated a memory threshold | |
| `gitlab_memwd_violations_handled_total` | Counter | 15.9 | Total number of times Ruby process memory violations were handled | |
| `gitlab_sli_rails_request_apdex_total` | Counter | 14.4 | Total number of request Apdex measurements. For more information, see [Rails request SLIs](../../../development/application_slis/rails_request.md) | `endpoint_id`, `feature_category`, `request_urgency` |
@ -229,8 +229,6 @@ configuration option in `gitlab.yml`. These metrics are served from the
| `sidekiq_mem_total_bytes` | Gauge | 15.3 | Number of bytes allocated for both objects consuming an object slot and objects that required a malloc'| |
| `geo_db_replication_lag_seconds` | Gauge | 10.2 | Database replication lag (seconds) | `url` |
| `geo_repositories` | Gauge | 10.2 | Total number of repositories available on primary | `url` |
| `geo_repositories_synced` | Gauge | 10.2 | Number of repositories synced on secondary | `url` |
| `geo_repositories_failed` | Gauge | 10.2 | Number of repositories failed to sync on secondary | `url` |
| `geo_lfs_objects` | Gauge | 10.2 | Number of LFS objects on primary | `url` |
| `geo_lfs_objects_checksummed` | Gauge | 14.6 | Number of LFS objects checksummed successfully on primary | `url` |
| `geo_lfs_objects_checksum_failed` | Gauge | 14.6 | Number of LFS objects failed to calculate the checksum on primary | `url` |
@ -248,14 +246,6 @@ configuration option in `gitlab.yml`. These metrics are served from the
| `geo_status_failed_total` | Counter | 10.2 | Number of times retrieving the status from the Geo Node failed | `url` |
| `geo_last_successful_status_check_timestamp` | Gauge | 10.2 | Last timestamp when the status was successfully updated | `url` |
| `geo_job_artifacts_synced_missing_on_primary` | Gauge | 10.7 | Number of job artifacts marked as synced due to the file missing on the primary | `url` |
| `geo_repositories_checksummed` | Gauge | 10.7 | Number of repositories checksummed on primary | `url` |
| `geo_repositories_checksum_failed` | Gauge | 10.7 | Number of repositories failed to calculate the checksum on primary | `url` |
| `geo_repositories_verified` | Gauge | 10.7 | Number of repositories successfully verified on secondary | `url` |
| `geo_repositories_verification_failed` | Gauge | 10.7 | Number of repositories that failed verification on secondary | `url` |
| `geo_repositories_checksum_mismatch` | Gauge | 10.7 | Number of repositories that checksum mismatch on secondary | `url` |
| `geo_repositories_checked` | Gauge | 11.1 | Number of repositories that have been checked via `git fsck` | `url` |
| `geo_repositories_checked_failed` | Gauge | 11.1 | Number of repositories that have a failure from `git fsck` | `url` |
| `geo_repositories_retrying_verification` | Gauge | 11.2 | Number of repositories verification failures that Geo is actively trying to correct on secondary | `url` |
| `geo_package_files` | Gauge | 13.0 | Number of package files on primary | `url` |
| `geo_package_files_checksummed` | Gauge | 13.0 | Number of package files checksummed on primary | `url` |
| `geo_package_files_checksum_failed` | Gauge | 13.0 | Number of package files failed to calculate the checksum on primary | `url` |

View File

@ -336,9 +336,6 @@ Example response:
"job_artifacts_synced_in_percentage": "0.00%",
"projects_count": 41,
"repositories_count": 41,
"repositories_failed_count": null,
"repositories_synced_count": null,
"repositories_synced_in_percentage": "0.00%",
"replication_slots_count": 1,
"replication_slots_used_count": 1,
"replication_slots_used_in_percentage": "100.00%",
@ -346,14 +343,6 @@ Example response:
"repositories_checked_count": 20,
"repositories_checked_failed_count": 20,
"repositories_checked_in_percentage": "100.00%",
"repositories_checksummed_count": 20,
"repositories_checksum_failed_count": 5,
"repositories_checksummed_in_percentage": "48.78%",
"repositories_verified_count": 20,
"repositories_verification_failed_count": 5,
"repositories_verified_in_percentage": "48.78%",
"repositories_checksum_mismatch_count": 3,
"repositories_retrying_verification_count": 1,
"last_event_id": 23,
"last_event_timestamp": 1509681166,
"cursor_last_event_id": null,
@ -596,21 +585,10 @@ Example response:
"design_management_repositories_verified_in_percentage": "100.00%",
"projects_count": 41,
"repositories_count": 41,
"repositories_failed_count": 1,
"repositories_synced_count": 40,
"repositories_synced_in_percentage": "97.56%",
"replication_slots_count": null,
"replication_slots_used_count": null,
"replication_slots_used_in_percentage": "0.00%",
"replication_slots_max_retained_wal_bytes": null,
"repositories_checksummed_count": 20,
"repositories_checksum_failed_count": 5,
"repositories_checksummed_in_percentage": "48.78%",
"repositories_verified_count": 20,
"repositories_verification_failed_count": 5,
"repositories_verified_in_percentage": "48.78%",
"repositories_checksum_mismatch_count": 3,
"repositories_retrying_verification_count": 4,
"repositories_checked_count": 5,
"repositories_checked_failed_count": 1,
"repositories_checked_in_percentage": "12.20%",
@ -811,9 +789,6 @@ Example response:
"job_artifacts_synced_in_percentage": "50.00%",
"projects_count": 41,
"repositories_count": 41,
"repositories_failed_count": 1,
"repositories_synced_count": 40,
"repositories_synced_in_percentage": "97.56%",
"replication_slots_count": null,
"replication_slots_used_count": null,
"replication_slots_used_in_percentage": "0.00%",

View File

@ -292,19 +292,7 @@ Example response:
[
{
"geo_node_id": 1,
"repository_verification_enabled": true,
"repositories_replication_enabled": null,
"repositories_synced_count": null,
"repositories_failed_count": null,
"repositories_verified_count": null,
"repositories_verification_failed_count": null,
"repositories_verification_total_count": null,
"job_artifacts_synced_missing_on_primary_count": null,
"repositories_checksummed_count": 19,
"repositories_checksum_failed_count": 0,
"repositories_checksum_mismatch_count": null,
"repositories_checksum_total_count": 19,
"repositories_retrying_verification_count": null,
"projects_count": 19,
"container_repositories_replication_enabled": null,
"lfs_objects_count": 0,
@ -461,9 +449,6 @@ Example response:
"git_push_event_count_weekly": null,
"proxy_remote_requests_event_count_weekly": null,
"proxy_local_requests_event_count_weekly": null,
"repositories_synced_in_percentage": "0.00%",
"repositories_checksummed_in_percentage": "100.00%",
"repositories_verified_in_percentage": "0.00%",
"repositories_checked_in_percentage": "0.00%",
"replication_slots_used_in_percentage": "100.00%",
"lfs_objects_synced_in_percentage": "0.00%",
@ -496,7 +481,7 @@ Example response:
"dependency_proxy_manifests_verified_in_percentage": "0.00%",
"project_wiki_repositories_synced_in_percentage": "0.00%",
"project_wiki_repositories_verified_in_percentage": "0.00%",
"repositories_count": 19,
"projects_count": 19,
"replication_slots_count": 1,
"replication_slots_used_count": 1,
"healthy": true,
@ -525,19 +510,7 @@ Example response:
},
{
"geo_node_id": 2,
"repository_verification_enabled": true,
"repositories_replication_enabled": true,
"repositories_synced_count": 18,
"repositories_failed_count": 0,
"repositories_verified_count": 0,
"repositories_verification_failed_count": 0,
"repositories_verification_total_count": 19,
"job_artifacts_synced_missing_on_primary_count": null,
"repositories_checksummed_count": null,
"repositories_checksum_failed_count": null,
"repositories_checksum_mismatch_count": 0,
"repositories_checksum_total_count": null,
"repositories_retrying_verification_count": 0,
"projects_count": 19,
"container_repositories_replication_enabled": null,
"lfs_objects_count": 0,
@ -694,9 +667,6 @@ Example response:
"git_push_event_count_weekly": null,
"proxy_remote_requests_event_count_weekly": null,
"proxy_local_requests_event_count_weekly": null,
"repositories_synced_in_percentage": "94.74%",
"repositories_checksummed_in_percentage": "0.00%",
"repositories_verified_in_percentage": "0.00%",
"repositories_checked_in_percentage": "0.00%",
"replication_slots_used_in_percentage": "0.00%",
"lfs_objects_synced_in_percentage": "0.00%",
@ -729,7 +699,7 @@ Example response:
"dependency_proxy_manifests_verified_in_percentage": "0.00%",
"project_wiki_repositories_synced_in_percentage": "100.00%",
"project_wiki_repositories_verified_in_percentage": "100.00%",
"repositories_count": 19,
"projects_count": 19,
"replication_slots_count": null,
"replication_slots_used_count": null,
"healthy": false,
@ -774,19 +744,7 @@ Example response:
```json
{
"geo_node_id": 2,
"repository_verification_enabled": true,
"repositories_replication_enabled": true,
"repositories_synced_count": 18,
"repositories_failed_count": 0,
"repositories_verified_count": 0,
"repositories_verification_failed_count": 0,
"repositories_verification_total_count": 19,
"job_artifacts_synced_missing_on_primary_count": null,
"repositories_checksummed_count": null,
"repositories_checksum_failed_count": null,
"repositories_checksum_mismatch_count": 0,
"repositories_checksum_total_count": null,
"repositories_retrying_verification_count": 0,
"projects_count": 19,
"container_repositories_replication_enabled": null,
"lfs_objects_count": 0,
@ -943,9 +901,6 @@ Example response:
"git_push_event_count_weekly": null,
"proxy_remote_requests_event_count_weekly": null,
"proxy_local_requests_event_count_weekly": null,
"repositories_synced_in_percentage": "94.74%",
"repositories_checksummed_in_percentage": "0.00%",
"repositories_verified_in_percentage": "0.00%",
"repositories_checked_in_percentage": "0.00%",
"replication_slots_used_in_percentage": "0.00%",
"lfs_objects_synced_in_percentage": "0.00%",

View File

@ -890,6 +890,10 @@ any job can have this variable, regardless of whether an environment is defined.
If the environment scope is `review/*`, then jobs with environment names starting
with `review/` would have that variable available.
Using environment-scoped variables with [`rules` and `include`](../yaml/includes.md#use-rules-with-include)
might not work as expected in a pipeline.
Because the environment-scoped variable is set only in a matching job,
the variable might not be defined when GitLab validates the pipeline configuration at pipeline creation.
In most cases, these features use the _environment specs_ mechanism, which offers
an efficient way to implement scoping in each environment group.

View File

@ -148,10 +148,6 @@ We also collect metrics specific to [Geo](../../../administration/geo/index.md)
```json
[
{
"repository_verification_enabled"=>true,
"repositories_replication_enabled"=>true,
"repositories_synced_count"=>24,
"repositories_failed_count"=>0,
"git_fetch_event_count_weekly"=>nil,
"git_push_event_count_weekly"=>nil,
... other geo node status fields

View File

@ -389,7 +389,7 @@ To clear all data from a project wiki and recreate it in a blank state:
p = Project.find_by_full_path('<username-or-group>/<project-name>')
# This command deletes the wiki project from the filesystem.
GitlabShellWorker.perform_in(0, :remove_repository, p.repository_storage, p.wiki.disk_path)
p.wiki.repository.remove
# Refresh the wiki repository state.
p.wiki.repository.expire_exists_cache

View File

@ -412,7 +412,7 @@ module API
end
def require_pages_enabled!
not_found! unless user_project.pages_available?
not_found! unless ::Gitlab::Pages.enabled?
end
def require_pages_config_enabled!

View File

@ -9,7 +9,7 @@ module Gitlab
# etc.
class WebTransaction < Transaction
THREAD_KEY = :_gitlab_metrics_transaction
BASE_LABEL_KEYS = %i[controller action feature_category].freeze
BASE_LABEL_KEYS = %i[controller action feature_category endpoint_id].freeze
CONTROLLER_KEY = 'action_controller.instance'
ENDPOINT_KEY = 'api.endpoint'
@ -95,7 +95,13 @@ module Gitlab
action = "#{action}.#{suffix}"
end
{ controller: controller.class.name, action: action, feature_category: feature_category }
{
controller: controller.class.name,
action: action,
feature_category: feature_category,
# inline endpoint_id_for_action as not all controllers extend ApplicationController
endpoint_id: "#{controller.class.name}##{controller.action_name}"
}
end
def labels_from_endpoint
@ -112,7 +118,12 @@ module Gitlab
if route
path = endpoint_paths_cache[route.request_method][route.path]
{ controller: 'Grape', action: "#{route.request_method} #{path}", feature_category: feature_category }
{
controller: 'Grape',
action: "#{route.request_method} #{path}",
feature_category: feature_category,
endpoint_id: API::Base.endpoint_id_for_route(route)
}
end
end

View File

@ -14,10 +14,6 @@ module Gitlab
class Shell
Error = Class.new(StandardError)
PERMITTED_ACTIONS = %w[
mv_repository remove_repository repository_exists?
].freeze
class << self
# Retrieve GitLab Shell secret token
#
@ -102,30 +98,6 @@ module Gitlab
false
end
# Removes a repository from file system.
# Given the underlying implementation removes the name
# passed as second argument on the passed storage.
#
# @example Remove a repository
# remove_repository("/path/to/storage", "gitlab/gitlab-ci")
#
# @param [String] storage project's storage path
# @param [String] disk_path current project path on disk
#
# @deprecated
def remove_repository(storage, disk_path)
return false if disk_path.empty?
Gitlab::Git::Repository.new(storage, "#{disk_path}.git", nil, nil).remove
true
rescue StandardError => e
Gitlab::AppLogger.warn("Repository does not exist: #{e} at: #{disk_path}.git")
Gitlab::ErrorTracking.track_exception(e, path: disk_path, storage: storage)
false
end
# Check if repository exists on disk
#
# @example Check if repository exists

View File

@ -85,7 +85,7 @@ module Sidebars
end
def pages_menu_item
unless context.project.pages_available? && context.current_user&.can?(:update_pages, context.project)
unless ::Gitlab::Pages.enabled? && context.current_user&.can?(:update_pages, context.project)
return ::Sidebars::NilMenuItem.new(item_id: :pages)
end

View File

@ -20920,12 +20920,6 @@ msgstr ""
msgid "Geo|%{label} should be between 1-999"
msgstr ""
msgid "Geo|%{name} is scheduled for re-sync"
msgstr ""
msgid "Geo|%{name} is scheduled for re-verify"
msgstr ""
msgid "Geo|%{timeAgoStr} (%{pendingEvents} events)"
msgstr ""
@ -20950,12 +20944,6 @@ msgstr ""
msgid "Geo|All projects"
msgstr ""
msgid "Geo|All projects are being scheduled for resync"
msgstr ""
msgid "Geo|All projects are being scheduled for reverify"
msgstr ""
msgid "Geo|Allow this secondary site to replicate content on Object Storage"
msgstr ""
@ -21001,9 +20989,6 @@ msgstr ""
msgid "Geo|Container repositories synchronization concurrency limit"
msgstr ""
msgid "Geo|Could not remove tracking entry for an existing project."
msgstr ""
msgid "Geo|Data replication lag"
msgstr ""
@ -21052,9 +21037,6 @@ msgstr ""
msgid "Geo|Geo Settings"
msgstr ""
msgid "Geo|Geo Status"
msgstr ""
msgid "Geo|Geo allows you to choose specific groups or storage shards to replicate."
msgstr ""
@ -21100,15 +21082,6 @@ msgstr ""
msgid "Geo|Last event ID processed"
msgstr ""
msgid "Geo|Last repository check run"
msgstr ""
msgid "Geo|Last successful sync"
msgstr ""
msgid "Geo|Last sync attempt"
msgstr ""
msgid "Geo|Last time verified"
msgstr ""
@ -21133,12 +21106,6 @@ msgstr ""
msgid "Geo|Must match with the %{codeStart}geo_node_name%{codeEnd} in %{codeStart}/etc/gitlab/gitlab.rb%{codeEnd}."
msgstr ""
msgid "Geo|Never"
msgstr ""
msgid "Geo|Next sync scheduled at"
msgstr ""
msgid "Geo|No %{replicable_type} were found. If you believe this may be an error, please refer to the %{linkStart}Geo Troubleshooting%{linkEnd} documentation for more information."
msgstr ""
@ -21181,9 +21148,6 @@ msgstr ""
msgid "Geo|Primary site"
msgstr ""
msgid "Geo|Project (ID: %{project_id}) no longer exists on the primary. It is safe to remove this entry, as this will not remove any data on disk."
msgstr ""
msgid "Geo|Projects in certain groups"
msgstr ""
@ -21196,9 +21160,6 @@ msgstr ""
msgid "Geo|Re-verification interval"
msgstr ""
msgid "Geo|Remove"
msgstr ""
msgid "Geo|Remove %{siteType} site"
msgstr ""
@ -21310,9 +21271,6 @@ msgstr ""
msgid "Geo|Site's status was updated %{timeAgo}."
msgstr ""
msgid "Geo|Status"
msgstr ""
msgid "Geo|Storage config"
msgstr ""
@ -21388,9 +21346,6 @@ msgstr ""
msgid "Geo|Tracking database entry will be removed. Are you sure?"
msgstr ""
msgid "Geo|Tracking entry for project (%{project_id}) was successfully removed."
msgstr ""
msgid "Geo|Tuning settings"
msgstr ""
@ -21430,9 +21385,6 @@ msgstr ""
msgid "Geo|Verified"
msgstr ""
msgid "Geo|Waiting for scheduler"
msgstr ""
msgid "Geo|With GitLab Geo, you can install a special read-only and replicated instance anywhere."
msgstr ""
@ -39729,9 +39681,6 @@ msgstr ""
msgid "Reports|metrics report"
msgstr ""
msgid "Repositories"
msgstr ""
msgid "Repositories Analytics"
msgstr ""

View File

@ -61,7 +61,7 @@
"@gitlab/favicon-overlay": "2.0.0",
"@gitlab/fonts": "^1.3.0",
"@gitlab/svgs": "3.65.0",
"@gitlab/ui": "66.7.0",
"@gitlab/ui": "66.20.0",
"@gitlab/visual-review-tools": "1.7.3",
"@gitlab/web-ide": "0.0.1-dev-20230921201626",
"@mattiasbuelens/web-streams-adapter": "^0.1.0",

View File

@ -97,6 +97,7 @@ module QA
view 'app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue' do
element :mr_widget_content
element 'pipeline-container'
end
view 'app/assets/javascripts/vue_shared/components/markdown/apply_suggestion.vue' do
@ -144,6 +145,10 @@ module QA
element 'fork-icon'
end
view 'app/assets/javascripts/vue_merge_request_widget/components/mr_collapsible_extension.vue' do
element 'mr-collapsible-title'
end
def start_review
click_element(:start_review_button)
@ -489,6 +494,28 @@ module QA
def has_fork_icon?
has_element?('fork-icon', skip_finished_loading_check: true)
end
def click_artifacts_dropdown_button
wait_for_requests
within_element('pipeline-container') do
click_element('base-dropdown-toggle')
end
end
def has_artifact_with_name?(name)
has_text?(name)
end
def open_exposed_artifacts_list
within_element('pipeline-container') do
wait_until(reload: false) { has_no_text?('Loading artifacts') }
click_element('mr-collapsible-title')
end
end
def has_exposed_artifact_with_name?(name)
has_link?(name)
end
end
end
end

View File

@ -0,0 +1,99 @@
# frozen_string_literal: true
module QA
RSpec.describe 'Verify', :runner, product_group: :pipeline_security do
describe 'Job artifacts' do
context 'when exposed' do
let(:total_jobs_count) { 3 }
let(:executor) { "qa-runner-#{Faker::Alphanumeric.alphanumeric(number: 8)}" }
let(:project) { create(:project, name: 'project-with-artifacts', initialize_with_readme: true) }
let!(:runner) { create(:project_runner, project: project, name: executor, tags: [executor]) }
let!(:commit_ci_file) do
Resource::Repository::Commit.fabricate_via_api! do |commit|
commit.project = project
commit.commit_message = 'Add .gitlab-ci.yml'
commit.add_files(
[
file_path: '.gitlab-ci.yml',
content: content
]
)
end
end
let(:merge_request) do
Resource::MergeRequest.fabricate_via_api! do |merge_request|
merge_request.project = project
merge_request.description = 'Simple MR for a simple test'
merge_request.target_new_branch = false
merge_request.file_name = 'new_file.txt'
merge_request.file_content = 'Simple file for a simple MR'
end
end
before do
create_mr
Flow::Login.sign_in
merge_request.visit!
end
after do
runner.remove_via_api!
end
it 'show up in MR widget', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/426999' do
Page::MergeRequest::Show.perform do |show|
Support::Waiter.wait_until(reload_page: false) do
show.has_pipeline_status?('passed')
end
show.click_artifacts_dropdown_button
aggregate_failures do
(1..total_jobs_count).each do |i|
expect(show).to have_artifact_with_name("job_with_artifact_#{i}")
end
end
show.click_artifacts_dropdown_button # dismiss the dropdown
show.open_exposed_artifacts_list
aggregate_failures do
(1..total_jobs_count).each do |i|
expect(show).to have_exposed_artifact_with_name("artifact_#{i}")
end
end
end
end
end
private
def content
(1..total_jobs_count).map do |i|
<<~YAML
job_with_artifact_#{i}:
tags: ["#{executor}"]
script:
- mkdir tmp
- echo "write some random strings #{i} times" >> tmp/file_#{i}.xml
artifacts:
expose_as: 'artifact #{i}'
paths:
- tmp/
YAML
end.join("\n")
end
def create_mr
merge_request
Support::Waiter.wait_until(message: 'Wait for mr pipeline to be created', max_duration: 180) do
project.pipelines.length > 1
end
end
end
end
end

View File

@ -80,8 +80,8 @@ RSpec.describe Pajamas::BannerComponent, type: :component do
describe 'variant' do
context 'by default (promotion)' do
it 'applies no variant class' do
expect(page).to have_css "[class='gl-banner']"
it 'does not apply introduction class' do
expect(page).not_to have_css ".gl-banner-introduction"
end
end
@ -89,7 +89,7 @@ RSpec.describe Pajamas::BannerComponent, type: :component do
let(:options) { { variant: :introduction } }
it "applies the introduction class to the banner" do
expect(page).to have_css ".gl-banner.gl-banner-introduction"
expect(page).to have_css ".gl-banner-introduction"
end
it "applies the confirm class to the close button" do
@ -101,7 +101,7 @@ RSpec.describe Pajamas::BannerComponent, type: :component do
let(:options) { { variant: :foobar } }
it 'ignores the unknown variant' do
expect(page).to have_css "[class='gl-banner']"
expect(page).to have_css ".gl-banner"
end
end
end

View File

@ -21,7 +21,6 @@ exports[`~/access_tokens/components/expires_at_field should render datepicker wi
mindate="Mon Jul 06 2020 00:00:00 GMT+0000 (Greenwich Mean Time)"
placeholder="YYYY-MM-DD"
showclearbutton="true"
size="medium"
theme=""
/>
</gl-form-group-stub>

View File

@ -70,7 +70,7 @@ describe('behaviors/components/json_table', () => {
});
it('renders gltable', () => {
expect(findTable().props()).toEqual({
expect(findTable().props()).toMatchObject({
fields: [],
items: [],
});
@ -121,7 +121,7 @@ describe('behaviors/components/json_table', () => {
});
it('passes cleaned fields and items to table', () => {
expect(findTable().props()).toEqual({
expect(findTable().props()).toMatchObject({
fields: [
'A',
{

View File

@ -14,45 +14,39 @@ exports[`packages_list_app renders 1`] = `
<div
class="gl-max-w-full"
>
<div>
<img
alt=""
class="gl-dark-invert-keep-hue gl-max-w-full"
height="144"
role="img"
src="helpSvg"
/>
</div>
<img
alt=""
class="gl-dark-invert-keep-hue gl-max-w-full"
height="144"
role="img"
src="helpSvg"
/>
</div>
<div
class="gl-m-auto gl-max-w-88"
class="gl-empty-state-content gl-m-auto gl-mx-auto gl-my-0 gl-p-5"
data-testid="gl-empty-state-content"
>
<div
class="gl-mx-auto gl-my-0 gl-p-5"
<h1
class="gl-font-size-h-display gl-line-height-36 gl-mb-0 gl-mt-0 h4"
>
<h1
class="gl-font-size-h-display gl-line-height-36 gl-mb-0 gl-mt-0 h4"
There are no packages yet
</h1>
<p
class="gl-mb-0 gl-mt-4"
>
Learn how to
<b-link-stub
class="gl-link"
href="helpUrl"
target="_blank"
>
There are no packages yet
</h1>
<p
class="gl-mb-0 gl-mt-4"
>
Learn how to
<b-link-stub
class="gl-link"
href="helpUrl"
target="_blank"
>
publish and share your packages
</b-link-stub>
with GitLab.
</p>
<div
class="gl-display-flex gl-flex-wrap gl-justify-content-center gl-mt-5"
/>
</div>
publish and share your packages
</b-link-stub>
with GitLab.
</p>
<div
class="gl-display-flex gl-flex-wrap gl-justify-content-center gl-mt-5"
/>
</div>
</section>
</div>

View File

@ -78,7 +78,7 @@ exports[`PypiInstallation renders all the messages 1`] = `
tabindex="-1"
>
<span
class="gl-bg-gray-50! gl-new-dropdown-item-content"
class="gl-new-dropdown-item-content"
>
<svg
aria-hidden="true"

View File

@ -31,7 +31,7 @@ RSpec.describe Gitlab::ImportExport::RepoRestorer do
subject { described_class.new(path_to_bundle: bundle_path, shared: shared, importable: project) }
after do
Gitlab::Shell.new.remove_repository(project.repository_storage, project.disk_path)
project.repository.remove
end
it 'restores the repo successfully', :aggregate_failures do
@ -66,7 +66,7 @@ RSpec.describe Gitlab::ImportExport::RepoRestorer do
subject { described_class.new(path_to_bundle: bundle_path, shared: shared, importable: ProjectWiki.new(project)) }
after do
Gitlab::Shell.new.remove_repository(project.wiki.repository_storage, project.wiki.disk_path)
project.wiki.repository.remove
end
it 'restores the wiki repo successfully', :aggregate_failures do

View File

@ -64,7 +64,7 @@ RSpec.describe Gitlab::Metrics::WebTransaction do
describe '#labels' do
context 'when request goes to Grape endpoint' do
before do
route = double(:route, request_method: 'GET', path: '/:version/projects/:id/archive(.:format)')
route = double(:route, request_method: 'GET', path: '/:version/projects/:id/archive(.:format)', origin: '/:version/projects/:id/archive')
endpoint = double(:endpoint, route: route,
options: { for: API::Projects, path: [":id/archive"] },
namespace: "/projects")
@ -76,7 +76,12 @@ RSpec.describe Gitlab::Metrics::WebTransaction do
end
it 'provides labels with the method and path of the route in the grape endpoint' do
expect(transaction.labels).to eq({ controller: 'Grape', action: 'GET /projects/:id/archive', feature_category: 'projects' })
expect(transaction.labels).to eq({
controller: 'Grape',
action: 'GET /projects/:id/archive',
feature_category: 'projects',
endpoint_id: 'GET /:version/projects/:id/archive'
})
end
it 'contains only the labels defined for transactions' do
@ -103,7 +108,7 @@ RSpec.describe Gitlab::Metrics::WebTransaction do
end
it 'tags a transaction with the name and action of a controller' do
expect(transaction.labels).to eq({ controller: 'TestController', action: 'show', feature_category: ::Gitlab::FeatureCategories::FEATURE_CATEGORY_DEFAULT })
expect(transaction.labels).to eq({ controller: 'TestController', action: 'show', feature_category: ::Gitlab::FeatureCategories::FEATURE_CATEGORY_DEFAULT, endpoint_id: 'TestController#show' })
end
it 'contains only the labels defined for transactions' do
@ -114,7 +119,7 @@ RSpec.describe Gitlab::Metrics::WebTransaction do
let(:request) { double(:request, format: double(:format, ref: :json)) }
it 'appends the mime type to the transaction action' do
expect(transaction.labels).to eq({ controller: 'TestController', action: 'show.json', feature_category: ::Gitlab::FeatureCategories::FEATURE_CATEGORY_DEFAULT })
expect(transaction.labels).to eq({ controller: 'TestController', action: 'show.json', feature_category: ::Gitlab::FeatureCategories::FEATURE_CATEGORY_DEFAULT, endpoint_id: 'TestController#show' })
end
end
@ -122,7 +127,7 @@ RSpec.describe Gitlab::Metrics::WebTransaction do
let(:request) { double(:request, format: double(:format, ref: 'http://example.com')) }
it 'does not append the MIME type to the transaction action' do
expect(transaction.labels).to eq({ controller: 'TestController', action: 'show', feature_category: ::Gitlab::FeatureCategories::FEATURE_CATEGORY_DEFAULT })
expect(transaction.labels).to eq({ controller: 'TestController', action: 'show', feature_category: ::Gitlab::FeatureCategories::FEATURE_CATEGORY_DEFAULT, endpoint_id: 'TestController#show' })
end
end
@ -131,7 +136,7 @@ RSpec.describe Gitlab::Metrics::WebTransaction do
# This is needed since we're not actually making a request, which would trigger the controller pushing to the context
::Gitlab::ApplicationContext.push(feature_category: 'source_code_management')
expect(transaction.labels).to eq({ controller: 'TestController', action: 'show', feature_category: "source_code_management" })
expect(transaction.labels).to eq({ controller: 'TestController', action: 'show', feature_category: 'source_code_management', endpoint_id: 'TestController#show' })
end
end
end
@ -147,7 +152,7 @@ RSpec.describe Gitlab::Metrics::WebTransaction do
let(:controller) { double(:controller, class: controller_class, action_name: 'show', request: request) }
let(:transaction_obj) { described_class.new({ 'action_controller.instance' => controller }) }
let(:labels) { { controller: 'TestController', action: 'show', feature_category: 'projects' } }
let(:labels) { { controller: 'TestController', action: 'show', feature_category: 'projects', endpoint_id: 'TestController#show' } }
before do
::Gitlab::ApplicationContext.push(feature_category: 'projects')

View File

@ -13,8 +13,6 @@ RSpec.describe Gitlab::Shell do
described_class.instance_variable_set(:@secret_token, nil)
end
it { is_expected.to respond_to :remove_repository }
describe '.secret_token' do
let(:secret_file) { 'tmp/tests/.secret_shell_test' }
let(:link_file) { 'tmp/tests/shell-secret-test/.gitlab_shell_secret' }
@ -83,19 +81,6 @@ RSpec.describe Gitlab::Shell do
allow(Gitlab.config.gitlab_shell).to receive(:git_timeout).and_return(800)
end
describe '#remove_repository' do
let!(:project) { create(:project, :repository, :legacy_storage) }
let(:disk_path) { "#{project.disk_path}.git" }
it 'returns true when the command succeeds' do
expect(project.repository.raw).to exist
expect(gitlab_shell.remove_repository(project.repository_storage, project.disk_path)).to be(true)
expect(project.repository.raw).not_to exist
end
end
describe '#mv_repository' do
let!(:project2) { create(:project, :repository) }

View File

@ -73,7 +73,7 @@ RSpec.describe Sidebars::Projects::Menus::DeploymentsMenu, feature_category: :na
let(:item_id) { :pages }
before do
allow(project).to receive(:pages_available?).and_return(pages_enabled)
allow(::Gitlab::Pages).to receive(:enabled?).and_return(pages_enabled)
end
describe 'when pages are enabled' do

View File

@ -115,6 +115,39 @@ RSpec.describe SwapNotesIdToBigintForSelfManaged, feature_category: :database do
end
end
end
context 'when having different naming for fk_d83a918cb1 foreign key' do
before do
connection.execute('ALTER TABLE system_note_metadata DROP CONSTRAINT IF EXISTS fk_d83a918cb1')
connection.execute('ALTER TABLE system_note_metadata DROP CONSTRAINT IF EXISTS fk_rails_d83a918cb1')
connection.execute('ALTER TABLE system_note_metadata ADD CONSTRAINT fk_rails_d83a918cb1 FOREIGN KEY (note_id)
REFERENCES notes(id) ON DELETE CASCADE')
end
after do
connection.execute('ALTER TABLE system_note_metadata DROP CONSTRAINT IF EXISTS fk_rails_d83a918cb1')
end
it 'swaps the columns' do
disable_migrations_output do
reversible_migration do |migration|
migration.before -> {
notes_table.reset_column_information
expect(notes_table.columns.find { |c| c.name == 'id' }.sql_type).to eq('integer')
expect(notes_table.columns.find { |c| c.name == 'id_convert_to_bigint' }.sql_type).to eq('bigint')
}
migration.after -> {
notes_table.reset_column_information
expect(notes_table.columns.find { |c| c.name == 'id' }.sql_type).to eq('bigint')
expect(notes_table.columns.find { |c| c.name == 'id_convert_to_bigint' }.sql_type).to eq('integer')
}
end
end
end
end
end
end
end

View File

@ -16,30 +16,20 @@ RSpec.describe LooseForeignKeys::DeletedRecord, type: :model, feature_category:
let(:records) { described_class.load_batch_for_table(table, 10) }
describe '.load_batch_for_table' do
where(:union_feature_flag_value) do
[true, false]
it 'loads records and orders them by creation date' do
expect(records).to eq([deleted_record_1, deleted_record_2, deleted_record_4])
end
with_them do
before do
stub_feature_flags('loose_foreign_keys_batch_load_using_union' => union_feature_flag_value)
end
it 'supports configurable batch size' do
records = described_class.load_batch_for_table(table, 2)
it 'loads records and orders them by creation date' do
expect(records).to eq([deleted_record_1, deleted_record_2, deleted_record_4])
end
expect(records).to eq([deleted_record_1, deleted_record_2])
end
it 'supports configurable batch size' do
records = described_class.load_batch_for_table(table, 2)
it 'returns the partition number in each returned record' do
records = described_class.load_batch_for_table(table, 4)
expect(records).to eq([deleted_record_1, deleted_record_2])
end
it 'returns the partition number in each returned record' do
records = described_class.load_batch_for_table(table, 4)
expect(records).to all(have_attributes(partition: (a_value > 0)))
end
expect(records).to all(have_attributes(partition: (a_value > 0)))
end
end

View File

@ -5146,28 +5146,6 @@ RSpec.describe Project, factory_default: :keep, feature_category: :groups_and_pr
end
end
describe '#pages_available?' do
let(:project) { create(:project, group: group) }
subject { project.pages_available? }
before do
allow(Gitlab.config.pages).to receive(:enabled).and_return(true)
end
context 'when the project is in a top level namespace' do
let(:group) { create(:group) }
it { is_expected.to be(true) }
end
context 'when the project is in a subgroup' do
let(:group) { create(:group, :nested) }
it { is_expected.to be(true) }
end
end
describe '#remove_private_deploy_keys' do
let!(:project) { create(:project) }

View File

@ -70,7 +70,6 @@ RSpec.describe Snippets::DestroyService, feature_category: :source_code_manageme
it 'does not schedule anything and return success' do
allow(snippet).to receive(:repository).and_return(nil)
expect(GitlabShellWorker).not_to receive(:perform_in)
expect_next_instance_of(Repositories::DestroyService) do |instance|
expect(instance).to receive(:execute).and_call_original
end
@ -151,7 +150,6 @@ RSpec.describe Snippets::DestroyService, feature_category: :source_code_manageme
expect(snippet.repository).not_to be_nil
expect(snippet.repository.exists?).to be_falsey
expect(GitlabShellWorker).not_to receive(:perform_in)
expect_next_instance_of(Repositories::DestroyService) do |instance|
expect(instance).to receive(:execute).and_call_original
end

View File

@ -39,7 +39,7 @@ module JavaScriptFixturesHelpers
end
def remove_repository(project)
Gitlab::Shell.new.remove_repository(project.repository_storage, project.disk_path)
project.repository.remove
end
# Public: Reads a GraphQL query from the filesystem as a string

View File

@ -2352,7 +2352,6 @@
- './ee/spec/serializers/evidences/build_artifact_entity_spec.rb'
- './ee/spec/serializers/evidences/evidence_entity_spec.rb'
- './ee/spec/serializers/fork_namespace_entity_spec.rb'
- './ee/spec/serializers/geo_project_registry_entity_spec.rb'
- './ee/spec/serializers/group_vulnerability_autocomplete_entity_spec.rb'
- './ee/spec/serializers/integrations/field_entity_spec.rb'
- './ee/spec/serializers/integrations/jira_serializers/issue_detail_entity_spec.rb'
@ -3151,18 +3150,7 @@
- './ee/spec/workers/geo/prune_event_log_worker_spec.rb'
- './ee/spec/workers/geo/registry_sync_worker_spec.rb'
- './ee/spec/workers/geo/repositories_clean_up_worker_spec.rb'
- './ee/spec/workers/geo/repository_cleanup_worker_spec.rb'
- './ee/spec/workers/geo_repository_destroy_worker_spec.rb'
- './ee/spec/workers/geo/repository_shard_sync_worker_spec.rb'
- './ee/spec/workers/geo/repository_sync_worker_spec.rb'
- './ee/spec/workers/geo/repository_verification/primary/batch_worker_spec.rb'
- './ee/spec/workers/geo/repository_verification/primary/shard_worker_spec.rb'
- './ee/spec/workers/geo/repository_verification/primary/single_worker_spec.rb'
- './ee/spec/workers/geo/repository_verification/secondary/scheduler_worker_spec.rb'
- './ee/spec/workers/geo/repository_verification/secondary/shard_worker_spec.rb'
- './ee/spec/workers/geo/repository_verification/secondary/single_worker_spec.rb'
- './ee/spec/workers/geo/reverification_batch_worker_spec.rb'
- './ee/spec/workers/geo/scheduler/per_shard_scheduler_worker_spec.rb'
- './ee/spec/workers/geo/scheduler/scheduler_worker_spec.rb'
- './ee/spec/workers/geo/secondary/registry_consistency_worker_spec.rb'
- './ee/spec/workers/geo/secondary_usage_data_cron_worker_spec.rb'

View File

@ -315,7 +315,6 @@ RSpec.describe 'Every Sidekiq worker', feature_category: :shared do
'GitlabPerformanceBarStatsWorker' => 3,
'GitlabSubscriptions::RefreshSeatsWorker' => 0,
'GitlabSubscriptions::AddOnPurchases::BulkRefreshUserAssignmentsWorker' => 0,
'GitlabShellWorker' => 3,
'GitlabServicePingWorker' => 3,
'GroupDestroyWorker' => 3,
'GroupExportWorker' => false,

View File

@ -1,31 +0,0 @@
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe GitlabShellWorker, :sidekiq_inline, feature_category: :source_code_management do
describe '#perform' do
Gitlab::Shell::PERMITTED_ACTIONS.each do |action|
describe "with the #{action} action" do
it 'forwards the message to Gitlab::Shell' do
expect_next_instance_of(Gitlab::Shell) do |instance|
expect(instance).to respond_to(action)
expect(instance).to receive(action).with('foo', 'bar')
end
described_class.perform_async(action, 'foo', 'bar')
end
end
end
describe 'all other commands' do
it 'raises ArgumentError' do
allow_next_instance_of(described_class) do |job_instance|
expect(job_instance).not_to receive(:gitlab_shell)
end
expect { described_class.perform_async('foo', 'bar', 'baz') }
.to raise_error(ArgumentError, 'foo not allowed for GitlabShellWorker')
end
end
end
end

View File

@ -19,7 +19,7 @@ require (
github.com/johannesboyne/gofakes3 v0.0.0-20230506070712-04da935ef877
github.com/jpillora/backoff v1.0.0
github.com/mitchellh/copystructure v1.2.0
github.com/prometheus/client_golang v1.16.0
github.com/prometheus/client_golang v1.17.0
github.com/rafaeljusto/redigomock/v3 v3.1.2
github.com/redis/go-redis/v9 v9.2.1
github.com/sebest/xff v0.0.0-20210106013422-671bd2870b3a
@ -35,7 +35,7 @@ require (
golang.org/x/oauth2 v0.9.0
golang.org/x/tools v0.8.0
google.golang.org/grpc v1.56.0
google.golang.org/protobuf v1.30.0
google.golang.org/protobuf v1.31.0
honnef.co/go/tools v0.4.3
)
@ -96,9 +96,9 @@ require (
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.42.0 // indirect
github.com/prometheus/procfs v0.10.1 // indirect
github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 // indirect
github.com/prometheus/common v0.44.0 // indirect
github.com/prometheus/procfs v0.11.1 // indirect
github.com/prometheus/prometheus v0.44.0 // indirect
github.com/ryszard/goskiplist v0.0.0-20150312221310-2dfbae5fcf46 // indirect
github.com/shabbyrobe/gocovmerge v0.0.0-20190829150210-3e036491d500 // indirect
@ -116,7 +116,7 @@ require (
golang.org/x/exp/typeparams v0.0.0-20221208152030-732eee02a75a // indirect
golang.org/x/mod v0.10.0 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/sys v0.9.0 // indirect
golang.org/x/sys v0.11.0 // indirect
golang.org/x/text v0.10.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect

View File

@ -1995,15 +1995,16 @@ github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrb
github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5nJFOEMgftOUOmlvYQ=
github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y=
github.com/prometheus/client_golang v1.15.0/go.mod h1:e9yaBhRPU2pPNsZwE+JdQl0KEt1N9XgF6zxWmaC0xOk=
github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8=
github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc=
github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q=
github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY=
github.com/prometheus/client_model v0.0.0-20171117100541-99fa1f4be8e5/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4=
github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w=
github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 h1:v7DLqVdK4VrYkVD5diGdl4sxJurKJEMnODWRJlxV9oM=
github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU=
github.com/prometheus/common v0.0.0-20180110214958-89604d197083/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
@ -2019,8 +2020,9 @@ github.com/prometheus/common v0.34.0/go.mod h1:gB3sOl7P0TvJabZpLY5uQMpUqRCPPCyRL
github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA=
github.com/prometheus/common v0.38.0/go.mod h1:MBXfmBQZrK5XpbCkjofnXs96LD2QQ7fEq4C0xjC/yec=
github.com/prometheus/common v0.41.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc=
github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM=
github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc=
github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY=
github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY=
github.com/prometheus/common/assets v0.1.0/go.mod h1:D17UVUE12bHbim7HzwUvtqm6gwBEaDQ0F+hIGbFbccI=
github.com/prometheus/common/assets v0.2.0/go.mod h1:D17UVUE12bHbim7HzwUvtqm6gwBEaDQ0F+hIGbFbccI=
github.com/prometheus/common/sigv4 v0.1.0/go.mod h1:2Jkxxk9yYvCkE5G1sQT7GuEXm57JrvHu9k5YwTjsNtI=
@ -2041,8 +2043,8 @@ github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1
github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4=
github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY=
github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg=
github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM=
github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwaUuI=
github.com/prometheus/procfs v0.11.1/go.mod h1:eesXgaPo1q7lBpVMoMy0ZOFTth9hBn4W/y0/p/ScXhY=
github.com/prometheus/prometheus v0.35.0/go.mod h1:7HaLx5kEPKJ0GDgbODG0fZgXbQ8K/XjZNJXQmbmgQlY=
github.com/prometheus/prometheus v0.44.0 h1:sgn8Fdx+uE5tHQn0/622swlk2XnIj6udoZCnbVjHIgc=
github.com/prometheus/prometheus v0.44.0/go.mod h1:aPsmIK3py5XammeTguyqTmuqzX/jeCdyOWWobLHNKQg=
@ -2798,8 +2800,9 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s=
golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM=
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
@ -3271,8 +3274,9 @@ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ
google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.29.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng=
google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
gopkg.in/DataDog/dd-trace-go.v1 v1.32.0 h1:DkD0plWEVUB8v/Ru6kRBW30Hy/fRNBC8hPdcExuBZMc=
gopkg.in/DataDog/dd-trace-go.v1 v1.32.0/go.mod h1:wRKMf/tRASHwH/UOfPQ3IQmVFhTz2/1a1/mpXoIjF54=
gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U=

View File

@ -1274,10 +1274,10 @@
resolved "https://registry.yarnpkg.com/@gitlab/svgs/-/svgs-3.65.0.tgz#0dace141f1dcac339ae5fc145176ea36f7774c64"
integrity sha512-hv7k48brF1xi2JaQ6WkQoSYZyuHx1h1YkX+AAzDRWyugDW0oePe0h9kpsBlggDo843Ae/Vm+4uC6oA9TPgh2dw==
"@gitlab/ui@66.7.0":
version "66.7.0"
resolved "https://registry.yarnpkg.com/@gitlab/ui/-/ui-66.7.0.tgz#ff83e27dd7c7187e3ee42bc7da10cf3ad3ee79be"
integrity sha512-OgWE3RcLiYS0YowlMV9CO2fmmL1clBTdP6USOhtB4nH34CFlU3pBSNKyw2NxtSg9f3kKR+FyEVDXxBwHJsQo4w==
"@gitlab/ui@66.20.0":
version "66.20.0"
resolved "https://registry.yarnpkg.com/@gitlab/ui/-/ui-66.20.0.tgz#66a48f1e0f356e96be79c01626350cca04cd0049"
integrity sha512-wavhvYuziLV0atwPe1qdcIM3RgAKGkPvaiFfR5CWdOS61fgPbPCe8PQTqXaVZItgYe176Mq/b3AuYcjoLE+S/w==
dependencies:
"@floating-ui/dom" "1.2.9"
bootstrap-vue "2.23.1"