Add latest changes from gitlab-org/gitlab@master
This commit is contained in:
parent
f7f0c05027
commit
f14814c981
|
@ -875,7 +875,6 @@ Gitlab/NamespacedClass:
|
|||
- app/workers/repository_import_worker.rb
|
||||
- app/workers/repository_remove_remote_worker.rb
|
||||
- app/workers/repository_update_remote_mirror_worker.rb
|
||||
- app/workers/requests_profiles_worker.rb
|
||||
- app/workers/run_pipeline_schedule_worker.rb
|
||||
- app/workers/schedule_merge_request_cleanup_refs_worker.rb
|
||||
- app/workers/schedule_migrate_external_diffs_worker.rb
|
||||
|
|
|
@ -5862,7 +5862,6 @@ Layout/LineLength:
|
|||
- 'spec/requests/projects_controller_spec.rb'
|
||||
- 'spec/requests/rack_attack_global_spec.rb'
|
||||
- 'spec/requests/recursive_webhook_detection_spec.rb'
|
||||
- 'spec/requests/request_profiler_spec.rb'
|
||||
- 'spec/requests/users_controller_spec.rb'
|
||||
- 'spec/routing/admin_routing_spec.rb'
|
||||
- 'spec/routing/group_routing_spec.rb'
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#import "../fragments/http_integration_item.fragment.graphql"
|
||||
|
||||
mutation destroyHttpIntegration($id: ID!) {
|
||||
mutation destroyHttpIntegration($id: AlertManagementHttpIntegrationID!) {
|
||||
httpIntegrationDestroy(input: { id: $id }) {
|
||||
errors
|
||||
integration {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#import "../fragments/http_integration_item.fragment.graphql"
|
||||
|
||||
mutation resetHttpIntegrationToken($id: ID!) {
|
||||
mutation resetHttpIntegrationToken($id: AlertManagementHttpIntegrationID!) {
|
||||
httpIntegrationResetToken(input: { id: $id }) {
|
||||
errors
|
||||
integration {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#import "../fragments/integration_item.fragment.graphql"
|
||||
|
||||
mutation resetPrometheusIntegrationToken($id: ID!) {
|
||||
mutation resetPrometheusIntegrationToken($id: IntegrationsPrometheusID!) {
|
||||
prometheusIntegrationResetToken(input: { id: $id }) {
|
||||
errors
|
||||
integration {
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
#import "../fragments/http_integration_item.fragment.graphql"
|
||||
|
||||
mutation updateHttpIntegration($id: ID!, $name: String!, $active: Boolean!) {
|
||||
mutation updateHttpIntegration(
|
||||
$id: AlertManagementHttpIntegrationID!
|
||||
$name: String!
|
||||
$active: Boolean!
|
||||
) {
|
||||
httpIntegrationUpdate(input: { id: $id, name: $name, active: $active }) {
|
||||
errors
|
||||
integration {
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
#import "../fragments/integration_item.fragment.graphql"
|
||||
|
||||
mutation updatePrometheusIntegration($id: ID!, $apiUrl: String!, $active: Boolean!) {
|
||||
mutation updatePrometheusIntegration(
|
||||
$id: IntegrationsPrometheusID!
|
||||
$apiUrl: String!
|
||||
$active: Boolean!
|
||||
) {
|
||||
prometheusIntegrationUpdate(input: { id: $id, apiUrl: $apiUrl, active: $active }) {
|
||||
errors
|
||||
integration {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#import "ee_else_ce/alerts_settings/graphql/fragments/http_integration_payload_data.fragment.graphql"
|
||||
|
||||
query getHttpIntegration($projectPath: ID!, $id: ID) {
|
||||
query getHttpIntegration($projectPath: ID!, $id: AlertManagementHttpIntegrationID!) {
|
||||
project(fullPath: $projectPath) {
|
||||
id
|
||||
alertManagementHttpIntegrations(id: $id) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
mutation DestroyBoardList($listId: ID!) {
|
||||
mutation DestroyBoardList($listId: ListID!) {
|
||||
destroyBoardList(input: { listId: $listId }) {
|
||||
errors
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#import "./board_list.fragment.graphql"
|
||||
|
||||
mutation UpdateBoardList($listId: ID!, $position: Int, $collapsed: Boolean) {
|
||||
mutation UpdateBoardList($listId: ListID!, $position: Int, $collapsed: Boolean) {
|
||||
updateBoardList(input: { listId: $listId, position: $position, collapsed: $collapsed }) {
|
||||
list {
|
||||
...BoardListFragment
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
query BoardLists(
|
||||
$fullPath: ID!
|
||||
$boardId: ID!
|
||||
$boardId: BoardID!
|
||||
$filters: BoardIssueInput
|
||||
$isGroup: Boolean = false
|
||||
$isProject: Boolean = false
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
query BoardList($id: ID!, $filters: BoardIssueInput) {
|
||||
query BoardList($id: ListID!, $filters: BoardIssueInput) {
|
||||
boardList(id: $id, issueFilters: $filters) {
|
||||
id
|
||||
issuesCount
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#import "ee_else_ce/boards/graphql/board_scope.fragment.graphql"
|
||||
|
||||
query GroupBoard($fullPath: ID!, $boardId: ID!) {
|
||||
query GroupBoard($fullPath: ID!, $boardId: BoardID!) {
|
||||
workspace: group(fullPath: $fullPath) {
|
||||
id
|
||||
board(id: $boardId) {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
mutation issueMoveList(
|
||||
$projectPath: ID!
|
||||
$iid: String!
|
||||
$boardId: ID!
|
||||
$boardId: BoardID!
|
||||
$fromListId: ID
|
||||
$toListId: ID
|
||||
$moveBeforeId: ID
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
|
||||
query BoardListsEE(
|
||||
$fullPath: ID!
|
||||
$boardId: ID!
|
||||
$id: ID
|
||||
$boardId: BoardID!
|
||||
$id: ListID
|
||||
$filters: BoardIssueInput
|
||||
$isGroup: Boolean = false
|
||||
$isProject: Boolean = false
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#import "ee_else_ce/boards/graphql/board_scope.fragment.graphql"
|
||||
|
||||
query ProjectBoard($fullPath: ID!, $boardId: ID!) {
|
||||
query ProjectBoard($fullPath: ID!, $boardId: BoardID!) {
|
||||
workspace: project(fullPath: $fullPath) {
|
||||
id
|
||||
board(id: $boardId) {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#import "../fragments/discussion_resolved_status.fragment.graphql"
|
||||
#import "../fragments/design_todo_item.fragment.graphql"
|
||||
|
||||
mutation toggleResolveDiscussion($id: ID!, $resolve: Boolean!) {
|
||||
mutation toggleResolveDiscussion($id: DiscussionID!, $resolve: Boolean!) {
|
||||
discussionToggleResolve(input: { id: $id, resolve: $resolve }) {
|
||||
discussion {
|
||||
id
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
query errorDetails($fullPath: ID!, $errorId: ID!) {
|
||||
query errorDetails($fullPath: ID!, $errorId: GitlabErrorTrackingDetailedErrorID!) {
|
||||
project(fullPath: $fullPath) {
|
||||
id
|
||||
sentryErrors {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
mutation todoMarkDone($id: ID!) {
|
||||
mutation todoMarkDone($id: TodoID!) {
|
||||
todoMarkDone(input: { id: $id }) {
|
||||
errors
|
||||
todo {
|
||||
|
|
|
@ -98,13 +98,14 @@ export default {
|
|||
|
||||
<template>
|
||||
<div class="discussion-header note-wrapper">
|
||||
<div v-once class="timeline-icon align-self-start flex-shrink-0">
|
||||
<div v-once class="timeline-icon gl-align-self-start gl-flex-shrink-0 gl-flex-shrink gl-mr-4">
|
||||
<user-avatar-link
|
||||
v-if="author"
|
||||
:link-href="author.path"
|
||||
:img-src="author.avatar_url"
|
||||
:img-alt="author.name"
|
||||
:img-size="40"
|
||||
:img-size="32"
|
||||
:img-css-classes="'gl-mr-0!' /* NOTE: this is needed only while we migrate user-avatar-image to GlAvatar (https://gitlab.com/groups/gitlab-org/-/epics/7731) */"
|
||||
/>
|
||||
</div>
|
||||
<div class="timeline-content w-100">
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
query getContainerRepositoryDetails($id: ID!) {
|
||||
query getContainerRepositoryDetails($id: ContainerRepositoryID!) {
|
||||
containerRepository(id: $id) {
|
||||
id
|
||||
name
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
query getContainerRepositoryMetadata($id: ID!) {
|
||||
query getContainerRepositoryMetadata($id: ContainerRepositoryID!) {
|
||||
containerRepository(id: $id) {
|
||||
id
|
||||
tagsCount
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#import "~/graphql_shared/fragments/page_info.fragment.graphql"
|
||||
|
||||
query getContainerRepositoryTags(
|
||||
$id: ID!
|
||||
$id: ContainerRepositoryID!
|
||||
$first: Int
|
||||
$last: Int
|
||||
$after: String
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
query getPackageDetails($id: ID!) {
|
||||
query getPackageDetails($id: PackagesPackageID!) {
|
||||
package(id: $id) {
|
||||
id
|
||||
name
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
mutation mergeRequestRequestRereview($projectPath: ID!, $iid: String!, $userId: ID!) {
|
||||
mutation mergeRequestRequestRereview($projectPath: ID!, $iid: String!, $userId: UserID!) {
|
||||
mergeRequestReviewerRereview(input: { projectPath: $projectPath, iid: $iid, userId: $userId }) {
|
||||
errors
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
mutation mergeRequestToggleAttentionRequested($projectPath: ID!, $iid: String!, $userId: ID!) {
|
||||
mutation mergeRequestToggleAttentionRequested($projectPath: ID!, $iid: String!, $userId: UserID!) {
|
||||
mergeRequestToggleAttentionRequested(
|
||||
input: { projectPath: $projectPath, iid: $iid, userId: $userId }
|
||||
) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
mutation mergeRequestSetMilestone($fullPath: ID!, $iid: String!, $attributeId: ID) {
|
||||
mutation mergeRequestSetMilestone($fullPath: ID!, $iid: String!, $attributeId: MilestoneID) {
|
||||
issuableSetAttribute: mergeRequestSetMilestone(
|
||||
input: { projectPath: $fullPath, iid: $iid, milestoneId: $attributeId }
|
||||
) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
mutation DeleteSnippet($id: ID!) {
|
||||
mutation DeleteSnippet($id: SnippetID!) {
|
||||
destroySnippet(input: { id: $id }) {
|
||||
errors
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#import "./work_item.fragment.graphql"
|
||||
|
||||
query workItem($id: ID!) {
|
||||
query workItem($id: WorkItemID!) {
|
||||
workItem(id: $id) {
|
||||
...WorkItem
|
||||
}
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Admin::RequestsProfilesController < Admin::ApplicationController
|
||||
feature_category :not_owned # rubocop:todo Gitlab/AvoidFeatureCategoryNotOwned
|
||||
|
||||
def index
|
||||
@profile_token = Gitlab::RequestProfiler.profile_token
|
||||
@profiles = Gitlab::RequestProfiler.all.group_by(&:request_path)
|
||||
end
|
||||
|
||||
def show
|
||||
clean_name = Rack::Utils.clean_path_info(params[:name])
|
||||
profile = Gitlab::RequestProfiler.find(clean_name)
|
||||
|
||||
unless profile && profile.content_type
|
||||
return redirect_to admin_requests_profiles_path, alert: 'Profile not found'
|
||||
end
|
||||
|
||||
send_file profile.file_path, type: "#{profile.content_type}; charset=utf-8", disposition: 'inline'
|
||||
end
|
||||
end
|
|
@ -9,6 +9,10 @@ class Clusters::BaseController < ApplicationController
|
|||
helper_method :clusterable
|
||||
|
||||
feature_category :kubernetes_management
|
||||
urgency :low, [
|
||||
:index, :show, :environments, :cluster_status, :prometheus_proxy,
|
||||
:destroy, :new_cluster_docs, :connect, :new, :create_user
|
||||
]
|
||||
|
||||
private
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ module GoogleApi
|
|||
before_action :validate_session_key!
|
||||
|
||||
feature_category :kubernetes_management
|
||||
urgency :low
|
||||
|
||||
##
|
||||
# handle the response from google after the user
|
||||
|
|
|
@ -4,6 +4,7 @@ class Projects::ClusterAgentsController < Projects::ApplicationController
|
|||
before_action :authorize_can_read_cluster_agent!
|
||||
|
||||
feature_category :kubernetes_management
|
||||
urgency :low
|
||||
|
||||
def show
|
||||
@agent_name = params[:name]
|
||||
|
|
|
@ -82,11 +82,10 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
|
|||
:rebase,
|
||||
:discussions,
|
||||
:pipelines,
|
||||
:test_reports
|
||||
]
|
||||
urgency :low, [
|
||||
:test_reports,
|
||||
:codequality_mr_diff_reports,
|
||||
:codequality_reports
|
||||
:codequality_reports,
|
||||
:terraform_reports
|
||||
]
|
||||
urgency :low, [:pipeline_status, :pipelines, :exposed_artifacts]
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ module Projects
|
|||
include PackagesAccess
|
||||
|
||||
feature_category :infrastructure_as_code
|
||||
urgency :low
|
||||
|
||||
def show
|
||||
@package = project.packages.find(params[:id])
|
||||
|
|
|
@ -7,6 +7,7 @@ module Projects
|
|||
before_action :authorize_read_cluster!
|
||||
|
||||
feature_category :not_owned # rubocop:todo Gitlab/AvoidFeatureCategoryNotOwned
|
||||
urgency :low
|
||||
|
||||
def index
|
||||
respond_to do |format|
|
||||
|
|
|
@ -4,6 +4,7 @@ class Projects::TerraformController < Projects::ApplicationController
|
|||
before_action :authorize_can_read_terraform_state!
|
||||
|
||||
feature_category :infrastructure_as_code
|
||||
urgency :low
|
||||
|
||||
def index
|
||||
end
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
query getDesignList($fullPath: ID!, $iid: String!, $atVersion: ID) {
|
||||
query getDesignList($fullPath: ID!, $iid: String!, $atVersion: DesignManagementVersionID) {
|
||||
project(fullPath: $fullPath) {
|
||||
__typename
|
||||
id
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
query SnippetBlobContent($ids: [ID!], $rich: Boolean!, $paths: [String!]) {
|
||||
query SnippetBlobContent($ids: [SnippetID!], $rich: Boolean!, $paths: [String!]) {
|
||||
snippets(ids: $ids) {
|
||||
__typename
|
||||
nodes {
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
module Resolvers
|
||||
module Ci
|
||||
# NOTE: This class was introduced to allow modifying the meaning of certain values in RunnerStatusEnum
|
||||
# while preserving backward compatibility. It can be removed in 15.0 once the API has stabilized.
|
||||
# while preserving backward compatibility. It can be removed in 17.0 after being deprecated
|
||||
# and made a no-op in %16.0 (legacy_mode will be hard-coded to nil).
|
||||
class RunnerStatusResolver < BaseResolver
|
||||
type Types::Ci::RunnerStatusEnum, null: false
|
||||
|
||||
|
@ -14,7 +15,11 @@ module Resolvers
|
|||
default_value: '14.5',
|
||||
required: false,
|
||||
description: 'Compatibility mode. A null value turns off compatibility mode.',
|
||||
deprecated: { reason: 'Will be removed in 15.0. From that release onward, the field will behave as if legacyMode is null', milestone: '14.6' }
|
||||
deprecated: {
|
||||
reason: 'Will be removed in 17.0. In GitLab 16.0 and later, ' \
|
||||
'the field will act as if `legacyMode` is null',
|
||||
milestone: '15.0'
|
||||
}
|
||||
|
||||
def resolve(legacy_mode:, **args)
|
||||
runner.status(legacy_mode)
|
||||
|
|
|
@ -69,7 +69,7 @@ module Types
|
|||
Types::Ci::RunnerStatusEnum,
|
||||
null: false,
|
||||
description: 'Status of the runner.',
|
||||
resolver: ::Resolvers::Ci::RunnerStatusResolver
|
||||
resolver: ::Resolvers::Ci::RunnerStatusResolver # TODO: Remove :resolver in %17.0
|
||||
field :tag_list, [GraphQL::Types::String], null: true,
|
||||
description: 'Tags associated with the runner.'
|
||||
field :token_expires_at, Types::TimeType, null: true,
|
||||
|
|
|
@ -56,7 +56,7 @@ module NavHelper
|
|||
end
|
||||
|
||||
def admin_monitoring_nav_links
|
||||
%w(system_info background_migrations background_jobs health_check requests_profiles)
|
||||
%w(system_info background_migrations background_jobs health_check)
|
||||
end
|
||||
|
||||
def admin_analytics_nav_links
|
||||
|
|
|
@ -322,6 +322,9 @@ module Ci
|
|||
end
|
||||
|
||||
def status(legacy_mode = nil)
|
||||
# TODO Deprecate legacy_mode in %16.0 and make it a no-op
|
||||
# (see https://gitlab.com/gitlab-org/gitlab/-/issues/360545)
|
||||
# TODO Remove legacy_mode in %17.0
|
||||
return deprecated_rest_status if legacy_mode == '14.5'
|
||||
|
||||
return :stale if stale?
|
||||
|
@ -331,9 +334,9 @@ module Ci
|
|||
end
|
||||
|
||||
# DEPRECATED
|
||||
# TODO Remove in %16.0 in favor of `status` for REST calls
|
||||
# TODO Remove in %16.0 in favor of `status` for REST calls, see https://gitlab.com/gitlab-org/gitlab/-/issues/344648
|
||||
def deprecated_rest_status
|
||||
if contacted_at.nil? # TODO Remove in %15.0, see https://gitlab.com/gitlab-org/gitlab/-/issues/344648
|
||||
if contacted_at.nil?
|
||||
:not_connected
|
||||
elsif active?
|
||||
online? ? :online : :offline
|
||||
|
|
|
@ -326,17 +326,13 @@ class ContainerRepository < ApplicationRecord
|
|||
return if importing?
|
||||
|
||||
start_import(forced: true)
|
||||
when 'import_canceled', 'pre_import_canceled'
|
||||
return if import_skipped?
|
||||
|
||||
skip_import(reason: :migration_canceled_by_registry)
|
||||
when 'import_complete'
|
||||
finish_import
|
||||
when 'import_failed'
|
||||
when 'import_failed', 'import_canceled'
|
||||
retry_import
|
||||
when 'pre_import_complete'
|
||||
finish_pre_import_and_start_import
|
||||
when 'pre_import_failed'
|
||||
when 'pre_import_failed', 'pre_import_canceled'
|
||||
retry_pre_import
|
||||
else
|
||||
yield
|
||||
|
|
|
@ -29,3 +29,5 @@ module Ci
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
Ci::Runners::ResetRegistrationTokenService.prepend_mod
|
||||
|
|
|
@ -54,8 +54,6 @@ module LooseForeignKeys
|
|||
attr_reader :parent_table, :loose_foreign_key_definitions, :deleted_parent_records, :modification_tracker, :deleted_records_counter, :deleted_records_rescheduled_count, :deleted_records_incremented_count
|
||||
|
||||
def handle_over_limit
|
||||
return if Feature.disabled?(:lfk_fair_queueing, default_enabled: :yaml)
|
||||
|
||||
records_to_reschedule = []
|
||||
records_to_increment = []
|
||||
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
- page_title _('Requests Profiles')
|
||||
|
||||
%h3.page-title
|
||||
= page_title
|
||||
|
||||
.bs-callout.clearfix
|
||||
= html_escape(_('Pass the header %{codeOpen} X-Profile-Token: %{profile_token} %{codeClose} to profile the request')) % { profile_token: @profile_token, codeOpen: '<code>'.html_safe, codeClose: '</code>'.html_safe }
|
||||
|
||||
- if @profiles.present?
|
||||
.gl-mt-3
|
||||
- @profiles.each do |path, profiles|
|
||||
.card
|
||||
.card-header
|
||||
%code= path
|
||||
%ul.content-list
|
||||
- profiles.each do |profile|
|
||||
%li
|
||||
= link_to profile.time.to_s(:long) + ' ' + profile.profile_mode.capitalize,
|
||||
admin_requests_profile_path(profile)
|
||||
- else
|
||||
%p
|
||||
= _('No profiles found')
|
|
@ -103,10 +103,6 @@
|
|||
= link_to admin_health_check_path, title: _('Health Check') do
|
||||
%span
|
||||
= _('Health Check')
|
||||
= nav_link(controller: :requests_profiles) do
|
||||
= link_to admin_requests_profiles_path, title: _('Requests Profiles') do
|
||||
%span
|
||||
= _('Requests Profiles')
|
||||
- if Gitlab::CurrentSettings.current_application_settings.grafana_enabled?
|
||||
= nav_link do
|
||||
= link_to Gitlab::CurrentSettings.current_application_settings.grafana_url, target: '_blank', title: _('Metrics Dashboard'), rel: 'noopener noreferrer' do
|
||||
|
|
|
@ -660,15 +660,6 @@
|
|||
:weight: 1
|
||||
:idempotent:
|
||||
:tags: []
|
||||
- :name: cronjob:requests_profiles
|
||||
:worker_name: RequestsProfilesWorker
|
||||
:feature_category: :source_code_management
|
||||
:has_external_dependencies:
|
||||
:urgency: :low
|
||||
:resource_boundary: :unknown
|
||||
:weight: 1
|
||||
:idempotent:
|
||||
:tags: []
|
||||
- :name: cronjob:schedule_merge_request_cleanup_refs
|
||||
:worker_name: ScheduleMergeRequestCleanupRefsWorker
|
||||
:feature_category: :code_review
|
||||
|
|
|
@ -13,7 +13,7 @@ module ContainerRegistry
|
|||
data_consistency :always
|
||||
feature_category :container_registry
|
||||
urgency :low
|
||||
deduplicate :until_executing, including_scheduled: true
|
||||
deduplicate :until_executing, ttl: DEFAULT_LEASE_TIMEOUT
|
||||
idempotent!
|
||||
|
||||
def perform
|
||||
|
@ -66,6 +66,7 @@ module ContainerRegistry
|
|||
end
|
||||
|
||||
def tag_count_too_high?
|
||||
return false if migration.max_tags_count == 0
|
||||
return false unless next_repository.tags_count > migration.max_tags_count
|
||||
|
||||
next_repository.skip_import(reason: :too_many_tags)
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class RequestsProfilesWorker # rubocop:disable Scalability/IdempotentWorker
|
||||
include ApplicationWorker
|
||||
|
||||
data_consistency :always
|
||||
|
||||
# rubocop:disable Scalability/CronWorkerContext
|
||||
# This worker does not perform work scoped to a context
|
||||
include CronjobQueue
|
||||
# rubocop:enable Scalability/CronWorkerContext
|
||||
|
||||
feature_category :source_code_management
|
||||
|
||||
def perform
|
||||
Gitlab::RequestProfiler.remove_all_profiles
|
||||
end
|
||||
end
|
|
@ -1,8 +0,0 @@
|
|||
---
|
||||
name: lfk_fair_queueing
|
||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/79116
|
||||
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/351082
|
||||
milestone: '14.8'
|
||||
type: development
|
||||
group: group::sharding
|
||||
default_enabled: true
|
|
@ -5,4 +5,4 @@ rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/357647
|
|||
milestone: '14.10'
|
||||
type: development
|
||||
group: group::optimize
|
||||
default_enabled: false
|
||||
default_enabled: true
|
||||
|
|
|
@ -482,9 +482,6 @@ Settings.cron_jobs['import_export_project_cleanup_worker']['job_class'] = 'Impor
|
|||
Settings.cron_jobs['ci_archive_traces_cron_worker'] ||= Settingslogic.new({})
|
||||
Settings.cron_jobs['ci_archive_traces_cron_worker']['cron'] ||= '17 * * * *'
|
||||
Settings.cron_jobs['ci_archive_traces_cron_worker']['job_class'] = 'Ci::ArchiveTracesCronWorker'
|
||||
Settings.cron_jobs['requests_profiles_worker'] ||= Settingslogic.new({})
|
||||
Settings.cron_jobs['requests_profiles_worker']['cron'] ||= '0 0 * * *'
|
||||
Settings.cron_jobs['requests_profiles_worker']['job_class'] = 'RequestsProfilesWorker'
|
||||
Settings.cron_jobs['remove_expired_members_worker'] ||= Settingslogic.new({})
|
||||
Settings.cron_jobs['remove_expired_members_worker']['cron'] ||= '10 0 * * *'
|
||||
Settings.cron_jobs['remove_expired_members_worker']['job_class'] = 'RemoveExpiredMembersWorker'
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
Rails.application.configure do |config|
|
||||
config.middleware.use(Gitlab::RequestProfiler::Middleware)
|
||||
config.middleware.use(Gitlab::Middleware::Speedscope)
|
||||
config.middleware.use(Gitlab::Middleware::MemoryReport)
|
||||
end
|
||||
|
|
|
@ -100,7 +100,6 @@ namespace :admin do
|
|||
resource :background_jobs, controller: 'background_jobs', only: [:show]
|
||||
|
||||
resource :system_info, controller: 'system_info', only: [:show]
|
||||
resources :requests_profiles, only: [:index, :show], param: :name, constraints: { name: /.+\.(html|txt)/ }
|
||||
|
||||
resources :projects, only: [:index]
|
||||
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
- name: "Runner status `not_connected` API value"
|
||||
announcement_milestone: "14.6" # The milestone when this feature was first announced as deprecated.
|
||||
removal_milestone: "15.0" # the milestone when this feature is planned to be removed
|
||||
removal_date: "2022-05-22"
|
||||
breaking_change: true
|
||||
body: | # Do not modify this line, instead modify the lines below.
|
||||
The GitLab Runner REST and GraphQL [API](https://docs.gitlab.com/ee/api/runners.html#runners-api) endpoints
|
||||
will return `never_contacted` instead of `not_connected` as the status values in 15.0.
|
||||
|
||||
Runners that have never contacted the GitLab instance will also return `stale` if created more than 3 months ago.
|
||||
stage: Verify
|
||||
tiers: [Core, Premium, Ultimate]
|
||||
issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/347305
|
||||
documentation_url: https://docs.gitlab.com/ee/api/runners.html
|
||||
announcement_date: "2021-12-22"
|
|
@ -27,7 +27,7 @@
|
|||
existing runners.
|
||||
stage: Verify
|
||||
tiers: [Core, Premium, Ultimate]
|
||||
issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/347211
|
||||
documentation_url: https://docs.gitlab.com/ee/api/runners.html
|
||||
issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/351109
|
||||
documentation_url: https://docs.gitlab.com/ee/api/graphql/reference/#cirunner
|
||||
image_url: # (optional) This is a link to a thumbnail image depicting the feature
|
||||
video_url: # (optional) Use the youtube thumbnail URL with the structure of https://img.youtube.com/vi/UNIQUEID/hqdefault.jpg
|
||||
|
|
|
@ -15,4 +15,4 @@
|
|||
stage: Verify
|
||||
tiers: [Core, Premium, Ultimate]
|
||||
issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/351109
|
||||
documentation_url: https://docs.gitlab.com/ee/api/runners.html
|
||||
documentation_url: https://docs.gitlab.com/ee/api/graphql/reference/#queryrunners
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
- name: "GraphQL API legacyMode argument for Runner status" # The name of the feature to be deprecated
|
||||
announcement_milestone: "15.0" # The milestone when this feature was first announced as deprecated.
|
||||
announcement_date: "2022-05-22" # The date of the milestone release when this feature was first announced as deprecated. This should almost always be the 22nd of a month (YYYY-MM-22), unless you did an out of band blog post.
|
||||
removal_milestone: "16.0" # The milestone when this feature is planned to be removed
|
||||
removal_date: "2023-05-22" # The date of the milestone release when this feature is planned to be removed. This should almost always be the 22nd of a month (YYYY-MM-22), unless you did an out of band blog post.
|
||||
breaking_change: true # If this deprecation is a breaking change, set this value to true
|
||||
reporter: pedropombeiro # GitLab username of the person reporting the deprecation
|
||||
body: | # Do not modify this line, instead modify the lines below.
|
||||
The `legacyMode` argument to the `status` field in `RunnerType` will be rendered non-functional in the 16.0 release
|
||||
as part of the deprecations details in the [issue](https://gitlab.com/gitlab-org/gitlab/-/issues/351109).
|
||||
|
||||
In GitLab 16.0 and later, the `status` field will act as if `legacyMode` is null. The `legacyMode` argument will
|
||||
be present during the 16.x cycle to avoid breaking the API signature, and will be removed altogether in the
|
||||
17.0 release.
|
||||
stage: Verify
|
||||
tiers: [Core, Premium, Ultimate]
|
||||
issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/360545
|
||||
documentation_url: https://docs.gitlab.com/ee/api/graphql/reference/#cirunnerstatus
|
|
@ -0,0 +1,13 @@
|
|||
- name: "Remove dependency_proxy_for_private_groups feature flag" # The name of the feature to be deprecated
|
||||
announcement_milestone: "14.5" # The milestone when this feature was first announced as deprecated.
|
||||
announcement_date: "2021-11-22" # The date of the milestone release when this feature was first announced as deprecated. This should almost always be the 22nd of a month (YYYY-MM-22), unless you did an out of band blog post.
|
||||
removal_milestone: "15.0" # The milestone when this feature is planned to be removed
|
||||
removal_date: "2022-05-22" # the date of the milestone release when this feature is planned to be removed
|
||||
breaking_change: true
|
||||
body: | # Do not modify this line, instead modify the lines below.
|
||||
A feature flag was [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/11582) in GitLab 13.7 as part of the change to require authentication to use the Dependency Proxy. Before GitLab 13.7, you could use the Dependency Proxy without authentication.
|
||||
|
||||
In GitLab 15.0, we will remove the feature flag, and you must always authenticate when you use the Dependency Proxy.
|
||||
stage: package
|
||||
tiers: Free
|
||||
issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/276777
|
|
@ -0,0 +1,13 @@
|
|||
- name: "Remove Versions from PackageType"
|
||||
announcement_milestone: "14.5" # The milestone when this feature was first announced as deprecated.
|
||||
announcement_date: "2021-11-22" # The date of the milestone release when this feature was first announced as deprecated. This should almost always be the 22nd of a month (YYYY-MM-22), unless you did an out of band blog post.
|
||||
removal_milestone: "15.0" # The milestone when this feature is planned to be removed
|
||||
removal_date: "2022-05-22" # the date of the milestone release when this feature is planned to be removed
|
||||
breaking_change: true
|
||||
body: | # Do not modify this line, instead modify the lines below.
|
||||
As part of the work to create a [Package Registry GraphQL API](https://gitlab.com/groups/gitlab-org/-/epics/6318), the Package group deprecated the `Version` type for the basic `PackageType` type and moved it to [`PackageDetailsType`](https://docs.gitlab.com/ee/api/graphql/reference/index.html#packagedetailstype).
|
||||
|
||||
In GitLab 15.0, we will completely remove `Version` from `PackageType`.
|
||||
stage: package
|
||||
tiers: Free
|
||||
issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/327453
|
|
@ -192,7 +192,7 @@ successfully, you must replicate their data using some other means.
|
|||
|[LFS objects](../../lfs/index.md) | **Yes** (10.2) | **Yes** (14.6) | Via Object Storage provider if supported. Native Geo support (Beta). | GitLab versions 11.11.x and 12.0.x are affected by [a bug that prevents any new LFS objects from replicating](https://gitlab.com/gitlab-org/gitlab/-/issues/32696).<br /><br />Replication is behind the feature flag `geo_lfs_object_replication`, enabled by default. Verification was behind the feature flag `geo_lfs_object_verification`, removed in 14.7. |
|
||||
|[Personal snippets](../../../user/snippets.md) | **Yes** (10.2) | **Yes** (10.2) | No | |
|
||||
|[Project snippets](../../../user/snippets.md) | **Yes** (10.2) | **Yes** (10.2) | No | |
|
||||
|[CI job artifacts](../../../ci/pipelines/job_artifacts.md) | **Yes** (10.4) | [No](https://gitlab.com/gitlab-org/gitlab/-/issues/8923) | Via Object Storage provider if supported. Native Geo support (Beta). | Verified only manually using [Integrity Check Rake Task](../../raketasks/check.md) on both sites and comparing the output between them. Job logs also verified on transfer. |
|
||||
|[CI job artifacts](../../../ci/pipelines/job_artifacts.md) | **Yes** (10.4) | **Yes** (14.10) | Via Object Storage provider if supported. Native Geo support (Beta). | Verification is behind the feature flag `geo_job_artifact_replication`, enabled by default in 14.10. |
|
||||
|[CI Pipeline Artifacts](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/models/ci/pipeline_artifact.rb) | [**Yes** (13.11)](https://gitlab.com/gitlab-org/gitlab/-/issues/238464) | [**Yes** (13.11)](https://gitlab.com/gitlab-org/gitlab/-/issues/238464) | Via Object Storage provider if supported. Native Geo support (Beta). | Persists additional artifacts after a pipeline completes. |
|
||||
|[Container Registry](../../packages/container_registry.md) | **Yes** (12.3) | No | No | Disabled by default. See [instructions](docker_registry.md) to enable. |
|
||||
|[Content in object storage (beta)](object_storage.md) | **Yes** (12.4) | [No](https://gitlab.com/gitlab-org/gitlab/-/issues/13845) | No | |
|
||||
|
|
|
@ -9525,7 +9525,7 @@ Returns [`CiRunnerStatus!`](#cirunnerstatus).
|
|||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| <a id="cirunnerstatuslegacymode"></a>`legacyMode` **{warning-solid}** | [`String`](#string) | **Deprecated** in 14.6. Will be removed in 15.0. From that release onward, the field will behave as if legacyMode is null. |
|
||||
| <a id="cirunnerstatuslegacymode"></a>`legacyMode` **{warning-solid}** | [`String`](#string) | **Deprecated** in 15.0. Will be removed in 17.0. In GitLab 16.0 and later, the field will act as if `legacyMode` is null. |
|
||||
|
||||
### `CiStage`
|
||||
|
||||
|
|
|
@ -100,11 +100,14 @@ Allows you to receive blame information. Each blame range contains lines and cor
|
|||
GET /projects/:id/repository/files/:file_path/blame
|
||||
```
|
||||
|
||||
| Attribute | Type | Required | Description |
|
||||
|-------------|----------------|----------|-----------------------------------------------------------------------------------------------------------------|
|
||||
| `id` | integer or string | yes | The ID or [URL-encoded path of the project](index.md#namespaced-path-encoding) owned by the authenticated user |
|
||||
| `file_path` | string | yes | URL encoded full path to new file. Ex. `lib%2Fclass%2Erb`. |
|
||||
| `ref` | string | yes | The name of branch, tag or commit |
|
||||
| Attribute | Type | Required | Description |
|
||||
|-----------------|-------------------|----------|--------------------------------------------------------------------------------------------------------------|
|
||||
| `id` | integer or string | yes | The ID or [URL-encoded path of the project](index.md#namespaced-path-encoding) owned by the authenticated user |
|
||||
| `file_path` | string | yes | URL encoded full path to new file. Ex. `lib%2Fclass%2Erb`. |
|
||||
| `ref` | string | yes | The name of branch, tag or commit |
|
||||
| `range` | hash | no | Blame range |
|
||||
| `range[start]` | integer | yes | The first line of the range to blame |
|
||||
| `range[end]` | integer | yes | The last line of the range to blame |
|
||||
|
||||
```shell
|
||||
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/13083/repository/files/path%2Fto%2Ffile.rb/blame?ref=master"
|
||||
|
@ -163,6 +166,41 @@ X-Gitlab-Execute-Filemode: false
|
|||
...
|
||||
```
|
||||
|
||||
### Examples
|
||||
|
||||
To request a blame range, specify `range[start]` and `range[end]` parameters with the start and end line numbers of the file.
|
||||
|
||||
```shell
|
||||
curl --head --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/13083/repository/files/path%2Fto%2Ffile.rb/blame?ref=master&range[start]=1&range[end]=2"
|
||||
```
|
||||
|
||||
Example response:
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"commit": {
|
||||
"id": "d42409d56517157c48bf3bd97d3f75974dde19fb",
|
||||
"message": "Add feature\n\nalso fix bug\n",
|
||||
"parent_ids": [
|
||||
"cc6e14f9328fa6d7b5a0d3c30dc2002a3f2a3822"
|
||||
],
|
||||
"authored_date": "2015-12-18T08:12:22.000Z",
|
||||
"author_name": "John Doe",
|
||||
"author_email": "john.doe@example.com",
|
||||
"committed_date": "2015-12-18T08:12:22.000Z",
|
||||
"committer_name": "John Doe",
|
||||
"committer_email": "john.doe@example.com"
|
||||
},
|
||||
"lines": [
|
||||
"require 'fileutils'",
|
||||
"require 'open3'"
|
||||
]
|
||||
},
|
||||
...
|
||||
]
|
||||
```
|
||||
|
||||
## Get raw file from repository
|
||||
|
||||
```plaintext
|
||||
|
|
|
@ -160,7 +160,7 @@ Our current RSpec tests parallelization setup is as follows:
|
|||
`knapsack/report-master.json` file:
|
||||
- The `knapsack/report-master.json` file is fetched from the latest `main` pipeline which runs `update-tests-metadata`
|
||||
(for now it's the 2-hourly scheduled master pipeline), if it's not here we initialize the file with `{}`.
|
||||
1. Each `[rspec|rspec-ee] [unit|integration|system|geo] n m` job are run with
|
||||
1. Each `[rspec|rspec-ee] [migration|unit|integration|system|geo] n m` job are run with
|
||||
`knapsack rspec` and should have an evenly distributed share of tests:
|
||||
- It works because the jobs have access to the `knapsack/report-master.json`
|
||||
since the "artifacts from all previous stages are passed by default".
|
||||
|
@ -170,7 +170,7 @@ Our current RSpec tests parallelization setup is as follows:
|
|||
`Report specs`, not under `Leftover specs`.
|
||||
1. The `update-tests-metadata` job (which only runs on scheduled pipelines for
|
||||
[the canonical project](https://gitlab.com/gitlab-org/gitlab) takes all the
|
||||
`knapsack/rspec*_pg_*.json` files and merge them all together into a single
|
||||
`knapsack/rspec*.json` files and merge them all together into a single
|
||||
`knapsack/report-master.json` file that is saved as artifact.
|
||||
|
||||
After that, the next pipeline uses the up-to-date `knapsack/report-master.json` file.
|
||||
|
@ -508,12 +508,9 @@ The current stages are:
|
|||
- `test`: This stage includes most of the tests, and DB/migration jobs.
|
||||
- `post-test`: This stage includes jobs that build reports or gather data from
|
||||
the `test` stage's jobs (for example, coverage, Knapsack metadata, and so on).
|
||||
- `review-prepare`: This stage includes a job that build the CNG images that are
|
||||
later used by the (Helm) Review App deployment (see
|
||||
[Review Apps](testing_guide/review_apps.md) for details).
|
||||
- `review`: This stage includes jobs that deploy the GitLab and Docs Review Apps.
|
||||
- `dast`: This stage includes jobs that run a DAST full scan against the Review App
|
||||
that is deployed in stage `review`.
|
||||
- `review`: This stage includes jobs that build the CNG images, deploy them, and
|
||||
run end-to-end tests against Review Apps (see [Review Apps](testing_guide/review_apps.md) for details).
|
||||
It also includes Docs Review App jobs.
|
||||
- `qa`: This stage includes jobs that perform QA tasks against the Review App
|
||||
that is deployed in stage `review`.
|
||||
- `post-qa`: This stage includes jobs that build reports or gather data from
|
||||
|
|
|
@ -0,0 +1,74 @@
|
|||
---
|
||||
stage: Enablement
|
||||
group: Distribution
|
||||
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
|
||||
---
|
||||
|
||||
# GitLab Dedicated
|
||||
|
||||
NOTE:
|
||||
GitLab Dedicated is currently in limited availability. Please [contact us](#contact-us) if you are interested.
|
||||
|
||||
GitLab Dedicated is a fully isolated, single-tenant GitLab instance that is:
|
||||
|
||||
- Hosted and managed by GitLab, Inc.
|
||||
- Deployed in a region of choice in AWS.
|
||||
|
||||
GitLab Dedicated enables you to offload the operational overhead of managing the DevOps Platform. It offers a high level of tenant isolation and deployment customization, ideal for enterprises in highly-regulated industries. By deploying your GitLab instance onto a separate Cloud Infrastructure from other tenants, GitLab Dedicated helps you better meet your security and compliance requirements.
|
||||
|
||||
## Available features
|
||||
|
||||
- Authentication: Support for instance-level [SAML OmniAuth](../../integration/saml.md) functionality. GitLab Dedicated acts as the service provider, and you will need to provide the necessary [configuration](../../integration/saml.md#general-setup) in order for GitLab to communicate with your IdP. This will be provided during onboarding. SAML [request signing](../../integration/saml.md#request-signing-optional) is supported.
|
||||
- Networking:
|
||||
- Public connectivity
|
||||
- Optional. Private connectivity via [AWS PrivateLink](https://aws.amazon.com/privatelink/).
|
||||
You can specify an AWS IAM Principal and preferred Availability Zones during onboarding to enable this functionality.
|
||||
- Upgrade strategy:
|
||||
- Monthly upgrades tracking one release behind the latest (n-1), with the latest security release.
|
||||
- Out of band security patches provided for high severity items.
|
||||
- Backup strategy: regular backups taken and tested.
|
||||
- Choice of Cloud Region: upon onboarding, choose the cloud region where you want to deploy your instance. Some AWS regions have limited features and as a result, we are not able to deploy production instances to those regions. See below for the [full list of regions](#aws-regions-not-supported) not currently supported.
|
||||
- Security: Data encrypted at rest and in transit using latest encryption standards.
|
||||
- Application: Self-managed [Ultimate feature set](https://about.gitlab.com/pricing/self-managed/feature-comparison/) with the exception of the unsupported features [listed below](#features-not-available-at-launch).
|
||||
|
||||
## Features not available at launch
|
||||
|
||||
Features that are not available but we plan to support in the future:
|
||||
|
||||
- LDAP, Smartcard, Kerberos authentication
|
||||
- Custom domain
|
||||
- Advanced Search
|
||||
- Pages
|
||||
- GitLab-managed runners
|
||||
- FortiAuthenticator/FortiToken 2FA
|
||||
- Reply-by email
|
||||
- Service desk
|
||||
|
||||
Features that we do not plan to offer at all:
|
||||
|
||||
- Mattermost
|
||||
- Server-side Git Hooks
|
||||
|
||||
### AWS regions not supported
|
||||
|
||||
The following AWS regions are not available at launch:
|
||||
|
||||
- Jakarta (ap-southeast-3)
|
||||
- Bahrain (me-south-1)
|
||||
- Hong Kong (ap-east-1)
|
||||
- Cape Town (af-south-1)
|
||||
- Milan (eu-south-1)
|
||||
- Paris (eu-west-3)
|
||||
- GovCloud
|
||||
|
||||
## Contact us
|
||||
|
||||
Fill in the following form to contact us and learn more about this offering.
|
||||
|
||||
<!-- markdownlint-disable -->
|
||||
|
||||
<script src="//page.gitlab.com/js/forms2/js/forms2.min.js"></script>
|
||||
<form id="mktoForm_3226"></form>
|
||||
<script>MktoForms2.loadForm("//page.gitlab.com", "194-VVC-221", 3226);</script>
|
||||
|
||||
<!-- markdownlint-enable -->
|
|
@ -12,7 +12,7 @@ comments: false
|
|||
- Keeps changes isolated
|
||||
- Consider a 1-to-1 link to issues
|
||||
- Push branches to the server frequently
|
||||
- Hint: This is a cheap backup for your work-in-progress code
|
||||
- Hint: Pushing branches is a cheap backup for your work-in-progress code.
|
||||
|
||||
## Feature branching sample workflow
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ Before diving into this document, make sure you are familiar with using
|
|||
## Git rebase
|
||||
|
||||
[Rebasing](https://git-scm.com/docs/git-rebase) is a very common operation in
|
||||
Git. There are the following rebase options:
|
||||
Git, and has these options:
|
||||
|
||||
- [Regular rebase](#regular-rebase).
|
||||
- [Interactive rebase](#interactive-rebase).
|
||||
|
@ -69,15 +69,15 @@ changes by resetting `my-feature-branch` against `my-feature-branch-backup`:
|
|||
git reset --hard my-feature-branch-backup
|
||||
```
|
||||
|
||||
Note that if you added changes to `my-feature-branch` after creating the backup branch,
|
||||
If you added changes to `my-feature-branch` after creating the backup branch,
|
||||
you lose them when resetting.
|
||||
|
||||
### Regular rebase
|
||||
|
||||
With a regular rebase you can update your feature branch with the default
|
||||
branch (or any other branch).
|
||||
This is an important step for Git-based development strategies. You can
|
||||
ensure that the changes you're adding to the codebase do not break any
|
||||
This step is important for Git-based development strategies. You can
|
||||
ensure your new changes don't break any
|
||||
existing changes added to the target branch _after_ you created your feature
|
||||
branch.
|
||||
|
||||
|
@ -148,7 +148,7 @@ executes it as soon as possible.
|
|||
The user performing the rebase action is considered
|
||||
a user that added commits to the merge request. When the merge request approvals setting
|
||||
[**Prevent approvals by users who add commits**](../../user/project/merge_requests/approvals/settings.md#prevent-approvals-by-users-who-add-commits)
|
||||
is enabled, this setting prevents the user from also approving the merge request.
|
||||
is enabled, the user can't also approve the merge request.
|
||||
|
||||
### Interactive rebase
|
||||
|
||||
|
@ -158,7 +158,7 @@ commits. Use a rebase for changing past commit messages,
|
|||
and organizing the commit history of your branch to keep it clean.
|
||||
|
||||
NOTE:
|
||||
If you want to keep the default branch commit history clean, you don't need to
|
||||
Keeping the default branch commit history clean doesn't require you to
|
||||
manually squash all your commits before merging every merge request.
|
||||
With [Squash and Merge](../../user/project/merge_requests/squash_and_merge.md),
|
||||
GitLab does it automatically.
|
||||
|
@ -176,18 +176,17 @@ git rebase -i HEAD~3
|
|||
Git opens the last three commits in your terminal text editor and describes
|
||||
all the interactive rebase options you can use. The default option is `pick`,
|
||||
which maintains the commit unchanged. Replace the keyword `pick` according to
|
||||
the operation you want to perform in each commit. To do so, you need to edit
|
||||
the operation you want to perform in each commit. To do so, edit
|
||||
the commits in your terminal's text editor.
|
||||
|
||||
For example, if you're using [Vim](https://www.vim.org/) as the text editor in
|
||||
a macOS's `ZSH` shell, and you want to `squash` or `fixup` all the three commits
|
||||
(join them into one):
|
||||
For example, with [Vim](https://www.vim.org/) as the text editor in
|
||||
a macOS's `ZSH` shell, you can `squash` or `fixup` (combine) all three commits:
|
||||
|
||||
<!-- vale gitlab.FirstPerson = NO -->
|
||||
|
||||
1. Press <kbd>i</kbd>
|
||||
on your keyboard to switch to Vim's editing mode.
|
||||
1. Navigate with your keyboard arrows to edit the **second** commit keyword
|
||||
1. Use your keyboard arrows to edit the **second** commit keyword
|
||||
from `pick` to `squash` or `fixup` (or `s` or `f`). Do the same to the **third** commit.
|
||||
The first commit should be left **unchanged** (`pick`) as we want to squash
|
||||
the second and third into the first.
|
||||
|
@ -204,7 +203,7 @@ a macOS's `ZSH` shell, and you want to `squash` or `fixup` all the three commits
|
|||
|
||||
<!-- vale gitlab.FirstPerson = YES -->
|
||||
|
||||
Note that the steps for editing through the command line can be slightly
|
||||
The steps for editing through the command line can be slightly
|
||||
different depending on your operating system and the shell you're using.
|
||||
|
||||
See [Numerous undo possibilities in Git](numerous_undo_possibilities_in_git/index.md#undo-staged-local-changes-without-modifying-history)
|
||||
|
@ -226,8 +225,8 @@ Forcing an update is **not** recommended when you're working on shared
|
|||
branches.
|
||||
|
||||
Alternatively, you can pass the flag [`--force-with-lease`](https://git-scm.com/docs/git-push#Documentation/git-push.txt---force-with-leaseltrefnamegt)
|
||||
instead. It is safer, as it does not overwrite any work on the remote
|
||||
branch if more commits were added to the remote branch by someone else:
|
||||
instead, as it is safer. This flag preserves any new commits added to the remote
|
||||
branch by other people:
|
||||
|
||||
```shell
|
||||
git push --force-with-lease origin my-feature-branch
|
||||
|
|
|
@ -45,7 +45,7 @@ Documentation for GitLab instance administrators is under [LFS administration do
|
|||
|
||||
## Using Git LFS
|
||||
|
||||
Let's take a look at the workflow when you need to check large files into your Git
|
||||
Let's take a look at the workflow for checking large files into your Git
|
||||
repository with Git LFS. For example, if you want to upload a very large file and
|
||||
check it into your Git repository:
|
||||
|
||||
|
@ -130,10 +130,10 @@ Technical details about how this works can be found in the [development document
|
|||
|
||||
## Troubleshooting
|
||||
|
||||
### Encountered `n` file(s) that should have been pointers, but weren't
|
||||
### Encountered `n` files that should have been pointers, but weren't
|
||||
|
||||
This error indicates the file (or files) are expected to be tracked by LFS, but for
|
||||
some reason the repository is not tracking them as LFS. This issue can be one
|
||||
This error indicates the files are expected to be tracked by LFS, but
|
||||
the repository is not tracking them as LFS. This issue can be one
|
||||
potential reason for this error:
|
||||
[Files not tracked with LFS when uploaded through the web interface](https://gitlab.com/gitlab-org/gitlab/-/issues/326342#note_586820485)
|
||||
|
||||
|
@ -160,7 +160,7 @@ To resolve the problem, migrate the affected file (or files) and push back to th
|
|||
|
||||
### error: Repository or object not found
|
||||
|
||||
There are a couple of reasons why this error can occur:
|
||||
This error can occur for a few reasons, including:
|
||||
|
||||
- You don't have permissions to access certain LFS object
|
||||
|
||||
|
@ -232,7 +232,7 @@ Git LFS authenticates the user with HTTP Basic Authentication on every push for
|
|||
every object, so user HTTPS credentials are required.
|
||||
|
||||
By default, Git has support for remembering the credentials for each repository
|
||||
you use. This is described in [Git credentials man pages](https://git-scm.com/docs/gitcredentials).
|
||||
you use. To learn more, read the [Git credentials man pages](https://git-scm.com/docs/gitcredentials).
|
||||
|
||||
For example, you can tell Git to remember the password for a period of time in
|
||||
which you expect to push the objects:
|
||||
|
|
|
@ -14,12 +14,12 @@ comments: false
|
|||
|
||||
## Merge conflicts sample workflow
|
||||
|
||||
1. Checkout a new branch and edit `conflicts.rb`. Add 'Line4' and 'Line5'.
|
||||
1. Check out a new branch and edit `conflicts.rb`. Add 'Line4' and 'Line5'.
|
||||
1. Commit and push.
|
||||
1. Checkout master and edit `conflicts.rb`. Add 'Line6' and 'Line7' below 'Line3'.
|
||||
1. Commit and push to master.
|
||||
1. Check out `main` and edit `conflicts.rb`. Add 'Line6' and 'Line7' below 'Line3'.
|
||||
1. Commit and push to `main``.
|
||||
1. Create a merge request and watch it fail.
|
||||
1. Rebase our new branch with master.
|
||||
1. Rebase our new branch with `main`.
|
||||
1. Fix conflicts on the `conflicts.rb` file.
|
||||
1. Stage the file and continue rebasing.
|
||||
1. Force push the changes.
|
||||
|
@ -34,12 +34,12 @@ git checkout -b conflicts_branch
|
|||
git commit -am "add line4 and line5"
|
||||
git push origin conflicts_branch
|
||||
|
||||
git checkout master
|
||||
git checkout main
|
||||
|
||||
# vi conflicts.rb
|
||||
# Add 'Line6' and 'Line7'
|
||||
git commit -am "add line6 and line7"
|
||||
git push origin master
|
||||
git push origin main
|
||||
```
|
||||
|
||||
Create a merge request on the GitLab web UI, and a conflict warning displays.
|
||||
|
@ -47,7 +47,7 @@ Create a merge request on the GitLab web UI, and a conflict warning displays.
|
|||
```shell
|
||||
git checkout conflicts_branch
|
||||
git fetch
|
||||
git rebase master
|
||||
git rebase main
|
||||
|
||||
# Fix conflicts by editing the files.
|
||||
|
||||
|
@ -64,6 +64,6 @@ git push origin conflicts_branch -f
|
|||
## Note
|
||||
|
||||
- When to use `git merge` and when to use `git rebase`
|
||||
- Rebase when updating your branch with master
|
||||
- Merge when bringing changes from feature to master
|
||||
- Rebase when updating your branch with `main`
|
||||
- Merge when bringing changes from feature to `main`
|
||||
- Reference: <https://www.atlassian.com/git/tutorials/merging-vs-rebasing>
|
||||
|
|
|
@ -26,7 +26,7 @@ Git 2.22.0 or later is required.
|
|||
|
||||
Storing large binary files in Git is normally discouraged, because every large
|
||||
file added is downloaded by everyone who clones or fetches changes
|
||||
thereafter. This is slow, if not a complete obstruction when working from a slow
|
||||
thereafter. These downloads are slow and problematic, especially when working from a slow
|
||||
or unreliable internet connection.
|
||||
|
||||
Using partial clone with a file size filter solves this problem, by excluding
|
||||
|
@ -65,7 +65,7 @@ The output is longer because Git:
|
|||
1. Clones the repository excluding files larger than 1 megabyte.
|
||||
1. Downloads any missing large files needed to check out the default branch.
|
||||
|
||||
When changing branches, Git may need to download more missing files.
|
||||
When changing branches, Git may download more missing files.
|
||||
|
||||
## Filter by object type
|
||||
|
||||
|
@ -147,7 +147,7 @@ For more details, see the Git documentation for
|
|||
```
|
||||
|
||||
1. Clone and filter by path. Support for `--filter=sparse:oid` using the
|
||||
clone command is not yet fully integrated with sparse checkout.
|
||||
clone command is not fully integrated with sparse checkout.
|
||||
|
||||
```shell
|
||||
|
||||
|
@ -162,8 +162,7 @@ For more details, see the Git documentation for
|
|||
WARNING:
|
||||
Git integrations with `bash`, `zsh`, etc and editors that automatically
|
||||
show Git status information often run `git fetch` which fetches the
|
||||
entire repository. You many need to disable or reconfigure these
|
||||
integrations.
|
||||
entire repository. Disabling or reconfiguring these integrations might be required.
|
||||
|
||||
## Remove partial clone filtering
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@ comments: false
|
|||
|
||||
# Git Stash **(FREE)**
|
||||
|
||||
We use `git stash` to store our changes when they are not ready to be committed
|
||||
and we need to change to a different branch.
|
||||
We use `git stash` to store our changes when they are not ready to be committed,
|
||||
but we must change to a different branch.
|
||||
|
||||
- Stash:
|
||||
|
||||
|
@ -37,7 +37,7 @@ and we need to change to a different branch.
|
|||
git stash list --stat
|
||||
```
|
||||
|
||||
- To clean our stack we need to manually remove them:
|
||||
- To clean our stack, manually remove them:
|
||||
|
||||
```shell
|
||||
# drop top stash
|
||||
|
@ -54,7 +54,7 @@ and we need to change to a different branch.
|
|||
git stash pop
|
||||
```
|
||||
|
||||
- If we meet conflicts we need to either reset or commit our changes.
|
||||
- If we meet conflicts, either reset or commit our changes.
|
||||
- Conflicts through `pop` doesn't drop a stash afterwards.
|
||||
|
||||
## Git Stash sample workflow
|
||||
|
|
|
@ -6,7 +6,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w
|
|||
|
||||
# Tags **(FREE)**
|
||||
|
||||
Tags are useful for marking certain deployments and releases for later
|
||||
Tags help you mark certain deployments and releases for later
|
||||
reference. Git supports two types of tags:
|
||||
|
||||
- Annotated tags: An unchangeable part of Git history.
|
||||
|
|
|
@ -30,7 +30,7 @@ When you want to contribute to someone else's repository, you make a copy of it.
|
|||
This copy is called a [**fork**](../../user/project/repository/forking_workflow.md#creating-a-fork).
|
||||
The process is called "creating a fork."
|
||||
|
||||
When you fork a repo, you create a copy of the project in your own
|
||||
When you fork a repository, you create a copy of the project in your own
|
||||
[namespace](../../user/group/#namespaces). You then have write permissions to modify the project files
|
||||
and settings.
|
||||
|
||||
|
@ -53,10 +53,10 @@ upload the changes to the remote repository on GitLab.
|
|||
## Pull and push
|
||||
|
||||
After you save a local copy of a repository and modify the files on your computer, you can upload the
|
||||
changes to GitLab. This is referred to as **pushing** to the remote, because you use the command
|
||||
changes to GitLab. This action is known as **pushing** to the remote, because you use the command
|
||||
[`git push`](../../gitlab-basics/start-using-git.md#send-changes-to-gitlabcom).
|
||||
|
||||
When the remote repository changes, your local copy is behind. You can update your local copy with the new
|
||||
changes in the remote repository.
|
||||
This is referred to as **pulling** from the remote, because you use the command
|
||||
This action is known as **pulling** from the remote, because you use the command
|
||||
[`git pull`](../../gitlab-basics/start-using-git.md#download-the-latest-changes-in-the-project).
|
||||
|
|
|
@ -8,7 +8,7 @@ type: reference
|
|||
# Useful Git commands **(FREE)**
|
||||
|
||||
The GitLab support team has collected these commands to help you. You may not
|
||||
need to use them often.
|
||||
need them frequently.
|
||||
|
||||
## Remotes
|
||||
|
||||
|
@ -42,7 +42,7 @@ git reset <filename>
|
|||
|
||||
### Revert a file to HEAD state and remove changes
|
||||
|
||||
There are two options to revert changes to a file:
|
||||
To revert changes to a file, you can use either:
|
||||
|
||||
- `git checkout <filename>`
|
||||
- `git reset --hard <filename>`
|
||||
|
|
|
@ -42,6 +42,25 @@ Each deprecation has a **planned removal milestone** and indicates whether it is
|
|||
|
||||
Most of the deprecations are **planned for removal in 15.0**, and many of them are **breaking changes**.
|
||||
|
||||
## 15.0
|
||||
|
||||
### GraphQL API legacyMode argument for Runner status
|
||||
|
||||
WARNING:
|
||||
This feature will be changed or removed in 16.0
|
||||
as a [breaking change](https://docs.gitlab.com/ee/development/contributing/#breaking-changes).
|
||||
Before updating GitLab, review the details carefully to determine if you need to make any
|
||||
changes to your code, settings, or workflow.
|
||||
|
||||
The `legacyMode` argument to the `status` field in `RunnerType` will be rendered non-functional in the 16.0 release
|
||||
as part of the deprecations details in the [issue](https://gitlab.com/gitlab-org/gitlab/-/issues/351109).
|
||||
|
||||
In GitLab 16.0 and later, the `status` field will act as if `legacyMode` is null. The `legacyMode` argument will
|
||||
be present during the 16.x cycle to avoid breaking the API signature, and will be removed altogether in the
|
||||
17.0 release.
|
||||
|
||||
**Planned removal milestone: 16.0 (2023-05-22)**
|
||||
|
||||
## 14.10
|
||||
|
||||
### Dependency Scanning default Java version changed to 17
|
||||
|
@ -1205,21 +1224,6 @@ If you are using our License Compliance API you should stop using the `approved`
|
|||
|
||||
**Planned removal milestone: 15.0 (2022-05-22)**
|
||||
|
||||
### Runner status `not_connected` API value
|
||||
|
||||
WARNING:
|
||||
This feature will be changed or removed in 15.0
|
||||
as a [breaking change](https://docs.gitlab.com/ee/development/contributing/#breaking-changes).
|
||||
Before updating GitLab, review the details carefully to determine if you need to make any
|
||||
changes to your code, settings, or workflow.
|
||||
|
||||
The GitLab Runner REST and GraphQL [API](https://docs.gitlab.com/ee/api/runners.html#runners-api) endpoints
|
||||
will return `never_contacted` instead of `not_connected` as the status values in 15.0.
|
||||
|
||||
Runners that have never contacted the GitLab instance will also return `stale` if created more than 3 months ago.
|
||||
|
||||
**Planned removal milestone: 15.0 (2022-05-22)**
|
||||
|
||||
### `type` and `types` keyword in CI/CD configuration
|
||||
|
||||
WARNING:
|
||||
|
|
|
@ -80,6 +80,30 @@ The permissions model for GraphQL is being updated. After 15.0, users with the G
|
|||
|
||||
The issue for this removal is [GitLab-#350682](https://gitlab.com/gitlab-org/gitlab/-/issues/350682)
|
||||
|
||||
### Remove Versions from PackageType
|
||||
|
||||
WARNING:
|
||||
This feature was changed or removed in 15.0
|
||||
as a [breaking change](https://docs.gitlab.com/ee/development/contributing/#breaking-changes).
|
||||
Before updating GitLab, review the details carefully to determine if you need to make any
|
||||
changes to your code, settings, or workflow.
|
||||
|
||||
As part of the work to create a [Package Registry GraphQL API](https://gitlab.com/groups/gitlab-org/-/epics/6318), the Package group deprecated the `Version` type for the basic `PackageType` type and moved it to [`PackageDetailsType`](https://docs.gitlab.com/ee/api/graphql/reference/index.html#packagedetailstype).
|
||||
|
||||
In GitLab 15.0, we will completely remove `Version` from `PackageType`.
|
||||
|
||||
### Remove dependency_proxy_for_private_groups feature flag
|
||||
|
||||
WARNING:
|
||||
This feature was changed or removed in 15.0
|
||||
as a [breaking change](https://docs.gitlab.com/ee/development/contributing/#breaking-changes).
|
||||
Before updating GitLab, review the details carefully to determine if you need to make any
|
||||
changes to your code, settings, or workflow.
|
||||
|
||||
A feature flag was [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/11582) in GitLab 13.7 as part of the change to require authentication to use the Dependency Proxy. Before GitLab 13.7, you could use the Dependency Proxy without authentication.
|
||||
|
||||
In GitLab 15.0, we will remove the feature flag, and you must always authenticate when you use the Dependency Proxy.
|
||||
|
||||
### Update to the Container Registry group-level API
|
||||
|
||||
WARNING:
|
||||
|
|
|
@ -6,6 +6,7 @@ module API
|
|||
include PaginationParams
|
||||
|
||||
feature_category :kubernetes_management
|
||||
urgency :low
|
||||
|
||||
before do
|
||||
authenticated_as_admin!
|
||||
|
|
|
@ -190,7 +190,7 @@ module API
|
|||
detail 'Retrieves a list of agents for the given job token'
|
||||
end
|
||||
route_setting :authentication, job_token_allowed: true
|
||||
get '/allowed_agents', feature_category: :kubernetes_management do
|
||||
get '/allowed_agents', urgency: :low, feature_category: :kubernetes_management do
|
||||
validate_current_authenticated_job
|
||||
|
||||
status 200
|
||||
|
|
|
@ -8,6 +8,7 @@ module API
|
|||
before { authenticate! }
|
||||
|
||||
feature_category :kubernetes_management
|
||||
urgency :low
|
||||
|
||||
params do
|
||||
requires :id, type: String, desc: 'The ID of a project'
|
||||
|
|
|
@ -56,6 +56,16 @@ module API
|
|||
end
|
||||
end
|
||||
|
||||
def fetch_blame_range(blame_params)
|
||||
return if blame_params[:range].blank?
|
||||
|
||||
range = Range.new(blame_params[:range][:start], blame_params[:range][:end])
|
||||
|
||||
render_api_error!('range[start] must be less than or equal to range[end]', 400) if range.begin > range.end
|
||||
|
||||
range
|
||||
end
|
||||
|
||||
def blob_data
|
||||
{
|
||||
file_name: @blob.name,
|
||||
|
@ -110,13 +120,19 @@ module API
|
|||
params do
|
||||
requires :file_path, type: String, file_path: true, desc: 'The url encoded path to the file. Ex. lib%2Fclass%2Erb'
|
||||
requires :ref, type: String, desc: 'The name of branch, tag or commit', allow_blank: false
|
||||
optional :range, type: Hash do
|
||||
requires :start, type: Integer, desc: 'The first line of the range to blame', allow_blank: false, values: ->(v) { v > 0 }
|
||||
requires :end, type: Integer, desc: 'The last line of the range to blame', allow_blank: false, values: ->(v) { v > 0 }
|
||||
end
|
||||
end
|
||||
get ":id/repository/files/:file_path/blame", requirements: FILE_ENDPOINT_REQUIREMENTS do
|
||||
blame_params = declared_params(include_missing: false)
|
||||
|
||||
assign_file_vars!
|
||||
|
||||
set_http_headers(blob_data)
|
||||
|
||||
blame_ranges = Gitlab::Blame.new(@blob, @commit).groups(highlight: false)
|
||||
blame_ranges = Gitlab::Blame.new(@blob, @commit, range: fetch_blame_range(blame_params)).groups(highlight: false)
|
||||
present blame_ranges, with: Entities::BlameRange
|
||||
end
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ module API
|
|||
end
|
||||
|
||||
feature_category :kubernetes_management
|
||||
urgency :low
|
||||
|
||||
params do
|
||||
requires :id, type: String, desc: 'The ID of the group'
|
||||
|
|
|
@ -5,6 +5,11 @@ module API
|
|||
module Internal
|
||||
class Kubernetes < ::API::Base
|
||||
feature_category :kubernetes_management
|
||||
urgency :low, [
|
||||
'/api/:version/internal/kubernetes/agent_configuration',
|
||||
'/api/:version/internal/kubernetes/agent_info',
|
||||
'/api/:version/internal/kubernetes/project_info'
|
||||
]
|
||||
|
||||
before do
|
||||
check_feature_enabled
|
||||
|
|
|
@ -10,6 +10,7 @@ module API
|
|||
end
|
||||
|
||||
feature_category :kubernetes_management
|
||||
urgency :low
|
||||
|
||||
params do
|
||||
requires :id, type: String, desc: 'The ID of the project'
|
||||
|
|
|
@ -22,6 +22,7 @@ module API
|
|||
}.freeze
|
||||
|
||||
feature_category :infrastructure_as_code
|
||||
urgency :low
|
||||
|
||||
after_validation do
|
||||
require_packages_enabled!
|
||||
|
|
|
@ -8,6 +8,7 @@ module API
|
|||
include ::Gitlab::Utils::StrongMemoize
|
||||
|
||||
feature_category :infrastructure_as_code
|
||||
urgency :low
|
||||
|
||||
default_format :json
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ module API
|
|||
default_format :json
|
||||
|
||||
feature_category :infrastructure_as_code
|
||||
urgency :low
|
||||
|
||||
before do
|
||||
authenticate!
|
||||
|
|
|
@ -17,7 +17,6 @@ module Gitlab
|
|||
lib/gitlab/profiler.rb
|
||||
lib/gitlab/query_limiting/
|
||||
lib/gitlab/request_context.rb
|
||||
lib/gitlab/request_profiler/
|
||||
lib/gitlab/sidekiq_logging/
|
||||
lib/gitlab/sidekiq_middleware/
|
||||
lib/gitlab/sidekiq_status/
|
||||
|
|
|
@ -16,7 +16,6 @@ module Gitlab
|
|||
lib/gitlab/middleware/
|
||||
ee/lib/gitlab/middleware/
|
||||
lib/gitlab/performance_bar/
|
||||
lib/gitlab/request_profiler/
|
||||
lib/gitlab/query_limiting/
|
||||
lib/gitlab/tracing/
|
||||
lib/gitlab/profiler.rb
|
||||
|
|
|
@ -1,36 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'fileutils'
|
||||
|
||||
module Gitlab
|
||||
module RequestProfiler
|
||||
PROFILES_DIR = "#{Gitlab.config.shared.path}/tmp/requests_profiles"
|
||||
|
||||
def all
|
||||
Dir["#{PROFILES_DIR}/*.{html,txt}"].map do |path|
|
||||
Profile.new(File.basename(path))
|
||||
end.select(&:valid?)
|
||||
end
|
||||
module_function :all # rubocop: disable Style/AccessModifierDeclarations
|
||||
|
||||
def find(name)
|
||||
file_path = File.join(PROFILES_DIR, name)
|
||||
return unless File.exist?(file_path)
|
||||
|
||||
Profile.new(name)
|
||||
end
|
||||
module_function :find # rubocop: disable Style/AccessModifierDeclarations
|
||||
|
||||
def profile_token
|
||||
Rails.cache.fetch('profile-token') do
|
||||
Devise.friendly_token
|
||||
end
|
||||
end
|
||||
module_function :profile_token # rubocop: disable Style/AccessModifierDeclarations
|
||||
|
||||
def remove_all_profiles
|
||||
FileUtils.rm_rf(PROFILES_DIR)
|
||||
end
|
||||
module_function :remove_all_profiles # rubocop: disable Style/AccessModifierDeclarations
|
||||
end
|
||||
end
|
|
@ -1,107 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'ruby-prof'
|
||||
require 'memory_profiler'
|
||||
|
||||
module Gitlab
|
||||
module RequestProfiler
|
||||
class Middleware
|
||||
def initialize(app)
|
||||
@app = app
|
||||
end
|
||||
|
||||
def call(env)
|
||||
if profile?(env)
|
||||
call_with_profiling(env)
|
||||
else
|
||||
@app.call(env)
|
||||
end
|
||||
end
|
||||
|
||||
def profile?(env)
|
||||
header_token = env['HTTP_X_PROFILE_TOKEN']
|
||||
return unless header_token.present?
|
||||
|
||||
profile_token = Gitlab::RequestProfiler.profile_token
|
||||
return unless profile_token.present?
|
||||
|
||||
header_token == profile_token
|
||||
end
|
||||
|
||||
def call_with_profiling(env)
|
||||
case env['HTTP_X_PROFILE_MODE']
|
||||
when 'execution', nil
|
||||
call_with_call_stack_profiling(env)
|
||||
when 'memory'
|
||||
call_with_memory_profiling(env)
|
||||
else
|
||||
raise ActionController::BadRequest, invalid_profile_mode(env)
|
||||
end
|
||||
end
|
||||
|
||||
def invalid_profile_mode(env)
|
||||
<<~HEREDOC
|
||||
Invalid X-Profile-Mode: #{env['HTTP_X_PROFILE_MODE']}.
|
||||
Supported profile mode request header:
|
||||
- X-Profile-Mode: execution
|
||||
- X-Profile-Mode: memory
|
||||
HEREDOC
|
||||
end
|
||||
|
||||
def call_with_call_stack_profiling(env)
|
||||
ret = nil
|
||||
report = RubyProf::Profile.profile do
|
||||
ret = catch(:warden) do # rubocop:disable Cop/BanCatchThrow
|
||||
@app.call(env)
|
||||
end
|
||||
end
|
||||
|
||||
generate_report(env, 'execution', 'html') do |file|
|
||||
printer = RubyProf::CallStackPrinter.new(report)
|
||||
printer.print(file)
|
||||
end
|
||||
|
||||
handle_request_ret(ret)
|
||||
end
|
||||
|
||||
def call_with_memory_profiling(env)
|
||||
ret = nil
|
||||
report = MemoryProfiler.report do
|
||||
ret = catch(:warden) do # rubocop:disable Cop/BanCatchThrow
|
||||
@app.call(env)
|
||||
end
|
||||
end
|
||||
|
||||
generate_report(env, 'memory', 'txt') do |file|
|
||||
report.pretty_print(to_file: file)
|
||||
end
|
||||
|
||||
handle_request_ret(ret)
|
||||
end
|
||||
|
||||
def generate_report(env, report_type, extension)
|
||||
file_name = "#{env['PATH_INFO'].tr('/', '|')}_#{Time.current.to_i}"\
|
||||
"_#{report_type}.#{extension}"
|
||||
file_path = "#{PROFILES_DIR}/#{file_name}"
|
||||
|
||||
FileUtils.mkdir_p(PROFILES_DIR)
|
||||
|
||||
begin
|
||||
File.open(file_path, 'wb') do |file|
|
||||
yield(file)
|
||||
end
|
||||
rescue StandardError
|
||||
FileUtils.rm(file_path)
|
||||
end
|
||||
end
|
||||
|
||||
def handle_request_ret(ret)
|
||||
if ret.is_a?(Array)
|
||||
ret
|
||||
else
|
||||
throw(:warden, ret) # rubocop:disable Cop/BanCatchThrow
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,43 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
module RequestProfiler
|
||||
class Profile
|
||||
attr_reader :name, :time, :file_path, :request_path, :profile_mode, :type
|
||||
|
||||
alias_method :to_param, :name
|
||||
|
||||
def initialize(name)
|
||||
@name = name
|
||||
@file_path = File.join(PROFILES_DIR, name)
|
||||
|
||||
set_attributes
|
||||
end
|
||||
|
||||
def valid?
|
||||
@request_path.present?
|
||||
end
|
||||
|
||||
def content_type
|
||||
case type
|
||||
when 'html'
|
||||
'text/html'
|
||||
when 'txt'
|
||||
'text/plain'
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def set_attributes
|
||||
matches = name.match(/^(?<path>.*)_(?<timestamp>\d+)(_(?<profile_mode>\w+))?\.(?<type>html|txt)$/)
|
||||
return unless matches
|
||||
|
||||
@request_path = matches[:path].tr('|', '/')
|
||||
@time = Time.at(matches[:timestamp].to_i).utc
|
||||
@profile_mode = matches[:profile_mode] || 'unknown'
|
||||
@type = matches[:type]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -25638,9 +25638,6 @@ msgstr ""
|
|||
msgid "No prioritized labels with such name or description"
|
||||
msgstr ""
|
||||
|
||||
msgid "No profiles found"
|
||||
msgstr ""
|
||||
|
||||
msgid "No project subscribes to the pipelines in this project."
|
||||
msgstr ""
|
||||
|
||||
|
@ -27284,9 +27281,6 @@ msgstr ""
|
|||
msgid "Pass job variables"
|
||||
msgstr ""
|
||||
|
||||
msgid "Pass the header %{codeOpen} X-Profile-Token: %{profile_token} %{codeClose} to profile the request"
|
||||
msgstr ""
|
||||
|
||||
msgid "Passed"
|
||||
msgstr ""
|
||||
|
||||
|
@ -32071,9 +32065,6 @@ msgstr ""
|
|||
msgid "Requests"
|
||||
msgstr ""
|
||||
|
||||
msgid "Requests Profiles"
|
||||
msgstr ""
|
||||
|
||||
msgid "Requests for pages at %{code_start}%{help_text_url}%{code_end} redirect to the URL. The destination must meet certain requirements. %{docs_link_start}Learn more.%{docs_link_end}"
|
||||
msgstr ""
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
module QA
|
||||
# Spec uses real github.com, which means outage of github.com can actually block deployment
|
||||
# Keep spec in reliable bucket but don't run in blocking pipelines
|
||||
RSpec.describe 'Manage', :github, :skip_live_env, :requires_admin do
|
||||
RSpec.describe 'Manage', :github, :reliable, :skip_live_env, :requires_admin do
|
||||
describe 'Project import', issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/353583' do
|
||||
let!(:api_client) { Runtime::API::Client.as_admin }
|
||||
let!(:group) { Resource::Group.fabricate_via_api! { |resource| resource.api_client = api_client } }
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
module QA
|
||||
# Spec uses real github.com, which means outage of github can actually block deployment
|
||||
# Keep spec in reliable bucket but don't run in blocking pipelines
|
||||
RSpec.describe 'Manage', :github, :skip_live_env, :requires_admin do
|
||||
RSpec.describe 'Manage', :github, :reliable, :skip_live_env, :requires_admin do
|
||||
describe 'Project import' do
|
||||
let(:github_repo) { 'gitlab-qa-github/import-test' }
|
||||
let(:api_client) { Runtime::API::Client.as_admin }
|
||||
|
|
|
@ -1,72 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'spec_helper'
|
||||
|
||||
RSpec.describe Admin::RequestsProfilesController do
|
||||
let_it_be(:admin) { create(:admin) }
|
||||
|
||||
before do
|
||||
sign_in(admin)
|
||||
end
|
||||
|
||||
describe '#show' do
|
||||
let(:tmpdir) { Dir.mktmpdir('profiler-test') }
|
||||
let(:test_file) { File.join(tmpdir, basename) }
|
||||
|
||||
subject do
|
||||
get :show, params: { name: basename }
|
||||
end
|
||||
|
||||
before do
|
||||
stub_const('Gitlab::RequestProfiler::PROFILES_DIR', tmpdir)
|
||||
File.write(test_file, sample_data)
|
||||
end
|
||||
|
||||
after do
|
||||
FileUtils.rm_rf(tmpdir)
|
||||
end
|
||||
|
||||
context 'when loading HTML profile' do
|
||||
let(:basename) { "profile_#{Time.current.to_i}_execution.html" }
|
||||
|
||||
let(:sample_data) do
|
||||
'<html> <body> <h1>Heading</h1> <p>paragraph.</p> </body> </html>'
|
||||
end
|
||||
|
||||
it 'renders the data' do
|
||||
subject
|
||||
|
||||
expect(response).to have_gitlab_http_status(:ok)
|
||||
expect(response.body).to eq(sample_data)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when loading TXT profile' do
|
||||
let(:basename) { "profile_#{Time.current.to_i}_memory.txt" }
|
||||
|
||||
let(:sample_data) do
|
||||
<<~TXT
|
||||
Total allocated: 112096396 bytes (1080431 objects)
|
||||
Total retained: 10312598 bytes (53567 objects)
|
||||
TXT
|
||||
end
|
||||
|
||||
it 'renders the data' do
|
||||
subject
|
||||
|
||||
expect(response).to have_gitlab_http_status(:ok)
|
||||
expect(response.body).to eq(sample_data)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when loading PDF profile' do
|
||||
let(:basename) { "profile_#{Time.current.to_i}_anything.pdf" }
|
||||
|
||||
let(:sample_data) { 'mocked pdf content' }
|
||||
|
||||
it 'fails to render the data' do
|
||||
expect { subject }.to raise_error(ActionController::UrlGenerationError, /No route matches.*unmatched constraints:/)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,136 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'spec_helper'
|
||||
|
||||
RSpec.describe 'Admin::RequestsProfilesController' do
|
||||
let(:tmpdir) { Dir.mktmpdir('profiler-test') }
|
||||
|
||||
before do
|
||||
stub_const('Gitlab::RequestProfiler::PROFILES_DIR', tmpdir)
|
||||
admin = create(:admin)
|
||||
sign_in(admin)
|
||||
gitlab_enable_admin_mode_sign_in(admin)
|
||||
end
|
||||
|
||||
after do
|
||||
FileUtils.rm_rf(tmpdir)
|
||||
end
|
||||
|
||||
describe 'GET /admin/requests_profiles' do
|
||||
it 'shows the current profile token' do
|
||||
allow(Rails).to receive(:cache).and_return(ActiveSupport::Cache::MemoryStore.new)
|
||||
|
||||
visit admin_requests_profiles_path
|
||||
|
||||
expect(page).to have_content("X-Profile-Token: #{Gitlab::RequestProfiler.profile_token}")
|
||||
end
|
||||
|
||||
context 'when having multiple profiles' do
|
||||
let(:time1) { 1.hour.ago }
|
||||
let(:time2) { 2.hours.ago }
|
||||
|
||||
let(:profiles) do
|
||||
[
|
||||
{
|
||||
request_path: '/gitlab-org/gitlab-foss',
|
||||
name: "|gitlab-org|gitlab-foss_#{time1.to_i}_execution.html",
|
||||
created: time1,
|
||||
profile_mode: 'Execution'
|
||||
},
|
||||
{
|
||||
request_path: '/gitlab-org/gitlab-foss',
|
||||
name: "|gitlab-org|gitlab-foss_#{time2.to_i}_execution.html",
|
||||
created: time2,
|
||||
profile_mode: 'Execution'
|
||||
},
|
||||
{
|
||||
request_path: '/gitlab-org/gitlab-foss',
|
||||
name: "|gitlab-org|gitlab-foss_#{time1.to_i}_memory.html",
|
||||
created: time1,
|
||||
profile_mode: 'Memory'
|
||||
},
|
||||
{
|
||||
request_path: '/gitlab-org/gitlab-foss',
|
||||
name: "|gitlab-org|gitlab-foss_#{time2.to_i}_memory.html",
|
||||
created: time2,
|
||||
profile_mode: 'Memory'
|
||||
},
|
||||
{
|
||||
request_path: '/gitlab-org/infrastructure',
|
||||
name: "|gitlab-org|infrastructure_#{time1.to_i}_execution.html",
|
||||
created: time1,
|
||||
profile_mode: 'Execution'
|
||||
},
|
||||
{
|
||||
request_path: '/gitlab-org/infrastructure',
|
||||
name: "|gitlab-org|infrastructure_#{time2.to_i}_memory.html",
|
||||
created: time2,
|
||||
profile_mode: 'Memory'
|
||||
},
|
||||
{
|
||||
request_path: '/gitlab-org/infrastructure',
|
||||
name: "|gitlab-org|infrastructure_#{time2.to_i}.html",
|
||||
created: time2,
|
||||
profile_mode: 'Unknown'
|
||||
}
|
||||
]
|
||||
end
|
||||
|
||||
before do
|
||||
profiles.each do |profile|
|
||||
FileUtils.touch(File.join(Gitlab::RequestProfiler::PROFILES_DIR, profile[:name]))
|
||||
end
|
||||
end
|
||||
|
||||
it 'lists all available profiles' do
|
||||
visit admin_requests_profiles_path
|
||||
|
||||
profiles.each do |profile|
|
||||
within('.card', text: profile[:request_path]) do
|
||||
expect(page).to have_selector(
|
||||
"a[href='#{admin_requests_profile_path(profile[:name])}']",
|
||||
text: "#{profile[:created].to_s(:long)} #{profile[:profile_mode]}")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'GET /admin/requests_profiles/:profile' do
|
||||
context 'when a profile exists' do
|
||||
before do
|
||||
File.write("#{Gitlab::RequestProfiler::PROFILES_DIR}/#{profile}", content)
|
||||
end
|
||||
|
||||
context 'when is valid call stack profile' do
|
||||
let(:content) { 'This is a call stack request profile' }
|
||||
let(:profile) { "|gitlab-org|gitlab-ce_#{Time.now.to_i}_execution.html" }
|
||||
|
||||
it 'displays the content' do
|
||||
visit admin_requests_profile_path(profile)
|
||||
|
||||
expect(page).to have_content(content)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when is valid memory profile' do
|
||||
let(:content) { 'This is a memory request profile' }
|
||||
let(:profile) { "|gitlab-org|gitlab-ce_#{Time.now.to_i}_memory.txt" }
|
||||
|
||||
it 'displays the content' do
|
||||
visit admin_requests_profile_path(profile)
|
||||
|
||||
expect(page).to have_content(content)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'when a profile does not exist' do
|
||||
it 'shows an error message' do
|
||||
visit admin_requests_profile_path('|non|existent_12345.html')
|
||||
|
||||
expect(page).to have_content('Profile not found')
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -25,7 +25,6 @@ RSpec.describe Gitlab::BacktraceCleaner do
|
|||
"app/models/repository.rb:113:in `commit'",
|
||||
"lib/gitlab/i18n.rb:50:in `with_locale'",
|
||||
"lib/gitlab/middleware/multipart.rb:95:in `call'",
|
||||
"lib/gitlab/request_profiler/middleware.rb:14:in `call'",
|
||||
"ee/lib/gitlab/database/load_balancing/rack_middleware.rb:37:in `call'",
|
||||
"ee/lib/gitlab/jira/middleware.rb:15:in `call'"
|
||||
]
|
||||
|
|
|
@ -1,61 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'spec_helper'
|
||||
|
||||
RSpec.describe Gitlab::RequestProfiler::Profile do
|
||||
let(:profile) { described_class.new(filename) }
|
||||
|
||||
describe '.new' do
|
||||
context 'using old filename' do
|
||||
let(:filename) { '|api|v4|version.txt_1562854738.html' }
|
||||
|
||||
it 'returns valid data' do
|
||||
expect(profile).to be_valid
|
||||
expect(profile.request_path).to eq('/api/v4/version.txt')
|
||||
expect(profile.time).to eq(Time.at(1562854738).utc)
|
||||
expect(profile.type).to eq('html')
|
||||
end
|
||||
end
|
||||
|
||||
context 'using new filename' do
|
||||
let(:filename) { '|api|v4|version.txt_1563547949_execution.html' }
|
||||
|
||||
it 'returns valid data' do
|
||||
expect(profile).to be_valid
|
||||
expect(profile.request_path).to eq('/api/v4/version.txt')
|
||||
expect(profile.profile_mode).to eq('execution')
|
||||
expect(profile.time).to eq(Time.at(1563547949).utc)
|
||||
expect(profile.type).to eq('html')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe '#content_type' do
|
||||
context 'when using html file' do
|
||||
let(:filename) { '|api|v4|version.txt_1562854738_memory.html' }
|
||||
|
||||
it 'returns valid data' do
|
||||
expect(profile).to be_valid
|
||||
expect(profile.content_type).to eq('text/html')
|
||||
end
|
||||
end
|
||||
|
||||
context 'when using text file' do
|
||||
let(:filename) { '|api|v4|version.txt_1562854738_memory.txt' }
|
||||
|
||||
it 'returns valid data' do
|
||||
expect(profile).to be_valid
|
||||
expect(profile.content_type).to eq('text/plain')
|
||||
end
|
||||
end
|
||||
|
||||
context 'when file is unknown' do
|
||||
let(:filename) { '|api|v4|version.txt_1562854738_memory.xxx' }
|
||||
|
||||
it 'returns valid data' do
|
||||
expect(profile).not_to be_valid
|
||||
expect(profile.content_type).to be_nil
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue