Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2023-12-05 21:13:48 +00:00
parent c8419b0227
commit 339b915363
463 changed files with 499 additions and 1657 deletions

View File

@ -14,7 +14,7 @@ include:
gitlab_auth_token_variable_name: "PROJECT_TOKEN_FOR_CI_SCRIPTS_API_USAGE"
allure_job_name: "${QA_RUN_TYPE}"
- project: gitlab-org/quality/pipeline-common
ref: 7.12.1
ref: 7.13.3
file:
- /ci/base.gitlab-ci.yml
- /ci/knapsack-report.yml

View File

@ -230,7 +230,6 @@ Layout/LineLength:
- 'app/helpers/merge_requests_helper.rb'
- 'app/helpers/mirror_helper.rb'
- 'app/helpers/nav/new_dropdown_helper.rb'
- 'app/helpers/nav/top_nav_helper.rb'
- 'app/helpers/nav_helper.rb'
- 'app/helpers/notify_helper.rb'
- 'app/helpers/operations_helper.rb'

View File

@ -2,7 +2,6 @@
Metrics/AbcSize:
Exclude:
- 'app/helpers/issuables_helper.rb'
- 'app/helpers/nav/top_nav_helper.rb'
- 'app/models/instance_configuration.rb'
- 'app/services/projects/create_service.rb'
- 'lib/gitlab/analytics/cycle_analytics/request_params.rb'

View File

@ -4,7 +4,6 @@ Metrics/CyclomaticComplexity:
- 'app/controllers/admin/application_settings_controller.rb'
- 'app/finders/deployments_finder.rb'
- 'app/helpers/button_helper.rb'
- 'app/helpers/nav/top_nav_helper.rb'
- 'app/models/concerns/issuable.rb'
- 'app/services/projects/create_service.rb'
- 'ee/app/controllers/ee/groups_controller.rb'

View File

@ -4,7 +4,6 @@ Metrics/PerceivedComplexity:
- 'app/controllers/admin/application_settings_controller.rb'
- 'app/finders/deployments_finder.rb'
- 'app/helpers/button_helper.rb'
- 'app/helpers/nav/top_nav_helper.rb'
- 'app/services/projects/create_service.rb'
- 'ee/app/controllers/ee/groups_controller.rb'
- 'lib/banzai/filter/references/abstract_reference_filter.rb'

View File

@ -1418,7 +1418,6 @@ RSpec/ContextWording:
- 'spec/helpers/listbox_helper_spec.rb'
- 'spec/helpers/markup_helper_spec.rb'
- 'spec/helpers/members_helper_spec.rb'
- 'spec/helpers/nav/top_nav_helper_spec.rb'
- 'spec/helpers/nav_helper_spec.rb'
- 'spec/helpers/notes_helper_spec.rb'
- 'spec/helpers/operations_helper_spec.rb'

View File

@ -291,7 +291,6 @@ RSpec/FactoryBot/AvoidCreate:
- 'spec/helpers/members_helper_spec.rb'
- 'spec/helpers/merge_requests_helper_spec.rb'
- 'spec/helpers/namespaces_helper_spec.rb'
- 'spec/helpers/nav/top_nav_helper_spec.rb'
- 'spec/helpers/nav_helper_spec.rb'
- 'spec/helpers/notes_helper_spec.rb'
- 'spec/helpers/notifications_helper_spec.rb'

View File

@ -2434,7 +2434,6 @@ RSpec/FeatureCategory:
- 'spec/helpers/markup_helper_spec.rb'
- 'spec/helpers/members_helper_spec.rb'
- 'spec/helpers/milestones_helper_spec.rb'
- 'spec/helpers/nav/top_nav_helper_spec.rb'
- 'spec/helpers/notifications_helper_spec.rb'
- 'spec/helpers/notify_helper_spec.rb'
- 'spec/helpers/numbers_helper_spec.rb'
@ -3799,7 +3798,6 @@ RSpec/FeatureCategory:
- 'spec/lib/gitlab/multi_collection_paginator_spec.rb'
- 'spec/lib/gitlab/multi_destination_logger_spec.rb'
- 'spec/lib/gitlab/namespaced_session_store_spec.rb'
- 'spec/lib/gitlab/nav/top_nav_menu_header_spec.rb'
- 'spec/lib/gitlab/no_cache_headers_spec.rb'
- 'spec/lib/gitlab/noteable_metadata_spec.rb'
- 'spec/lib/gitlab/object_hierarchy_spec.rb'

View File

@ -1617,7 +1617,6 @@ RSpec/NamedSubject:
- 'spec/helpers/markup_helper_spec.rb'
- 'spec/helpers/merge_requests_helper_spec.rb'
- 'spec/helpers/namespaces_helper_spec.rb'
- 'spec/helpers/nav/top_nav_helper_spec.rb'
- 'spec/helpers/nav_helper_spec.rb'
- 'spec/helpers/operations_helper_spec.rb'
- 'spec/helpers/page_layout_helper_spec.rb'

View File

@ -99,7 +99,6 @@ RSpec/ReturnFromStub:
- 'spec/helpers/explore_helper_spec.rb'
- 'spec/helpers/groups_helper_spec.rb'
- 'spec/helpers/issues_helper_spec.rb'
- 'spec/helpers/nav/top_nav_helper_spec.rb'
- 'spec/helpers/nav_helper_spec.rb'
- 'spec/helpers/operations_helper_spec.rb'
- 'spec/helpers/projects_helper_spec.rb'

View File

@ -110,7 +110,6 @@ Style/ArgumentsForwarding:
- 'lib/gitlab/legacy_github_import/client.rb'
- 'lib/gitlab/memory/watchdog/configuration.rb'
- 'lib/gitlab/metrics/prometheus.rb'
- 'lib/gitlab/nav/top_nav_view_model_builder.rb'
- 'lib/gitlab/quick_actions/dsl.rb'
- 'lib/gitlab/rack_attack.rb'
- 'lib/gitlab/redis/multi_store.rb'

View File

@ -61,7 +61,6 @@ Style/GuardClause:
- 'app/helpers/admin/user_actions_helper.rb'
- 'app/helpers/events_helper.rb'
- 'app/helpers/issues_helper.rb'
- 'app/helpers/nav/top_nav_helper.rb'
- 'app/helpers/notes_helper.rb'
- 'app/helpers/preferences_helper.rb'
- 'app/helpers/profiles_helper.rb'
@ -275,7 +274,6 @@ Style/GuardClause:
- 'ee/app/helpers/ee/application_helper.rb'
- 'ee/app/helpers/ee/auth_helper.rb'
- 'ee/app/helpers/ee/nav/new_dropdown_helper.rb'
- 'ee/app/helpers/ee/nav/top_nav_helper.rb'
- 'ee/app/helpers/ee/projects/pipeline_helper.rb'
- 'ee/app/helpers/ee/projects_helper.rb'
- 'ee/app/models/allowed_email_domain.rb'

View File

@ -88,7 +88,6 @@ Style/IfUnlessModifier:
- 'app/helpers/lazy_image_tag_helper.rb'
- 'app/helpers/markup_helper.rb'
- 'app/helpers/merge_requests_helper.rb'
- 'app/helpers/nav/top_nav_helper.rb'
- 'app/helpers/nav_helper.rb'
- 'app/helpers/page_layout_helper.rb'
- 'app/helpers/preferences_helper.rb'

View File

@ -351,7 +351,6 @@ Style/InlineDisableAnnotation:
- 'app/helpers/issuables_helper.rb'
- 'app/helpers/lazy_image_tag_helper.rb'
- 'app/helpers/namespaces_helper.rb'
- 'app/helpers/nav/top_nav_helper.rb'
- 'app/helpers/page_layout_helper.rb'
- 'app/helpers/routing/projects_helper.rb'
- 'app/helpers/routing/pseudonymization_helper.rb'

View File

@ -1 +1 @@
c0b07ba36fc8fc40830f061cb55a5c951a166e1c
61813ee439cc7a3e0858b4955f4511315eaab650

View File

@ -8,6 +8,8 @@ import CatalogListSkeletonLoader from '../list/catalog_list_skeleton_loader.vue'
import CatalogHeader from '../list/catalog_header.vue';
import EmptyState from '../list/empty_state.vue';
import getCatalogResources from '../../graphql/queries/get_ci_catalog_resources.query.graphql';
import getCurrentPage from '../../graphql/queries/client/get_current_page.query.graphql';
import updateCurrentPageMutation from '../../graphql/mutations/client/update_current_page.mutation.graphql';
export default {
components: {
@ -46,6 +48,12 @@ export default {
createAlert({ message: e.message || this.$options.i18n.fetchError, variant: 'danger' });
},
},
currentPage: {
query: getCurrentPage,
update(data) {
return data?.page?.current || 1;
},
},
},
computed: {
hasResources() {
@ -72,7 +80,7 @@ export default {
},
});
this.currentPage -= 1;
this.decrementPage();
} catch (e) {
// Ensure that the current query is properly stoped if an error occurs.
this.$apollo.queries.catalogResources.stop();
@ -87,7 +95,7 @@ export default {
},
});
this.currentPage += 1;
this.incrementPage();
} catch (e) {
// Ensure that the current query is properly stoped if an error occurs.
this.$apollo.queries.catalogResources.stop();
@ -95,6 +103,20 @@ export default {
createAlert({ message: e?.message || this.$options.i18n.fetchError, variant: 'danger' });
}
},
updatePageCount(pageNumber) {
this.$apollo.mutate({
mutation: updateCurrentPageMutation,
variables: {
pageNumber,
},
});
},
decrementPage() {
this.updatePageCount(this.currentPage - 1);
},
incrementPage() {
this.updatePageCount(this.currentPage + 1);
},
onUpdateSearchTerm(searchTerm) {
this.searchTerm = !searchTerm.length ? null : searchTerm;
this.resetPageCount();
@ -109,7 +131,7 @@ export default {
});
},
resetPageCount() {
this.currentPage = 1;
this.updatePageCount(1);
},
},
i18n: {

View File

@ -0,0 +1,7 @@
mutation updateCurrentPage($pageNumber: Int!) {
updateCurrentPage(pageNumber: $pageNumber) @client {
page {
current
}
}
}

View File

@ -0,0 +1,5 @@
query getCurrentPage {
page @client {
current
}
}

View File

@ -1,33 +1,45 @@
import { componentsMockData } from '../constants';
import getCurrentPage from './queries/client/get_current_page.query.graphql';
export const ciCatalogResourcesItemsCount = 20;
export const CI_CATALOG_RESOURCE_TYPE = 'Ci::Catalog::Resource';
export const cacheConfig = {
cacheConfig: {
typePolicies: {
Query: {
fields: {
ciCatalogResource(_, { args, toReference }) {
return toReference({
__typename: 'CiCatalogResource',
// Webpath is the fullpath with a leading slash
webPath: `/${args.fullPath}`,
});
},
ciCatalogResources: {
keyArgs: false,
},
typePolicies: {
Query: {
fields: {
ciCatalogResource(_, { args, toReference }) {
return toReference({
__typename: 'CiCatalogResource',
// Webpath is the fullpath with a leading slash
webPath: `/${args.fullPath}`,
});
},
ciCatalogResources: {
keyArgs: false,
},
},
CiCatalogResource: {
keyFields: ['webPath'],
},
},
CiCatalogResource: {
keyFields: ['webPath'],
},
},
};
export const resolvers = {
Mutation: {
updateCurrentPage: (_, { pageNumber }, { cache }) => {
cache.writeQuery({
query: getCurrentPage,
data: {
page: {
__typename: 'CatalogPage',
current: pageNumber,
},
},
});
},
},
CiCatalogResource: {
components() {
return componentsMockData;

View File

@ -0,0 +1,11 @@
type CatalogPage {
current: Int
}
extend type Query {
page: CatalogPage
}
extend type Mutation {
updateCurrentPage(pageNumber: Int!): CatalogPage
}

View File

@ -2,6 +2,7 @@ import Vue from 'vue';
import VueApollo from 'vue-apollo';
import createDefaultClient from '~/lib/graphql';
import { cacheConfig, resolvers } from '~/ci/catalog/graphql/settings';
import typeDefs from '~/ci/catalog/graphql/typedefs.graphql';
import GlobalCatalog from './global_catalog.vue';
import CiResourcesPage from './components/pages/ci_resources_page.vue';
@ -19,7 +20,7 @@ export const initCatalog = (selector = '#js-ci-cd-catalog') => {
Vue.use(VueApollo);
const apolloProvider = new VueApollo({
defaultClient: createDefaultClient(resolvers, cacheConfig),
defaultClient: createDefaultClient(resolvers, { cacheConfig, typeDefs }),
});
return new Vue({

View File

@ -68,7 +68,7 @@ export default {
{
class: [
'js-log-line',
'log-line',
'job-log-line',
{ 'gl-bg-gray-700': isHighlighted || applyHashHighlight },
],
},

View File

@ -68,7 +68,7 @@ export default {
<template>
<div
class="js-log-line log-line collapsible-line d-flex justify-content-between ws-normal gl-align-items-flex-start gl-relative"
class="js-log-line job-log-line-header job-log-line"
:class="{ 'gl-bg-gray-700': isHighlighted || applyHashHighlight }"
role="button"
@click="handleOnClick"
@ -78,7 +78,7 @@ export default {
<span
v-for="(content, i) in line.content"
:key="i"
class="line-text w-100 gl-white-space-pre-wrap"
class="gl-flex-grow-1 gl-white-space-pre-wrap"
:class="content.style"
>{{ content.text }}</span
>

View File

@ -20,7 +20,7 @@ export default {
return h(
'a',
{
class: 'gl-link d-inline-block text-right line-number flex-shrink-0',
class: 'job-log-line-number',
attrs: {
id: lineId,
href: lineHref,

View File

@ -66,7 +66,7 @@ export default {
};
</script>
<template>
<code class="job-log d-block" data-testid="job-log-content">
<code class="job-log gl-display-block" data-testid="job-log-content">
<template v-for="line in jobLog">
<template v-if="isLineVisible(line)">
<log-line-header

View File

@ -207,6 +207,7 @@
"WorkItemWidgetDefinition": [
"WorkItemWidgetDefinitionAssignees",
"WorkItemWidgetDefinitionGeneric",
"WorkItemWidgetDefinitionHierarchy",
"WorkItemWidgetDefinitionLabels"
]
}

View File

@ -178,9 +178,6 @@ export default {
canAssignUnassignUser() {
return this.workItemAssignees && this.canSetWorkItemMetadata;
},
projectFullPath() {
return this.workItem.namespace?.fullPath;
},
workItemsMvc2Enabled() {
return this.glFeatures.workItemsMvc2;
},
@ -450,7 +447,7 @@ export default {
v-if="showWorkItemCurrentUserTodos"
:work-item-id="workItem.id"
:work-item-iid="workItemIid"
:work-item-fullpath="projectFullPath"
:work-item-fullpath="fullPath"
:current-user-todos="currentUserTodos"
@error="updateError = $event"
/>
@ -546,7 +543,7 @@ export default {
<work-item-award-emoji
v-if="workItemAwardEmoji"
:work-item-id="workItem.id"
:work-item-fullpath="projectFullPath"
:work-item-fullpath="fullPath"
:award-emoji="workItemAwardEmoji.awardEmoji"
:work-item-iid="workItemIid"
@error="updateError = $event"
@ -569,7 +566,7 @@ export default {
v-if="showWorkItemLinkedItems"
:work-item-id="workItem.id"
:work-item-iid="workItemIid"
:work-item-full-path="projectFullPath"
:work-item-full-path="fullPath"
:work-item-type="workItem.workItemType.name"
@showModal="openInModal"
/>

View File

@ -180,18 +180,19 @@
background-color: $builds-log-bg;
}
.log-line {
.job-log-line {
padding: 1px $gl-padding-8 1px $job-log-line-padding;
min-height: $gl-line-height-20;
}
.line-number {
.job-log-line-number {
color: $gray-500;
padding: 0 $gl-padding-8;
padding: 0 1em 0 $gl-padding-8;
min-width: $job-line-number-width;
margin-left: -$job-line-number-margin;
padding-right: 1em;
user-select: none;
display: inline-block;
text-align: right;
&:hover,
&:active,
@ -201,7 +202,11 @@
}
}
.collapsible-line {
.job-log-line-header {
display: flex;
position: relative;
align-items: flex-start;
&:hover {
background-color: rgba($white, 0.2);
}

View File

@ -96,7 +96,7 @@ class MilestonesFinder
end
def by_iids(items)
return items unless params[:iids].present? && !params[:include_parent_milestones]
return items unless params[:iids].present? && !params[:include_ancestors]
items.by_iid(params[:iids])
end

View File

@ -30,6 +30,12 @@ module Resolvers
widget_definitions: :enabled_widget_definitions
}
end
def nested_preloads
{
widget_definitions: { allowed_child_types: :allowed_child_types_by_name }
}
end
end
end
end

View File

@ -13,7 +13,8 @@ module Types
ORPHAN_TYPES = [
::Types::WorkItems::WidgetDefinitions::AssigneesType,
::Types::WorkItems::WidgetDefinitions::GenericType
::Types::WorkItems::WidgetDefinitions::GenericType,
::Types::WorkItems::WidgetDefinitions::HierarchyType
].freeze
def self.ce_orphan_types
@ -23,6 +24,8 @@ module Types
def self.resolve_type(object, _context)
if object == ::WorkItems::Widgets::Assignees
::Types::WorkItems::WidgetDefinitions::AssigneesType
elsif object == ::WorkItems::Widgets::Hierarchy
::Types::WorkItems::WidgetDefinitions::HierarchyType
else
::Types::WorkItems::WidgetDefinitions::GenericType
end

View File

@ -0,0 +1,26 @@
# frozen_string_literal: true
module Types
module WorkItems
module WidgetDefinitions
# rubocop:disable Graphql/AuthorizeTypes -- authorized in work item type entity
class HierarchyType < BaseObject
graphql_name 'WorkItemWidgetDefinitionHierarchy'
description 'Represents a hierarchy widget definition'
implements Types::WorkItems::WidgetDefinitionInterface
field :allowed_child_types, Types::WorkItems::TypeType.connection_type,
null: true,
complexity: 5,
extras: [:parent],
description: 'Allowed child types for the work item type.'
def allowed_child_types(parent:)
parent.allowed_child_types(cache: true)
end
end
# rubocop:enable Graphql/AuthorizeTypes
end
end
end

View File

@ -15,14 +15,6 @@ module DashboardHelper
merge_requests_dashboard_path(reviewer_username: current_user.username)
end
def dashboard_nav_links
@dashboard_nav_links ||= get_dashboard_nav_links
end
def dashboard_nav_link?(link)
dashboard_nav_links.include?(link)
end
def has_start_trial?
false
end
@ -53,18 +45,6 @@ module DashboardHelper
end
end
end
private
def get_dashboard_nav_links
links = [:projects, :groups, :snippets, :your_work, :explore]
if can?(current_user, :read_cross_project)
links += [:activity, :milestones]
end
links
end
end
DashboardHelper.prepend_mod_with('DashboardHelper')

View File

@ -25,14 +25,6 @@ module ExploreHelper
request_path_with_options(options)
end
def explore_nav_links
@explore_nav_links ||= get_explore_nav_links
end
def explore_nav_link?(link)
explore_nav_links.include?(link)
end
def public_visibility_restricted?
Gitlab::VisibilityLevel.public_visibility_restricted?
end
@ -56,10 +48,6 @@ module ExploreHelper
private
def get_explore_nav_links
[:projects, :groups, :topics, :snippets]
end
def request_path_with_options(options = {})
request.path + "?#{options.to_param}"
end

View File

@ -1,340 +0,0 @@
# frozen_string_literal: true
module Nav
module TopNavHelper
PROJECTS_VIEW = :projects
GROUPS_VIEW = :groups
NEW_VIEW = :new
SEARCH_VIEW = :search
def top_nav_view_model(project:, group:)
builder = ::Gitlab::Nav::TopNavViewModelBuilder.new
build_base_view_model(builder: builder, project: project, group: group)
builder.build
end
def top_nav_responsive_view_model(project:, group:)
builder = ::Gitlab::Nav::TopNavViewModelBuilder.new
build_base_view_model(builder: builder, project: project, group: group)
new_view_model = new_dropdown_view_model(project: project, group: group)
if new_view_model && new_view_model.fetch(:menu_sections)&.any?
builder.add_view(NEW_VIEW, new_view_model)
end
if top_nav_show_search
builder.add_view(SEARCH_VIEW, ::Gitlab::Nav::TopNavMenuItem.build(**top_nav_search_menu_item_attrs))
end
builder.build
end
def top_nav_show_search
header_link?(:search)
end
def top_nav_search_menu_item_attrs
{
id: 'search',
title: _('Search'),
icon: 'search',
href: search_context.search_url
}
end
private
def top_nav_localized_headers
{
explore: s_('TopNav|Explore'),
switch_to: s_('TopNav|Switch to')
}.freeze
end
def build_base_view_model(builder:, project:, group:)
if current_user
build_view_model(builder: builder, project: project, group: group)
else
build_anonymous_view_model(builder: builder)
end
end
def build_anonymous_view_model(builder:)
if explore_nav_link?(:projects)
builder.add_primary_menu_item_with_shortcut(
header: top_nav_localized_headers[:explore],
href: explore_root_path,
active: nav == 'project' || active_nav_link?(path: %w[dashboard#show root#show projects#trending projects#starred projects#index]),
**projects_menu_item_attrs
)
end
if explore_nav_link?(:groups)
builder.add_primary_menu_item_with_shortcut(
header: top_nav_localized_headers[:explore],
href: explore_groups_path,
active: nav == 'group' || active_nav_link?(controller: [:groups, 'groups/milestones', 'groups/group_members']),
**groups_menu_item_attrs
)
end
if explore_nav_link?(:topics)
builder.add_primary_menu_item_with_shortcut(
header: top_nav_localized_headers[:explore],
active: active_nav_link?(page: topics_explore_projects_path, path: 'projects#topic'),
href: topics_explore_projects_path,
**topics_menu_item_attrs
)
end
if explore_nav_link?(:snippets)
builder.add_primary_menu_item_with_shortcut(
header: top_nav_localized_headers[:explore],
active: active_nav_link?(controller: :snippets),
href: explore_snippets_path,
**snippets_menu_item_attrs
)
end
end
def build_view_model(builder:, project:, group:)
# These come from `app/views/layouts/nav/_dashboard.html.haml`
if dashboard_nav_link?(:projects)
current_item = project ? current_project(project: project) : {}
builder.add_primary_menu_item_with_shortcut(
header: top_nav_localized_headers[:switch_to],
active: nav == 'project' || active_nav_link?(path: %w[root#index projects#trending projects#starred dashboard/projects#index]),
data: { track_label: "projects_dropdown", track_action: "click_dropdown", track_property: "navigation_top", testid: "projects_dropdown" },
view: PROJECTS_VIEW,
shortcut_href: dashboard_projects_path,
**projects_menu_item_attrs
)
builder.add_view(PROJECTS_VIEW, container_view_props(namespace: 'projects', current_item: current_item, submenu: projects_submenu))
end
if dashboard_nav_link?(:groups)
current_item = group ? current_group(group: group) : {}
builder.add_primary_menu_item_with_shortcut(
header: top_nav_localized_headers[:switch_to],
active: nav == 'group' || active_nav_link?(path: %w[dashboard/groups explore/groups]),
data: { track_label: "groups_dropdown", track_action: "click_dropdown", track_property: "navigation_top", testid: "groups_dropdown" },
view: GROUPS_VIEW,
shortcut_href: dashboard_groups_path,
**groups_menu_item_attrs
)
builder.add_view(GROUPS_VIEW, container_view_props(namespace: 'groups', current_item: current_item, submenu: groups_submenu))
end
if dashboard_nav_link?(:your_work)
builder.add_primary_menu_item(
id: 'your-work',
header: top_nav_localized_headers[:switch_to],
title: _('Your work'),
href: dashboard_projects_path,
active: active_nav_link?(controller: []),
icon: 'work',
data: { **menu_data_tracking_attrs('your-work') }
)
end
if dashboard_nav_link?(:explore)
builder.add_primary_menu_item(
id: 'explore',
header: top_nav_localized_headers[:switch_to],
title: _('Explore'),
href: explore_projects_path,
active: active_nav_link?(controller: ["explore/groups", "explore/snippets"], page: ["/explore/projects", "/explore", "/explore/projects/topics"], path: ["projects#topic"]),
icon: 'compass',
data: { **menu_data_tracking_attrs('explore') }
)
end
if dashboard_nav_link?(:milestones)
builder.add_shortcut(
id: 'milestones-shortcut',
title: _('Milestones'),
href: dashboard_milestones_path,
css_class: 'dashboard-shortcuts-milestones'
)
end
if dashboard_nav_link?(:snippets)
builder.add_shortcut(
id: 'snippets-shortcut',
title: _('Snippets'),
href: dashboard_snippets_path,
css_class: 'dashboard-shortcuts-snippets'
)
end
if dashboard_nav_link?(:activity)
builder.add_shortcut(
id: 'activity-shortcut',
title: _('Activity'),
href: activity_dashboard_path,
css_class: 'dashboard-shortcuts-activity'
)
end
# Using admin? is generally discouraged because it does not check for
# "admin_mode". In this case we are migrating code and check both, so
# we should be good.
# rubocop: disable Cop/UserAdmin
if current_user&.admin?
title = _('Admin')
builder.add_secondary_menu_item(
id: 'admin',
title: title,
active: active_nav_link?(controller: 'admin/dashboard'),
icon: 'admin',
href: admin_root_path,
data: { qa_selector: 'admin_area_link', **menu_data_tracking_attrs(title) }
)
end
if Gitlab::CurrentSettings.admin_mode
if header_link?(:admin_mode)
builder.add_secondary_menu_item(
id: 'leave_admin_mode',
title: _('Leave admin mode'),
active: active_nav_link?(controller: 'admin/sessions'),
icon: 'lock-open',
href: destroy_admin_session_path,
data: { method: 'post', **menu_data_tracking_attrs('leave_admin_mode') }
)
elsif current_user.admin?
title = _('Enter admin mode')
builder.add_secondary_menu_item(
id: 'enter_admin_mode',
title: title,
active: active_nav_link?(controller: 'admin/sessions'),
icon: 'lock',
href: new_admin_session_path,
data: { testid: 'menu_item_link', qa_title: title, **menu_data_tracking_attrs(title) }
)
end
end
# rubocop: enable Cop/UserAdmin
end
def projects_menu_item_attrs
{
id: 'project',
title: _('Projects'),
icon: 'project',
shortcut_class: 'dashboard-shortcuts-projects'
}
end
def groups_menu_item_attrs
{
id: 'groups',
title: _('Groups'),
icon: 'group',
shortcut_class: 'dashboard-shortcuts-groups'
}
end
def topics_menu_item_attrs
{
id: 'topics',
title: _('Topics'),
icon: 'labels',
shortcut_class: 'dashboard-shortcuts-topics'
}
end
def snippets_menu_item_attrs
{
id: 'snippets',
title: _('Snippets'),
icon: 'snippet',
shortcut_class: 'dashboard-shortcuts-snippets'
}
end
def menu_data_tracking_attrs(label)
tracking_attrs(
"menu_#{label.underscore.parameterize(separator: '_')}",
'click_dropdown',
'navigation_top'
)[:data] || {}
end
def container_view_props(namespace:, current_item:, submenu:)
{
namespace: namespace,
currentUserName: current_user&.username,
currentItem: current_item,
linksPrimary: submenu[:primary],
linksSecondary: submenu[:secondary]
}
end
def current_project(project:)
return {} unless project.persisted?
{
id: project.id,
name: project.name,
namespace: project.full_name,
webUrl: project_path(project),
avatarUrl: project.avatar_url
}
end
def current_group(group:)
return {} unless group.persisted?
{
id: group.id,
name: group.name,
namespace: group.full_name,
webUrl: group_path(group),
avatarUrl: group.avatar_url
}
end
def projects_submenu
builder = ::Gitlab::Nav::TopNavMenuBuilder.new
projects_submenu_items(builder: builder)
builder.build
end
def projects_submenu_items(builder:)
title = _('View all projects')
builder.add_primary_menu_item(
id: 'your',
title: title,
href: dashboard_projects_path,
data: { testid: 'menu_item_link', qa_title: title, **menu_data_tracking_attrs(title) }
)
end
def groups_submenu
# These group links come from `app/views/layouts/nav/groups_dropdown/_show.html.haml`
builder = ::Gitlab::Nav::TopNavMenuBuilder.new
title = _('View all groups')
builder.add_primary_menu_item(
id: 'your',
title: title,
href: dashboard_groups_path,
data: { testid: 'menu_item_link', qa_title: title, **menu_data_tracking_attrs(title) }
)
builder.build
end
end
end
Nav::TopNavHelper.prepend_mod

View File

@ -1937,7 +1937,7 @@ class Project < ApplicationRecord
repository = project_repository || build_project_repository
repository.update!(shard_name: repository_storage, disk_path: disk_path)
cleanup if replicate_object_pool_on_move_ff_enabled?
cleanup
end
def create_repository(force: false, default_branch: nil, object_format: nil)
@ -2760,7 +2760,6 @@ class Project < ApplicationRecord
# After repository is moved from shard to shard, disconnect it from the previous object pool and connect to the new pool
def swap_pool_repository!
return unless replicate_object_pool_on_move_ff_enabled?
return unless repository_exists?
old_pool_repository = pool_repository
@ -2775,7 +2774,7 @@ class Project < ApplicationRecord
def link_pool_repository
return unless pool_repository
return if (pool_repository.shard_name != repository.shard) && replicate_object_pool_on_move_ff_enabled?
return if pool_repository.shard_name != repository.shard
pool_repository.link_repository(repository)
end
@ -3463,10 +3462,6 @@ class Project < ApplicationRecord
RunnersTokenPrefixable::RUNNERS_TOKEN_PREFIX
end
def replicate_object_pool_on_move_ff_enabled?
Feature.enabled?(:replicate_object_pool_on_move, self)
end
def pool_repository_shard_matches_repository?(pool)
pool_repository_shard = pool.shard.name

View File

@ -9,6 +9,11 @@ module WorkItems
self.table_name = 'work_item_types'
include CacheMarkdownField
include ReactiveCaching
self.reactive_cache_work_type = :no_dependency
self.reactive_cache_refresh_interval = 10.minutes
self.reactive_cache_lifetime = 1.hour
# type name is used in restrictions DB seeder to assure restrictions for
# default types are pre-filled
@ -53,8 +58,14 @@ module WorkItems
has_many :widget_definitions, foreign_key: :work_item_type_id, inverse_of: :work_item_type
has_many :enabled_widget_definitions, -> { where(disabled: false) }, foreign_key: :work_item_type_id,
inverse_of: :work_item_type, class_name: 'WorkItems::WidgetDefinition'
has_many :child_restrictions, class_name: 'WorkItems::HierarchyRestriction', foreign_key: :parent_type_id,
inverse_of: :parent_type
has_many :allowed_child_types_by_name, -> { order_by_name_asc },
through: :child_restrictions, class_name: 'WorkItems::Type',
foreign_key: :child_type_id, source: :child_type
before_validation :strip_whitespace
after_save :clear_reactive_cache!
# TODO: review validation rules
# https://gitlab.com/gitlab-org/gitlab/-/issues/336919
@ -101,6 +112,16 @@ module WorkItems
name == WorkItems::Type::TYPE_NAMES[:issue]
end
def calculate_reactive_cache
allowed_child_types_by_name
end
def allowed_child_types(cache: false)
cached_data = cache ? with_reactive_cache { |query_data| query_data } : nil
cached_data || allowed_child_types_by_name
end
private
def strip_whitespace

View File

@ -18,7 +18,7 @@ module Projects
project.track_project_repository
# Link repository from the new shard to pool repository from the new shard
project.link_pool_repository if replicate_object_pool_on_move_ff_enabled?
project.link_pool_repository
end
def mirror_repositories
@ -36,7 +36,6 @@ module Projects
end
def mirror_object_pool(destination_storage_name)
return unless replicate_object_pool_on_move_ff_enabled?
return unless project.repository_exists?
pool_repository = project.pool_repository
@ -92,9 +91,5 @@ module Projects
state: 'ready'
)
end
def replicate_object_pool_on_move_ff_enabled?
Feature.enabled?(:replicate_object_pool_on_move, project)
end
end
end

View File

@ -1,17 +1,18 @@
.gpg-popover-certificate-details
%strong= _('Certificate Subject')
- if signature.x509_certificate.revoked?
%strong.cred= _('(revoked)')
%ul
- x509_subject(signature.x509_certificate.subject, ["CN", "O"]).map do |key, value|
%li= key + "=" + value
%li= _('Subject Key Identifier:')
%li.unstyled= signature.x509_certificate.subject_key_identifier.gsub(":", " ")
- if signature.x509_certificate
.gpg-popover-certificate-details
%strong= _('Certificate Subject')
- if signature.x509_certificate.revoked?
%strong.cred= _('(revoked)')
%ul
- x509_subject(signature.x509_certificate.subject, ["CN", "O"]).map do |key, value|
%li= key + "=" + value
%li= _('Subject Key Identifier:')
%li.unstyled= signature.x509_certificate.subject_key_identifier.gsub(":", " ")
.gpg-popover-certificate-details
%strong= _('Certificate Issuer')
%ul
- x509_subject(signature.x509_certificate.x509_issuer.subject, ["CN", "OU", "O"]).map do |key, value|
%li= key + "=" + value
%li= _('Subject Key Identifier:')
%li.unstyled= signature.x509_certificate.x509_issuer.subject_key_identifier.gsub(":", " ")
.gpg-popover-certificate-details
%strong= _('Certificate Issuer')
%ul
- x509_subject(signature.x509_certificate.x509_issuer.subject, ["CN", "OU", "O"]).map do |key, value|
%li= key + "=" + value
%li= _('Subject Key Identifier:')
%li.unstyled= signature.x509_certificate.x509_issuer.subject_key_identifier.gsub(":", " ")

View File

@ -1,8 +0,0 @@
---
name: replicate_object_pool_on_move
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/127143
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/420720
milestone: '16.3'
type: development
group: group::source code
default_enabled: true

View File

@ -0,0 +1,12 @@
- title: "List repository directories Rake task"
removal_milestone: "17.0"
announcement_milestone: "16.7"
breaking_change: true
reporter: mkozono
stage: enablement
issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/384361
body: |
The `gitlab-rake gitlab:list_repos` Rake task does not work and will be removed in GitLab 17.0.
If you're migrating GitLab, use
[backup and restore](https://docs.gitlab.com/ee/administration/operations/moving_repositories.html#recommended-approach-in-all-cases)
instead.

View File

@ -2,7 +2,6 @@
stage: none
group: unassigned
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
type: reference
---
# GitLab Admin Area **(FREE SELF)**

View File

@ -1,5 +1,4 @@
---
type: reference
stage: Govern
group: Authentication
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments

View File

@ -1,5 +1,4 @@
---
type: concepts, howto
stage: Govern
group: Authentication
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments

View File

@ -1,5 +1,4 @@
---
type: reference
stage: Govern
group: Authentication
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments

View File

@ -1,5 +1,4 @@
---
type: index
stage: Govern
group: Authentication
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments

View File

@ -1,5 +1,4 @@
---
type: reference
stage: Govern
group: Authentication
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments

View File

@ -1,5 +1,4 @@
---
type: reference
stage: Govern
group: Authentication
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments

View File

@ -1,5 +1,4 @@
---
type: reference
stage: Govern
group: Authentication
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments

View File

@ -1,5 +1,4 @@
---
type: reference
stage: Govern
group: Authentication
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments

View File

@ -1,5 +1,4 @@
---
type: reference
stage: Govern
group: Authentication
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments

View File

@ -2,7 +2,6 @@
stage: Govern
group: Authentication
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
type: reference
---
# Smartcard authentication **(PREMIUM SELF)**

View File

@ -2,7 +2,6 @@
stage: Growth
group: Acquisition
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
type: reference, howto
---
# Broadcast messages **(FREE SELF)**

View File

@ -2,7 +2,6 @@
stage: Verify
group: Pipeline Execution
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
type: howto
---
# GitLab CI/CD instance configuration **(FREE SELF)**

View File

@ -2,7 +2,6 @@
stage: Systems
group: Distribution
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
type: reference
---
# Configure your GitLab installation **(FREE SELF)**

View File

@ -2,7 +2,6 @@
stage: Systems
group: Distribution
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
type: reference
---
# How to set up Consul **(PREMIUM SELF)**

View File

@ -2,7 +2,6 @@
stage: Govern
group: Authentication
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
type: howto
---
# Credentials inventory **(ULTIMATE SELF)**

View File

@ -2,7 +2,6 @@
stage: Create
group: Source Code
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
type: reference
---
# Diff limits administration **(FREE SELF)**

View File

@ -2,7 +2,6 @@
stage: none
group: unassigned
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
type: howto, reference
---
# Email from GitLab **(PREMIUM SELF)**

View File

@ -2,7 +2,6 @@
stage: Systems
group: Distribution
info: "To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments"
type: reference
---
# Encrypted Configuration **(FREE SELF)**

View File

@ -2,7 +2,6 @@
stage: Systems
group: Distribution
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
type: reference
---
# Environment variables **(FREE SELF)**

View File

@ -2,7 +2,6 @@
stage: Verify
group: Pipeline Execution
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
type: reference, howto
---
# External pipeline validation **(FREE SELF)**

View File

@ -2,7 +2,6 @@
stage: Manage
group: Import and Integrate
info: "To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments"
type: reference
---
# File hooks **(FREE SELF)**

View File

@ -2,7 +2,6 @@
stage: Systems
group: Geo
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
type: howto
---
# Bring a demoted primary site back online **(PREMIUM SELF)**

View File

@ -2,7 +2,6 @@
stage: Systems
group: Geo
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
type: howto
---
# Disaster recovery for planned failover **(PREMIUM SELF)**

View File

@ -2,7 +2,6 @@
stage: Systems
group: Geo
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
type: howto
---
WARNING:

View File

@ -2,7 +2,6 @@
stage: Systems
group: Geo
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
type: howto
---
WARNING:

View File

@ -2,7 +2,6 @@
stage: Systems
group: Geo
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
type: howto
---

View File

@ -2,7 +2,6 @@
stage: Systems
group: Geo
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
type: howto
---
# Geo configuration **(PREMIUM SELF)**

View File

@ -2,7 +2,6 @@
stage: Systems
group: Geo
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
type: howto
---
# Container registry for a secondary site **(PREMIUM SELF)**

View File

@ -2,7 +2,6 @@
stage: Systems
group: Geo
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
type: howto
---
# Supported Geo data types **(PREMIUM SELF)**

View File

@ -2,7 +2,6 @@
stage: Systems
group: Geo
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
type: howto
---
# Disabling Geo **(PREMIUM SELF)**

View File

@ -2,7 +2,6 @@
stage: Systems
group: Geo
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
type: howto
---
# Location-aware Git remote URL with AWS Route53 **(PREMIUM SELF)**

View File

@ -2,7 +2,6 @@
stage: Systems
group: Geo
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
type: howto
---
# Geo for multiple nodes **(PREMIUM SELF)**

View File

@ -2,7 +2,6 @@
stage: Systems
group: Geo
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
type: howto
---
# Geo with Object storage **(PREMIUM SELF)**

View File

@ -2,7 +2,6 @@
stage: Systems
group: Geo
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
type: howto
---
# Removing secondary Geo sites **(PREMIUM SELF)**

View File

@ -2,7 +2,6 @@
stage: Systems
group: Geo
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
type: howto
---
# Geo security review (Q&A) **(PREMIUM SELF)**

View File

@ -2,7 +2,6 @@
stage: Systems
group: Geo
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
type: howto
---
# Geo with Single Sign On (SSO) **(PREMIUM SELF)**

View File

@ -2,7 +2,6 @@
stage: Systems
group: Geo
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
type: howto
---
# Tuning Geo **(PREMIUM SELF)**

View File

@ -2,7 +2,6 @@
stage: Systems
group: Geo
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
type: howto
---
# Upgrading the Geo sites **(PREMIUM SELF)**

View File

@ -2,7 +2,6 @@
stage: Systems
group: Geo
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
type: howto
---
# Geo proxying for secondary sites **(PREMIUM SELF)**

View File

@ -2,7 +2,6 @@
stage: Systems
group: Geo
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
type: howto
---
# Location-aware public URL **(PREMIUM SELF)**

View File

@ -2,7 +2,6 @@
stage: Systems
group: Geo
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
type: howto
---
# Geo database replication **(PREMIUM SELF)**

View File

@ -2,7 +2,6 @@
stage: Systems
group: Geo
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
type: howto
---
# Setting up Geo **(PREMIUM SELF)**

View File

@ -2,7 +2,6 @@
stage: Systems
group: Distribution
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
type: reference
---
# GitLab application limits **(FREE SELF)**

View File

@ -2,7 +2,6 @@
stage: Create
group: Source Code
info: "To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments"
type: reference, howto
---
# Diagrams.net **(FREE SELF)**

View File

@ -2,7 +2,6 @@
stage: Plan
group: Project Management
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
type: reference, howto
---
# Mailgun **(FREE SELF)**

View File

@ -2,7 +2,6 @@
stage: Create
group: Source Code
info: "To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments"
type: reference, howto
---
# PlantUML **(FREE SELF)**

View File

@ -2,7 +2,6 @@
stage: Plan
group: Project Management
info: "To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments"
type: reference
---
# Markdown cache **(FREE SELF)**

View File

@ -2,7 +2,6 @@
stage: Create
group: Code Review
info: "To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments"
type: reference
---
# Issue closing pattern **(FREE SELF)**

View File

@ -2,7 +2,6 @@
stage: Verify
group: Runner
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
type: reference
---
# Job logs **(FREE SELF)**

View File

@ -2,7 +2,6 @@
stage: Plan
group: Project Management
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
type: reference
---
# Labels administration **(FREE SELF)**

View File

@ -2,7 +2,6 @@
stage: Systems
group: Distribution
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
type: howto
---
# Using the Libravatar service with GitLab **(FREE SELF)**

View File

@ -2,7 +2,6 @@
stage: Create
group: Source Code
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
type: reference, concepts
---
# Merge request approvals **(PREMIUM SELF)**

View File

@ -2,7 +2,6 @@
stage: Govern
group: Authentication
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
type: howto
---
# Moderate users (administration) **(FREE SELF)**

View File

@ -2,7 +2,6 @@
stage: Systems
group: Distribution
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
type: reference
---
# Using NFS with GitLab **(FREE SELF)**

View File

@ -2,7 +2,6 @@
stage: Data Stores
group: Database
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
type: reference
---
# Working with the bundled PgBouncer service **(FREE SELF)**

View File

@ -898,6 +898,12 @@ Stopping or restarting the Patroni service on the leader node triggers an automa
### Manual failover procedure for Patroni
WARNING:
In GitLab 16.5 and earlier, PgBouncer nodes do not automatically fail over alongside
Patroni nodes. PgBouncer services
[must be restarted manually](#pgbouncer-errors-error-running-command-gitlabctlerrorsexecutionerror-and-error-database-gitlabhq_production-is-not-paused)
for a successful switchover.
While Patroni supports automatic failover, you also have the ability to perform
a manual one, where you have two slightly different options:
@ -920,7 +926,7 @@ For further details on this subject, see the
#### Geo secondary site considerations
When a Geo secondary site is replicating from a primary site that uses `Patroni` and `PgBouncer`, [replicating through PgBouncer is not supported](https://github.com/pgbouncer/pgbouncer/issues/382#issuecomment-517911529). The secondary *must* replicate directly from the leader node in the `Patroni` cluster. When there is an automatic or manual failover in the `Patroni` cluster, you can manually re-point your secondary site to replicate from the new leader with:
When a Geo secondary site is replicating from a primary site that uses `Patroni` and `PgBouncer`, [replicating through PgBouncer is not supported](https://github.com/pgbouncer/pgbouncer/issues/382#issuecomment-517911529). The secondary _must_ replicate directly from the leader node in the `Patroni` cluster. When there is an automatic or manual failover in the `Patroni` cluster, you can manually re-point your secondary site to replicate from the new leader with:
```shell
sudo gitlab-ctl replicate-geo-database --host=<new_leader_ip> --replication-slot=<slot_name>
@ -957,7 +963,7 @@ For further details, see [Patroni documentation on this subject](https://patroni
### Switching from repmgr to Patroni
WARNING:
Switching from repmgr to Patroni is straightforward, the other way around is *not*. Rolling back from Patroni to repmgr can be complicated and may involve deletion of data directory. If you need to do that, contact GitLab support.
Switching from repmgr to Patroni is straightforward, the other way around is _not_. Rolling back from Patroni to repmgr can be complicated and may involve deletion of data directory. If you need to do that, contact GitLab support.
You can switch an exiting database cluster to use Patroni instead of repmgr with the following steps:
@ -1011,7 +1017,7 @@ Here are a few key facts that you must consider before upgrading PostgreSQL:
GitLab deployment is down for the duration of database upgrade or, at least, as long as your leader
node is upgraded. This can be **a significant downtime depending on the size of your database**.
- Upgrading PostgreSQL creates a new data directory with a new control data. From the perspective of Petroni, this is a new cluster that needs to be bootstrapped again. Therefore, as part of the upgrade procedure, the cluster state (stored in Consul) is wiped out. After the upgrade is complete, Patroni bootstraps a new cluster. **This changes your _cluster ID_**.
- Upgrading PostgreSQL creates a new data directory with a new control data. From the perspective of Patroni, this is a new cluster that needs to be bootstrapped again. Therefore, as part of the upgrade procedure, the cluster state (stored in Consul) is wiped out. After the upgrade is complete, Patroni bootstraps a new cluster. **This changes your _cluster ID_**.
- The procedures for upgrading leader and replicas are not the same. That is why it is important to use the right procedure on each node.
@ -1311,9 +1317,11 @@ postgresql['trust_auth_cidr_addresses'] = %w(123.123.123.123/32 <other_cidrs>)
### PgBouncer errors `Error running command: GitlabCtl::Errors::ExecutionError` and `ERROR: database gitlabhq_production is not paused`
In versions of GitLab prior to 16.5.0, the automatic failover of PgBouncer does not
happen after a Patroni switchover. GitLab failed to detect a paused database, then
attempted to `RESUME` a not-paused database:
Due to a [known issue](https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/8166) that
affects versions of GitLab prior to 16.5.0, the automatic failover of PgBouncer nodes does not
happen after a [Patroni switchover](#manual-failover-procedure-for-patroni). In this
example, GitLab failed to detect a paused database, then attempted to `RESUME` a
not-paused database:
```plaintext
INFO -- : Running: gitlab-ctl pgb-notify --pg-database gitlabhq_production --newhost database7.example.com --user pgbouncer --hostuser gitlab-consul
@ -1321,6 +1329,13 @@ ERROR -- : STDERR: Error running command: GitlabCtl::Errors::ExecutionError
ERROR -- : STDERR: ERROR: ERROR: database gitlabhq_production is not paused
```
To ensure a [Patroni switchover](#manual-failover-procedure-for-patroni) succeeds,
you must manually restart the PgBouncer service on all PgBouncer nodes with this command:
```shell
gitlab-ctl restart pgbouncer
```
### Reinitialize a replica
If a replica cannot start or rejoin the cluster, or when it lags behind and cannot catch up, it might be necessary to reinitialize the replica:

View File

@ -1,5 +1,4 @@
---
type: index
stage: Systems
group: Distribution
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments

View File

@ -1,5 +1,4 @@
---
type: howto
stage: Systems
group: Distribution
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments

Some files were not shown because too many files have changed in this diff Show More