Add latest changes from gitlab-org/gitlab@master
This commit is contained in:
parent
866b1f8ed7
commit
919f0e86ba
|
@ -1,34 +1,10 @@
|
|||
---
|
||||
# Cop supports --auto-correct.
|
||||
# Cop supports --autocorrect.
|
||||
Layout/SpaceInsideParens:
|
||||
# Offense count: 701
|
||||
# Temporarily disabled due to too many offenses
|
||||
Enabled: false
|
||||
Exclude:
|
||||
- 'app/controllers/projects/environments_controller.rb'
|
||||
- 'app/controllers/projects/pipeline_schedules_controller.rb'
|
||||
- 'app/graphql/mutations/ci/job/base.rb'
|
||||
- 'app/helpers/icons_helper.rb'
|
||||
- 'app/helpers/projects_helper.rb'
|
||||
- 'app/helpers/reminder_emails_helper.rb'
|
||||
- 'app/models/alert_management/alert.rb'
|
||||
- 'app/models/ci/build_metadata.rb'
|
||||
- 'app/models/concerns/milestoneable.rb'
|
||||
- 'app/models/concerns/mirror_authentication.rb'
|
||||
- 'app/models/concerns/protected_ref_access.rb'
|
||||
- 'app/models/cycle_analytics/project_level_stage_adapter.rb'
|
||||
- 'app/models/merge_request.rb'
|
||||
- 'app/models/pages_domain.rb'
|
||||
- 'app/models/project.rb'
|
||||
- 'app/services/ci/archive_trace_service.rb'
|
||||
- 'app/services/jira_import/start_import_service.rb'
|
||||
- 'app/services/labels/transfer_service.rb'
|
||||
- 'app/services/packages/debian/create_distribution_service.rb'
|
||||
- 'app/services/packages/debian/update_distribution_service.rb'
|
||||
- 'app/services/packages/npm/create_package_service.rb'
|
||||
- 'app/services/personal_access_tokens/revoke_service.rb'
|
||||
- 'app/services/snippets/create_service.rb'
|
||||
- 'app/services/spam/spam_verdict_service.rb'
|
||||
- 'config/initializers/wikicloth_redos_patch.rb'
|
||||
- 'db/post_migrate/20210722042939_update_issuable_slas_where_issue_closed.rb'
|
||||
- 'ee/app/graphql/resolvers/external_issue_resolver.rb'
|
||||
|
|
|
@ -1 +1 @@
|
|||
bb32df05c777d0cd8a8d15249c99e2d8055e0769
|
||||
f94d4abfae5a3ee09caacd1b2dd28dca875eafa0
|
||||
|
|
|
@ -64,8 +64,9 @@ export default {
|
|||
if (res.data) {
|
||||
this.status = res.data.severity;
|
||||
|
||||
this.track('rendered_version_badge', {
|
||||
label: this.title,
|
||||
this.track('render', {
|
||||
label: 'version_badge',
|
||||
property: this.title,
|
||||
});
|
||||
}
|
||||
})
|
||||
|
@ -77,7 +78,10 @@ export default {
|
|||
onClick() {
|
||||
if (!this.actionable) return;
|
||||
|
||||
this.track('click_version_badge', { label: this.title });
|
||||
this.track('click_link', {
|
||||
label: 'version_badge',
|
||||
property: this.title,
|
||||
});
|
||||
},
|
||||
},
|
||||
UPGRADE_DOCS_URL,
|
||||
|
|
|
@ -183,7 +183,7 @@ class Projects::EnvironmentsController < Projects::ApplicationController
|
|||
def metrics
|
||||
respond_to do |format|
|
||||
format.html do
|
||||
redirect_to project_metrics_dashboard_path(project, environment: environment )
|
||||
redirect_to project_metrics_dashboard_path(project, environment: environment)
|
||||
end
|
||||
format.json do
|
||||
# Currently, this acts as a hint to load the metrics details into the cache
|
||||
|
|
|
@ -435,7 +435,11 @@ class Projects::IssuesController < Projects::ApplicationController
|
|||
return render_404 if issue.task? && !project.work_items_feature_flag_enabled?
|
||||
return unless issue.task?
|
||||
|
||||
redirect_to project_work_items_path(project, issue.id, params: request.query_parameters)
|
||||
if Feature.enabled?(:use_iid_in_work_items_path, project.group)
|
||||
redirect_to project_work_items_path(project, issue.iid, params: request.query_parameters.merge(iid_path: true))
|
||||
else
|
||||
redirect_to project_work_items_path(project, issue.id, params: request.query_parameters)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ class Projects::PipelineSchedulesController < Projects::ApplicationController
|
|||
def schedule_params
|
||||
params.require(:schedule)
|
||||
.permit(:description, :cron, :cron_timezone, :ref, :active,
|
||||
variables_attributes: [:id, :variable_type, :key, :secret_value, :_destroy] )
|
||||
variables_attributes: [:id, :variable_type, :key, :secret_value, :_destroy])
|
||||
end
|
||||
|
||||
def authorize_play_pipeline_schedule!
|
||||
|
|
|
@ -18,7 +18,7 @@ module Mutations
|
|||
null: false,
|
||||
description: 'Number of artifacts deleted.'
|
||||
|
||||
def find_object(id: )
|
||||
def find_object(id:)
|
||||
GlobalID::Locator.locate(id)
|
||||
end
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ module Mutations
|
|||
required: true,
|
||||
description: 'ID of the job to mutate.'
|
||||
|
||||
def find_object(id: )
|
||||
def find_object(id:)
|
||||
GlobalID::Locator.locate(id)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -20,7 +20,7 @@ module Mutations
|
|||
null: true,
|
||||
description: 'Deleted artifact.'
|
||||
|
||||
def find_object(id: )
|
||||
def find_object(id:)
|
||||
GlobalID::Locator.locate(id)
|
||||
end
|
||||
|
||||
|
|
|
@ -532,6 +532,11 @@ module Types
|
|||
description: "Branch rules configured for the project.",
|
||||
resolver: Resolvers::Projects::BranchRulesResolver
|
||||
|
||||
field :languages, [Types::Projects::RepositoryLanguageType],
|
||||
null: true,
|
||||
description: "Programming languages used in the project.",
|
||||
calls_gitaly: true
|
||||
|
||||
def timelog_categories
|
||||
object.project_namespace.timelog_categories if Feature.enabled?(:timelog_categories)
|
||||
end
|
||||
|
@ -609,6 +614,10 @@ module Types
|
|||
object.service_desk_address
|
||||
end
|
||||
|
||||
def languages
|
||||
::Projects::RepositoryLanguagesService.new(project, current_user).execute
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def project
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Types
|
||||
module Projects
|
||||
# rubocop: disable Graphql/AuthorizeTypes
|
||||
class RepositoryLanguageType < BaseObject
|
||||
graphql_name 'RepositoryLanguage'
|
||||
|
||||
field :name, GraphQL::Types::String, null: false,
|
||||
description: 'Name of the repository language.'
|
||||
|
||||
field :share, GraphQL::Types::Float, null: true,
|
||||
description: "Percentage of the repository's languages."
|
||||
|
||||
field :color, Types::ColorType, null: true,
|
||||
description: 'Color to visualize the repository language.'
|
||||
end
|
||||
# rubocop: enable Graphql/AuthorizeTypes
|
||||
end
|
||||
end
|
|
@ -42,7 +42,7 @@ module IconsHelper
|
|||
|
||||
content_tag(
|
||||
:svg,
|
||||
content_tag(:use, '', { 'href' => "#{sprite_icon_path}##{icon_name}" } ),
|
||||
content_tag(:use, '', { 'href' => "#{sprite_icon_path}##{icon_name}" }),
|
||||
class: css_classes.empty? ? nil : css_classes.join(' '),
|
||||
data: { testid: "#{icon_name}-icon" }
|
||||
)
|
||||
|
|
|
@ -157,9 +157,9 @@ module IssuablesHelper
|
|||
|
||||
if issuable.respond_to?(:work_item_type) && WorkItems::Type::WI_TYPES_WITH_CREATED_HEADER.include?(issuable.work_item_type.base_type)
|
||||
output << content_tag(:span, sprite_icon("#{issuable.work_item_type.icon_name}", css_class: 'gl-icon gl-vertical-align-middle gl-text-gray-500'), class: 'gl-mr-2', aria: { hidden: 'true' })
|
||||
output << content_tag(:span, s_('IssuableStatus|%{wi_type} created %{created_at} by ').html_safe % { wi_type: issuable.issue_type.capitalize, created_at: time_ago_with_tooltip(issuable.created_at) }, class: 'gl-mr-2' )
|
||||
output << content_tag(:span, s_('IssuableStatus|%{wi_type} created %{created_at} by ').html_safe % { wi_type: issuable.issue_type.capitalize, created_at: time_ago_with_tooltip(issuable.created_at) }, class: 'gl-mr-2')
|
||||
else
|
||||
output << content_tag(:span, s_('IssuableStatus|Created %{created_at} by').html_safe % { created_at: time_ago_with_tooltip(issuable.created_at) }, class: 'gl-mr-2' )
|
||||
output << content_tag(:span, s_('IssuableStatus|Created %{created_at} by').html_safe % { created_at: time_ago_with_tooltip(issuable.created_at) }, class: 'gl-mr-2')
|
||||
end
|
||||
|
||||
if issuable.is_a?(Issue) && issuable.service_desk_reply_to
|
||||
|
|
|
@ -69,7 +69,7 @@ module ProjectsHelper
|
|||
if opts[:name]
|
||||
inject_classes.concat(["js-user-link", opts[:mobile_classes]])
|
||||
else
|
||||
inject_classes.append( "has-tooltip" )
|
||||
inject_classes.append("has-tooltip")
|
||||
end
|
||||
|
||||
inject_classes = inject_classes.compact.join(" ")
|
||||
|
|
|
@ -41,7 +41,7 @@ module ReminderEmailsHelper
|
|||
|
||||
body = invitation_reminder_body_text(reminder_index)
|
||||
|
||||
(format == :html ? html_escape(body) : body ) % options
|
||||
(format == :html ? html_escape(body) : body) % options
|
||||
end
|
||||
|
||||
def invitation_reminder_accept_link(token, format: nil)
|
||||
|
|
|
@ -43,7 +43,14 @@ module Routing
|
|||
end
|
||||
|
||||
def work_item_url(entity, *args)
|
||||
project_work_items_url(entity.project, entity.id, *args)
|
||||
unless Feature.enabled?(:use_iid_in_work_items_path, entity.project.group)
|
||||
return project_work_items_url(entity.project, entity.id, *args)
|
||||
end
|
||||
|
||||
options = args.first || {}
|
||||
options[:iid_path] = true
|
||||
|
||||
project_work_items_url(entity.project, entity.iid, **options)
|
||||
end
|
||||
|
||||
def merge_request_url(entity, *args)
|
||||
|
|
|
@ -51,7 +51,7 @@ module Ci
|
|||
end
|
||||
|
||||
def set_cancel_gracefully
|
||||
runtime_runner_features.merge!( { cancel_gracefully: true } )
|
||||
runtime_runner_features.merge!({ cancel_gracefully: true })
|
||||
end
|
||||
|
||||
def cancel_gracefully?
|
||||
|
|
|
@ -18,7 +18,7 @@ module Milestoneable
|
|||
scope :with_milestone, ->(title) { left_joins_milestones.where(milestones: { title: title }) }
|
||||
scope :without_particular_milestones, ->(titles) { left_outer_joins(:milestone).where("milestones.title NOT IN (?) OR milestone_id IS NULL", titles) }
|
||||
scope :any_release, -> { joins_milestone_releases }
|
||||
scope :with_release, -> (tag, project_id) { joins_milestone_releases.where( milestones: { releases: { tag: tag, project_id: project_id } } ) }
|
||||
scope :with_release, -> (tag, project_id) { joins_milestone_releases.where(milestones: { releases: { tag: tag, project_id: project_id } }) }
|
||||
scope :without_particular_release, -> (tag, project_id) { joins_milestone_releases.where.not(milestones: { releases: { tag: tag, project_id: project_id } }) }
|
||||
|
||||
scope :left_joins_milestones, -> { joins("LEFT OUTER JOIN milestones ON #{table_name}.milestone_id = milestones.id") }
|
||||
|
|
|
@ -11,7 +11,7 @@ module MirrorAuthentication
|
|||
|
||||
# We should generate a key even if there's no SSH URL present
|
||||
before_validation :generate_ssh_private_key!, if: -> {
|
||||
regenerate_ssh_private_key || ( auth_method == 'ssh_public_key' && ssh_private_key.blank? )
|
||||
regenerate_ssh_private_key || (auth_method == 'ssh_public_key' && ssh_private_key.blank?)
|
||||
}
|
||||
|
||||
credentials_field :auth_method, reader: false
|
||||
|
|
|
@ -21,8 +21,8 @@ module ProtectedRefAccess
|
|||
included do
|
||||
scope :maintainer, -> { where(access_level: Gitlab::Access::MAINTAINER) }
|
||||
scope :developer, -> { where(access_level: Gitlab::Access::DEVELOPER) }
|
||||
scope :by_user, -> (user) { where(user_id: user ) }
|
||||
scope :by_group, -> (group) { where(group_id: group ) }
|
||||
scope :by_user, -> (user) { where(user_id: user) }
|
||||
scope :by_group, -> (group) { where(group_id: group) }
|
||||
scope :for_role, -> { where(user_id: nil, group_id: nil) }
|
||||
scope :for_user, -> { where.not(user_id: nil) }
|
||||
scope :for_group, -> { where.not(group_id: nil) }
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
# compatible with the old value stream controller actions.
|
||||
module CycleAnalytics
|
||||
class ProjectLevelStageAdapter
|
||||
ProjectLevelStage = Struct.new(:title, :description, :legend, :name, :project_median, keyword_init: true )
|
||||
ProjectLevelStage = Struct.new(:title, :description, :legend, :name, :project_median, keyword_init: true)
|
||||
|
||||
def initialize(stage, options)
|
||||
@stage = stage
|
||||
|
|
|
@ -1677,7 +1677,7 @@ class MergeRequest < ApplicationRecord
|
|||
# TODO: consider renaming this as with exposed artifacts we generate reports,
|
||||
# not always compare
|
||||
# issue: https://gitlab.com/gitlab-org/gitlab/issues/34224
|
||||
def compare_reports(service_class, current_user = nil, report_type = nil, additional_params = {} )
|
||||
def compare_reports(service_class, current_user = nil, report_type = nil, additional_params = {})
|
||||
with_reactive_cache(service_class.name, current_user&.id, report_type) do |data|
|
||||
unless service_class.new(project, current_user, id: id, report_type: report_type, additional_params: additional_params)
|
||||
.latest?(comparison_base_pipeline(service_class.name), actual_head_pipeline, data)
|
||||
|
|
|
@ -50,7 +50,7 @@ class PagesDomain < ApplicationRecord
|
|||
|
||||
scope :for_project, ->(project) { where(project: project) }
|
||||
|
||||
scope :enabled, -> { where('enabled_until >= ?', Time.current ) }
|
||||
scope :enabled, -> { where('enabled_until >= ?', Time.current) }
|
||||
scope :needs_verification, -> do
|
||||
verified_at = arel_table[:verified_at]
|
||||
enabled_until = arel_table[:enabled_until]
|
||||
|
|
|
@ -1616,7 +1616,7 @@ class Project < ApplicationRecord
|
|||
end
|
||||
|
||||
def all_clusters
|
||||
group_clusters = Clusters::Cluster.joins(:groups).where(cluster_groups: { group_id: ancestors_upto } )
|
||||
group_clusters = Clusters::Cluster.joins(:groups).where(cluster_groups: { group_id: ancestors_upto })
|
||||
instance_clusters = Clusters::Cluster.instance_type
|
||||
|
||||
Clusters::Cluster.from_union([clusters, group_clusters, instance_clusters])
|
||||
|
|
|
@ -552,7 +552,7 @@ class Wiki
|
|||
def fetch_pages_content!(pages)
|
||||
blobs =
|
||||
repository
|
||||
.blobs_at(pages.map { |page| [default_branch, page.path] } )
|
||||
.blobs_at(pages.map { |page| [default_branch, page.path] })
|
||||
.to_h { |blob| [blob.path, blob.data] }
|
||||
|
||||
pages.each do |page|
|
||||
|
|
|
@ -68,7 +68,7 @@ module Ci
|
|||
Gitlab::ErrorTracking
|
||||
.track_and_raise_for_dev_exception(error,
|
||||
issue_url: 'https://gitlab.com/gitlab-org/gitlab-foss/issues/51502',
|
||||
job_id: job.id )
|
||||
job_id: job.id)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -40,7 +40,7 @@ module JiraImport
|
|||
project.import_type = 'jira'
|
||||
project.save! && jira_import.schedule!
|
||||
|
||||
ServiceResponse.success(payload: { import_data: jira_import } )
|
||||
ServiceResponse.success(payload: { import_data: jira_import })
|
||||
rescue StandardError => ex
|
||||
# in case project.save! raises an error
|
||||
Gitlab::ErrorTracking.track_exception(ex, project_id: project.id)
|
||||
|
|
|
@ -51,7 +51,7 @@ module Labels
|
|||
# rubocop: disable CodeReuse/ActiveRecord
|
||||
def group_labels_applied_to_issues
|
||||
@labels_applied_to_issues ||= Label.joins(:issues)
|
||||
.joins("INNER JOIN namespaces on namespaces.id = labels.group_id AND namespaces.type = 'Group'" )
|
||||
.joins("INNER JOIN namespaces on namespaces.id = labels.group_id AND namespaces.type = 'Group'")
|
||||
.where(issues: { project_id: project.id }).reorder(nil)
|
||||
end
|
||||
# rubocop: enable CodeReuse/ActiveRecord
|
||||
|
@ -59,7 +59,7 @@ module Labels
|
|||
# rubocop: disable CodeReuse/ActiveRecord
|
||||
def group_labels_applied_to_merge_requests
|
||||
@labels_applied_to_mrs ||= Label.joins(:merge_requests)
|
||||
.joins("INNER JOIN namespaces on namespaces.id = labels.group_id AND namespaces.type = 'Group'" )
|
||||
.joins("INNER JOIN namespaces on namespaces.id = labels.group_id AND namespaces.type = 'Group'")
|
||||
.where(merge_requests: { target_project_id: project.id }).reorder(nil)
|
||||
end
|
||||
# rubocop: enable CodeReuse/ActiveRecord
|
||||
|
|
|
@ -61,7 +61,7 @@ module Packages
|
|||
create_objects(distribution.architectures, architectures, error_label: 'Architecture')
|
||||
end
|
||||
|
||||
def create_objects(objects, object_names_from_params, error_label: )
|
||||
def create_objects(objects, object_names_from_params, error_label:)
|
||||
object_names_from_params.each do |name|
|
||||
new_object = objects.create(name: name)
|
||||
append_errors(new_object, error_label)
|
||||
|
|
|
@ -58,7 +58,7 @@ module Packages
|
|||
update_objects(distribution.architectures, architectures, error_label: 'Architecture')
|
||||
end
|
||||
|
||||
def update_objects(objects, object_names_from_params, error_label: )
|
||||
def update_objects(objects, object_names_from_params, error_label:)
|
||||
current_object_names = objects.map(&:name)
|
||||
missing_object_names = object_names_from_params - current_object_names
|
||||
extra_object_names = current_object_names - object_names_from_params
|
||||
|
|
|
@ -81,7 +81,7 @@ module Packages
|
|||
# - https://blog.aaronlenoir.com/2017/11/10/get-original-length-from-base-64-string/
|
||||
# - https://en.wikipedia.org/wiki/Base64#Decoding_Base64_with_padding
|
||||
encoded_data = attachment['data']
|
||||
((encoded_data.length * 0.75 ) - encoded_data[-2..].count('=')).to_i
|
||||
((encoded_data.length * 0.75) - encoded_data[-2..].count('=')).to_i
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ module PersonalAccessTokens
|
|||
class RevokeService < BaseService
|
||||
attr_reader :token, :current_user, :group
|
||||
|
||||
def initialize(current_user = nil, token: nil, group: nil )
|
||||
def initialize(current_user = nil, token: nil, group: nil)
|
||||
@current_user = current_user
|
||||
@token = token
|
||||
@group = group
|
||||
|
|
|
@ -34,7 +34,7 @@ module Snippets
|
|||
|
||||
move_temporary_files
|
||||
|
||||
ServiceResponse.success(payload: { snippet: @snippet } )
|
||||
ServiceResponse.success(payload: { snippet: @snippet })
|
||||
else
|
||||
snippet_error_response(@snippet, 400)
|
||||
end
|
||||
|
|
|
@ -24,7 +24,7 @@ module Spam
|
|||
|
||||
label = spamcheck_error ? 'ERROR' : spamcheck_result.to_s.upcase
|
||||
|
||||
histogram.observe( { result: label }, external_spam_check_round_trip_time )
|
||||
histogram.observe({ result: label }, external_spam_check_round_trip_time)
|
||||
|
||||
# assign result to a var for logging it before reassigning to nil when monitorMode is true
|
||||
original_spamcheck_result = spamcheck_result
|
||||
|
|
|
@ -65,7 +65,7 @@ module WorkItems
|
|||
end
|
||||
|
||||
def invalid_args_error(params)
|
||||
error(_("One or more arguments are invalid: %{args}." % { args: params.keys.to_sentence } ))
|
||||
error(_("One or more arguments are invalid: %{args}." % { args: params.keys.to_sentence }))
|
||||
end
|
||||
|
||||
def service_response!(result)
|
||||
|
|
|
@ -5,8 +5,9 @@
|
|||
href: help_page_path('update/index'),
|
||||
data: {
|
||||
testid: 'gitlab-version-container',
|
||||
track_action: 'click_version_help_dropdown',
|
||||
track_label: "#{Gitlab.version_info.major}.#{Gitlab.version_info.minor}"
|
||||
track_action: 'click_link',
|
||||
track_label: 'version_help_dropdown',
|
||||
track_property: "#{Gitlab.version_info.major}.#{Gitlab.version_info.minor}"
|
||||
}
|
||||
}
|
||||
%span
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
---
|
||||
name: use_iid_in_work_items_path
|
||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/101451
|
||||
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/378349
|
||||
milestone: '15.5'
|
||||
type: development
|
||||
group: group::project management
|
||||
default_enabled: false
|
|
@ -1023,6 +1023,7 @@ Settings.monitoring.sidekiq_health_checks['port'] ||= 8092
|
|||
|
||||
Settings.monitoring['web_exporter'] ||= Settingslogic.new({})
|
||||
Settings.monitoring.web_exporter['enabled'] ||= false
|
||||
Settings.monitoring.web_exporter['log_enabled'] ||= true
|
||||
Settings.monitoring.web_exporter['address'] ||= 'localhost'
|
||||
Settings.monitoring.web_exporter['port'] ||= 8083
|
||||
Settings.monitoring.web_exporter['tls_enabled'] ||= false
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddIndexAuthorIdAndIdOnMergeRequests < Gitlab::Database::Migration[2.0]
|
||||
INDEX_NAME = 'index_merge_requests_on_author_id_and_id'
|
||||
|
||||
disable_ddl_transaction!
|
||||
|
||||
def up
|
||||
add_concurrent_index :merge_requests, %i[author_id id], name: INDEX_NAME
|
||||
end
|
||||
|
||||
def down
|
||||
remove_concurrent_index_by_name :merge_requests, INDEX_NAME
|
||||
end
|
||||
end
|
|
@ -0,0 +1 @@
|
|||
c9f5827072920fdc52efeaf1ab39c67c48896a6288c5720e4be96070340ce6d8
|
|
@ -29520,6 +29520,8 @@ CREATE INDEX index_merge_requests_on_assignee_id ON merge_requests USING btree (
|
|||
|
||||
CREATE INDEX index_merge_requests_on_author_id ON merge_requests USING btree (author_id);
|
||||
|
||||
CREATE INDEX index_merge_requests_on_author_id_and_id ON merge_requests USING btree (author_id, id);
|
||||
|
||||
CREATE INDEX index_merge_requests_on_author_id_and_target_project_id ON merge_requests USING btree (author_id, target_project_id);
|
||||
|
||||
CREATE INDEX index_merge_requests_on_created_at ON merge_requests USING btree (created_at);
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
# Checks for "admin" and recommends using the full word instead. "Admin Area" is OK.
|
||||
#
|
||||
# For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles
|
||||
# For a list of all options, see https://vale.sh/docs/topics/styles/
|
||||
extends: substitution
|
||||
message: 'Verify this use of the word "admin". Can it be updated to "administration", "administrator", "administer", or "Admin Area"?'
|
||||
link: https://docs.gitlab.com/ee/development/documentation/styleguide/index.html
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
# - Alert boxes with the note text on the same line
|
||||
# - Alert boxes using words other than "NOTE" or "WARNING"
|
||||
#
|
||||
# For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles
|
||||
# For a list of all options, see https://vale.sh/docs/topics/styles/
|
||||
extends: existence
|
||||
message: 'Alert box "%s" must use the formatting in the style guide.'
|
||||
link: https://docs.gitlab.com/ee/development/documentation/styleguide/index.html#alert-boxes
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
# Don't write plural words with the '(s)' construction. "HTTP(S)" is acceptable.
|
||||
#
|
||||
# For a list of all options, see https://docs.errata.ai/vale/styles
|
||||
# For a list of all options, see https://vale.sh/docs/topics/styles/
|
||||
extends: existence
|
||||
message: 'Rewrite "%s" to be plural, without parentheses.'
|
||||
link: https://docs.gitlab.com/ee/development/documentation/styleguide/word_list.html#s
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
# Verifies that badges are not mixed case, which won't render properly.
|
||||
#
|
||||
# For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles
|
||||
# For a list of all options, see https://vale.sh/docs/topics/styles/
|
||||
extends: existence
|
||||
message: 'Badge "%s" must be capitalized.'
|
||||
link: https://docs.gitlab.com/ee/development/documentation/styleguide/index.html#product-tier-badges
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
# Checks that US spelling is used instead of British spelling.
|
||||
#
|
||||
# For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles
|
||||
# For a list of all options, see https://vale.sh/docs/topics/styles/
|
||||
extends: substitution
|
||||
message: 'Use the US spelling "%s" instead of the British "%s".'
|
||||
link: https://docs.gitlab.com/ee/development/documentation/styleguide/index.html#language
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
# Checks that the `.gitlab-ci.yml` file is referenced properly.
|
||||
#
|
||||
# For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles
|
||||
# For a list of all options, see https://vale.sh/docs/topics/styles/
|
||||
extends: existence
|
||||
message: 'The CI/CD configuration file should be exactly: `.gitlab-ci.yml`'
|
||||
link: https://docs.gitlab.com/ee/development/documentation/versions.html
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
# Ensures all codeblock language tags use the full name, not aliases.
|
||||
#
|
||||
# For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles
|
||||
# For a list of all options, see https://vale.sh/docs/topics/styles/
|
||||
extends: existence
|
||||
message: 'Syntax highlighting hint "%s" must be one of: yaml, ruby, plaintext, markdown, javascript, shell, golang, python, dockerfile, or typescript.'
|
||||
link: https://docs.gitlab.com/ee/development/documentation/styleguide/index.html#code-blocks
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
# Ensures all code blocks using `curl` wrap URL strings in quotation marks.
|
||||
#
|
||||
# For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles
|
||||
# For a list of all options, see https://vale.sh/docs/topics/styles/
|
||||
extends: existence
|
||||
message: 'For consistency across all cURL examples, always wrap the URL in double quotes ("): %s'
|
||||
link: https://docs.gitlab.com/ee/development/documentation/restful_api_styleguide.html#curl-commands
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
# Checks for words that indicate a product or feature may change in the future.
|
||||
#
|
||||
# For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles
|
||||
# For a list of all options, see https://vale.sh/docs/topics/styles/
|
||||
extends: existence
|
||||
message: 'Avoid words like "%s" when you write about future features. Our documentation is about the current state of the product.'
|
||||
level: suggestion
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
# Do not refer to the default branch as the "master" branch, if possible.
|
||||
#
|
||||
# For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles
|
||||
# For a list of all options, see https://vale.sh/docs/topics/styles/
|
||||
extends: existence
|
||||
message: 'Use "default branch" or `main` instead of `master`, when possible.'
|
||||
level: warning
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
# Catches many ways the phrase 'dropdown list' can be fumbled.
|
||||
#
|
||||
# For a list of all options, see https://errata-ai.github.io/vale/styles/
|
||||
# For a list of all options, see https://vale.sh/docs/topics/styles/
|
||||
extends: existence
|
||||
message: 'Use "dropdown list".'
|
||||
link: https://docs.gitlab.com/ee/development/documentation/styleguide/word_list.html#dropdown-list
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
# Checks that there is no useless whitespace at the end of lines.
|
||||
#
|
||||
# For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles
|
||||
# For a list of all options, see https://vale.sh/docs/topics/styles/
|
||||
extends: existence
|
||||
message: 'Lines should not end with whitespace characters.'
|
||||
link: https://docs.gitlab.com/ee/development/documentation/versions.html
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
# Suggests the correct way to describe elements in a form.
|
||||
#
|
||||
# For a list of all options, see https://errata-ai.github.io/vale/styles/
|
||||
# For a list of all options, see https://vale.sh/docs/topics/styles/
|
||||
extends: substitution
|
||||
message: 'When describing elements, %s "%s".'
|
||||
link: https://docs.gitlab.com/ee/development/documentation/styleguide/index.html#language
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
# Checks for use of first person pronouns.
|
||||
#
|
||||
# For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles
|
||||
# For a list of all options, see https://vale.sh/docs/topics/styles/
|
||||
extends: existence
|
||||
message: '"%s" is a first-person pronoun. Use second- or third-person pronouns (like we, you, us, one) instead.'
|
||||
level: warning
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
# Checks for use of future tense in sentences. Present tense is strongly preferred.
|
||||
#
|
||||
# For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles
|
||||
# For a list of all options, see https://vale.sh/docs/topics/styles/
|
||||
extends: existence
|
||||
message: 'Avoid using future tense: "%s". Use present tense instead.'
|
||||
ignorecase: true
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
# Checks for generic, unhelpful subheadings.
|
||||
#
|
||||
# For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles
|
||||
# For a list of all options, see https://vale.sh/docs/topics/styles/
|
||||
extends: existence
|
||||
message: 'Rename the subheading "%s", or re-purpose the content elsewhere.'
|
||||
level: warning
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
# Suggests alternatives for words that foster ableism.
|
||||
#
|
||||
# For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles
|
||||
# For a list of all options, see https://vale.sh/docs/topics/styles/
|
||||
extends: substitution
|
||||
message: 'Use inclusive language. Consider "%s" instead of "%s".'
|
||||
link: https://docs.gitlab.com/ee/development/documentation/styleguide/index.html#inclusive-language
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
# Suggests alternatives for words that are culturally inappropriate.
|
||||
#
|
||||
# For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles
|
||||
# For a list of all options, see https://vale.sh/docs/topics/styles/
|
||||
extends: substitution
|
||||
message: 'Use inclusive language. Consider "%s" instead of "%s".'
|
||||
link: https://docs.gitlab.com/ee/development/documentation/styleguide/index.html#inclusive-language
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
# Suggests alternatives for words that are gender-specific.
|
||||
#
|
||||
# For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles
|
||||
# For a list of all options, see https://vale.sh/docs/topics/styles/
|
||||
extends: substitution
|
||||
message: 'Use inclusive language. Consider "%s" instead of "%s".'
|
||||
link: https://docs.gitlab.com/ee/development/documentation/styleguide/index.html#inclusive-language
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
# Checks that anchor fragments on internal links are in lower-case.
|
||||
#
|
||||
# For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles
|
||||
# For a list of all options, see https://vale.sh/docs/topics/styles/
|
||||
extends: existence
|
||||
message: 'Links to subheadings in GitLab docs must be in lower-case: "%s"'
|
||||
link: https://docs.gitlab.com/ee/development/documentation/styleguide/index.html#links-to-internal-documentation
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
# Checks that internal links have .md extenstion and not .html extension.
|
||||
#
|
||||
# For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles
|
||||
# For a list of all options, see https://vale.sh/docs/topics/styles/
|
||||
extends: existence
|
||||
message: 'Link "%s" must link directly to a file and use the .md file extension.'
|
||||
link: https://docs.gitlab.com/ee/development/documentation/styleguide/index.html#links-to-internal-documentation
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
# Checks that internal link paths don't start with "./", which is not needed.
|
||||
#
|
||||
# For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles
|
||||
# For a list of all options, see https://vale.sh/docs/topics/styles/
|
||||
extends: existence
|
||||
message: 'Link "%s" must not start with "./".'
|
||||
link: https://docs.gitlab.com/ee/development/documentation/styleguide/index.html#links-to-internal-documentation
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
# Checks for use of Latin terms.
|
||||
#
|
||||
# For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles
|
||||
# For a list of all options, see https://vale.sh/docs/topics/styles/
|
||||
extends: substitution
|
||||
message: 'Use "%s" instead of "%s", but consider rewriting the sentence.'
|
||||
link: https://docs.gitlab.com/ee/development/documentation/styleguide/index.html#usage-list
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
# Check for use of GLFM emoji syntax (https://docs.gitlab.com/ee/user/markdown.html#emojis), which doesn't render correctly in documentation.
|
||||
#
|
||||
# For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles
|
||||
# For a list of all options, see https://vale.sh/docs/topics/styles/
|
||||
extends: existence
|
||||
message: 'This appears to be GLFM emoji syntax. Replace "%s" with GitLab SVGs or Unicode emojis.'
|
||||
link: https://docs.gitlab.com/ee/development/documentation/styleguide/#gitlab-svg-icons
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
# Checks for the presence of semantically unhelpful words in link text.
|
||||
#
|
||||
# For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles
|
||||
# For a list of all options, see https://vale.sh/docs/topics/styles/
|
||||
extends: existence
|
||||
message: 'Improve SEO and accessibility by rewriting "%s" in the link text.'
|
||||
level: warning
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
# Checks for the presence of merge conflict markers.
|
||||
#
|
||||
# For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles
|
||||
# For a list of all options, see https://vale.sh/docs/topics/styles/
|
||||
extends: existence
|
||||
message: 'Merge conflict marker "%s" found.'
|
||||
link: https://docs.gitlab.com/ee/development/code_review.html#merging-a-merge-request
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
# Checks that links are all on a single line.
|
||||
#
|
||||
# For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles
|
||||
# For a list of all options, see https://vale.sh/docs/topics/styles/
|
||||
extends: existence
|
||||
message: 'Link "%s" must be on a single line, even if very long.'
|
||||
link: https://docs.gitlab.com/ee/development/documentation/styleguide/index.html#basic-link-criteria
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
# Use only standard single and double quotes, not left or right quotes.
|
||||
#
|
||||
# For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles
|
||||
# For a list of all options, see https://vale.sh/docs/topics/styles/
|
||||
extends: existence
|
||||
message: 'Use standard single quotes or double quotes only. Do not use left or right quotes.'
|
||||
level: warning
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
# Checks for references to versions of GitLab that are no longer supported.
|
||||
#
|
||||
# For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles
|
||||
# For a list of all options, see https://vale.sh/docs/topics/styles/
|
||||
extends: existence
|
||||
message: 'Can this reference to "%s" be refactored?'
|
||||
link: https://docs.gitlab.com/ee/development/documentation/styleguide/index.html#gitlab-versions
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
# Checks for the lack of an Oxford comma. In some cases, will catch overly complex sentence structures with lots of commas.
|
||||
#
|
||||
# For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles
|
||||
# For a list of all options, see https://vale.sh/docs/topics/styles/
|
||||
extends: existence
|
||||
message: 'Use a comma before the last "and" or "or" in a list of four or more items.'
|
||||
link: https://docs.gitlab.com/ee/development/documentation/styleguide/index.html#punctuation
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
# The word GitLab should not be used in the possessive form.
|
||||
#
|
||||
# For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles
|
||||
# For a list of all options, see https://vale.sh/docs/topics/styles/
|
||||
extends: existence
|
||||
message: "Rewrite '%s' to not use 's."
|
||||
level: error
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
# Checks the Flesch-Kincaid reading level.
|
||||
#
|
||||
# https://docs.errata.ai/vale/styles#metric
|
||||
#
|
||||
# For a list of all options, see https://vale.sh/docs/topics/styles/
|
||||
extends: metric
|
||||
message: "The grade level - %s - refers to how hard the content is to understand. Aim for 8th grade or lower by using shorter sentences and words."
|
||||
link: https://docs.gitlab.com/ee/development/documentation/testing.html#vale-readability-score
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
# Checks for reference-style links that should be converted to inline links.
|
||||
#
|
||||
# For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles
|
||||
# For a list of all options, see https://vale.sh/docs/topics/styles/
|
||||
extends: existence
|
||||
message: 'Link "%s" must be inline.'
|
||||
link: https://docs.gitlab.com/ee/development/documentation/styleguide/index.html#basic-link-criteria
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
# Checks for the presence of absolute hyperlinks that should be relative.
|
||||
#
|
||||
# For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles
|
||||
# For a list of all options, see https://vale.sh/docs/topics/styles/
|
||||
extends: existence
|
||||
message: 'Link "%s" must be a relative link with a .md extension.'
|
||||
link: https://docs.gitlab.com/ee/development/documentation/styleguide/index.html#links-to-internal-documentation
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
# Checks for the presence of double slashes in relative URLs.
|
||||
#
|
||||
# For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles
|
||||
# For a list of all options, see https://vale.sh/docs/topics/styles/
|
||||
extends: existence
|
||||
message: 'Relative links must not include a double slash.'
|
||||
link: https://docs.gitlab.com/ee/development/documentation/styleguide/index.html#links-to-internal-documentation
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
# Checks for duplicate words, like `the the` or `and and`.
|
||||
#
|
||||
# For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles
|
||||
# For a list of all options, see https://vale.sh/docs/topics/styles/
|
||||
extends: repetition
|
||||
message: '"%s" is repeated.'
|
||||
level: error
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
# Counts words in a sentence and alerts if a sentence exceeds 25 words.
|
||||
#
|
||||
# For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles
|
||||
# For a list of all options, see https://vale.sh/docs/topics/styles/
|
||||
extends: occurrence
|
||||
message: 'Shorter sentences improve readability (max 25 words).'
|
||||
scope: sentence
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
# Checks for incorrect spacing (no spaces, or more than one space) around punctuation.
|
||||
#
|
||||
# For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles
|
||||
# For a list of all options, see https://vale.sh/docs/topics/styles/
|
||||
extends: existence
|
||||
message: '"%s" must contain one and only one space.'
|
||||
link: https://docs.gitlab.com/ee/development/documentation/styleguide/index.html#punctuation
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
# Checks for words implying ease of use, to avoid cognitive dissonance for frustrated users.
|
||||
#
|
||||
# For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles
|
||||
# For a list of all options, see https://vale.sh/docs/topics/styles/
|
||||
extends: existence
|
||||
message: 'Avoid words like "%s" that imply ease of use, because the user may find this action hard.'
|
||||
level: suggestion
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
# Commands, like `git clone` must use backticks, and must not be added to the
|
||||
# exceptions.
|
||||
#
|
||||
# For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles
|
||||
# For a list of all options, see https://vale.sh/docs/topics/styles/
|
||||
extends: spelling
|
||||
message: 'Spelling check: "%s"?'
|
||||
level: warning
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
# Suggests better options for frequently misused terms that are often - but not always - incorrect.
|
||||
# SubstitutionWarning.yml and Substitutions.yml also exist.
|
||||
#
|
||||
# For a list of all options, see https://errata-ai.github.io/vale/styles/
|
||||
# For a list of all options, see https://vale.sh/docs/topics/styles/
|
||||
extends: substitution
|
||||
message: 'Consider %s instead of "%s".'
|
||||
link: https://docs.gitlab.com/ee/development/documentation/styleguide/word_list.html
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
# Checks for misused terms or common shorthand that should never be used at GitLab, but can't be flagged as errors.
|
||||
# Substitutions.yml and SubstitionSuggestions.yml also exist.
|
||||
#
|
||||
# For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles
|
||||
# For a list of all options, see https://vale.sh/docs/topics/styles/
|
||||
extends: substitution
|
||||
message: 'If possible, use "%s" instead of "%s".'
|
||||
link: https://about.gitlab.com/handbook/communication/#top-misused-terms
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
# Checks for misused terms that should never be used at GitLab.
|
||||
# SubstitutionWarning.yml and SubstitionSuggestions.yml also exist.
|
||||
#
|
||||
# For a list of all options, see https://docs.errata.ai/vale/styles
|
||||
# For a list of all options, see https://vale.sh/docs/topics/styles/
|
||||
extends: substitution
|
||||
message: 'Use "%s" instead of "%s".'
|
||||
link: https://about.gitlab.com/handbook/communication/#top-misused-terms
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
# You should not use "To Do", unless it refers to the UI element.
|
||||
#
|
||||
# For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles
|
||||
# For a list of all options, see https://vale.sh/docs/topics/styles/
|
||||
extends: substitution
|
||||
message: 'Use "to-do item" in most cases, or "Add a to do" if referring to the UI button.'
|
||||
link: https://docs.gitlab.com/ee/development/documentation/styleguide/index.html#feature-names
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
# Checks for words that need a noun for clarity.
|
||||
#
|
||||
# For a list of all options, see https://docs.errata.ai/vale/styles
|
||||
# For a list of all options, see https://vale.sh/docs/topics/styles/
|
||||
extends: existence
|
||||
message: "'%s' is not precise. Try rewriting with a specific subject and verb."
|
||||
link: https://docs.gitlab.com/ee/development/documentation/styleguide/word_list.html#this-these-that-those
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
# Checks for use of all uppercase letters with unknown reason.
|
||||
#
|
||||
# For a list of all options, see https://docs.errata.ai/vale/styles.
|
||||
# For a list of all options, see https://vale.sh/docs/topics/styles/
|
||||
extends: conditional
|
||||
message: "'%s' is uppercase. Use lowercase or `backticks` if possible. Otherwise add this word to the rule's exception list."
|
||||
link: https://docs.gitlab.com/ee/development/documentation/testing.html#vale-uppercase-acronym-test
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
# - `> Introduced in GitLab 14.0.
|
||||
# - `> Removed in GitLab 15.0.
|
||||
#
|
||||
# For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles
|
||||
# For a list of all options, see https://vale.sh/docs/topics/styles/
|
||||
extends: existence
|
||||
message: 'This introduced-in section is not formatted correctly. Each entry must start with `> -` and long entries must be on one line.'
|
||||
link: https://docs.gitlab.com/ee/development/documentation/versions.html
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
# Verifies that single-item version notes don't have a hyphen.
|
||||
#
|
||||
# For a list of all options, see https://errata-ai.gitbook.io/vale/getting-started/styles
|
||||
# For a list of all options, see https://vale.sh/docs/topics/styles/
|
||||
extends: existence
|
||||
message: 'Version text with only a single item must not start with a hyphen.'
|
||||
link: https://docs.gitlab.com/ee/development/documentation/versions.html#add-a-version-history-item
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
# Suggests shorter versions of wordy phrases.
|
||||
#
|
||||
# For a list of all options, see https://docs.errata.ai/vale/styles
|
||||
# For a list of all options, see https://vale.sh/docs/topics/styles/
|
||||
extends: substitution
|
||||
message: '%s "%s".'
|
||||
link: https://docs.gitlab.com/ee/development/documentation/styleguide/word_list.html
|
||||
|
@ -11,7 +11,6 @@ level: suggestion
|
|||
ignorecase: true
|
||||
swap:
|
||||
in order to: "Be concise: use 'to' rather than"
|
||||
needs? to: "Rewrite the sentence, or use 'must', instead of"
|
||||
note that: "Be concise: rewrite the sentence to not use"
|
||||
please: "Remove this word from the sentence: "
|
||||
respectively: "Rewrite the sentence to be more precise, instead of using "
|
||||
|
|
|
@ -7,10 +7,8 @@ type: reference
|
|||
|
||||
# File hooks **(FREE SELF)**
|
||||
|
||||
> Renamed feature from Plugins to File hooks in GitLab 12.8.
|
||||
|
||||
With custom file hooks, GitLab administrators can introduce custom integrations
|
||||
without modifying the GitLab source code.
|
||||
Use custom file hooks (not to be confused with [server hooks](server_hooks.md) or [system hooks](system_hooks.md)),
|
||||
to introduce custom integrations without modifying the GitLab source code.
|
||||
|
||||
A file hook runs on each event. You can filter events or projects
|
||||
in a file hook's code, and create many file hooks as you need. Each file hook is
|
||||
|
|
|
@ -9,7 +9,8 @@ disqus_identifier: 'https://docs.gitlab.com/ee/administration/custom_hooks.html'
|
|||
|
||||
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/196051) in GitLab 12.8 replacing Custom Hooks.
|
||||
|
||||
Server hooks run custom logic on the GitLab server. Users can use them to run Git-related tasks such as:
|
||||
Server hooks (not to be confused with [system hooks](system_hooks.md) or [file hooks](file_hooks.md)) run custom logic
|
||||
on the GitLab server. You can use them to run Git-related tasks such as:
|
||||
|
||||
- Enforcing specific commit policies.
|
||||
- Performing tasks based on the state of the repository.
|
||||
|
|
|
@ -7,7 +7,8 @@ type: reference
|
|||
|
||||
# System hooks **(FREE SELF)**
|
||||
|
||||
Your GitLab instance can perform HTTP POST requests on the following events:
|
||||
System hooks (not to be confused with [server hooks](server_hooks.md) or [file hooks](file_hooks.md)) perform HTTP POST
|
||||
requests and are triggered on the following events:
|
||||
|
||||
- `group_create`
|
||||
- `group_destroy`
|
||||
|
@ -31,21 +32,18 @@ Your GitLab instance can perform HTTP POST requests on the following events:
|
|||
- `user_update_for_group`
|
||||
- `user_update_for_team`
|
||||
|
||||
The triggers for most of these are self-explanatory, but `project_update` and
|
||||
`project_rename` deserve some clarification: `project_update` is fired any time
|
||||
an attribute of a project is changed (including name, description, and tags)
|
||||
_unless_ the `path` attribute is also changed. In that case, a `project_rename`
|
||||
is triggered instead (so that, for instance, if all you care about is the
|
||||
repository URL, you can just listen for `project_rename`).
|
||||
The triggers for most of these are self-explanatory, but `project_update` and `project_rename` require clarification:
|
||||
|
||||
`user_failed_login` is sent whenever a _blocked_ user attempts to sign in and is
|
||||
denied access.
|
||||
- `project_update` triggers when an attribute of a project is changed (including name, description, and tags)
|
||||
**except** when the `path` attribute is also changed.
|
||||
- `project_rename` triggers when an attribute of a project (including `path`) is changed. If you only care about the
|
||||
repository URL, just listen for `project_rename`.
|
||||
|
||||
System hooks can be used, for example, for logging or changing information in an
|
||||
LDAP server.
|
||||
`user_failed_login` is sent whenever a **blocked** user attempts to sign in and is denied access.
|
||||
|
||||
In addition to these default events, you can enable triggers for other events,
|
||||
such as push events, and disable the `repository_update` event
|
||||
As an example, use system hooks for logging or changing information in an LDAP server.
|
||||
|
||||
You can also enable triggers for other events, such as push events, and disable the `repository_update` event
|
||||
when you create a system hook.
|
||||
|
||||
NOTE:
|
||||
|
|
|
@ -16297,6 +16297,7 @@ Represents vulnerability finding of a security report on the pipeline.
|
|||
| <a id="projectjiraimportstatus"></a>`jiraImportStatus` | [`String`](#string) | Status of Jira import background job of the project. |
|
||||
| <a id="projectjiraimports"></a>`jiraImports` | [`JiraImportConnection`](#jiraimportconnection) | Jira imports into the project. (see [Connections](#connections)) |
|
||||
| <a id="projectjobsenabled"></a>`jobsEnabled` | [`Boolean`](#boolean) | Indicates if CI/CD pipeline jobs are enabled for the current user. |
|
||||
| <a id="projectlanguages"></a>`languages` | [`[RepositoryLanguage!]`](#repositorylanguage) | Programming languages used in the project. |
|
||||
| <a id="projectlastactivityat"></a>`lastActivityAt` | [`Time`](#time) | Timestamp of the project last activity. |
|
||||
| <a id="projectlfsenabled"></a>`lfsEnabled` | [`Boolean`](#boolean) | Indicates if the project has Large File Storage (LFS) enabled. |
|
||||
| <a id="projectmergecommittemplate"></a>`mergeCommitTemplate` | [`String`](#string) | Template used to create merge commit message in merge requests. |
|
||||
|
@ -17968,6 +17969,16 @@ Returns [`Tree`](#tree).
|
|||
| <a id="repositoryblobstoredexternally"></a>`storedExternally` | [`Boolean`](#boolean) | Whether the blob's content is stored externally (for instance, in LFS). |
|
||||
| <a id="repositoryblobwebpath"></a>`webPath` | [`String`](#string) | Web path of the blob. |
|
||||
|
||||
### `RepositoryLanguage`
|
||||
|
||||
#### Fields
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| <a id="repositorylanguagecolor"></a>`color` | [`Color`](#color) | Color to visualize the repository language. |
|
||||
| <a id="repositorylanguagename"></a>`name` | [`String!`](#string) | Name of the repository language. |
|
||||
| <a id="repositorylanguageshare"></a>`share` | [`Float`](#float) | Percentage of the repository's languages. |
|
||||
|
||||
### `Requirement`
|
||||
|
||||
Represents a requirement.
|
||||
|
|
|
@ -0,0 +1,103 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module BulkImports
|
||||
module Projects
|
||||
module Pipelines
|
||||
class ReferencesPipeline
|
||||
include Pipeline
|
||||
|
||||
BATCH_SIZE = 100
|
||||
|
||||
def extract(_context)
|
||||
data = Enumerator.new do |enum|
|
||||
add_matching_objects(portable.issues, enum)
|
||||
add_matching_objects(portable.merge_requests, enum)
|
||||
end
|
||||
|
||||
BulkImports::Pipeline::ExtractedData.new(data: data)
|
||||
end
|
||||
|
||||
def transform(_context, object)
|
||||
body = object_body(object).dup
|
||||
|
||||
matching_urls(object).each do |old_url, new_url|
|
||||
body.gsub!(old_url, new_url)
|
||||
end
|
||||
|
||||
object.assign_attributes(body_field(object) => body)
|
||||
|
||||
object
|
||||
end
|
||||
|
||||
def load(_context, object)
|
||||
object.save! if object_body_changed?(object)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def add_matching_objects(collection, enum)
|
||||
collection.each_batch(of: BATCH_SIZE, column: :iid) do |batch|
|
||||
batch.each do |object|
|
||||
enum << object if object_has_reference?(object)
|
||||
|
||||
object.notes.each_batch(of: BATCH_SIZE) do |notes_batch|
|
||||
notes_batch.each do |note|
|
||||
enum << note if object_has_reference?(note)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def object_has_reference?(object)
|
||||
object_body(object).include?(source_full_path)
|
||||
end
|
||||
|
||||
def object_body(object)
|
||||
call_object_method(object)
|
||||
end
|
||||
|
||||
def object_body_changed?(object)
|
||||
call_object_method(object, suffix: '_changed?')
|
||||
end
|
||||
|
||||
def call_object_method(object, suffix: nil)
|
||||
method = body_field(object)
|
||||
method = "#{method}#{suffix}" if suffix.present?
|
||||
|
||||
object.public_send(method) # rubocop:disable GitlabSecurity/PublicSend
|
||||
end
|
||||
|
||||
def body_field(object)
|
||||
object.is_a?(Note) ? 'note' : 'description'
|
||||
end
|
||||
|
||||
def matching_urls(object)
|
||||
URI.extract(object_body(object), %w[http https]).each_with_object([]) do |url, array|
|
||||
parsed_url = URI.parse(url)
|
||||
|
||||
next unless source_host == parsed_url.host
|
||||
next unless parsed_url.path&.start_with?("/#{source_full_path}")
|
||||
|
||||
array << [url, new_url(parsed_url)]
|
||||
end
|
||||
end
|
||||
|
||||
def new_url(parsed_old_url)
|
||||
parsed_old_url.host = ::Gitlab.config.gitlab.host
|
||||
parsed_old_url.port = ::Gitlab.config.gitlab.port
|
||||
parsed_old_url.scheme = ::Gitlab.config.gitlab.https ? 'https' : 'http'
|
||||
parsed_old_url.to_s.gsub!(source_full_path, portable.full_path)
|
||||
end
|
||||
|
||||
def source_host
|
||||
@source_host ||= URI.parse(context.configuration.url).host
|
||||
end
|
||||
|
||||
def source_full_path
|
||||
context.entity.source_full_path
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -129,6 +129,10 @@ module BulkImports
|
|||
pipeline: BulkImports::Projects::Pipelines::PipelineSchedulesPipeline,
|
||||
stage: 5
|
||||
},
|
||||
references: {
|
||||
pipeline: BulkImports::Projects::Pipelines::ReferencesPipeline,
|
||||
stage: 5
|
||||
},
|
||||
finisher: {
|
||||
pipeline: BulkImports::Common::Pipelines::EntityFinisher,
|
||||
stage: 6
|
||||
|
|
|
@ -34,7 +34,7 @@ module Gitlab
|
|||
end
|
||||
|
||||
def version_info
|
||||
Gitlab::VersionInfo.parse(version)
|
||||
Gitlab::VersionInfo.parse(version, parse_suffix: true)
|
||||
end
|
||||
|
||||
# Return GitLab KAS external_url
|
||||
|
|
|
@ -188,3 +188,5 @@ module QA
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
QA::Page::Project::PipelineEditor::Show.prepend_mod_with('Page::Project::PipelineEditor::Show', namespace: QA)
|
||||
|
|
|
@ -43,3 +43,5 @@ module QA
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
QA::Page::Project::SubMenus::CiCd.prepend_mod_with('Page::Project::SubMenus::CiCd', namespace: QA)
|
||||
|
|
|
@ -170,37 +170,56 @@ RSpec.describe Projects::IssuesController do
|
|||
|
||||
context 'when work_items feature flag is enabled' do
|
||||
shared_examples 'redirects to show work item page' do
|
||||
it 'redirects to work item page' do
|
||||
expect(response).to redirect_to(project_work_items_path(project, task.id, query))
|
||||
context 'when use_iid_in_work_items_path feature flag is disabled' do
|
||||
before do
|
||||
stub_feature_flags(use_iid_in_work_items_path: false)
|
||||
end
|
||||
|
||||
it 'redirects to work item page' do
|
||||
make_request
|
||||
|
||||
expect(response).to redirect_to(project_work_items_path(project, task.id, query))
|
||||
end
|
||||
end
|
||||
|
||||
it 'redirects to work item page using iid' do
|
||||
make_request
|
||||
|
||||
expect(response).to redirect_to(project_work_items_path(project, task.iid, query.merge(iid_path: true)))
|
||||
end
|
||||
end
|
||||
|
||||
context 'show action' do
|
||||
let(:query) { { query: 'any' } }
|
||||
|
||||
before do
|
||||
get :show, params: { namespace_id: project.namespace, project_id: project, id: task.iid, **query }
|
||||
it_behaves_like 'redirects to show work item page' do
|
||||
subject(:make_request) do
|
||||
get :show, params: { namespace_id: project.namespace, project_id: project, id: task.iid, **query }
|
||||
end
|
||||
end
|
||||
|
||||
it_behaves_like 'redirects to show work item page'
|
||||
end
|
||||
|
||||
context 'edit action' do
|
||||
let(:query) { { query: 'any' } }
|
||||
|
||||
before do
|
||||
get :edit, params: { namespace_id: project.namespace, project_id: project, id: task.iid, **query }
|
||||
it_behaves_like 'redirects to show work item page' do
|
||||
subject(:make_request) do
|
||||
get :edit, params: { namespace_id: project.namespace, project_id: project, id: task.iid, **query }
|
||||
end
|
||||
end
|
||||
|
||||
it_behaves_like 'redirects to show work item page'
|
||||
end
|
||||
|
||||
context 'update action' do
|
||||
before do
|
||||
put :update, params: { namespace_id: project.namespace, project_id: project, id: task.iid, issue: { title: 'New title' } }
|
||||
it_behaves_like 'redirects to show work item page' do
|
||||
subject(:make_request) do
|
||||
put :update, params: {
|
||||
namespace_id: project.namespace,
|
||||
project_id: project,
|
||||
id: task.iid,
|
||||
issue: { title: 'New title' }
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
it_behaves_like 'redirects to show work item page'
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue