Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2021-06-22 15:06:55 +00:00
parent e2d00f9148
commit 793034a905
90 changed files with 1026 additions and 549 deletions

View File

@ -123,5 +123,14 @@ export default {
:tiptap-editor="contentEditor.tiptapEditor"
@execute="trackToolbarControlExecution"
/>
<toolbar-button
data-testid="horizontal-rule"
content-type="horizontalRule"
icon-name="dash"
editor-command="setHorizontalRule"
:label="__('Add a horizontal rule')"
:tiptap-editor="contentEditor.tiptapEditor"
@execute="trackToolbarControlExecution"
/>
</div>
</template>

View File

@ -1,5 +1,12 @@
import { nodeInputRule } from '@tiptap/core';
import { HorizontalRule } from '@tiptap/extension-horizontal-rule';
import { defaultMarkdownSerializer } from 'prosemirror-markdown/src/to_markdown';
export const tiptapExtension = HorizontalRule;
export const hrInputRuleRegExp = /^---$/;
export const tiptapExtension = HorizontalRule.extend({
addInputRules() {
return [nodeInputRule(hrInputRuleRegExp, this.type)];
},
});
export const serializer = defaultMarkdownSerializer.nodes.horizontal_rule;

View File

@ -1,5 +1,5 @@
<script>
import { GlDropdownItem, GlAvatar } from '@gitlab/ui';
import { GlDropdownItem, GlAvatar, GlSafeHtmlDirective as SafeHtml } from '@gitlab/ui';
import highlight from '~/lib/utils/highlight';
import { truncateNamespace } from '~/lib/utils/text_utility';
@ -9,6 +9,9 @@ export default {
GlDropdownItem,
GlAvatar,
},
directives: {
SafeHtml,
},
props: {
item: {
type: Object,
@ -62,8 +65,7 @@ export default {
:size="32"
/>
<div class="gl-display-flex gl-flex-direction-column">
<!-- eslint-disable-next-line vue/no-v-html -->
<span data-testid="item-title" v-html="highlightedItemName">{{ item[name] }}</span>
<span v-safe-html="highlightedItemName" data-testid="item-title"></span>
<span class="gl-font-sm gl-text-gray-700" data-testid="item-namespace">{{
truncatedNamespace
}}</span>

View File

@ -88,7 +88,12 @@ class AuditEvent < ApplicationRecord
end
def parallel_persist
PARALLEL_PERSISTENCE_COLUMNS.each { |col| self[col] = details[col] }
PARALLEL_PERSISTENCE_COLUMNS.each do |name|
original = self[name] || self.details[name]
next unless original
self[name] = self.details[name] = original
end
end
end

View File

@ -7,6 +7,8 @@ class Wiki
include Gitlab::Utils::StrongMemoize
include GlobalID::Identification
extend ActiveModel::Naming
MARKUPS = { # rubocop:disable Style/MultilineIfModifier
'Markdown' => :markdown,
'RDoc' => :rdoc,

View File

@ -26,7 +26,8 @@ module Ci
# this returns builds that are ordered by number of running builds
# we prefer projects that don't use shared runners at all
relation
.joins("LEFT JOIN (#{running_builds_for_shared_runners.to_sql}) AS project_builds ON ci_pending_builds.project_id=project_builds.project_id")
.with(running_builds_for_shared_runners_cte.to_arel)
.joins("LEFT JOIN project_builds ON ci_pending_builds.project_id = project_builds.project_id")
.order(Arel.sql('COALESCE(project_builds.running_builds, 0) ASC'), 'ci_pending_builds.build_id ASC')
end
end
@ -53,11 +54,14 @@ module Ci
private
def running_builds_for_shared_runners
::Ci::RunningBuild
def running_builds_for_shared_runners_cte
running_builds = ::Ci::RunningBuild
.instance_type
.group(:project_id)
.select(:project_id, 'COUNT(*) AS running_builds')
::Gitlab::SQL::CTE
.new(:project_builds, running_builds, materialized: true)
end
# rubocop:enable CodeReuse/ActiveRecord
end

View File

@ -32,11 +32,11 @@ class PostReceiveService
response.add_alert_message(broadcast_message)
response.add_merge_request_urls(merge_request_urls)
# Neither User nor Project are guaranteed to be returned; an orphaned write deploy
# Neither User nor Repository are guaranteed to be returned; an orphaned write deploy
# key could be used
if user && project
redirect_message = Gitlab::Checks::ProjectMoved.fetch_message(user.id, project.id)
project_created_message = Gitlab::Checks::ProjectCreated.fetch_message(user.id, project.id)
if user && repository
redirect_message = Gitlab::Checks::ContainerMoved.fetch_message(user, repository)
project_created_message = Gitlab::Checks::ProjectCreated.fetch_message(user, repository)
response.add_basic_message(redirect_message)
response.add_basic_message(project_created_message)
@ -94,6 +94,8 @@ class PostReceiveService
end
def record_onboarding_progress
return unless project
OnboardingProgressService.new(project.namespace).execute(action: :git_write)
end
end

View File

@ -3,14 +3,16 @@ key_path: counts_monthly.aggregated_metrics.incident_management_alerts_total_uni
description: Count of unique users per month to take an action on an alert
product_section: ops
product_stage: monitor
product_group: group::health
product_group: group::monitor
product_category: incident_management
value_type: number
status: data_available
time_frame: 28d
data_source: database
data_source: redis_hll
distribution:
- ce
- ee
tier:
- free
skip_validation: true
- premium
- ultimate

View File

@ -3,14 +3,16 @@ key_path: counts_monthly.aggregated_metrics.incident_management_incidents_total_
description: Count of unique users per month to take an action on an incident
product_section: ops
product_stage: monitor
product_group: group::health
product_group: group::monitor
product_category: incident_management
value_type: number
status: data_available
time_frame: 28d
data_source: database
data_source: redis_hll
distribution:
- ce
- ee
tier:
- free
skip_validation: true
- premium
- ultimate

View File

@ -3,14 +3,16 @@ key_path: usage_activity_by_stage_monthly.monitor.projects_with_incidents
description: 'Count of unique projects with an incident created in the last month'
product_section: ops
product_stage: monitor
product_group: group::health
product_group: group::monitor
product_category: incident_management
value_type: number
status: data_available
time_frame: 28d
data_source:
data_source: database
distribution:
- ce
- ee
tier:
- free
skip_validation: true
- premium
- ultimate

View File

@ -4,14 +4,16 @@ description: 'Count of unique projects with an incident from an alert created in
last month'
product_section: ops
product_stage: monitor
product_group: group::health
product_group: group::monitor
product_category: incident_management
value_type: number
status: data_available
time_frame: 28d
data_source:
data_source: database
distribution:
- ce
- ee
tier:
- free
skip_validation: true
- premium
- ultimate

View File

@ -1,9 +1,9 @@
---
key_path: redis_hll_counters.incident_management.incident_management_alert_status_changed_monthly
description:
description: Count of unique users changing alert's status changes per month
product_section: ops
product_stage: monitor
product_group: group::health
product_group: group::monitor
product_category:
value_type: number
status: data_available
@ -11,6 +11,8 @@ time_frame: 28d
data_source: redis_hll
distribution:
- ce
- ee
tier:
- free
skip_validation: true
- premium
- ultimate

View File

@ -1,9 +1,9 @@
---
key_path: redis_hll_counters.incident_management.incident_management_alert_assigned_monthly
description:
description: Count of unique users assigning an alert per month
product_section: ops
product_stage: monitor
product_group: group::health
product_group: group::monitor
product_category:
value_type: number
status: data_available
@ -11,6 +11,8 @@ time_frame: 28d
data_source: redis_hll
distribution:
- ce
- ee
tier:
- free
skip_validation: true
- premium
- ultimate

View File

@ -1,9 +1,9 @@
---
key_path: redis_hll_counters.incident_management.incident_management_alert_todo_monthly
description:
description: Count of unique users adding alerts to the TODO list per month
product_section: ops
product_stage: monitor
product_group: group::health
product_group: group::monitor
product_category:
value_type: number
status: data_available
@ -11,6 +11,8 @@ time_frame: 28d
data_source: redis_hll
distribution:
- ce
- ee
tier:
- free
skip_validation: true
- premium
- ultimate

View File

@ -1,9 +1,9 @@
---
key_path: redis_hll_counters.incident_management.incident_management_incident_created_monthly
description:
description: Count of unique users creating incidents per month
product_section: ops
product_stage: monitor
product_group: group::health
product_group: group::monitor
product_category:
value_type: number
status: data_available
@ -11,6 +11,8 @@ time_frame: 28d
data_source: redis_hll
distribution:
- ce
- ee
tier:
- free
skip_validation: true
- premium
- ultimate

View File

@ -1,9 +1,9 @@
---
key_path: redis_hll_counters.incident_management.incident_management_incident_reopened_monthly
description:
description: Count of unique users reopening incidents per month
product_section: ops
product_stage: monitor
product_group: group::health
product_group: group::monitor
product_category:
value_type: number
status: data_available
@ -11,6 +11,8 @@ time_frame: 28d
data_source: redis_hll
distribution:
- ce
- ee
tier:
- free
skip_validation: true
- premium
- ultimate

View File

@ -1,9 +1,9 @@
---
key_path: redis_hll_counters.incident_management.incident_management_incident_closed_monthly
description:
description: Count of users closing incidents per month
product_section: ops
product_stage: monitor
product_group: group::health
product_group: group::monitor
product_category:
value_type: number
status: data_available
@ -11,6 +11,8 @@ time_frame: 28d
data_source: redis_hll
distribution:
- ce
- ee
tier:
- free
skip_validation: true
- premium
- ultimate

View File

@ -1,9 +1,9 @@
---
key_path: redis_hll_counters.incident_management.incident_management_incident_assigned_monthly
description:
description: Count of users assigning incidents per month
product_section: ops
product_stage: monitor
product_group: group::health
product_group: group::monitor
product_category:
value_type: number
status: data_available
@ -11,6 +11,8 @@ time_frame: 28d
data_source: redis_hll
distribution:
- ce
- ee
tier:
- free
skip_validation: true
- premium
- ultimate

View File

@ -1,9 +1,9 @@
---
key_path: redis_hll_counters.incident_management.incident_management_incident_todo_monthly
description:
description: Count of unique users adding incidents to the TODO list per month
product_section: ops
product_stage: monitor
product_group: group::health
product_group: group::monitor
product_category:
value_type: number
status: data_available
@ -11,6 +11,8 @@ time_frame: 28d
data_source: redis_hll
distribution:
- ce
- ee
tier:
- free
skip_validation: true
- premium
- ultimate

View File

@ -1,9 +1,9 @@
---
key_path: redis_hll_counters.incident_management.incident_management_incident_comment_monthly
description:
description: Count of unique users adding comments per month on incidents
product_section: ops
product_stage: monitor
product_group: group::health
product_group: group::monitor
product_category:
value_type: number
status: data_available
@ -11,6 +11,8 @@ time_frame: 28d
data_source: redis_hll
distribution:
- ce
- ee
tier:
- free
skip_validation: true
- premium
- ultimate

View File

@ -0,0 +1,18 @@
---
key_path: redis_hll_counters.incident_management.incident_management_incident_zoom_meeting_monthly
description: Count of users creating Zoom meetings about incidents per month
product_section: ops
product_stage: monitor
product_group: group::monitor
product_category:
value_type: number
status: data_available
time_frame: 28d
data_source: redis_hll
distribution:
- ce
- ee
tier:
- free
- premium
- ultimate

View File

@ -1,9 +1,9 @@
---
key_path: redis_hll_counters.incident_management.incident_management_incident_relate_monthly
description:
description: Count of unique users adding issues per month that are related to an incident
product_section: ops
product_stage: monitor
product_group: group::health
product_group: group::monitor
product_category:
value_type: number
status: data_available
@ -11,6 +11,8 @@ time_frame: 28d
data_source: redis_hll
distribution:
- ce
- ee
tier:
- free
skip_validation: true
- premium
- ultimate

View File

@ -1,9 +1,9 @@
---
key_path: redis_hll_counters.incident_management.incident_management_incident_unrelate_monthly
description:
description: Count of users removing issues that are related to an incident per month
product_section: ops
product_stage: monitor
product_group: group::health
product_group: group::monitor
product_category:
value_type: number
status: data_available
@ -11,6 +11,8 @@ time_frame: 28d
data_source: redis_hll
distribution:
- ce
- ee
tier:
- free
skip_validation: true
- premium
- ultimate

View File

@ -1,9 +1,9 @@
---
key_path: redis_hll_counters.incident_management.incident_management_incident_change_confidential_monthly
description:
description: Count of users changing incidents to confidential per month
product_section: ops
product_stage: monitor
product_group: group::health
product_group: group::monitor
product_category:
value_type: number
status: data_available
@ -11,6 +11,8 @@ time_frame: 28d
data_source: redis_hll
distribution:
- ce
- ee
tier:
- free
skip_validation: true
- premium
- ultimate

View File

@ -1,9 +1,9 @@
---
key_path: redis_hll_counters.incident_management.incident_management_total_unique_counts_monthly
description:
description: Count of unique users performing events related with incidents per month
product_section: ops
product_stage: monitor
product_group: group::health
product_group: group::monitor
product_category:
value_type: number
status: data_available
@ -11,6 +11,8 @@ time_frame: 28d
data_source: redis_hll
distribution:
- ce
- ee
tier:
- free
skip_validation: true
- premium
- ultimate

View File

@ -4,7 +4,7 @@ description: Count of unique users per month to create an incident corresponding
an alert
product_section: ops
product_stage: monitor
product_group: group::health
product_group: group::monitor
product_category: incident_management
value_type: number
status: data_available
@ -12,6 +12,8 @@ time_frame: 28d
data_source: redis_hll
distribution:
- ce
- ee
tier:
- free
skip_validation: true
- premium
- ultimate

View File

@ -0,0 +1,18 @@
---
key_path: counts_weekly.aggregated_metrics.incident_management_alerts_total_unique_counts
description: Count of unique users per week to take an action on an alert
product_section: ops
product_stage: monitor
product_group: group::monitor
product_category: incident_management
value_type: number
status: data_available
time_frame: 7d
data_source: redis_hll
distribution:
- ce
- ee
tier:
- free
- premium
- ultimate

View File

@ -0,0 +1,18 @@
---
key_path: counts_weekly.aggregated_metrics.incident_management_incidents_total_unique_counts
description: Count of unique users per week to take an action on an incident
product_section: ops
product_stage: monitor
product_group: group::monitor
product_category: incident_management
value_type: number
status: data_available
time_frame: 7d
data_source: redis_hll
distribution:
- ce
- ee
tier:
- free
- premium
- ultimate

View File

@ -0,0 +1,18 @@
---
key_path: redis_hll_counters.incident_management.incident_management_alert_status_changed_weekly
description: Count of unique users changing alert's status per week
product_section: ops
product_stage: monitor
product_group: group::monitor
product_category:
value_type: number
status: data_available
time_frame: 7d
data_source: redis_hll
distribution:
- ce
- ee
tier:
- free
- premium
- ultimate

View File

@ -0,0 +1,18 @@
---
key_path: redis_hll_counters.incident_management.incident_management_alert_assigned_weekly
description: Count of unique users assigning an alert per week
product_section: ops
product_stage: monitor
product_group: group::monitor
product_category:
value_type: number
status: data_available
time_frame: 7d
data_source: redis_hll
distribution:
- ce
- ee
tier:
- free
- premium
- ultimate

View File

@ -0,0 +1,18 @@
---
key_path: redis_hll_counters.incident_management.incident_management_alert_todo_weekly
description: Count of unique users adding alerts to the TODO list per week
product_section: ops
product_stage: monitor
product_group: group::monitor
product_category:
value_type: number
status: data_available
time_frame: 7d
data_source: redis_hll
distribution:
- ce
- ee
tier:
- free
- premium
- ultimate

View File

@ -0,0 +1,18 @@
---
key_path: redis_hll_counters.incident_management.incident_management_incident_created_weekly
description: Count of unique users creating incidents per week
product_section: ops
product_stage: monitor
product_group: group::monitor
product_category:
value_type: number
status: data_available
time_frame: 7d
data_source: redis_hll
distribution:
- ce
- ee
tier:
- free
- premium
- ultimate

View File

@ -0,0 +1,18 @@
---
key_path: redis_hll_counters.incident_management.incident_management_incident_reopened_weekly
description: Count of unique users reopening incidents per week
product_section: ops
product_stage: monitor
product_group: group::monitor
product_category:
value_type: number
status: data_available
time_frame: 7d
data_source: redis_hll
distribution:
- ce
- ee
tier:
- free
- premium
- ultimate

View File

@ -1,16 +1,18 @@
---
key_path: redis_hll_counters.incident_management.incident_management_incident_published_monthly
description:
key_path: redis_hll_counters.incident_management.incident_management_incident_closed_weekly
description: Count of users closing incidents per week
product_section: ops
product_stage: monitor
product_group: group::health
product_group: group::monitor
product_category:
value_type: number
status: data_available
time_frame: 28d
time_frame: 7d
data_source: redis_hll
distribution:
- ce
- ee
tier:
- free
skip_validation: true
- premium
- ultimate

View File

@ -0,0 +1,18 @@
---
key_path: redis_hll_counters.incident_management.incident_management_incident_assigned_weekly
description: Count of unique users assiging incidents per week
product_section: ops
product_stage: monitor
product_group: group::monitor
product_category:
value_type: number
status: data_available
time_frame: 7d
data_source: redis_hll
distribution:
- ce
- ee
tier:
- free
- premium
- ultimate

View File

@ -0,0 +1,18 @@
---
key_path: redis_hll_counters.incident_management.incident_management_incident_todo_weekly
description: Count of unique users adding incidents to the TODO list per week
product_section: ops
product_stage: monitor
product_group: group::monitor
product_category:
value_type: number
status: data_available
time_frame: 7d
data_source: redis_hll
distribution:
- ce
- ee
tier:
- free
- premium
- ultimate

View File

@ -0,0 +1,18 @@
---
key_path: redis_hll_counters.incident_management.incident_management_incident_comment_weekly
description: Count of unique users adding comments on incidents per week
product_section: ops
product_stage: monitor
product_group: group::monitor
product_category:
value_type: number
status: data_available
time_frame: 7d
data_source: redis_hll
distribution:
- ce
- ee
tier:
- free
- premium
- ultimate

View File

@ -0,0 +1,18 @@
---
key_path: redis_hll_counters.incident_management.incident_management_incident_zoom_meeting_weekly
description: Count of unique users creating Zoom meetings about incidents per week
product_section: ops
product_stage: monitor
product_group: group::monitor
product_category:
value_type: number
status: data_available
time_frame: 7d
data_source: redis_hll
distribution:
- ce
- ee
tier:
- free
- premium
- ultimate

View File

@ -0,0 +1,18 @@
---
key_path: redis_hll_counters.incident_management.incident_management_incident_relate_weekly
description: Count of unique users adding issues per that are related to an incident week
product_section: ops
product_stage: monitor
product_group: group::monitor
product_category:
value_type: number
status: data_available
time_frame: 7d
data_source: redis_hll
distribution:
- ce
- ee
tier:
- free
- premium
- ultimate

View File

@ -0,0 +1,18 @@
---
key_path: redis_hll_counters.incident_management.incident_management_incident_unrelate_weekly
description: Count of unique users removing issue that are related to an incident per week
product_section: ops
product_stage: monitor
product_group: group::monitor
product_category:
value_type: number
status: data_available
time_frame: 7d
data_source: redis_hll
distribution:
- ce
- ee
tier:
- free
- premium
- ultimate

View File

@ -0,0 +1,18 @@
---
key_path: redis_hll_counters.incident_management.incident_management_incident_change_confidential_weekly
description: Count of unique users changing incidents to confidential per week
product_section: ops
product_stage: monitor
product_group: group::monitor
product_category:
value_type: number
status: data_available
time_frame: 7d
data_source: redis_hll
distribution:
- ce
- ee
tier:
- free
- premium
- ultimate

View File

@ -0,0 +1,18 @@
---
key_path: redis_hll_counters.incident_management.incident_management_total_unique_counts_weekly
description: Count of unique users performing events related to the incident management
product_section: ops
product_stage: monitor
product_group: group::monitor
product_category:
value_type: number
status: data_available
time_frame: 7d
data_source: redis_hll
distribution:
- ce
- ee
tier:
- free
- premium
- ultimate

View File

@ -0,0 +1,19 @@
---
key_path: redis_hll_counters.incident_management_alerts.incident_management_alert_create_incident_weekly
description: Count of unique users per week to create an incident corresponding to
an alert
product_section: ops
product_stage: monitor
product_group: group::monitor
product_category: incident_management
value_type: number
status: data_available
time_frame: 7d
data_source: redis_hll
distribution:
- ce
- ee
tier:
- free
- premium
- ultimate

View File

@ -3,7 +3,7 @@ key_path: counts.issues_created_from_gitlab_error_tracking_ui
description: Count of issues manually created from the GitLab UI on Sentry errors
product_section: ops
product_stage: monitor
product_group: group::health
product_group: group::monitor
product_category: error_tracking
value_type: number
status: data_available
@ -11,6 +11,8 @@ time_frame: all
data_source: database
distribution:
- ce
- ee
tier:
- free
skip_validation: true
- premium
- ultimate

View File

@ -3,7 +3,7 @@ key_path: counts.issues_with_associated_zoom_link
description: Count of issues where a user has linked a Zoom meeting
product_section: ops
product_stage: monitor
product_group: group::health
product_group: group::monitor
product_category: incident_management
value_type: number
status: data_available
@ -16,4 +16,3 @@ tier:
- free
- premium
- ultimate
skip_validation: true

View File

@ -4,7 +4,7 @@ description: Count of issues where a user have added AND removed a zoom meeting
slash commands
product_section: ops
product_stage: monitor
product_group: group::health
product_group: group::monitor
product_category: incident_management
value_type: number
status: data_available
@ -17,4 +17,3 @@ tier:
- free
- premium
- ultimate
skip_validation: true

View File

@ -3,7 +3,7 @@ key_path: counts.issues_with_embedded_grafana_charts_approx
description: Count of issues where a user has embedded a Grafana chart
product_section: ops
product_stage: monitor
product_group: group::health
product_group: group::monitor
product_category: incident_management
value_type: number
status: data_available
@ -16,4 +16,3 @@ tier:
- free
- premium
- ultimate
skip_validation: true

View File

@ -3,7 +3,7 @@ key_path: counts.issues_created_from_alerts
description: Count of issues created automatically on alerts from GitLab-Managed Prometheus
product_section: ops
product_stage: monitor
product_group: group::health
product_group: group::monitor
product_category: incident_management
value_type: number
status: data_available
@ -16,4 +16,3 @@ tier:
- free
- premium
- ultimate
skip_validation: true

View File

@ -3,7 +3,7 @@ key_path: counts.issues_created_gitlab_alerts
description: Count of all issues created from GitLab alerts (bot and non-bot)
product_section: ops
product_stage: monitor
product_group: group::health
product_group: group::monitor
product_category: incident_management
value_type: number
status: data_available
@ -16,4 +16,3 @@ tier:
- free
- premium
- ultimate
skip_validation: true

View File

@ -3,7 +3,7 @@ key_path: counts.issues_created_manually_from_alerts
description: Count of issues created manually by non-bot users from GitLab alerts
product_section: ops
product_stage: monitor
product_group: group::health
product_group: group::monitor
product_category: incident_management
value_type: number
status: data_available
@ -16,4 +16,3 @@ tier:
- free
- premium
- ultimate
skip_validation: true

View File

@ -3,7 +3,7 @@ key_path: counts.incident_issues
description: Count of incidents (issues where issue_type=incident)
product_section: ops
product_stage: monitor
product_group: group::health
product_group: group::monitor
product_category: incident_management
value_type: number
status: data_available
@ -16,4 +16,3 @@ tier:
- free
- premium
- ultimate
skip_validation: true

View File

@ -3,7 +3,7 @@ key_path: counts.alert_bot_incident_issues
description: Count of issues created by the alert bot automatically
product_section: ops
product_stage: monitor
product_group: group::health
product_group: group::monitor
product_category: incident_management
value_type: number
status: data_available
@ -16,4 +16,3 @@ tier:
- free
- premium
- ultimate
skip_validation: true

View File

@ -3,7 +3,7 @@ key_path: counts.incident_labeled_issues
description: Count of all issues with the label=incident
product_section: ops
product_stage: monitor
product_group: group::health
product_group: group::monitor
product_category: incident_management
value_type: number
status: data_available
@ -16,4 +16,3 @@ tier:
- free
- premium
- ultimate
skip_validation: true

View File

@ -3,7 +3,7 @@ key_path: counts.projects_creating_incidents
description: Counts of Projects that have incident issues, regardless of status.
product_section: ops
product_stage: monitor
product_group: group::health
product_group: group::monitor
product_category: incident_management
value_type: number
status: data_available
@ -11,6 +11,8 @@ time_frame: all
data_source: database
distribution:
- ce
- ee
tier:
- free
skip_validation: true
- premium
- ultimate

View File

@ -3,7 +3,7 @@ key_path: counts.projects_with_error_tracking_enabled
description: Count of projects that have enabled Error tracking via Sentry
product_section: ops
product_stage: monitor
product_group: group::health
product_group: group::monitor
product_category: error_tracking
value_type: number
status: data_available
@ -16,4 +16,3 @@ tier:
- free
- premium
- ultimate
skip_validation: true

View File

@ -3,7 +3,7 @@ key_path: counts.projects_with_alerts_service_enabled
description: Count of projects that have enabled the Alerts service
product_section: ops
product_stage: monitor
product_group: group::health
product_group: group::monitor
product_category: incident_management
value_type: number
status: removed
@ -17,4 +17,3 @@ tier:
- free
- premium
- ultimate
skip_validation: true

View File

@ -3,7 +3,7 @@ key_path: counts.projects_with_alerts_created
description: Count of projects with alerts created in given time period
product_section: ops
product_stage: monitor
product_group: group::health
product_group: group::monitor
product_category: alert_management
value_type: number
status: data_available
@ -11,6 +11,8 @@ time_frame: all
data_source: database
distribution:
- ce
- ee
tier:
- free
skip_validation: true
- premium
- ultimate

View File

@ -3,7 +3,7 @@ key_path: counts.projects_with_enabled_alert_integrations
description: Count of projects with at least 1 enabled integration
product_section: ops
product_stage: monitor
product_group: group::health
product_group: group::monitor
product_category: incident_management
value_type: number
status: data_available
@ -11,6 +11,8 @@ time_frame: all
data_source: database
distribution:
- ce
- ee
tier:
- free
skip_validation: true
- premium
- ultimate

View File

@ -1,16 +0,0 @@
---
key_path: counts.status_page_incident_publishes
description: Cumulative count of usages of publish operation
product_section: ops
product_stage: monitor
product_group: group::health
product_category: incident_management
value_type: number
status: data_available
time_frame: all
data_source: database
distribution:
- ce
tier:
- free
skip_validation: true

View File

@ -1,16 +0,0 @@
---
key_path: counts.status_page_incident_unpublishes
description: Cumulative count of usages of unpublish operation
product_section: ops
product_stage: monitor
product_group: group::health
product_category: incident_management
value_type: number
status: data_available
time_frame: all
data_source: database
distribution:
- ce
tier:
- free
skip_validation: true

View File

@ -1,16 +0,0 @@
---
key_path: counts.status_page_projects
description: Projects with status page enabled
product_section: ops
product_stage: monitor
product_group: group::health
product_category: incident_management
value_type: number
status: data_available
time_frame: all
data_source: database
distribution:
- ce
tier:
- free
skip_validation: true

View File

@ -1,16 +0,0 @@
---
key_path: counts.status_page_issues
description: Issues published to a Status Page
product_section: ops
product_stage: monitor
product_group: group::health
product_category: incident_management
value_type: number
status: data_available
time_frame: all
data_source: database
distribution:
- ce
tier:
- free
skip_validation: true

View File

@ -3,14 +3,16 @@ key_path: usage_activity_by_stage.monitor.projects_with_error_tracking_enabled
description: Projects where error tracking is enabled
product_section: ops
product_stage: monitor
product_group: group::health
product_group: group::monitor
product_category: error_tracking
value_type: number
status: data_available
time_frame: all
data_source:
data_source: database
distribution:
- ce
- ee
tier:
- free
skip_validation: true
- premium
- ultimate

View File

@ -3,14 +3,16 @@ key_path: usage_activity_by_stage.monitor.projects_with_incidents
description: Count of unique projects with an incident
product_section: ops
product_stage: monitor
product_group: group::health
product_group: group::monitor
product_category: incident_management
value_type: number
status: data_available
time_frame: all
data_source:
data_source: database
distribution:
- ce
- ee
tier:
- free
skip_validation: true
- premium
- ultimate

View File

@ -3,14 +3,16 @@ key_path: usage_activity_by_stage.monitor.projects_with_alert_incidents
description: Count of unique projects with an incident from an alert
product_section: ops
product_stage: monitor
product_group: group::health
product_group: group::monitor
product_category: incident_management
value_type: number
status: data_available
time_frame: all
data_source:
data_source: database
distribution:
- ce
- ee
tier:
- free
skip_validation: true
- premium
- ultimate

View File

@ -1,16 +0,0 @@
---
key_path: usage_activity_by_stage.monitor.projects_incident_sla_enabled
description: Projects where Incident SLA is enabled
product_section: ops
product_stage: monitor
product_group: group::health
product_category: error_tracking
value_type: number
status: data_available
time_frame: all
data_source:
distribution:
- ce
tier:
- free
skip_validation: true

View File

@ -4,9 +4,7 @@ group: Certify
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---
# Reply by email
> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/1173) in GitLab 8.0.
# Reply by email **(FREE SELF)**
GitLab can be set up to allow users to comment on issues and merge requests by
replying to notification emails.
@ -34,10 +32,10 @@ addition, this "reply key" is also added to the `References` header.
When you reply to the notification email, your email client:
- sends the email to the `Reply-To` address it got from the notification email
- sets the `In-Reply-To` header to the value of the `Message-ID` header from the
- Sends the email to the `Reply-To` address it got from the notification email
- Sets the `In-Reply-To` header to the value of the `Message-ID` header from the
notification email
- sets the `References` header to the value of the `Message-ID` plus the value of
- Sets the `References` header to the value of the `Message-ID` plus the value of
the notification email's `References` header.
### GitLab receives your reply to the notification email
@ -45,8 +43,8 @@ When you reply to the notification email, your email client:
When GitLab receives your reply, it looks for the "reply key" in the
following headers, in this order:
1. the `To` header
1. the `References` header
1. `To` header
1. `References` header
If it finds a reply key, it leaves your reply as a comment on
the entity the notification was about (issue, merge request, commit...).

View File

@ -10,20 +10,52 @@ info: To determine the technical writer assigned to the Stage/Group associated w
### Action Types
Available action types for the `action` parameter are:
Available types for the `action` parameter, and the resources that might be affected:
- `approved`
- `created`
- `updated`
- Merge request
- `closed`
- `reopened`
- `pushed`
- `commented`
- `merged`
- `joined`
- `left`
- Epic
- Issue
- Merge request
- Milestone
- `commented` on any `Noteable` record.
- Alert
- Commit
- Design
- Issue
- Merge request
- Snippet
- `created`
- Design
- Epic
- Issue
- Merge request
- Milestone
- Project
- Wiki page
- `destroyed`
- Design
- Milestone
- Wiki page
- `expired`
- Project membership
- `joined`
- Project membership
- `left`
- Project membership
- `merged`
- Merge request
- `pushed` commits to (or deleted commits from) a repository, individually or in bulk.
- Project
- `reopened`
- Epic
- Issue
- Merge request
- Milestone
- `updated`
- Design
- Wiki page
Note that these options are in lower case.

View File

@ -1213,7 +1213,6 @@ POST /projects
| `show_default_award_emojis` | boolean | **{dotted-circle}** No | Show default award emojis. |
| `snippets_access_level` | string | **{dotted-circle}** No | One of `disabled`, `private`, or `enabled`. |
| `snippets_enabled` | boolean | **{dotted-circle}** No | _(Deprecated)_ Enable snippets for this project. Use `snippets_access_level` instead. |
| `squash_option` | string | **{dotted-circle}** No | One of `never`, `always`, `default_on`, or `default_off`. |
| `tag_list` | array | **{dotted-circle}** No | _([Deprecated](https://gitlab.com/gitlab-org/gitlab/-/issues/328226) in GitLab 14.0)_ The list of tags for a project; put array of tags, that should be finally assigned to a project. Use `topics` instead. |
| `template_name` | string | **{dotted-circle}** No | When used without `use_custom_template`, name of a [built-in project template](../user/project/working_with_projects.md#built-in-templates). When used with `use_custom_template`, name of a custom project template. |
| `template_project_id` **(PREMIUM)** | integer | **{dotted-circle}** No | When used with `use_custom_template`, project ID of a custom project template. This is preferable to using `template_name` since `template_name` may be ambiguous. |
@ -1289,7 +1288,6 @@ POST /projects/user/:user_id
| `show_default_award_emojis` | boolean | **{dotted-circle}** No | Show default award emojis. |
| `snippets_access_level` | string | **{dotted-circle}** No | One of `disabled`, `private`, or `enabled`. |
| `snippets_enabled` | boolean | **{dotted-circle}** No | _(Deprecated)_ Enable snippets for this project. Use `snippets_access_level` instead. |
| `squash_option` | string | **{dotted-circle}** No | One of `never`, `always`, `default_on`, or `default_off`. |
| `suggestion_commit_message` | string | **{dotted-circle}** No | The commit message used to apply merge request [suggestions](../user/project/merge_requests/reviews/suggestions.md). |
| `tag_list` | array | **{dotted-circle}** No | _([Deprecated](https://gitlab.com/gitlab-org/gitlab/-/issues/328226) in GitLab 14.0)_ The list of tags for a project; put array of tags, that should be finally assigned to a project. Use `topics` instead. |
| `template_name` | string | **{dotted-circle}** No | When used without `use_custom_template`, name of a [built-in project template](../user/project/working_with_projects.md#built-in-templates). When used with `use_custom_template`, name of a custom project template. |
@ -1369,7 +1367,6 @@ PUT /projects/:id
| `show_default_award_emojis` | boolean | **{dotted-circle}** No | Show default award emojis. |
| `snippets_access_level` | string | **{dotted-circle}** No | One of `disabled`, `private`, or `enabled`. |
| `snippets_enabled` | boolean | **{dotted-circle}** No | _(Deprecated)_ Enable snippets for this project. Use `snippets_access_level` instead. |
| `squash_option` | string | **{dotted-circle}** No | One of `never`, `always`, `default_on`, or `default_off`. |
| `suggestion_commit_message` | string | **{dotted-circle}** No | The commit message used to apply merge request suggestions. |
| `tag_list` | array | **{dotted-circle}** No | _([Deprecated](https://gitlab.com/gitlab-org/gitlab/-/issues/328226) in GitLab 14.0)_ The list of tags for a project; put array of tags, that should be finally assigned to a project. Use `topics` instead. |
| `topics` | array | **{dotted-circle}** No | The list of topics for the project. This replaces any existing topics that are already added to the project. _([Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/328226) in GitLab 14.0.)_ |

View File

@ -412,7 +412,7 @@ Count of issues created by the alert bot automatically
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_all/20210216180449_alert_bot_incident_issues.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
@ -2428,7 +2428,7 @@ Count of incidents (issues where issue_type=incident)
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_all/20210216180447_incident_issues.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
@ -2440,7 +2440,7 @@ Count of all issues with the label=incident
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_all/20210216180451_incident_labeled_issues.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
@ -3028,7 +3028,7 @@ Count of issues created automatically on alerts from GitLab-Managed Prometheus
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_all/20210216180441_issues_created_from_alerts.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
@ -3040,11 +3040,11 @@ Count of issues manually created from the GitLab UI on Sentry errors
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_all/20210216180434_issues_created_from_gitlab_error_tracking_ui.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
Tiers: `free`
Tiers: `free`, `premium`, `ultimate`
### `counts.issues_created_gitlab_alerts`
@ -3052,7 +3052,7 @@ Count of all issues created from GitLab alerts (bot and non-bot)
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_all/20210216180443_issues_created_gitlab_alerts.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
@ -3064,7 +3064,7 @@ Count of issues created manually by non-bot users from GitLab alerts
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_all/20210216180445_issues_created_manually_from_alerts.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
@ -3076,7 +3076,7 @@ Count of issues where a user have added AND removed a zoom meeting using slash c
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_all/20210216180438_issues_using_zoom_quick_actions.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
@ -3088,7 +3088,7 @@ Count of issues where a user has linked a Zoom meeting
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_all/20210216180436_issues_with_associated_zoom_link.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
@ -3100,7 +3100,7 @@ Count of issues where a user has embedded a Grafana chart
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_all/20210216180440_issues_with_embedded_grafana_charts_approx.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
@ -4288,11 +4288,11 @@ Counts of Projects that have incident issues, regardless of status.
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_all/20210216180453_projects_creating_incidents.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
Tiers: `free`
Tiers: `free`, `premium`, `ultimate`
### `counts.projects_custom_issue_tracker_active`
@ -5212,11 +5212,11 @@ Count of projects with alerts created in given time period
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_all/20210216180458_projects_with_alerts_created.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
Tiers: `free`
Tiers: `free`, `premium`, `ultimate`
### `counts.projects_with_alerts_service_enabled`
@ -5224,7 +5224,7 @@ Count of projects that have enabled the Alerts service
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_all/20210216180456_projects_with_alerts_service_enabled.yml)
Group: `group::health`
Group: `group::monitor`
Status: `removed`
@ -5236,11 +5236,11 @@ Count of projects with at least 1 enabled integration
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_all/20210216180500_projects_with_enabled_alert_integrations.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
Tiers: `free`
Tiers: `free`, `premium`, `ultimate`
### `counts.projects_with_error_tracking_enabled`
@ -5248,7 +5248,7 @@ Count of projects that have enabled Error tracking via Sentry
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_all/20210216180454_projects_with_error_tracking_enabled.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
@ -5810,49 +5810,49 @@ Tiers: `free`, `premium`, `ultimate`
Cumulative count of usages of publish operation
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_all/20210216180502_status_page_incident_publishes.yml)
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_all/20210216180502_status_page_incident_publishes.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
Tiers: `free`
Tiers: `ultimate`
### `counts.status_page_incident_unpublishes`
Cumulative count of usages of unpublish operation
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_all/20210216180504_status_page_incident_unpublishes.yml)
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_all/20210216180504_status_page_incident_unpublishes.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
Tiers: `free`
Tiers: `ultimate`
### `counts.status_page_issues`
Issues published to a Status Page
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_all/20210216180507_status_page_issues.yml)
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_all/20210216180507_status_page_issues.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
Tiers: `free`
Tiers: `ultimate`
### `counts.status_page_projects`
Projects with status page enabled
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_all/20210216180506_status_page_projects.yml)
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_all/20210216180506_status_page_projects.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
Tiers: `free`
Tiers: `ultimate`
### `counts.successful_deployments`
@ -6628,11 +6628,11 @@ Count of unique users per month to take an action on an alert
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_28d/20210216180509_incident_management_alerts_total_unique_counts.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
Tiers: `free`
Tiers: `free`, `premium`, `ultimate`
### `counts_monthly.aggregated_metrics.incident_management_incidents_total_unique_counts`
@ -6640,11 +6640,11 @@ Count of unique users per month to take an action on an incident
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_28d/20210216180511_incident_management_incidents_total_unique_counts.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
Tiers: `free`
Tiers: `free`, `premium`, `ultimate`
### `counts_monthly.aggregated_metrics.product_analytics_test_metrics_intersection`
@ -6842,25 +6842,25 @@ Tiers: `premium`, `ultimate`
Count of unique users per week to take an action on an alert
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_7d/20210216180513_incident_management_alerts_total_unique_counts.yml)
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_7d/20210216180513_incident_management_alerts_total_unique_counts.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
Tiers:
Tiers: `free`, `premium`, `ultimate`
### `counts_weekly.aggregated_metrics.incident_management_incidents_total_unique_counts`
Count of unique users per week to take an action on an incident
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_7d/20210216180515_incident_management_incidents_total_unique_counts.yml)
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_7d/20210216180515_incident_management_incidents_total_unique_counts.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
Tiers:
Tiers: `free`, `premium`, `ultimate`
### `counts_weekly.aggregated_metrics.product_analytics_test_metrics_intersection`
@ -11712,363 +11712,363 @@ Tiers: `free`, `premium`, `ultimate`
### `redis_hll_counters.incident_management.incident_management_alert_assigned_monthly`
Missing description
Count of an alert's assignments per month
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_28d/20210216180533_incident_management_alert_assigned_monthly.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
Tiers: `free`
Tiers: `free`, `premium`, `ultimate`
### `redis_hll_counters.incident_management.incident_management_alert_assigned_weekly`
Missing description
Count of an alert's assignments per week
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_7d/20210216180532_incident_management_alert_assigned_weekly.yml)
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_7d/20210216180532_incident_management_alert_assigned_weekly.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
Tiers:
Tiers: `free`, `premium`, `ultimate`
### `redis_hll_counters.incident_management.incident_management_alert_status_changed_monthly`
Missing description
Count of an alert's status changes per month
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_28d/20210216180530_incident_management_alert_status_changed_monthly.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
Tiers: `free`
Tiers: `free`, `premium`, `ultimate`
### `redis_hll_counters.incident_management.incident_management_alert_status_changed_weekly`
Missing description
Count of an alert's status changes per week
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_7d/20210216180528_incident_management_alert_status_changed_weekly.yml)
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_7d/20210216180528_incident_management_alert_status_changed_weekly.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
Tiers:
Tiers: `free`, `premium`, `ultimate`
### `redis_hll_counters.incident_management.incident_management_alert_todo_monthly`
Missing description
Count of alerts added to the TODO list per month
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_28d/20210216180537_incident_management_alert_todo_monthly.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
Tiers: `free`
Tiers: `free`, `premium`, `ultimate`
### `redis_hll_counters.incident_management.incident_management_alert_todo_weekly`
Missing description
Count of alerts added to the TODO list per week
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_7d/20210216180535_incident_management_alert_todo_weekly.yml)
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_7d/20210216180535_incident_management_alert_todo_weekly.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
Tiers:
Tiers: `free`, `premium`, `ultimate`
### `redis_hll_counters.incident_management.incident_management_incident_assigned_monthly`
Missing description
Count of an incidents's assignments per month
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_28d/20210216180552_incident_management_incident_assigned_monthly.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
Tiers: `free`
Tiers: `free`, `premium`, `ultimate`
### `redis_hll_counters.incident_management.incident_management_incident_assigned_weekly`
Missing description
Count of an incidents's assignments per week
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_7d/20210216180550_incident_management_incident_assigned_weekly.yml)
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_7d/20210216180550_incident_management_incident_assigned_weekly.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
Tiers:
Tiers: `free`, `premium`, `ultimate`
### `redis_hll_counters.incident_management.incident_management_incident_change_confidential_monthly`
Missing description
Count of incidents changed to confidential per month
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_28d/20210216180618_incident_management_incident_change_confidential_monthly.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
Tiers: `free`
Tiers: `free`, `premium`, `ultimate`
### `redis_hll_counters.incident_management.incident_management_incident_change_confidential_weekly`
Missing description
Count of incidents changed to confidential per week
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_7d/20210216180616_incident_management_incident_change_confidential_weekly.yml)
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_7d/20210216180616_incident_management_incident_change_confidential_weekly.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
Tiers:
Tiers: `free`, `premium`, `ultimate`
### `redis_hll_counters.incident_management.incident_management_incident_closed_monthly`
Missing description
Count of incidents closed per month
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_28d/20210216180548_incident_management_incident_closed_monthly.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
Tiers: `free`
Tiers: `free`, `premium`, `ultimate`
### `redis_hll_counters.incident_management.incident_management_incident_closed_weekly`
Missing description
Count of incidents closed per week
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_7d/20210216180546_incident_management_incident_closed_weekly.yml)
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_7d/20210216180546_incident_management_incident_closed_weekly.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
Tiers:
Tiers: `free`, `premium`, `ultimate`
### `redis_hll_counters.incident_management.incident_management_incident_comment_monthly`
Missing description
Count of comments per month on incidents
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_28d/20210216180559_incident_management_incident_comment_monthly.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
Tiers: `free`
Tiers: `free`, `premium`, `ultimate`
### `redis_hll_counters.incident_management.incident_management_incident_comment_weekly`
Missing description
Count of comments per week on incidents
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_7d/20210216180558_incident_management_incident_comment_weekly.yml)
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_7d/20210216180558_incident_management_incident_comment_weekly.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
Tiers:
Tiers: `free`, `premium`, `ultimate`
### `redis_hll_counters.incident_management.incident_management_incident_created_monthly`
Missing description
Count of incidents created per month
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_28d/20210216180541_incident_management_incident_created_monthly.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
Tiers: `free`
Tiers: `free`, `premium`, `ultimate`
### `redis_hll_counters.incident_management.incident_management_incident_created_weekly`
Missing description
Count of incidents created per week
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_7d/20210216180539_incident_management_incident_created_weekly.yml)
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_7d/20210216180539_incident_management_incident_created_weekly.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
Tiers:
Tiers: `free`, `premium`, `ultimate`
### `redis_hll_counters.incident_management.incident_management_incident_published_monthly`
Missing description
Count of published incidents per month
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_28d/20210216180607_incident_management_incident_published_monthly.yml)
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_28d/20210216180607_incident_management_incident_published_monthly.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
Tiers: `free`
Tiers: `free`, `premium`, `ultimate`
### `redis_hll_counters.incident_management.incident_management_incident_published_weekly`
Missing description
Count of published incidents per week
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_7d/20210216180605_incident_management_incident_published_weekly.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
Tiers:
Tiers: `free`, `premium`, `ultimate`
### `redis_hll_counters.incident_management.incident_management_incident_relate_monthly`
Missing description
Count of issues added per month that are related to an incident
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_28d/20210216180611_incident_management_incident_relate_monthly.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
Tiers: `free`
Tiers: `free`, `premium`, `ultimate`
### `redis_hll_counters.incident_management.incident_management_incident_relate_weekly`
Missing description
Count of issues added per week that are related to an incident
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_7d/20210216180609_incident_management_incident_relate_weekly.yml)
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_7d/20210216180609_incident_management_incident_relate_weekly.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
Tiers:
Tiers: `free`, `premium`, `ultimate`
### `redis_hll_counters.incident_management.incident_management_incident_reopened_monthly`
Missing description
Count of incidents reopened per month
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_28d/20210216180545_incident_management_incident_reopened_monthly.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
Tiers: `free`
Tiers: `free`, `premium`, `ultimate`
### `redis_hll_counters.incident_management.incident_management_incident_reopened_weekly`
Missing description
Count of incidents reopened per week
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_7d/20210216180543_incident_management_incident_reopened_weekly.yml)
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_7d/20210216180543_incident_management_incident_reopened_weekly.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
Tiers:
Tiers: `free`, `premium`, `ultimate`
### `redis_hll_counters.incident_management.incident_management_incident_todo_monthly`
Missing description
Count of incidents added to the TODO list per month
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_28d/20210216180556_incident_management_incident_todo_monthly.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
Tiers: `free`
Tiers: `free`, `premium`, `ultimate`
### `redis_hll_counters.incident_management.incident_management_incident_todo_weekly`
Missing description
Count of incidents added to the TODO list per week
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_7d/20210216180554_incident_management_incident_todo_weekly.yml)
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_7d/20210216180554_incident_management_incident_todo_weekly.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
Tiers:
Tiers: `free`, `premium`, `ultimate`
### `redis_hll_counters.incident_management.incident_management_incident_unrelate_monthly`
Missing description
Count of issues removed per month that are related to an incident
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_28d/20210216180614_incident_management_incident_unrelate_monthly.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
Tiers: `free`
Tiers: `free`, `premium`, `ultimate`
### `redis_hll_counters.incident_management.incident_management_incident_unrelate_weekly`
Missing description
Count of issues removed per week that are related to an incident
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_7d/20210216180612_incident_management_incident_unrelate_weekly.yml)
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_7d/20210216180612_incident_management_incident_unrelate_weekly.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
Tiers:
Tiers: `free`, `premium`, `ultimate`
### `redis_hll_counters.incident_management.incident_management_incident_zoom_meeting_monthly`
Missing description
Count of Zoom meetings about incidents per month
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_28d/20210216180603_incident_management_incident_zoom_meeting_monthly.yml)
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_28d/20210216180603_incident_management_incident_zoom_meeting_monthly.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
Tiers:
Tiers: `free`, `premium`, `ultimate`
### `redis_hll_counters.incident_management.incident_management_incident_zoom_meeting_weekly`
Missing description
Count of Zoom meetings about incidents per week
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_7d/20210216180601_incident_management_incident_zoom_meeting_weekly.yml)
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_7d/20210216180601_incident_management_incident_zoom_meeting_weekly.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
Tiers:
Tiers: `free`, `premium`, `ultimate`
### `redis_hll_counters.incident_management.incident_management_total_unique_counts_monthly`
Missing description
Count of total unique incidents per month
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_28d/20210216180622_incident_management_total_unique_counts_monthly.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
Tiers: `free`
Tiers: `free`, `premium`, `ultimate`
### `redis_hll_counters.incident_management.incident_management_total_unique_counts_weekly`
Missing description
Count of total unique incidents per week
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_7d/20210216180620_incident_management_total_unique_counts_weekly.yml)
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_7d/20210216180620_incident_management_total_unique_counts_weekly.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
Tiers:
Tiers: `free`, `premium`, `ultimate`
### `redis_hll_counters.incident_management_alerts.incident_management_alert_create_incident_monthly`
@ -12076,23 +12076,23 @@ Count of unique users per month to create an incident corresponding to an alert
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_28d/20210216180625_incident_management_alert_create_incident_monthly.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
Tiers: `free`
Tiers: `free`, `premium`, `ultimate`
### `redis_hll_counters.incident_management_alerts.incident_management_alert_create_incident_weekly`
Count of unique users per week to create an incident corresponding to an alert
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_7d/20210216180623_incident_management_alert_create_incident_weekly.yml)
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_7d/20210216180623_incident_management_alert_create_incident_weekly.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
Tiers:
Tiers: `free`, `premium`, `ultimate`
### `redis_hll_counters.incident_management_oncall.i_incident_management_oncall_notification_sent_monthly`
@ -16972,13 +16972,13 @@ Tiers: `free`, `premium`, `ultimate`
Projects where Incident SLA is enabled
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_all/20210216180522_projects_incident_sla_enabled.yml)
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_all/20210216180522_projects_incident_sla_enabled.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
Tiers: `free`
Tiers: `premium`, `ultimate`
### `usage_activity_by_stage.monitor.projects_with_alert_incidents`
@ -16986,11 +16986,11 @@ Count of unique projects with an incident from an alert
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_all/20210216180520_projects_with_alert_incidents.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
Tiers: `free`
Tiers: `free`, `premium`, `ultimate`
### `usage_activity_by_stage.monitor.projects_with_enabled_alert_integrations_histogram`
@ -17012,11 +17012,11 @@ Projects where error tracking is enabled
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_all/20210216180517_projects_with_error_tracking_enabled.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
Tiers: `free`
Tiers: `free`, `premium`, `ultimate`
### `usage_activity_by_stage.monitor.projects_with_incidents`
@ -17024,11 +17024,11 @@ Count of unique projects with an incident
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_all/20210216180518_projects_with_incidents.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
Tiers: `free`
Tiers: `free`, `premium`, `ultimate`
### `usage_activity_by_stage.monitor.projects_with_tracing_enabled`
@ -18956,11 +18956,11 @@ Count of unique projects with an incident from an alert created in the last mont
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_28d/20210216180526_projects_with_alert_incidents.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
Tiers: `free`
Tiers: `free`, `premium`, `ultimate`
### `usage_activity_by_stage_monthly.monitor.projects_with_error_tracking_enabled`
@ -18980,11 +18980,11 @@ Count of unique projects with an incident created in the last month
[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_28d/20210216180524_projects_with_incidents.yml)
Group: `group::health`
Group: `group::monitor`
Status: `data_available`
Tiers: `free`
Tiers: `free`, `premium`, `ultimate`
### `usage_activity_by_stage_monthly.monitor.projects_with_tracing_enabled`

View File

@ -1071,7 +1071,7 @@ Ensure you comply with the [Changelog entries guide](../changelog.md).
### 9. Ask for a Product Intelligence Review
On GitLab.com, we have DangerBot set up to monitor Product Intelligence related files and DangerBot recommends a [Product Intelligence review](review_guidelines.md). Mention `@gitlab-org/growth/product_intelligence/engineers` in your MR for a review.
On GitLab.com, we have DangerBot set up to monitor Product Intelligence related files and DangerBot recommends a [Product Intelligence review](review_guidelines.md).
### 10. Verify your metric

View File

@ -0,0 +1,41 @@
# frozen_string_literal: true
module Gitlab
module Checks
class ContainerMoved < PostPushMessage
REDIRECT_NAMESPACE = "redirect_namespace"
def initialize(repository, user, protocol, redirected_path)
@redirected_path = redirected_path
super(repository, user, protocol)
end
def message
<<~MESSAGE
#{container.class.model_name.human} '#{redirected_path}' was moved to '#{container.full_path}'.
Please update your Git remote:
git remote set-url origin #{url_to_repo}
MESSAGE
end
private
attr_reader :redirected_path
def self.message_key(user, repository)
"#{REDIRECT_NAMESPACE}:#{user.id}:#{repository.gl_repository}"
end
# TODO: Remove in the next release
# https://gitlab.com/gitlab-org/gitlab/-/issues/292030
def self.legacy_message_key(user, repository)
return unless repository.project
"#{REDIRECT_NAMESPACE}:#{user.id}:#{repository.project.id}"
end
end
end
end

View File

@ -9,21 +9,32 @@ module Gitlab
@protocol = protocol
end
def self.fetch_message(user_id, project_id)
key = message_key(user_id, project_id)
def self.fetch_message(user, repository)
key = message_key(user, repository)
# Also check for messages in the legacy key
# TODO: Remove in the next release
# https://gitlab.com/gitlab-org/gitlab/-/issues/292030
legacy_key = legacy_message_key(user, repository) if respond_to?(:legacy_message_key)
Gitlab::Redis::SharedState.with do |redis|
message = redis.get(key)
redis.del(key)
message
if legacy_key
legacy_message = redis.get(legacy_key)
redis.del(legacy_key)
end
legacy_message || message
end
end
def add_message
return unless user.present? && project.present?
return unless user && repository
Gitlab::Redis::SharedState.with do |redis|
key = self.class.message_key(user.id, project.id)
key = self.class.message_key(user, repository)
redis.setex(key, 5.minutes, message)
end
end
@ -39,7 +50,7 @@ module Gitlab
delegate :project, to: :repository, allow_nil: true
delegate :container, to: :repository, allow_nil: false
def self.message_key(user_id, project_id)
def self.message_key(user, repository)
raise NotImplementedError
end

View File

@ -21,8 +21,16 @@ module Gitlab
private
def self.message_key(user_id, project_id)
"#{PROJECT_CREATED}:#{user_id}:#{project_id}"
def self.message_key(user, repository)
"#{PROJECT_CREATED}:#{user.id}:#{repository.gl_repository}"
end
# TODO: Remove in the next release
# https://gitlab.com/gitlab-org/gitlab/-/issues/292030
def self.legacy_message_key(user, repository)
return unless repository.project
"#{PROJECT_CREATED}:#{user.id}:#{repository.project.id}"
end
def project_url

View File

@ -1,33 +0,0 @@
# frozen_string_literal: true
module Gitlab
module Checks
class ProjectMoved < PostPushMessage
REDIRECT_NAMESPACE = "redirect_namespace"
def initialize(repository, user, protocol, redirected_path)
@redirected_path = redirected_path
super(repository, user, protocol)
end
def message
<<~MESSAGE
Project '#{redirected_path}' was moved to '#{project.full_path}'.
Please update your Git remote:
git remote set-url origin #{url_to_repo}
MESSAGE
end
private
attr_reader :redirected_path
def self.message_key(user_id, project_id)
"#{REDIRECT_NAMESPACE}:#{user_id}:#{project_id}"
end
end
end
end

View File

@ -9,7 +9,6 @@ module Gitlab
ForbiddenError = Class.new(StandardError)
NotFoundError = Class.new(StandardError)
TimeoutError = Class.new(StandardError)
ProjectMovedError = Class.new(NotFoundError)
# Use the magic string '_any' to indicate we do not know what the
# changes are. This is also what gitlab-shell does.
@ -148,11 +147,11 @@ module Gitlab
raise NotFoundError, not_found_message if container.nil?
check_project! if project?
add_container_moved_message!
end
def check_project!
check_project_accessibility!
add_project_moved_message!
end
def check_custom_action
@ -221,12 +220,12 @@ module Gitlab
error_message(:project_not_found)
end
def add_project_moved_message!
def add_container_moved_message!
return if redirected_path.nil?
project_moved = Checks::ProjectMoved.new(repository, user, protocol, redirected_path)
container_moved = Checks::ContainerMoved.new(repository, user, protocol, redirected_path)
project_moved.add_message
container_moved.add_message
end
def check_command_disabled!

View File

@ -13,7 +13,6 @@ module Gitlab
# @returns [HasRepository, Project, String, String]
def self.parse(path)
repo_path = path.delete_prefix('/').delete_suffix('.git')
redirected_path = nil
# Detect the repo type based on the path, the first one tried is the project
# type, which does not have a suffix.
@ -26,9 +25,11 @@ module Gitlab
# Removing the suffix (.wiki, .design, ...) from the project path
full_path = repo_path.chomp(type.path_suffix)
container, project, redirected_path = find_container(type, full_path)
container, project = find_container(type, full_path)
next unless container
return [container, project, type, redirected_path] if container
redirected_path = repo_path if redirected?(container, repo_path)
return [container, project, type, redirected_path]
end
# When a project did not exist, the parsed repo_type would be empty.
@ -40,32 +41,28 @@ module Gitlab
# Returns an array containing:
# - The repository container
# - The related project (if available)
# - The original container path (if redirected)
#
# @returns [HasRepository, Project, String]
def self.find_container(type, full_path)
return [nil, nil, nil] if full_path.blank?
return [nil, nil] if full_path.blank?
if type.snippet?
snippet, redirected_path = find_snippet(full_path)
snippet = find_snippet(full_path)
[snippet, snippet&.project, redirected_path]
[snippet, snippet&.project]
elsif type.wiki?
wiki, redirected_path = find_wiki(full_path)
wiki = find_wiki(full_path)
[wiki, wiki.try(:project), redirected_path]
[wiki, wiki.try(:project)]
else
project, redirected_path = find_project(full_path)
project = find_project(full_path)
[project, project, redirected_path]
[project, project]
end
end
def self.find_project(project_path)
project = Project.find_by_full_path(project_path, follow_redirects: true)
redirected_path = project_path if redirected?(project, project_path)
[project, redirected_path]
Project.find_by_full_path(project_path, follow_redirects: true)
end
def self.redirected?(container, container_path)
@ -77,11 +74,11 @@ module Gitlab
# - h5bp/html5-boilerplate/snippets/53
def self.find_snippet(snippet_path)
snippet_id, project_path = extract_snippet_info(snippet_path)
return [nil, nil] unless snippet_id
return unless snippet_id
project, redirected_path = find_project(project_path) if project_path
project = find_project(project_path) if project_path
[Snippet.find_by_id_and_project(id: snippet_id, project: project), redirected_path]
Snippet.find_by_id_and_project(id: snippet_id, project: project)
end
# Wiki path can be either:
@ -93,10 +90,9 @@ module Gitlab
# - group/subgroup
def self.find_wiki(container_path)
container = Routable.find_by_full_path(container_path, follow_redirects: true)
redirected_path = container_path if redirected?(container, container_path)
# In CE, Group#wiki is not available so this will return nil for a group path.
[container&.try(:wiki), redirected_path]
container&.try(:wiki)
end
def self.extract_snippet_info(snippet_path)

View File

@ -5,8 +5,8 @@ require 'fileutils'
module Tasks
module Gitlab
module Assets
FOSS_ASSET_FOLDERS = %w[app/assets app/views fixtures/emojis vendor/assets/javascripts].freeze
EE_ASSET_FOLDERS = %w[ee/app/assets ee/app/views].freeze
FOSS_ASSET_FOLDERS = %w[app/assets fixtures/emojis vendor/assets/javascripts].freeze
EE_ASSET_FOLDERS = %w[ee/app/assets].freeze
JS_ASSET_PATTERNS = %w[*.js config/**/*.js].freeze
JS_ASSET_FILES = %w[package.json yarn.lock].freeze
MASTER_MD5_HASH_FILE = 'master-assets-hash.txt'

View File

@ -1927,6 +1927,9 @@ msgstr ""
msgid "Add a homepage to your wiki that contains information about your project and GitLab will display it here instead of this message."
msgstr ""
msgid "Add a horizontal rule"
msgstr ""
msgid "Add a line"
msgstr ""

View File

@ -51,6 +51,7 @@ FactoryBot.define do
trait :unauthenticated do
author_id { -1 }
author_name { 'An unauthenticated user' }
details do
{
custom_message: 'Custom action',

View File

@ -39,17 +39,18 @@ describe('content_editor/components/top_toolbar', () => {
});
describe.each`
testId | controlProps
${'bold'} | ${{ contentType: 'bold', iconName: 'bold', label: 'Bold text', editorCommand: 'toggleBold' }}
${'italic'} | ${{ contentType: 'italic', iconName: 'italic', label: 'Italic text', editorCommand: 'toggleItalic' }}
${'strike'} | ${{ contentType: 'strike', iconName: 'strikethrough', label: 'Strikethrough', editorCommand: 'toggleStrike' }}
${'code'} | ${{ contentType: 'code', iconName: 'code', label: 'Code', editorCommand: 'toggleCode' }}
${'blockquote'} | ${{ contentType: 'blockquote', iconName: 'quote', label: 'Insert a quote', editorCommand: 'toggleBlockquote' }}
${'bullet-list'} | ${{ contentType: 'bulletList', iconName: 'list-bulleted', label: 'Add a bullet list', editorCommand: 'toggleBulletList' }}
${'ordered-list'} | ${{ contentType: 'orderedList', iconName: 'list-numbered', label: 'Add a numbered list', editorCommand: 'toggleOrderedList' }}
${'code-block'} | ${{ contentType: 'codeBlock', iconName: 'doc-code', label: 'Insert a code block', editorCommand: 'toggleCodeBlock' }}
${'text-styles'} | ${{}}
${'link'} | ${{}}
testId | controlProps
${'bold'} | ${{ contentType: 'bold', iconName: 'bold', label: 'Bold text', editorCommand: 'toggleBold' }}
${'italic'} | ${{ contentType: 'italic', iconName: 'italic', label: 'Italic text', editorCommand: 'toggleItalic' }}
${'strike'} | ${{ contentType: 'strike', iconName: 'strikethrough', label: 'Strikethrough', editorCommand: 'toggleStrike' }}
${'code'} | ${{ contentType: 'code', iconName: 'code', label: 'Code', editorCommand: 'toggleCode' }}
${'blockquote'} | ${{ contentType: 'blockquote', iconName: 'quote', label: 'Insert a quote', editorCommand: 'toggleBlockquote' }}
${'bullet-list'} | ${{ contentType: 'bulletList', iconName: 'list-bulleted', label: 'Add a bullet list', editorCommand: 'toggleBulletList' }}
${'ordered-list'} | ${{ contentType: 'orderedList', iconName: 'list-numbered', label: 'Add a numbered list', editorCommand: 'toggleOrderedList' }}
${'horizontal-rule'} | ${{ contentType: 'horizontalRule', iconName: 'dash', label: 'Add a horizontal rule', editorCommand: 'setHorizontalRule' }}
${'code-block'} | ${{ contentType: 'codeBlock', iconName: 'doc-code', label: 'Insert a code block', editorCommand: 'toggleCodeBlock' }}
${'text-styles'} | ${{}}
${'link'} | ${{}}
`('given a $testId toolbar control', ({ testId, controlProps }) => {
beforeEach(() => {
buildWrapper();

View File

@ -0,0 +1,20 @@
import { hrInputRuleRegExp } from '~/content_editor/extensions/horizontal_rule';
describe('content_editor/extensions/horizontal_rule', () => {
describe.each`
input | matches
${'---'} | ${true}
${'--'} | ${false}
${'---x'} | ${false}
${' ---x'} | ${false}
${' --- '} | ${false}
${'x---x'} | ${false}
${'x---'} | ${false}
`('hrInputRuleRegExp', ({ input, matches }) => {
it(`${matches ? 'matches' : 'does not match'}: "${input}"`, () => {
const match = new RegExp(hrInputRuleRegExp).test(input);
expect(match).toBe(matches);
});
});
});

View File

@ -10,6 +10,8 @@
markdown: '`code`'
- name: strike
markdown: '~~del~~'
- name: horizontal_rule
markdown: '---'
- name: link
markdown: '[GitLab](https://gitlab.com)'
- name: code_block

View File

@ -2,7 +2,7 @@
require 'spec_helper'
RSpec.describe Gitlab::Checks::ProjectMoved, :clean_gitlab_redis_shared_state do
RSpec.describe Gitlab::Checks::ContainerMoved, :clean_gitlab_redis_shared_state do
let_it_be(:user) { create(:user) }
let_it_be(:project) { create(:project, :repository, :wiki_repo, namespace: user.namespace) }
@ -14,27 +14,48 @@ RSpec.describe Gitlab::Checks::ProjectMoved, :clean_gitlab_redis_shared_state do
subject { described_class.new(repository, git_user, protocol, redirect_path) }
describe '.fetch_message' do
let(:key) { "redirect_namespace:#{user.id}:#{project.repository.gl_repository}" }
let(:legacy_key) { "redirect_namespace:#{user.id}:#{project.id}" }
context 'with a redirect message queue' do
before do
subject.add_message
end
it 'returns the redirect message' do
expect(described_class.fetch_message(user.id, project.id)).to eq(subject.message)
expect(described_class.fetch_message(user, project.repository)).to eq(subject.message)
end
it 'deletes the redirect message from redis' do
expect(Gitlab::Redis::SharedState.with { |redis| redis.get("redirect_namespace:#{user.id}:#{project.id}") }).not_to be_nil
expect(Gitlab::Redis::SharedState.with { |redis| redis.get(key) }).not_to be_nil
described_class.fetch_message(user.id, project.id)
described_class.fetch_message(user, project.repository)
expect(Gitlab::Redis::SharedState.with { |redis| redis.get("redirect_namespace:#{user.id}:#{project.id}") }).to be_nil
expect(Gitlab::Redis::SharedState.with { |redis| redis.get(key) }).to be_nil
end
context 'with a message in the legacy key' do
before do
Gitlab::Redis::SharedState.with do |redis|
redis.set(legacy_key, 'legacy message')
end
end
it 'returns and deletes the legacy message' do
expect(Gitlab::Redis::SharedState.with { |redis| redis.get(key) }).not_to be_nil
expect(Gitlab::Redis::SharedState.with { |redis| redis.get(legacy_key) }).not_to be_nil
expect(described_class.fetch_message(user, project.repository)).to eq('legacy message')
expect(Gitlab::Redis::SharedState.with { |redis| redis.get(key) }).to be_nil
expect(Gitlab::Redis::SharedState.with { |redis| redis.get(legacy_key) }).to be_nil
end
end
end
context 'with no redirect message queue' do
it 'returns nil' do
expect(described_class.fetch_message(1, 2)).to be_nil
expect(described_class.fetch_message(user, project.repository)).to be_nil
end
end
end
@ -58,7 +79,7 @@ RSpec.describe Gitlab::Checks::ProjectMoved, :clean_gitlab_redis_shared_state do
shared_examples 'returns redirect message' do
it do
message = <<~MSG
Project '#{redirect_path}' was moved to '#{project.full_path}'.
#{container_label} '#{redirect_path}' was moved to '#{repository.container.full_path}'.
Please update your Git remote:
@ -86,6 +107,7 @@ RSpec.describe Gitlab::Checks::ProjectMoved, :clean_gitlab_redis_shared_state do
context 'with project' do
it_behaves_like 'errors per protocol' do
let(:container_label) { 'Project' }
let(:http_url_to_repo) { project.http_url_to_repo }
let(:ssh_url_to_repo) { project.ssh_url_to_repo }
end
@ -95,6 +117,7 @@ RSpec.describe Gitlab::Checks::ProjectMoved, :clean_gitlab_redis_shared_state do
let(:repository) { project.wiki.repository }
it_behaves_like 'errors per protocol' do
let(:container_label) { 'Project wiki' }
let(:http_url_to_repo) { project.wiki.http_url_to_repo }
let(:ssh_url_to_repo) { project.wiki.ssh_url_to_repo }
end
@ -106,6 +129,7 @@ RSpec.describe Gitlab::Checks::ProjectMoved, :clean_gitlab_redis_shared_state do
let(:repository) { snippet.repository }
it_behaves_like 'errors per protocol' do
let(:container_label) { 'Project snippet' }
let(:http_url_to_repo) { snippet.http_url_to_repo }
let(:ssh_url_to_repo) { snippet.ssh_url_to_repo }
end
@ -116,8 +140,10 @@ RSpec.describe Gitlab::Checks::ProjectMoved, :clean_gitlab_redis_shared_state do
let(:repository) { snippet.repository }
it 'returns nil' do
expect(subject.add_message).to be_nil
it_behaves_like 'errors per protocol' do
let(:container_label) { 'Personal snippet' }
let(:http_url_to_repo) { snippet.http_url_to_repo }
let(:ssh_url_to_repo) { snippet.ssh_url_to_repo }
end
end
end

View File

@ -13,27 +13,48 @@ RSpec.describe Gitlab::Checks::ProjectCreated, :clean_gitlab_redis_shared_state
subject { described_class.new(repository, git_user, 'http') }
describe '.fetch_message' do
let(:key) { "project_created:#{user.id}:#{project.repository.gl_repository}" }
let(:legacy_key) { "project_created:#{user.id}:#{project.id}" }
context 'with a project created message queue' do
before do
subject.add_message
end
it 'returns project created message' do
expect(described_class.fetch_message(user.id, project.id)).to eq(subject.message)
expect(described_class.fetch_message(user, project.repository)).to eq(subject.message)
end
it 'deletes the project created message from redis' do
expect(Gitlab::Redis::SharedState.with { |redis| redis.get("project_created:#{user.id}:#{project.id}") }).not_to be_nil
expect(Gitlab::Redis::SharedState.with { |redis| redis.get(key) }).not_to be_nil
described_class.fetch_message(user.id, project.id)
described_class.fetch_message(user, project.repository)
expect(Gitlab::Redis::SharedState.with { |redis| redis.get("project_created:#{user.id}:#{project.id}") }).to be_nil
expect(Gitlab::Redis::SharedState.with { |redis| redis.get(key) }).to be_nil
end
context 'with a message in the legacy key' do
before do
Gitlab::Redis::SharedState.with do |redis|
redis.set(legacy_key, 'legacy message')
end
end
it 'returns and deletes the legacy message' do
expect(Gitlab::Redis::SharedState.with { |redis| redis.get(key) }).not_to be_nil
expect(Gitlab::Redis::SharedState.with { |redis| redis.get(legacy_key) }).not_to be_nil
expect(described_class.fetch_message(user, project.repository)).to eq('legacy message')
expect(Gitlab::Redis::SharedState.with { |redis| redis.get(key) }).to be_nil
expect(Gitlab::Redis::SharedState.with { |redis| redis.get(legacy_key) }).to be_nil
end
end
end
context 'with no project created message queue' do
it 'returns nil' do
expect(described_class.fetch_message(1, 2)).to be_nil
expect(described_class.fetch_message(user, project.repository)).to be_nil
end
end
end

View File

@ -265,7 +265,7 @@ RSpec.describe Gitlab::GitAccess do
it 'enqueues a redirected message for pushing' do
push_access_check
expect(Gitlab::Checks::ProjectMoved.fetch_message(user.id, project.id)).not_to be_nil
expect(Gitlab::Checks::ContainerMoved.fetch_message(user, project.repository)).not_to be_nil
end
it 'allows push and pull access' do

View File

@ -13,11 +13,11 @@ RSpec.describe ::Gitlab::RepoPath do
describe '.parse' do
context 'a repository storage path' do
it 'parses a full repository project path' do
it 'parses a full project repository path' do
expect(described_class.parse(project.repository.full_path)).to eq([project, project, Gitlab::GlRepository::PROJECT, nil])
end
it 'parses a full wiki project path' do
it 'parses a full project wiki repository path' do
expect(described_class.parse(project.wiki.repository.full_path)).to eq([project.wiki, project, Gitlab::GlRepository::WIKI, nil])
end
@ -49,7 +49,7 @@ RSpec.describe ::Gitlab::RepoPath do
end
it 'parses a relative wiki path' do
expect(described_class.parse(redirect.path + '.wiki.git')).to eq([project.wiki, project, Gitlab::GlRepository::WIKI, redirect_route])
expect(described_class.parse(redirect.path + '.wiki.git')).to eq([project.wiki, project, Gitlab::GlRepository::WIKI, "#{redirect_route}.wiki"])
end
it 'parses a relative path starting with /' do
@ -57,7 +57,7 @@ RSpec.describe ::Gitlab::RepoPath do
end
it 'parses a redirected project snippet repository path' do
expect(described_class.parse(redirect.path + "/snippets/#{project_snippet.id}.git")).to eq([project_snippet, project, Gitlab::GlRepository::SNIPPET, redirect_route])
expect(described_class.parse(redirect.path + "/snippets/#{project_snippet.id}.git")).to eq([project_snippet, project, Gitlab::GlRepository::SNIPPET, "#{redirect_route}/snippets/#{project_snippet.id}"])
end
end
end
@ -70,8 +70,8 @@ RSpec.describe ::Gitlab::RepoPath do
describe '.find_project' do
context 'when finding a project by its canonical path' do
context 'when the cases match' do
it 'returns the project and nil' do
expect(described_class.find_project(project.full_path)).to eq([project, nil])
it 'returns the project' do
expect(described_class.find_project(project.full_path)).to eq(project)
end
end
@ -80,45 +80,45 @@ RSpec.describe ::Gitlab::RepoPath do
# easy and safe to redirect someone to the correctly-cased URL. For git
# requests, we should accept wrongly-cased URLs because it is a pain to
# block people's git operations and force them to update remote URLs.
it 'returns the project and nil' do
expect(described_class.find_project(project.full_path.upcase)).to eq([project, nil])
it 'returns the project' do
expect(described_class.find_project(project.full_path.upcase)).to eq(project)
end
end
end
context 'when finding a project via a redirect' do
it 'returns the project and nil' do
expect(described_class.find_project(redirect.path)).to eq([project, redirect.path])
it 'returns the project' do
expect(described_class.find_project(redirect.path)).to eq(project)
end
end
end
describe '.find_snippet' do
it 'extracts path and id from personal snippet route' do
expect(described_class.find_snippet("snippets/#{personal_snippet.id}")).to eq([personal_snippet, nil])
expect(described_class.find_snippet("snippets/#{personal_snippet.id}")).to eq(personal_snippet)
end
it 'extracts path and id from project snippet route' do
expect(described_class.find_snippet("#{project.full_path}/snippets/#{project_snippet.id}")).to eq([project_snippet, nil])
expect(described_class.find_snippet("#{project.full_path}/snippets/#{project_snippet.id}")).to eq(project_snippet)
end
it 'returns nil for invalid snippet paths' do
aggregate_failures do
expect(described_class.find_snippet("snippets/#{project_snippet.id}")).to eq([nil, nil])
expect(described_class.find_snippet("#{project.full_path}/snippets/#{personal_snippet.id}")).to eq([nil, nil])
expect(described_class.find_snippet('')).to eq([nil, nil])
expect(described_class.find_snippet("snippets/#{project_snippet.id}")).to be_nil
expect(described_class.find_snippet("#{project.full_path}/snippets/#{personal_snippet.id}")).to be_nil
expect(described_class.find_snippet('')).to be_nil
end
end
it 'returns nil for snippets not associated with the project' do
snippet = create(:project_snippet)
expect(described_class.find_snippet("#{project.full_path}/snippets/#{snippet.id}")).to eq([nil, nil])
expect(described_class.find_snippet("#{project.full_path}/snippets/#{snippet.id}")).to be_nil
end
context 'when finding a project snippet via a redirect' do
it 'returns the project and true' do
expect(described_class.find_snippet("#{redirect.path}/snippets/#{project_snippet.id}")).to eq([project_snippet, redirect.path])
it 'returns the project snippet' do
expect(described_class.find_snippet("#{redirect.path}/snippets/#{project_snippet.id}")).to eq(project_snippet)
end
end
end

View File

@ -3,9 +3,6 @@
require 'spec_helper'
RSpec.describe AuditEvent do
let_it_be(:audit_event) { create(:project_audit_event) }
subject { audit_event }
describe 'validations' do
include_examples 'validates IP address' do
let(:attribute) { :ip_address }
@ -13,6 +10,71 @@ RSpec.describe AuditEvent do
end
end
describe 'callbacks' do
describe '#parallel_persist' do
shared_examples 'a parallel persisted field' do
using RSpec::Parameterized::TableSyntax
where(:column, :details, :expected_value) do
:value | nil | :value
nil | :value | :value
:value | :another_value | :value
nil | nil | nil
end
with_them do
let(:values) { { value: value, another_value: "#{value}88" } }
let(:audit_event) do
build(:audit_event, name => values[column], details: { name => values[details] })
end
it 'sets both values to be the same', :aggregate_failures do
audit_event.validate
expect(audit_event[name]).to eq(values[expected_value])
expect(audit_event.details[name]).to eq(values[expected_value])
end
end
end
context 'wih author_name' do
let(:name) { :author_name }
let(:value) { 'Mary Poppins' }
it_behaves_like 'a parallel persisted field'
end
context 'with entity_path' do
let(:name) { :entity_path }
let(:value) { 'gitlab-org' }
it_behaves_like 'a parallel persisted field'
end
context 'with target_details' do
let(:name) { :target_details }
let(:value) { 'gitlab-org/gitlab' }
it_behaves_like 'a parallel persisted field'
end
context 'with target_type' do
let(:name) { :target_type }
let(:value) { 'Project' }
it_behaves_like 'a parallel persisted field'
end
context 'with target_id' do
let(:name) { :target_id }
let(:value) { 8 }
it_behaves_like 'a parallel persisted field'
end
end
end
describe '#as_json' do
context 'ip_address' do
subject { build(:group_audit_event, ip_address: '192.168.1.1').as_json }

View File

@ -1176,59 +1176,68 @@ RSpec.describe API::Internal::Base do
allow_any_instance_of(Gitlab::Identifier).to receive(:identify).and_return(user)
end
context 'with Project' do
it 'executes PostReceiveService' do
message = <<~MESSAGE.strip
To create a merge request for #{branch_name}, visit:
http://#{Gitlab.config.gitlab.host}/#{project.full_path}/-/merge_requests/new?merge_request%5Bsource_branch%5D=#{branch_name}
MESSAGE
shared_examples 'runs post-receive hooks' do
let(:gl_repository) { container.repository.gl_repository }
let(:messages) { [] }
it 'executes PostReceiveService' do
subject
expect(response).to have_gitlab_http_status(:ok)
expect(json_response).to eq({
'messages' => [{ 'message' => message, 'type' => 'basic' }],
'messages' => messages,
'reference_counter_decreased' => true
})
end
it 'tries to notify that the container has moved' do
expect(Gitlab::Checks::ContainerMoved).to receive(:fetch_message).with(user, container.repository)
subject
end
it_behaves_like 'storing arguments in the application context' do
let(:expected_params) { { user: user.username, project: project.full_path } }
let(:expected_params) { expected_context }
end
end
context 'with Project' do
it_behaves_like 'runs post-receive hooks' do
let(:container) { project }
let(:expected_context) { { user: user.username, project: project.full_path } }
let(:messages) do
[
{
'message' => <<~MESSAGE.strip,
To create a merge request for #{branch_name}, visit:
http://#{Gitlab.config.gitlab.host}/#{project.full_path}/-/merge_requests/new?merge_request%5Bsource_branch%5D=#{branch_name}
MESSAGE
'type' => 'basic'
}
]
end
end
end
context 'with PersonalSnippet' do
let(:gl_repository) { "snippet-#{personal_snippet.id}" }
it 'executes PostReceiveService' do
subject
expect(json_response).to eq({
'messages' => [],
'reference_counter_decreased' => true
})
end
it_behaves_like 'storing arguments in the application context' do
let(:expected_params) { { user: key.user.username } }
let(:gl_repository) { "snippet-#{personal_snippet.id}" }
it_behaves_like 'runs post-receive hooks' do
let(:container) { personal_snippet }
let(:expected_context) { { user: key.user.username } }
end
end
context 'with ProjectSnippet' do
let(:gl_repository) { "snippet-#{project_snippet.id}" }
it 'executes PostReceiveService' do
subject
expect(json_response).to eq({
'messages' => [],
'reference_counter_decreased' => true
})
it_behaves_like 'runs post-receive hooks' do
let(:container) { project_snippet }
let(:expected_context) { { user: key.user.username, project: project_snippet.project.full_path } }
end
end
it_behaves_like 'storing arguments in the application context' do
let(:expected_params) { { user: key.user.username, project: project_snippet.project.full_path } }
let(:gl_repository) { "snippet-#{project_snippet.id}" }
context 'with ProjectWiki' do
it_behaves_like 'runs post-receive hooks' do
let(:container) { project.wiki }
let(:expected_context) { { user: key.user.username, project: project.full_path } }
end
end
@ -1236,7 +1245,7 @@ RSpec.describe API::Internal::Base do
it 'does not try to notify that project moved' do
allow_any_instance_of(Gitlab::Identifier).to receive(:identify).and_return(nil)
expect(Gitlab::Checks::ProjectMoved).not_to receive(:fetch_message)
expect(Gitlab::Checks::ContainerMoved).not_to receive(:fetch_message)
subject
@ -1244,33 +1253,17 @@ RSpec.describe API::Internal::Base do
end
end
context 'when project is nil' do
context 'with Project' do
let(:gl_repository) { 'project-foo' }
context 'when container is nil' do
let(:gl_repository) { 'project-foo' }
it 'does not try to notify that project moved' do
allow(Gitlab::GlRepository).to receive(:parse).and_return([nil, nil, Gitlab::GlRepository::PROJECT])
it 'does not try to notify that project moved' do
allow(Gitlab::GlRepository).to receive(:parse).and_return([nil, nil, Gitlab::GlRepository::PROJECT])
expect(Gitlab::Checks::ProjectMoved).not_to receive(:fetch_message)
expect(Gitlab::Checks::ContainerMoved).not_to receive(:fetch_message)
subject
subject
expect(response).to have_gitlab_http_status(:ok)
end
end
context 'with PersonalSnippet' do
let(:gl_repository) { "snippet-#{personal_snippet.id}" }
it 'does not try to notify that project moved' do
allow(Gitlab::GlRepository).to receive(:parse).and_return([personal_snippet, nil, Gitlab::GlRepository::SNIPPET])
expect(Gitlab::Checks::ProjectMoved).not_to receive(:fetch_message)
subject
expect(response).to have_gitlab_http_status(:ok)
end
expect(response).to have_gitlab_http_status(:ok)
end
end
end

View File

@ -283,7 +283,7 @@ RSpec.describe PostReceiveService do
context 'with a redirected data' do
it 'returns redirected message on the response' do
project_moved = Gitlab::Checks::ProjectMoved.new(project.repository, user, 'http', 'foo/baz')
project_moved = Gitlab::Checks::ContainerMoved.new(project.repository, user, 'http', 'foo/baz')
project_moved.add_message
expect(subject).to include(build_basic_message(project_moved.message))