From fdb5a6d73c634c2545cd2cb70cdc0a3b1458c712 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 5 Oct 2023 03:08:14 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- .rubocop_todo/gitlab/namespaced_class.yml | 2 - .rubocop_todo/gitlab/strong_memoize_attr.yml | 2 - .rubocop_todo/layout/line_length.yml | 2 - .../lint/ambiguous_operator_precedence.yml | 1 - .rubocop_todo/lint/unused_method_argument.yml | 1 - .../rspec/factory_bot/avoid_create.yml | 1 - .rubocop_todo/style/format_string.yml | 1 - .rubocop_todo/style/guard_clause.yml | 1 - .rubocop_todo/style/if_unless_modifier.yml | 1 - .rubocop_todo/style/redundant_self.yml | 1 - .../string_literals_in_interpolation.yml | 1 - .rubocop_todo/style/symbol_proc.yml | 1 - GITALY_SERVER_VERSION | 2 +- .../pajamas/banner_component.html.haml | 36 ++++--- .../projects/application_controller.rb | 2 +- app/models/integrations/jira.rb | 88 +++++++++++------ .../loose_foreign_keys/deleted_record.rb | 30 ++---- app/models/project.rb | 4 - app/services/projects/after_rename_service.rb | 2 - .../migrate_repository_service.rb | 2 - app/workers/all_queues.yml | 9 -- app/workers/gitlab_shell_worker.rb | 23 ----- ...se_foreign_keys_batch_load_using_union.yml | 8 -- config/initializers/1_settings.rb | 9 -- config/sidekiq_queues.yml | 2 - ...wap_notes_id_to_bigint_for_self_managed.rb | 26 +++++ .../background_verification.md | 37 ------- .../geo/replication/troubleshooting.md | 16 +-- .../monitoring/prometheus/gitlab_metrics.md | 68 ++++++------- doc/api/geo_nodes.md | 25 ----- doc/api/geo_sites.md | 49 +-------- doc/ci/environments/index.md | 4 + .../internal_analytics/service_ping/index.md | 4 - doc/user/project/wiki/index.md | 2 +- lib/api/helpers.rb | 2 +- lib/gitlab/metrics/web_transaction.rb | 17 +++- lib/gitlab/shell.rb | 28 ------ .../projects/menus/deployments_menu.rb | 2 +- locale/gitlab.pot | 51 ---------- package.json | 2 +- qa/qa/page/merge_request/show.rb | 27 +++++ .../expose_job_artifacts_in_mr_spec.rb | 99 +++++++++++++++++++ .../pajamas/banner_component_spec.rb | 8 +- .../expires_at_field_spec.js.snap | 1 - .../behaviors/components/json_table_spec.js | 4 +- .../packages_list_app_spec.js.snap | 60 +++++------ .../pypi_installation_spec.js.snap | 2 +- .../import_export/repo_restorer_spec.rb | 4 +- .../gitlab/metrics/web_transaction_spec.rb | 19 ++-- spec/lib/gitlab/shell_spec.rb | 15 --- .../projects/menus/deployments_menu_spec.rb | 2 +- ...otes_id_to_bigint_for_self_managed_spec.rb | 33 +++++++ .../loose_foreign_keys/deleted_record_spec.rb | 28 ++---- spec/models/project_spec.rb | 22 ----- .../services/snippets/destroy_service_spec.rb | 2 - .../helpers/javascript_fixtures_helpers.rb | 2 +- spec/support/rspec_order_todo.yml | 12 --- spec/workers/every_sidekiq_worker_spec.rb | 1 - spec/workers/gitlab_shell_worker_spec.rb | 31 ------ workhorse/go.mod | 12 +-- workhorse/go.sum | 20 ++-- yarn.lock | 8 +- 62 files changed, 417 insertions(+), 560 deletions(-) delete mode 100644 app/workers/gitlab_shell_worker.rb delete mode 100644 config/feature_flags/development/loose_foreign_keys_batch_load_using_union.yml create mode 100644 qa/qa/specs/features/browser_ui/4_verify/ci_job_artifacts/expose_job_artifacts_in_mr_spec.rb delete mode 100644 spec/workers/gitlab_shell_worker_spec.rb diff --git a/.rubocop_todo/gitlab/namespaced_class.yml b/.rubocop_todo/gitlab/namespaced_class.yml index 1d2382e58b7..f0f48b500c6 100644 --- a/.rubocop_todo/gitlab/namespaced_class.yml +++ b/.rubocop_todo/gitlab/namespaced_class.yml @@ -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' diff --git a/.rubocop_todo/gitlab/strong_memoize_attr.yml b/.rubocop_todo/gitlab/strong_memoize_attr.yml index 703c80c7667..33dcb37b15a 100644 --- a/.rubocop_todo/gitlab/strong_memoize_attr.yml +++ b/.rubocop_todo/gitlab/strong_memoize_attr.yml @@ -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' diff --git a/.rubocop_todo/layout/line_length.yml b/.rubocop_todo/layout/line_length.yml index df594c22dea..a786a2ad510 100644 --- a/.rubocop_todo/layout/line_length.yml +++ b/.rubocop_todo/layout/line_length.yml @@ -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' diff --git a/.rubocop_todo/lint/ambiguous_operator_precedence.yml b/.rubocop_todo/lint/ambiguous_operator_precedence.yml index f21c101d4a2..e496bc5af1a 100644 --- a/.rubocop_todo/lint/ambiguous_operator_precedence.yml +++ b/.rubocop_todo/lint/ambiguous_operator_precedence.yml @@ -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' diff --git a/.rubocop_todo/lint/unused_method_argument.yml b/.rubocop_todo/lint/unused_method_argument.yml index e052454ae32..6c4d0d12ca9 100644 --- a/.rubocop_todo/lint/unused_method_argument.yml +++ b/.rubocop_todo/lint/unused_method_argument.yml @@ -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' diff --git a/.rubocop_todo/rspec/factory_bot/avoid_create.yml b/.rubocop_todo/rspec/factory_bot/avoid_create.yml index 2725b035d65..177c77ab154 100644 --- a/.rubocop_todo/rspec/factory_bot/avoid_create.yml +++ b/.rubocop_todo/rspec/factory_bot/avoid_create.yml @@ -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' diff --git a/.rubocop_todo/style/format_string.yml b/.rubocop_todo/style/format_string.yml index c45ddab8441..0a55967106f 100644 --- a/.rubocop_todo/style/format_string.yml +++ b/.rubocop_todo/style/format_string.yml @@ -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' diff --git a/.rubocop_todo/style/guard_clause.yml b/.rubocop_todo/style/guard_clause.yml index 64568649287..5668e4a6ad0 100644 --- a/.rubocop_todo/style/guard_clause.yml +++ b/.rubocop_todo/style/guard_clause.yml @@ -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' diff --git a/.rubocop_todo/style/if_unless_modifier.yml b/.rubocop_todo/style/if_unless_modifier.yml index ef4fca8270d..4c80057c31b 100644 --- a/.rubocop_todo/style/if_unless_modifier.yml +++ b/.rubocop_todo/style/if_unless_modifier.yml @@ -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' diff --git a/.rubocop_todo/style/redundant_self.yml b/.rubocop_todo/style/redundant_self.yml index 7e12c89f9c8..49132170448 100644 --- a/.rubocop_todo/style/redundant_self.yml +++ b/.rubocop_todo/style/redundant_self.yml @@ -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' diff --git a/.rubocop_todo/style/string_literals_in_interpolation.yml b/.rubocop_todo/style/string_literals_in_interpolation.yml index c8cd3c9f074..daa9b90b177 100644 --- a/.rubocop_todo/style/string_literals_in_interpolation.yml +++ b/.rubocop_todo/style/string_literals_in_interpolation.yml @@ -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' diff --git a/.rubocop_todo/style/symbol_proc.yml b/.rubocop_todo/style/symbol_proc.yml index a8f966d2266..fa6cf5c4a7e 100644 --- a/.rubocop_todo/style/symbol_proc.yml +++ b/.rubocop_todo/style/symbol_proc.yml @@ -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' diff --git a/GITALY_SERVER_VERSION b/GITALY_SERVER_VERSION index 285cc1123e7..5e6e56a55da 100644 --- a/GITALY_SERVER_VERSION +++ b/GITALY_SERVER_VERSION @@ -1 +1 @@ -5763976d9d8ec1559fc17b1b236c82089c369c4c +3e0b54959f433192b6147792427fa4521e5724b5 diff --git a/app/components/pajamas/banner_component.html.haml b/app/components/pajamas/banner_component.html.haml index 8a177edddb5..ebb88b305dc 100644 --- a/app/components/pajamas/banner_component.html.haml +++ b/app/components/pajamas/banner_component.html.haml @@ -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) diff --git a/app/controllers/projects/application_controller.rb b/app/controllers/projects/application_controller.rb index 62233c8c3c9..30c6f4d865a 100644 --- a/app/controllers/projects/application_controller.rb +++ b/app/controllers/projects/application_controller.rb @@ -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! diff --git a/app/models/integrations/jira.rb b/app/models/integrations/jira.rb index d8d1f860e9a..a08f826ed23 100644 --- a/app/models/integrations/jira.rb +++ b/app/models/integrations/jira.rb @@ -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 = ''.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: ''.html_safe } + jira_doc_link_start = format(''.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: ''.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 = ''.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: ''.html_safe } + jira_issues_link_start = format(''.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: ''.html_safe + ) if project&.issues_enabled? - gitlab_issues_link_start = ''.html_safe % { url: edit_project_path(project, anchor: 'js-shared-permissions') } + gitlab_issues_link_start = format(''.html_safe, url: edit_project_path(project, + anchor: 'js-shared-permissions')) description += '

'.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: '
'.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: ''.html_safe + ) end description diff --git a/app/models/loose_foreign_keys/deleted_record.rb b/app/models/loose_foreign_keys/deleted_record.rb index 1d26c3c11e4..6af80686ec2 100644 --- a/app/models/loose_foreign_keys/deleted_record.rb +++ b/app/models/loose_foreign_keys/deleted_record.rb @@ -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) diff --git a/app/models/project.rb b/app/models/project.rb index d614c96990e..55cdad1dd94 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -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 diff --git a/app/services/projects/after_rename_service.rb b/app/services/projects/after_rename_service.rb index 9dc957b5be2..bbb812fd7be 100644 --- a/app/services/projects/after_rename_service.rb +++ b/app/services/projects/after_rename_service.rb @@ -147,5 +147,3 @@ module Projects end end end - -Projects::AfterRenameService.prepend_mod_with('Projects::AfterRenameService') diff --git a/app/services/projects/hashed_storage/migrate_repository_service.rb b/app/services/projects/hashed_storage/migrate_repository_service.rb index b65d0e63fd3..b3de9d78cb8 100644 --- a/app/services/projects/hashed_storage/migrate_repository_service.rb +++ b/app/services/projects/hashed_storage/migrate_repository_service.rb @@ -51,5 +51,3 @@ module Projects end end end - -Projects::HashedStorage::MigrateRepositoryService.prepend_mod_with('Projects::HashedStorage::MigrateRepositoryService') diff --git a/app/workers/all_queues.yml b/app/workers/all_queues.yml index f39c5f5c232..01f62be505b 100644 --- a/app/workers/all_queues.yml +++ b/app/workers/all_queues.yml @@ -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 diff --git a/app/workers/gitlab_shell_worker.rb b/app/workers/gitlab_shell_worker.rb deleted file mode 100644 index af657cb3dbd..00000000000 --- a/app/workers/gitlab_shell_worker.rb +++ /dev/null @@ -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 diff --git a/config/feature_flags/development/loose_foreign_keys_batch_load_using_union.yml b/config/feature_flags/development/loose_foreign_keys_batch_load_using_union.yml deleted file mode 100644 index 4e4a1e262b0..00000000000 --- a/config/feature_flags/development/loose_foreign_keys_batch_load_using_union.yml +++ /dev/null @@ -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 diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 899ee1d8cd9..a35ab8f1a89 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -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' diff --git a/config/sidekiq_queues.yml b/config/sidekiq_queues.yml index 37a6ade60fd..479ed10b752 100644 --- a/config/sidekiq_queues.yml +++ b/config/sidekiq_queues.yml @@ -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 diff --git a/db/post_migrate/20230823145126_swap_notes_id_to_bigint_for_self_managed.rb b/db/post_migrate/20230823145126_swap_notes_id_to_bigint_for_self_managed.rb index ddfaefc452b..988adff7d79 100644 --- a/db/post_migrate/20230823145126_swap_notes_id_to_bigint_for_self_managed.rb +++ b/db/post_migrate/20230823145126_swap_notes_id_to_bigint_for_self_managed.rb @@ -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 diff --git a/doc/administration/geo/disaster_recovery/background_verification.md b/doc/administration/geo/disaster_recovery/background_verification.md index a31261892bb..8aec77d9d88 100644 --- a/doc/administration/geo/disaster_recovery/background_verification.md +++ b/doc/administration/geo/disaster_recovery/background_verification.md @@ -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 diff --git a/doc/administration/geo/replication/troubleshooting.md b/doc/administration/geo/replication/troubleshooting.md index dd2693f4ba7..b96fe29e28a 100644 --- a/doc/administration/geo/replication/troubleshooting.md +++ b/doc/administration/geo/replication/troubleshooting.md @@ -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) diff --git a/doc/administration/monitoring/prometheus/gitlab_metrics.md b/doc/administration/monitoring/prometheus/gitlab_metrics.md index 59fb5784068..9efe39b8d3a 100644 --- a/doc/administration/monitoring/prometheus/gitlab_metrics.md +++ b/doc/administration/monitoring/prometheus/gitlab_metrics.md @@ -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__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__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__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__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__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__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__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__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__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` | diff --git a/doc/api/geo_nodes.md b/doc/api/geo_nodes.md index e709a810255..3f7fd537abf 100644 --- a/doc/api/geo_nodes.md +++ b/doc/api/geo_nodes.md @@ -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%", diff --git a/doc/api/geo_sites.md b/doc/api/geo_sites.md index 2c0ceab62e2..eaf813ae201 100644 --- a/doc/api/geo_sites.md +++ b/doc/api/geo_sites.md @@ -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%", diff --git a/doc/ci/environments/index.md b/doc/ci/environments/index.md index ac5cf4f8875..03afb105d1e 100644 --- a/doc/ci/environments/index.md +++ b/doc/ci/environments/index.md @@ -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. diff --git a/doc/development/internal_analytics/service_ping/index.md b/doc/development/internal_analytics/service_ping/index.md index d3f13b83460..26f94fe8b75 100644 --- a/doc/development/internal_analytics/service_ping/index.md +++ b/doc/development/internal_analytics/service_ping/index.md @@ -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 diff --git a/doc/user/project/wiki/index.md b/doc/user/project/wiki/index.md index 4f3aa0d0d49..63adc0d3945 100644 --- a/doc/user/project/wiki/index.md +++ b/doc/user/project/wiki/index.md @@ -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('/') # 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 diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb index db08bc6c63a..56b157f662a 100644 --- a/lib/api/helpers.rb +++ b/lib/api/helpers.rb @@ -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! diff --git a/lib/gitlab/metrics/web_transaction.rb b/lib/gitlab/metrics/web_transaction.rb index f3c1e6897af..ad635a9e376 100644 --- a/lib/gitlab/metrics/web_transaction.rb +++ b/lib/gitlab/metrics/web_transaction.rb @@ -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 diff --git a/lib/gitlab/shell.rb b/lib/gitlab/shell.rb index 87f4d3bb9bd..b47e0b1d396 100644 --- a/lib/gitlab/shell.rb +++ b/lib/gitlab/shell.rb @@ -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 diff --git a/lib/sidebars/projects/menus/deployments_menu.rb b/lib/sidebars/projects/menus/deployments_menu.rb index ff2f833763a..e2ebb347077 100644 --- a/lib/sidebars/projects/menus/deployments_menu.rb +++ b/lib/sidebars/projects/menus/deployments_menu.rb @@ -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 diff --git a/locale/gitlab.pot b/locale/gitlab.pot index addd7dd46a6..910aa093095 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -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 "" diff --git a/package.json b/package.json index 0e58b667356..146dd4b0a4b 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/qa/qa/page/merge_request/show.rb b/qa/qa/page/merge_request/show.rb index f626cb2dd78..8e960751f5a 100644 --- a/qa/qa/page/merge_request/show.rb +++ b/qa/qa/page/merge_request/show.rb @@ -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 diff --git a/qa/qa/specs/features/browser_ui/4_verify/ci_job_artifacts/expose_job_artifacts_in_mr_spec.rb b/qa/qa/specs/features/browser_ui/4_verify/ci_job_artifacts/expose_job_artifacts_in_mr_spec.rb new file mode 100644 index 00000000000..dd7e8832c29 --- /dev/null +++ b/qa/qa/specs/features/browser_ui/4_verify/ci_job_artifacts/expose_job_artifacts_in_mr_spec.rb @@ -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 diff --git a/spec/components/pajamas/banner_component_spec.rb b/spec/components/pajamas/banner_component_spec.rb index c9d9a9176e8..47dc9042913 100644 --- a/spec/components/pajamas/banner_component_spec.rb +++ b/spec/components/pajamas/banner_component_spec.rb @@ -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 diff --git a/spec/frontend/access_tokens/components/__snapshots__/expires_at_field_spec.js.snap b/spec/frontend/access_tokens/components/__snapshots__/expires_at_field_spec.js.snap index 42818c14029..2bd2b17a12d 100644 --- a/spec/frontend/access_tokens/components/__snapshots__/expires_at_field_spec.js.snap +++ b/spec/frontend/access_tokens/components/__snapshots__/expires_at_field_spec.js.snap @@ -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="" /> diff --git a/spec/frontend/behaviors/components/json_table_spec.js b/spec/frontend/behaviors/components/json_table_spec.js index ae62d28d6c0..3277e58669a 100644 --- a/spec/frontend/behaviors/components/json_table_spec.js +++ b/spec/frontend/behaviors/components/json_table_spec.js @@ -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', { diff --git a/spec/frontend/packages_and_registries/infrastructure_registry/components/list/components/__snapshots__/packages_list_app_spec.js.snap b/spec/frontend/packages_and_registries/infrastructure_registry/components/list/components/__snapshots__/packages_list_app_spec.js.snap index 8e2d46df51f..6af9e38192e 100644 --- a/spec/frontend/packages_and_registries/infrastructure_registry/components/list/components/__snapshots__/packages_list_app_spec.js.snap +++ b/spec/frontend/packages_and_registries/infrastructure_registry/components/list/components/__snapshots__/packages_list_app_spec.js.snap @@ -14,45 +14,39 @@ exports[`packages_list_app renders 1`] = `
-
- -
+
-
-

+

+ Learn how to + - There are no packages yet -

-

- Learn how to - - publish and share your packages - - with GitLab. -

-
-
+ publish and share your packages + + with GitLab. +

+
diff --git a/spec/frontend/packages_and_registries/package_registry/components/details/__snapshots__/pypi_installation_spec.js.snap b/spec/frontend/packages_and_registries/package_registry/components/details/__snapshots__/pypi_installation_spec.js.snap index 05a5a718e52..17acf7381c0 100644 --- a/spec/frontend/packages_and_registries/package_registry/components/details/__snapshots__/pypi_installation_spec.js.snap +++ b/spec/frontend/packages_and_registries/package_registry/components/details/__snapshots__/pypi_installation_spec.js.snap @@ -78,7 +78,7 @@ exports[`PypiInstallation renders all the messages 1`] = ` tabindex="-1" >