diff options
106 files changed, 463 insertions, 854 deletions
diff --git a/.rubocop_todo/gitlab/namespaced_class.yml b/.rubocop_todo/gitlab/namespaced_class.yml index aa60c135af9..ba820abbb3e 100644 --- a/.rubocop_todo/gitlab/namespaced_class.yml +++ b/.rubocop_todo/gitlab/namespaced_class.yml @@ -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 diff --git a/.rubocop_todo/layout/line_length.yml b/.rubocop_todo/layout/line_length.yml index 12db16d1f39..e23ca755000 100644 --- a/.rubocop_todo/layout/line_length.yml +++ b/.rubocop_todo/layout/line_length.yml @@ -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' diff --git a/app/assets/javascripts/alerts_settings/graphql/mutations/destroy_http_integration.mutation.graphql b/app/assets/javascripts/alerts_settings/graphql/mutations/destroy_http_integration.mutation.graphql index a3a50651fd0..05bf8eab524 100644 --- a/app/assets/javascripts/alerts_settings/graphql/mutations/destroy_http_integration.mutation.graphql +++ b/app/assets/javascripts/alerts_settings/graphql/mutations/destroy_http_integration.mutation.graphql @@ -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 { diff --git a/app/assets/javascripts/alerts_settings/graphql/mutations/reset_http_token.mutation.graphql b/app/assets/javascripts/alerts_settings/graphql/mutations/reset_http_token.mutation.graphql index c0754d8e32b..65245bfb914 100644 --- a/app/assets/javascripts/alerts_settings/graphql/mutations/reset_http_token.mutation.graphql +++ b/app/assets/javascripts/alerts_settings/graphql/mutations/reset_http_token.mutation.graphql @@ -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 { diff --git a/app/assets/javascripts/alerts_settings/graphql/mutations/reset_prometheus_token.mutation.graphql b/app/assets/javascripts/alerts_settings/graphql/mutations/reset_prometheus_token.mutation.graphql index 8f34521b9fd..99179fca1f9 100644 --- a/app/assets/javascripts/alerts_settings/graphql/mutations/reset_prometheus_token.mutation.graphql +++ b/app/assets/javascripts/alerts_settings/graphql/mutations/reset_prometheus_token.mutation.graphql @@ -1,6 +1,6 @@ #import "../fragments/integration_item.fragment.graphql" -mutation resetPrometheusIntegrationToken($id: ID!) { +mutation resetPrometheusIntegrationToken($id: IntegrationsPrometheusID!) { prometheusIntegrationResetToken(input: { id: $id }) { errors integration { diff --git a/app/assets/javascripts/alerts_settings/graphql/mutations/update_http_integration.mutation.graphql b/app/assets/javascripts/alerts_settings/graphql/mutations/update_http_integration.mutation.graphql index 37df9ec25eb..cc9e841ffb9 100644 --- a/app/assets/javascripts/alerts_settings/graphql/mutations/update_http_integration.mutation.graphql +++ b/app/assets/javascripts/alerts_settings/graphql/mutations/update_http_integration.mutation.graphql @@ -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 { diff --git a/app/assets/javascripts/alerts_settings/graphql/mutations/update_prometheus_integration.mutation.graphql b/app/assets/javascripts/alerts_settings/graphql/mutations/update_prometheus_integration.mutation.graphql index 62761730bd2..95d72e4af91 100644 --- a/app/assets/javascripts/alerts_settings/graphql/mutations/update_prometheus_integration.mutation.graphql +++ b/app/assets/javascripts/alerts_settings/graphql/mutations/update_prometheus_integration.mutation.graphql @@ -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 { diff --git a/app/assets/javascripts/alerts_settings/graphql/queries/get_http_integration.query.graphql b/app/assets/javascripts/alerts_settings/graphql/queries/get_http_integration.query.graphql index 7299e6836d4..5f6ab27cae9 100644 --- a/app/assets/javascripts/alerts_settings/graphql/queries/get_http_integration.query.graphql +++ b/app/assets/javascripts/alerts_settings/graphql/queries/get_http_integration.query.graphql @@ -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) { diff --git a/app/assets/javascripts/boards/graphql/board_list_destroy.mutation.graphql b/app/assets/javascripts/boards/graphql/board_list_destroy.mutation.graphql index ef3fd36e980..5cb1a74d5c7 100644 --- a/app/assets/javascripts/boards/graphql/board_list_destroy.mutation.graphql +++ b/app/assets/javascripts/boards/graphql/board_list_destroy.mutation.graphql @@ -1,4 +1,4 @@ -mutation DestroyBoardList($listId: ID!) { +mutation DestroyBoardList($listId: ListID!) { destroyBoardList(input: { listId: $listId }) { errors } diff --git a/app/assets/javascripts/boards/graphql/board_list_update.mutation.graphql b/app/assets/javascripts/boards/graphql/board_list_update.mutation.graphql index b474c9acb93..13327028065 100644 --- a/app/assets/javascripts/boards/graphql/board_list_update.mutation.graphql +++ b/app/assets/javascripts/boards/graphql/board_list_update.mutation.graphql @@ -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 diff --git a/app/assets/javascripts/boards/graphql/board_lists.query.graphql b/app/assets/javascripts/boards/graphql/board_lists.query.graphql index 8780d6fd91a..06e8c8783de 100644 --- a/app/assets/javascripts/boards/graphql/board_lists.query.graphql +++ b/app/assets/javascripts/boards/graphql/board_lists.query.graphql @@ -2,7 +2,7 @@ query BoardLists( $fullPath: ID! - $boardId: ID! + $boardId: BoardID! $filters: BoardIssueInput $isGroup: Boolean = false $isProject: Boolean = false diff --git a/app/assets/javascripts/boards/graphql/board_lists_deferred.query.graphql b/app/assets/javascripts/boards/graphql/board_lists_deferred.query.graphql index bae3220dfad..f48383624c9 100644 --- a/app/assets/javascripts/boards/graphql/board_lists_deferred.query.graphql +++ b/app/assets/javascripts/boards/graphql/board_lists_deferred.query.graphql @@ -1,4 +1,4 @@ -query BoardList($id: ID!, $filters: BoardIssueInput) { +query BoardList($id: ListID!, $filters: BoardIssueInput) { boardList(id: $id, issueFilters: $filters) { id issuesCount diff --git a/app/assets/javascripts/boards/graphql/group_board.query.graphql b/app/assets/javascripts/boards/graphql/group_board.query.graphql index 8d87b83da96..526e3193efe 100644 --- a/app/assets/javascripts/boards/graphql/group_board.query.graphql +++ b/app/assets/javascripts/boards/graphql/group_board.query.graphql @@ -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) { diff --git a/app/assets/javascripts/boards/graphql/issue_move_list.mutation.graphql b/app/assets/javascripts/boards/graphql/issue_move_list.mutation.graphql index 1658cf09085..89670760450 100644 --- a/app/assets/javascripts/boards/graphql/issue_move_list.mutation.graphql +++ b/app/assets/javascripts/boards/graphql/issue_move_list.mutation.graphql @@ -3,7 +3,7 @@ mutation issueMoveList( $projectPath: ID! $iid: String! - $boardId: ID! + $boardId: BoardID! $fromListId: ID $toListId: ID $moveBeforeId: ID diff --git a/app/assets/javascripts/boards/graphql/lists_issues.query.graphql b/app/assets/javascripts/boards/graphql/lists_issues.query.graphql index 994ea894be3..bf5329c4a8d 100644 --- a/app/assets/javascripts/boards/graphql/lists_issues.query.graphql +++ b/app/assets/javascripts/boards/graphql/lists_issues.query.graphql @@ -2,8 +2,8 @@ query BoardListsEE( $fullPath: ID! - $boardId: ID! - $id: ID + $boardId: BoardID! + $id: ListID $filters: BoardIssueInput $isGroup: Boolean = false $isProject: Boolean = false diff --git a/app/assets/javascripts/boards/graphql/project_board.query.graphql b/app/assets/javascripts/boards/graphql/project_board.query.graphql index 8246d615a6a..2a9142696d2 100644 --- a/app/assets/javascripts/boards/graphql/project_board.query.graphql +++ b/app/assets/javascripts/boards/graphql/project_board.query.graphql @@ -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) { diff --git a/app/assets/javascripts/design_management/graphql/mutations/toggle_resolve_discussion.mutation.graphql b/app/assets/javascripts/design_management/graphql/mutations/toggle_resolve_discussion.mutation.graphql index 124f12ef018..c235e7fbf3d 100644 --- a/app/assets/javascripts/design_management/graphql/mutations/toggle_resolve_discussion.mutation.graphql +++ b/app/assets/javascripts/design_management/graphql/mutations/toggle_resolve_discussion.mutation.graphql @@ -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 diff --git a/app/assets/javascripts/error_tracking/queries/details.query.graphql b/app/assets/javascripts/error_tracking/queries/details.query.graphql index f70e09d76f7..dd21b0f9c92 100644 --- a/app/assets/javascripts/error_tracking/queries/details.query.graphql +++ b/app/assets/javascripts/error_tracking/queries/details.query.graphql @@ -1,4 +1,4 @@ -query errorDetails($fullPath: ID!, $errorId: ID!) { +query errorDetails($fullPath: ID!, $errorId: GitlabErrorTrackingDetailedErrorID!) { project(fullPath: $fullPath) { id sentryErrors { diff --git a/app/assets/javascripts/graphql_shared/mutations/todo_mark_done.mutation.graphql b/app/assets/javascripts/graphql_shared/mutations/todo_mark_done.mutation.graphql index 4d59b4d94cd..e8ad919f4a8 100644 --- a/app/assets/javascripts/graphql_shared/mutations/todo_mark_done.mutation.graphql +++ b/app/assets/javascripts/graphql_shared/mutations/todo_mark_done.mutation.graphql @@ -1,4 +1,4 @@ -mutation todoMarkDone($id: ID!) { +mutation todoMarkDone($id: TodoID!) { todoMarkDone(input: { id: $id }) { errors todo { diff --git a/app/assets/javascripts/notes/components/diff_discussion_header.vue b/app/assets/javascripts/notes/components/diff_discussion_header.vue index 45d97f278dc..5210d2ca287 100644 --- a/app/assets/javascripts/notes/components/diff_discussion_header.vue +++ b/app/assets/javascripts/notes/components/diff_discussion_header.vue @@ -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"> diff --git a/app/assets/javascripts/packages_and_registries/container_registry/explorer/graphql/queries/get_container_repository_details.query.graphql b/app/assets/javascripts/packages_and_registries/container_registry/explorer/graphql/queries/get_container_repository_details.query.graphql index 916740f41b8..e2036d9e63d 100644 --- a/app/assets/javascripts/packages_and_registries/container_registry/explorer/graphql/queries/get_container_repository_details.query.graphql +++ b/app/assets/javascripts/packages_and_registries/container_registry/explorer/graphql/queries/get_container_repository_details.query.graphql @@ -1,4 +1,4 @@ -query getContainerRepositoryDetails($id: ID!) { +query getContainerRepositoryDetails($id: ContainerRepositoryID!) { containerRepository(id: $id) { id name diff --git a/app/assets/javascripts/packages_and_registries/container_registry/explorer/graphql/queries/get_container_repository_metadata.query.graphql b/app/assets/javascripts/packages_and_registries/container_registry/explorer/graphql/queries/get_container_repository_metadata.query.graphql index f1f67b98407..1faa9dec795 100644 --- a/app/assets/javascripts/packages_and_registries/container_registry/explorer/graphql/queries/get_container_repository_metadata.query.graphql +++ b/app/assets/javascripts/packages_and_registries/container_registry/explorer/graphql/queries/get_container_repository_metadata.query.graphql @@ -1,4 +1,4 @@ -query getContainerRepositoryMetadata($id: ID!) { +query getContainerRepositoryMetadata($id: ContainerRepositoryID!) { containerRepository(id: $id) { id tagsCount diff --git a/app/assets/javascripts/packages_and_registries/container_registry/explorer/graphql/queries/get_container_repository_tags.query.graphql b/app/assets/javascripts/packages_and_registries/container_registry/explorer/graphql/queries/get_container_repository_tags.query.graphql index 8c577cc7b17..e57ac2a9efe 100644 --- a/app/assets/javascripts/packages_and_registries/container_registry/explorer/graphql/queries/get_container_repository_tags.query.graphql +++ b/app/assets/javascripts/packages_and_registries/container_registry/explorer/graphql/queries/get_container_repository_tags.query.graphql @@ -1,7 +1,7 @@ #import "~/graphql_shared/fragments/page_info.fragment.graphql" query getContainerRepositoryTags( - $id: ID! + $id: ContainerRepositoryID! $first: Int $last: Int $after: String diff --git a/app/assets/javascripts/packages_and_registries/package_registry/graphql/queries/get_package_details.query.graphql b/app/assets/javascripts/packages_and_registries/package_registry/graphql/queries/get_package_details.query.graphql index c45cbe56e00..41b0c285fff 100644 --- a/app/assets/javascripts/packages_and_registries/package_registry/graphql/queries/get_package_details.query.graphql +++ b/app/assets/javascripts/packages_and_registries/package_registry/graphql/queries/get_package_details.query.graphql @@ -1,4 +1,4 @@ -query getPackageDetails($id: ID!) { +query getPackageDetails($id: PackagesPackageID!) { package(id: $id) { id name diff --git a/app/assets/javascripts/sidebar/queries/reviewer_rereview.mutation.graphql b/app/assets/javascripts/sidebar/queries/reviewer_rereview.mutation.graphql index 73765e7d77b..0d66ee0d6e5 100644 --- a/app/assets/javascripts/sidebar/queries/reviewer_rereview.mutation.graphql +++ b/app/assets/javascripts/sidebar/queries/reviewer_rereview.mutation.graphql @@ -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 } diff --git a/app/assets/javascripts/sidebar/queries/toggle_attention_requested.mutation.graphql b/app/assets/javascripts/sidebar/queries/toggle_attention_requested.mutation.graphql index a9f4af6e1b9..495d272b698 100644 --- a/app/assets/javascripts/sidebar/queries/toggle_attention_requested.mutation.graphql +++ b/app/assets/javascripts/sidebar/queries/toggle_attention_requested.mutation.graphql @@ -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 } ) { diff --git a/app/assets/javascripts/sidebar/queries/update_merge_request_milestone.mutation.graphql b/app/assets/javascripts/sidebar/queries/update_merge_request_milestone.mutation.graphql index 368f06fac7f..938953ccfb2 100644 --- a/app/assets/javascripts/sidebar/queries/update_merge_request_milestone.mutation.graphql +++ b/app/assets/javascripts/sidebar/queries/update_merge_request_milestone.mutation.graphql @@ -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 } ) { diff --git a/app/assets/javascripts/snippets/mutations/delete_snippet.mutation.graphql b/app/assets/javascripts/snippets/mutations/delete_snippet.mutation.graphql index f43d53661f4..a13c143f775 100644 --- a/app/assets/javascripts/snippets/mutations/delete_snippet.mutation.graphql +++ b/app/assets/javascripts/snippets/mutations/delete_snippet.mutation.graphql @@ -1,4 +1,4 @@ -mutation DeleteSnippet($id: ID!) { +mutation DeleteSnippet($id: SnippetID!) { destroySnippet(input: { id: $id }) { errors } diff --git a/app/assets/javascripts/work_items/graphql/work_item.query.graphql b/app/assets/javascripts/work_items/graphql/work_item.query.graphql index 1d3dae0649d..3b46fed97ec 100644 --- a/app/assets/javascripts/work_items/graphql/work_item.query.graphql +++ b/app/assets/javascripts/work_items/graphql/work_item.query.graphql @@ -1,6 +1,6 @@ #import "./work_item.fragment.graphql" -query workItem($id: ID!) { +query workItem($id: WorkItemID!) { workItem(id: $id) { ...WorkItem } diff --git a/app/controllers/admin/requests_profiles_controller.rb b/app/controllers/admin/requests_profiles_controller.rb deleted file mode 100644 index b60cb7ff9c2..00000000000 --- a/app/controllers/admin/requests_profiles_controller.rb +++ /dev/null @@ -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 diff --git a/app/controllers/clusters/base_controller.rb b/app/controllers/clusters/base_controller.rb index f88d381b3bf..2401d8b1044 100644 --- a/app/controllers/clusters/base_controller.rb +++ b/app/controllers/clusters/base_controller.rb @@ -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 diff --git a/app/controllers/google_api/authorizations_controller.rb b/app/controllers/google_api/authorizations_controller.rb index b9c5e87c69c..5080ee5fbbe 100644 --- a/app/controllers/google_api/authorizations_controller.rb +++ b/app/controllers/google_api/authorizations_controller.rb @@ -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 diff --git a/app/controllers/projects/cluster_agents_controller.rb b/app/controllers/projects/cluster_agents_controller.rb index 282b9ef1fb7..3f759e5c18c 100644 --- a/app/controllers/projects/cluster_agents_controller.rb +++ b/app/controllers/projects/cluster_agents_controller.rb @@ -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] diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb index eb6a341ead0..f93b39dbfd3 100644 --- a/app/controllers/projects/merge_requests_controller.rb +++ b/app/controllers/projects/merge_requests_controller.rb @@ -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] diff --git a/app/controllers/projects/packages/infrastructure_registry_controller.rb b/app/controllers/projects/packages/infrastructure_registry_controller.rb index 99d75afc63a..f1410bf6043 100644 --- a/app/controllers/projects/packages/infrastructure_registry_controller.rb +++ b/app/controllers/projects/packages/infrastructure_registry_controller.rb @@ -6,6 +6,7 @@ module Projects include PackagesAccess feature_category :infrastructure_as_code + urgency :low def show @package = project.packages.find(params[:id]) diff --git a/app/controllers/projects/serverless/functions_controller.rb b/app/controllers/projects/serverless/functions_controller.rb index 7352edaaab2..d61694cf40f 100644 --- a/app/controllers/projects/serverless/functions_controller.rb +++ b/app/controllers/projects/serverless/functions_controller.rb @@ -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| diff --git a/app/controllers/projects/terraform_controller.rb b/app/controllers/projects/terraform_controller.rb index aef163c98c5..ed1783bb43d 100644 --- a/app/controllers/projects/terraform_controller.rb +++ b/app/controllers/projects/terraform_controller.rb @@ -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 diff --git a/app/graphql/queries/design_management/get_design_list.query.graphql b/app/graphql/queries/design_management/get_design_list.query.graphql index f0caa7c5b4c..c2100b5fa04 100644 --- a/app/graphql/queries/design_management/get_design_list.query.graphql +++ b/app/graphql/queries/design_management/get_design_list.query.graphql @@ -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 diff --git a/app/graphql/queries/snippet/snippet_blob_content.query.graphql b/app/graphql/queries/snippet/snippet_blob_content.query.graphql index 4459a5e4316..0ac7d4d23a0 100644 --- a/app/graphql/queries/snippet/snippet_blob_content.query.graphql +++ b/app/graphql/queries/snippet/snippet_blob_content.query.graphql @@ -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 { diff --git a/app/graphql/resolvers/ci/runner_status_resolver.rb b/app/graphql/resolvers/ci/runner_status_resolver.rb index d916a8a13f0..447ab306ba7 100644 --- a/app/graphql/resolvers/ci/runner_status_resolver.rb +++ b/app/graphql/resolvers/ci/runner_status_resolver.rb @@ -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) diff --git a/app/graphql/types/ci/runner_type.rb b/app/graphql/types/ci/runner_type.rb index 598b691965f..bdc5bfa62eb 100644 --- a/app/graphql/types/ci/runner_type.rb +++ b/app/graphql/types/ci/runner_type.rb @@ -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, diff --git a/app/helpers/nav_helper.rb b/app/helpers/nav_helper.rb index 1c4d294baa7..d4d3fddb2cd 100644 --- a/app/helpers/nav_helper.rb +++ b/app/helpers/nav_helper.rb @@ -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 diff --git a/app/models/ci/runner.rb b/app/models/ci/runner.rb index 1a620040fdf..328b0ee2e14 100644 --- a/app/models/ci/runner.rb +++ b/app/models/ci/runner.rb @@ -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 diff --git a/app/models/container_repository.rb b/app/models/container_repository.rb index 92f0b978788..331902ba101 100644 --- a/app/models/container_repository.rb +++ b/app/models/container_repository.rb @@ -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 diff --git a/app/services/ci/runners/reset_registration_token_service.rb b/app/services/ci/runners/reset_registration_token_service.rb index bbe49c04644..2a3fb08c5e1 100644 --- a/app/services/ci/runners/reset_registration_token_service.rb +++ b/app/services/ci/runners/reset_registration_token_service.rb @@ -29,3 +29,5 @@ module Ci end end end + +Ci::Runners::ResetRegistrationTokenService.prepend_mod diff --git a/app/services/loose_foreign_keys/batch_cleaner_service.rb b/app/services/loose_foreign_keys/batch_cleaner_service.rb index b89de15a568..95eb8b47009 100644 --- a/app/services/loose_foreign_keys/batch_cleaner_service.rb +++ b/app/services/loose_foreign_keys/batch_cleaner_service.rb @@ -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 = [] diff --git a/app/views/admin/requests_profiles/index.html.haml b/app/views/admin/requests_profiles/index.html.haml deleted file mode 100644 index 9d42a2bfa93..00000000000 --- a/app/views/admin/requests_profiles/index.html.haml +++ /dev/null @@ -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') diff --git a/app/views/layouts/nav/sidebar/_admin.html.haml b/app/views/layouts/nav/sidebar/_admin.html.haml index 94c708783e4..02565a8f573 100644 --- a/app/views/layouts/nav/sidebar/_admin.html.haml +++ b/app/views/layouts/nav/sidebar/_admin.html.haml @@ -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 diff --git a/app/workers/all_queues.yml b/app/workers/all_queues.yml index a2d54570a01..c436335a244 100644 --- a/app/workers/all_queues.yml +++ b/app/workers/all_queues.yml @@ -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 diff --git a/app/workers/container_registry/migration/enqueuer_worker.rb b/app/workers/container_registry/migration/enqueuer_worker.rb index 8705deb0cb2..78dab929ed5 100644 --- a/app/workers/container_registry/migration/enqueuer_worker.rb +++ b/app/workers/container_registry/migration/enqueuer_worker.rb @@ -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) diff --git a/app/workers/requests_profiles_worker.rb b/app/workers/requests_profiles_worker.rb deleted file mode 100644 index e02b63fb621..00000000000 --- a/app/workers/requests_profiles_worker.rb +++ /dev/null @@ -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 diff --git a/config/feature_flags/development/lfk_fair_queueing.yml b/config/feature_flags/development/lfk_fair_queueing.yml deleted file mode 100644 index 6dc6cb72e56..00000000000 --- a/config/feature_flags/development/lfk_fair_queueing.yml +++ /dev/null @@ -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 diff --git a/config/feature_flags/development/vsa_reaggregation_worker.yml b/config/feature_flags/development/vsa_reaggregation_worker.yml index d5218d6e7e3..a3cc83722a3 100644 --- a/config/feature_flags/development/vsa_reaggregation_worker.yml +++ b/config/feature_flags/development/vsa_reaggregation_worker.yml @@ -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 diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index c0dc18c60c9..430b2548866 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -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' diff --git a/config/initializers/request_profiler.rb b/config/initializers/request_profiler.rb index c368568ec51..7b588ded1ea 100644 --- a/config/initializers/request_profiler.rb +++ b/config/initializers/request_profiler.rb @@ -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 diff --git a/config/routes/admin.rb b/config/routes/admin.rb index a81b6173e28..2bc050dfa67 100644 --- a/config/routes/admin.rb +++ b/config/routes/admin.rb @@ -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] diff --git a/data/deprecations/14-6-runner-api-status-renames-not_connected.yml b/data/deprecations/14-6-runner-api-status-renames-not_connected.yml deleted file mode 100644 index a2aba7cadbe..00000000000 --- a/data/deprecations/14-6-runner-api-status-renames-not_connected.yml +++ /dev/null @@ -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" diff --git a/data/deprecations/14-8-runner-api-active-field-replaced-with-paused-breaking-change.yml b/data/deprecations/14-8-runner-api-active-field-replaced-with-paused-breaking-change.yml index 0300641e540..99af852c13e 100644 --- a/data/deprecations/14-8-runner-api-active-field-replaced-with-paused-breaking-change.yml +++ b/data/deprecations/14-8-runner-api-active-field-replaced-with-paused-breaking-change.yml @@ -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 diff --git a/data/deprecations/14-8-runner-api-status-filter-does-accept-active-or-paused.yml b/data/deprecations/14-8-runner-api-status-filter-does-accept-active-or-paused.yml index 8f706840f0d..174e51f5f5d 100644 --- a/data/deprecations/14-8-runner-api-status-filter-does-accept-active-or-paused.yml +++ b/data/deprecations/14-8-runner-api-status-filter-does-accept-active-or-paused.yml @@ -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 diff --git a/data/deprecations/15-0-runner-status-legacy-mode.yml b/data/deprecations/15-0-runner-status-legacy-mode.yml new file mode 100644 index 00000000000..ee7ac1af820 --- /dev/null +++ b/data/deprecations/15-0-runner-status-legacy-mode.yml @@ -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 diff --git a/data/removals/15_0/15-0-remove-dependency-proxy-feature-flag.yml b/data/removals/15_0/15-0-remove-dependency-proxy-feature-flag.yml new file mode 100644 index 00000000000..1d43573bb22 --- /dev/null +++ b/data/removals/15_0/15-0-remove-dependency-proxy-feature-flag.yml @@ -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 diff --git a/data/removals/15_0/15-0-remove-versions-packagetype.yml b/data/removals/15_0/15-0-remove-versions-packagetype.yml new file mode 100644 index 00000000000..cfce5d8a226 --- /dev/null +++ b/data/removals/15_0/15-0-remove-versions-packagetype.yml @@ -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 diff --git a/doc/administration/geo/replication/datatypes.md b/doc/administration/geo/replication/datatypes.md index 5beb2479c57..83e207e7a8f 100644 --- a/doc/administration/geo/replication/datatypes.md +++ b/doc/administration/geo/replication/datatypes.md @@ -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 | | diff --git a/doc/api/graphql/reference/index.md b/doc/api/graphql/reference/index.md index abb2a6195e9..58278b6e0ca 100644 --- a/doc/api/graphql/reference/index.md +++ b/doc/api/graphql/reference/index.md @@ -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` diff --git a/doc/api/repository_files.md b/doc/api/repository_files.md index 1fdc48a6d92..8097fecea87 100644 --- a/doc/api/repository_files.md +++ b/doc/api/repository_files.md @@ -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 diff --git a/doc/development/pipelines.md b/doc/development/pipelines.md index e0b236bc5fc..2fe295bfedb 100644 --- a/doc/development/pipelines.md +++ b/doc/development/pipelines.md @@ -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 diff --git a/doc/subscriptions/gitlab_dedicated/index.md b/doc/subscriptions/gitlab_dedicated/index.md new file mode 100644 index 00000000000..b970dc04a01 --- /dev/null +++ b/doc/subscriptions/gitlab_dedicated/index.md @@ -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 --> diff --git a/doc/topics/git/feature_branching.md b/doc/topics/git/feature_branching.md index f0ded5511ee..d3b2510f4e8 100644 --- a/doc/topics/git/feature_branching.md +++ b/doc/topics/git/feature_branching.md @@ -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 diff --git a/doc/topics/git/git_rebase.md b/doc/topics/git/git_rebase.md index c0bc7ed4e5c..87fce0b29ff 100644 --- a/doc/topics/git/git_rebase.md +++ b/doc/topics/git/git_rebase.md @@ -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 diff --git a/doc/topics/git/lfs/index.md b/doc/topics/git/lfs/index.md index db63cee3523..410d2150de5 100644 --- a/doc/topics/git/lfs/index.md +++ b/doc/topics/git/lfs/index.md @@ -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: diff --git a/doc/topics/git/merge_conflicts.md b/doc/topics/git/merge_conflicts.md index 47276ccb0b2..03b7c03c02a 100644 --- a/doc/topics/git/merge_conflicts.md +++ b/doc/topics/git/merge_conflicts.md @@ -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> diff --git a/doc/topics/git/partial_clone.md b/doc/topics/git/partial_clone.md index cad29d30af4..91ff4d69c2f 100644 --- a/doc/topics/git/partial_clone.md +++ b/doc/topics/git/partial_clone.md @@ -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 diff --git a/doc/topics/git/stash.md b/doc/topics/git/stash.md index d321795e034..638ab559bd3 100644 --- a/doc/topics/git/stash.md +++ b/doc/topics/git/stash.md @@ -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 diff --git a/doc/topics/git/tags.md b/doc/topics/git/tags.md index 8576bcd09ed..d3237fda968 100644 --- a/doc/topics/git/tags.md +++ b/doc/topics/git/tags.md @@ -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. diff --git a/doc/topics/git/terminology.md b/doc/topics/git/terminology.md index 35814543934..4ce87aa2d11 100644 --- a/doc/topics/git/terminology.md +++ b/doc/topics/git/terminology.md @@ -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). diff --git a/doc/topics/git/useful_git_commands.md b/doc/topics/git/useful_git_commands.md index 61f170d934a..13a40dd58ca 100644 --- a/doc/topics/git/useful_git_commands.md +++ b/doc/topics/git/useful_git_commands.md @@ -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>` diff --git a/doc/update/deprecations.md b/doc/update/deprecations.md index c850bf0877b..0cee33cca97 100644 --- a/doc/update/deprecations.md +++ b/doc/update/deprecations.md @@ -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: diff --git a/doc/update/removals.md b/doc/update/removals.md index 8250d84247e..98d4718049f 100644 --- a/doc/update/removals.md +++ b/doc/update/removals.md @@ -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: diff --git a/lib/api/admin/instance_clusters.rb b/lib/api/admin/instance_clusters.rb index e453020daf3..eb43ed1d37a 100644 --- a/lib/api/admin/instance_clusters.rb +++ b/lib/api/admin/instance_clusters.rb @@ -6,6 +6,7 @@ module API include PaginationParams feature_category :kubernetes_management + urgency :low before do authenticated_as_admin! diff --git a/lib/api/ci/jobs.rb b/lib/api/ci/jobs.rb index 86897eb61ae..04999b5fb44 100644 --- a/lib/api/ci/jobs.rb +++ b/lib/api/ci/jobs.rb @@ -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 diff --git a/lib/api/clusters/agents.rb b/lib/api/clusters/agents.rb index 6c1bf21b952..0fa556d2da9 100644 --- a/lib/api/clusters/agents.rb +++ b/lib/api/clusters/agents.rb @@ -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' diff --git a/lib/api/files.rb b/lib/api/files.rb index 41a8e899614..fd574ca865b 100644 --- a/lib/api/files.rb +++ b/lib/api/files.rb @@ -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 diff --git a/lib/api/group_clusters.rb b/lib/api/group_clusters.rb index a5a60ce8741..b95d17494db 100644 --- a/lib/api/group_clusters.rb +++ b/lib/api/group_clusters.rb @@ -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' diff --git a/lib/api/internal/kubernetes.rb b/lib/api/internal/kubernetes.rb index 59bc917a602..50573dbd3ba 100644 --- a/lib/api/internal/kubernetes.rb +++ b/lib/api/internal/kubernetes.rb @@ -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 diff --git a/lib/api/project_clusters.rb b/lib/api/project_clusters.rb index acac694a2f5..00ac255c365 100644 --- a/lib/api/project_clusters.rb +++ b/lib/api/project_clusters.rb @@ -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' diff --git a/lib/api/terraform/modules/v1/packages.rb b/lib/api/terraform/modules/v1/packages.rb index 797b4aad033..8da77ba18ae 100644 --- a/lib/api/terraform/modules/v1/packages.rb +++ b/lib/api/terraform/modules/v1/packages.rb @@ -22,6 +22,7 @@ module API }.freeze feature_category :infrastructure_as_code + urgency :low after_validation do require_packages_enabled! diff --git a/lib/api/terraform/state.rb b/lib/api/terraform/state.rb index 29e71611092..7b111451b9f 100644 --- a/lib/api/terraform/state.rb +++ b/lib/api/terraform/state.rb @@ -8,6 +8,7 @@ module API include ::Gitlab::Utils::StrongMemoize feature_category :infrastructure_as_code + urgency :low default_format :json diff --git a/lib/api/terraform/state_version.rb b/lib/api/terraform/state_version.rb index d3680323b9f..ca37c786666 100644 --- a/lib/api/terraform/state_version.rb +++ b/lib/api/terraform/state_version.rb @@ -6,6 +6,7 @@ module API default_format :json feature_category :infrastructure_as_code + urgency :low before do authenticate! diff --git a/lib/gitlab/backtrace_cleaner.rb b/lib/gitlab/backtrace_cleaner.rb index caea05c720d..d2ca2057eb6 100644 --- a/lib/gitlab/backtrace_cleaner.rb +++ b/lib/gitlab/backtrace_cleaner.rb @@ -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/ diff --git a/lib/gitlab/profiler.rb b/lib/gitlab/profiler.rb index 3a5f1a1d480..d15b57eb888 100644 --- a/lib/gitlab/profiler.rb +++ b/lib/gitlab/profiler.rb @@ -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 diff --git a/lib/gitlab/request_profiler.rb b/lib/gitlab/request_profiler.rb deleted file mode 100644 index 541d505e735..00000000000 --- a/lib/gitlab/request_profiler.rb +++ /dev/null @@ -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 diff --git a/lib/gitlab/request_profiler/middleware.rb b/lib/gitlab/request_profiler/middleware.rb deleted file mode 100644 index acdf8d4541f..00000000000 --- a/lib/gitlab/request_profiler/middleware.rb +++ /dev/null @@ -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 diff --git a/lib/gitlab/request_profiler/profile.rb b/lib/gitlab/request_profiler/profile.rb deleted file mode 100644 index 76c675658b1..00000000000 --- a/lib/gitlab/request_profiler/profile.rb +++ /dev/null @@ -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 diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 941ff5ab6c2..b9a73775f01 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -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 "" diff --git a/qa/qa/specs/features/api/1_manage/import_github_repo_spec.rb b/qa/qa/specs/features/api/1_manage/import_github_repo_spec.rb index 705bc20202e..79bba484bea 100644 --- a/qa/qa/specs/features/api/1_manage/import_github_repo_spec.rb +++ b/qa/qa/specs/features/api/1_manage/import_github_repo_spec.rb @@ -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 } } diff --git a/qa/qa/specs/features/browser_ui/1_manage/project/import_github_repo_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/project/import_github_repo_spec.rb index 4621c540eb3..3bf5a11b074 100644 --- a/qa/qa/specs/features/browser_ui/1_manage/project/import_github_repo_spec.rb +++ b/qa/qa/specs/features/browser_ui/1_manage/project/import_github_repo_spec.rb @@ -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 } diff --git a/spec/controllers/admin/requests_profiles_controller_spec.rb b/spec/controllers/admin/requests_profiles_controller_spec.rb deleted file mode 100644 index 7ee46b5b28a..00000000000 --- a/spec/controllers/admin/requests_profiles_controller_spec.rb +++ /dev/null @@ -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 diff --git a/spec/features/admin/admin_requests_profiles_spec.rb b/spec/features/admin/admin_requests_profiles_spec.rb deleted file mode 100644 index e92528d431d..00000000000 --- a/spec/features/admin/admin_requests_profiles_spec.rb +++ /dev/null @@ -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 diff --git a/spec/lib/gitlab/backtrace_cleaner_spec.rb b/spec/lib/gitlab/backtrace_cleaner_spec.rb index e46a90e8606..cdde5a02d3b 100644 --- a/spec/lib/gitlab/backtrace_cleaner_spec.rb +++ b/spec/lib/gitlab/backtrace_cleaner_spec.rb @@ -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'" ] diff --git a/spec/lib/gitlab/request_profiler/profile_spec.rb b/spec/lib/gitlab/request_profiler/profile_spec.rb deleted file mode 100644 index 30e23a99b22..00000000000 --- a/spec/lib/gitlab/request_profiler/profile_spec.rb +++ /dev/null @@ -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 diff --git a/spec/lib/gitlab/request_profiler_spec.rb b/spec/lib/gitlab/request_profiler_spec.rb deleted file mode 100644 index 4d3b361efcb..00000000000 --- a/spec/lib/gitlab/request_profiler_spec.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe Gitlab::RequestProfiler do - describe '.profile_token' do - it 'returns a token' do - expect(described_class.profile_token).to be_present - end - - it 'caches the token' do - expect(Rails.cache).to receive(:fetch).with('profile-token') - - described_class.profile_token - end - end - - context 'with temporary PROFILES_DIR' do - let(:tmpdir) { Dir.mktmpdir('profiler-test') } - let(:profile_name) { '|api|v4|version.txt_1562854738_memory.html' } - let(:profile_path) { File.join(tmpdir, profile_name) } - - before do - stub_const('Gitlab::RequestProfiler::PROFILES_DIR', tmpdir) - FileUtils.touch(profile_path) - end - - after do - FileUtils.rm_rf(tmpdir) - end - - describe '.remove_all_profiles' do - it 'removes Gitlab::RequestProfiler::PROFILES_DIR directory' do - described_class.remove_all_profiles - - expect(Dir.exist?(tmpdir)).to be false - end - end - - describe '.all' do - subject { described_class.all } - - it 'returns all profiles' do - expect(subject.map(&:name)).to contain_exactly(profile_name) - end - end - - describe '.find' do - subject { described_class.find(profile_name) } - - it 'returns all profiles' do - expect(subject.name).to eq(profile_name) - end - end - end -end diff --git a/spec/requests/api/files_spec.rb b/spec/requests/api/files_spec.rb index cb0b5f6bfc3..06d22e7e218 100644 --- a/spec/requests/api/files_spec.rb +++ b/spec/requests/api/files_spec.rb @@ -462,6 +462,66 @@ RSpec.describe API::Files do expect(range['commit']['committer_email']).to eq('dmitriy.zaporozhets@gmail.com') end + context 'with a range parameter' do + let(:params) { super().merge(range: { start: 2, end: 4 }) } + + it 'returns file blame attributes as json for the range' do + get api(route(file_path) + '/blame', current_user), params: params + + expect(response).to have_gitlab_http_status(:ok) + expect(json_response.size).to eq(2) + + lines = json_response.map { |x| x['lines'] } + + expect(lines.map(&:size)).to eq(expected_blame_range_sizes[1..2]) + expect(lines.flatten).to eq(["require 'open3'", '', 'module Popen']) + end + + context 'when start > end' do + let(:params) { super().merge(range: { start: 4, end: 2 }) } + + it 'returns 400 error' do + get api(route(file_path) + '/blame', current_user), params: params + + expect(response).to have_gitlab_http_status(:bad_request) + expect(json_response['message']).to eq('range[start] must be less than or equal to range[end]') + end + end + + context 'when range is incomplete' do + let(:params) { super().merge(range: { start: 1 }) } + + it 'returns 400 error' do + get api(route(file_path) + '/blame', current_user), params: params + + expect(response).to have_gitlab_http_status(:bad_request) + expect(json_response['error']).to eq('range[end] is missing, range[end] is empty') + end + end + + context 'when range contains negative integers' do + let(:params) { super().merge(range: { start: -2, end: -5 }) } + + it 'returns 400 error' do + get api(route(file_path) + '/blame', current_user), params: params + + expect(response).to have_gitlab_http_status(:bad_request) + expect(json_response['error']).to eq('range[start] does not have a valid value, range[end] does not have a valid value') + end + end + + context 'when range is missing' do + let(:params) { super().merge(range: { start: '', end: '' }) } + + it 'returns 400 error' do + get api(route(file_path) + '/blame', current_user), params: params + + expect(response).to have_gitlab_http_status(:bad_request) + expect(json_response['error']).to eq('range[start] is empty, range[end] is empty') + end + end + end + it 'returns blame file info for files with dots' do url = route('.gitignore') + '/blame' diff --git a/spec/requests/request_profiler_spec.rb b/spec/requests/request_profiler_spec.rb deleted file mode 100644 index 72689595480..00000000000 --- a/spec/requests/request_profiler_spec.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe 'Request Profiler' do - let(:user) { create(:user) } - - shared_examples 'profiling a request' do |profile_type, extension| - before do - allow(Rails).to receive(:cache).and_return(ActiveSupport::Cache::MemoryStore.new) - allow(RubyProf::Profile).to receive(:profile) do |&blk| - blk.call - RubyProf::Profile.new - end - allow(MemoryProfiler).to receive(:report) do |&blk| - blk.call - MemoryProfiler.start - MemoryProfiler.stop - end - end - - it 'creates a profile of the request' do - project = create(:project, namespace: user.namespace) - time = Time.now - path = "/#{project.full_path}" - - travel_to(time) do - get path, params: {}, headers: { 'X-Profile-Token' => Gitlab::RequestProfiler.profile_token, 'X-Profile-Mode' => profile_type } - end - - profile_type = 'execution' if profile_type.nil? - profile_path = "#{Gitlab.config.shared.path}/tmp/requests_profiles/#{path.tr('/', '|')}_#{time.to_i}_#{profile_type}.#{extension}" - expect(File.exist?(profile_path)).to be true - end - - after do - Gitlab::RequestProfiler.remove_all_profiles - end - end - - context "when user is logged-in" do - before do - login_as(user) - end - - include_examples 'profiling a request', 'execution', 'html' - include_examples 'profiling a request', nil, 'html' - include_examples 'profiling a request', 'memory', 'txt' - end - - context "when user is not logged-in" do - include_examples 'profiling a request', 'execution', 'html' - include_examples 'profiling a request', nil, 'html' - include_examples 'profiling a request', 'memory', 'txt' - end -end diff --git a/spec/services/loose_foreign_keys/batch_cleaner_service_spec.rb b/spec/services/loose_foreign_keys/batch_cleaner_service_spec.rb index 538d9638879..735f090d926 100644 --- a/spec/services/loose_foreign_keys/batch_cleaner_service_spec.rb +++ b/spec/services/loose_foreign_keys/batch_cleaner_service_spec.rb @@ -181,16 +181,6 @@ RSpec.describe LooseForeignKeys::BatchCleanerService do end end end - - context 'when the lfk_fair_queueing FF is off' do - before do - stub_feature_flags(lfk_fair_queueing: false) - end - - it 'does nothing' do - expect { cleaner.execute }.not_to change { deleted_record.reload.cleanup_attempts } - end - end end end end diff --git a/spec/support/shared_examples/requests/api/container_repositories_shared_examples.rb b/spec/support/shared_examples/requests/api/container_repositories_shared_examples.rb index de3c5c8e052..3a28f99a1b2 100644 --- a/spec/support/shared_examples/requests/api/container_repositories_shared_examples.rb +++ b/spec/support/shared_examples/requests/api/container_repositories_shared_examples.rb @@ -169,10 +169,12 @@ RSpec.shared_examples 'reconciling migration_state' do end end - context 'import_failed response' do - let(:status) { 'import_failed' } + %w[import_canceled import_failed].each do |status| + context "#{status} response" do + let(:status) { status } - it_behaves_like 'retrying the import' + it_behaves_like 'retrying the import' + end end context 'pre_import_in_progress response' do @@ -192,23 +194,11 @@ RSpec.shared_examples 'reconciling migration_state' do end end - context 'pre_import_failed response' do - let(:status) { 'pre_import_failed' } - - it_behaves_like 'retrying the pre_import' - end - - %w[pre_import_canceled import_canceled].each do |canceled_status| - context "#{canceled_status} response" do - let(:status) { canceled_status } - - it_behaves_like 'enforcing states coherence to', 'import_skipped' do - it 'skips with migration_canceled_by_registry' do - subject + %w[pre_import_canceled pre_import_failed].each do |status| + context "#{status} response" do + let(:status) { status } - expect(repository.reload.migration_skipped_reason).to eq('migration_canceled_by_registry') - end - end + it_behaves_like 'retrying the pre_import' end end end diff --git a/spec/workers/container_registry/migration/enqueuer_worker_spec.rb b/spec/workers/container_registry/migration/enqueuer_worker_spec.rb index a8f13958681..dbac36e50d5 100644 --- a/spec/workers/container_registry/migration/enqueuer_worker_spec.rb +++ b/spec/workers/container_registry/migration/enqueuer_worker_spec.rb @@ -65,19 +65,23 @@ RSpec.describe ContainerRegistry::Migration::EnqueuerWorker, :aggregate_failures end end - it 'starts the pre-import for the next qualified repository' do - expect_log_extra_metadata( - import_type: 'next', - container_repository_id: container_repository.id, - container_repository_path: container_repository.path, - container_repository_migration_state: 'pre_importing' - ) + shared_examples 'starting the next import' do + it 'starts the pre-import for the next qualified repository' do + expect_log_extra_metadata( + import_type: 'next', + container_repository_id: container_repository.id, + container_repository_path: container_repository.path, + container_repository_migration_state: 'pre_importing' + ) - subject + subject - expect(container_repository.reload).to be_pre_importing + expect(container_repository.reload).to be_pre_importing + end end + it_behaves_like 'starting the next import' + context 'when the new pre-import maxes out the capacity' do before do # set capacity to 10 @@ -97,6 +101,18 @@ RSpec.describe ContainerRegistry::Migration::EnqueuerWorker, :aggregate_failures end it_behaves_like 're-enqueuing based on capacity' + + context 'max tag count is 0' do + before do + stub_application_setting(container_registry_import_max_tags_count: 0) + # Add 8 tags to the next repository + stub_container_registry_tags( + repository: container_repository.path, tags: %w(a b c d e f g h), with_manifest: true + ) + end + + it_behaves_like 'starting the next import' + end end context 'migrations are disabled' do @@ -311,4 +327,11 @@ RSpec.describe ContainerRegistry::Migration::EnqueuerWorker, :aggregate_failures end end end + + describe 'worker attributes' do + it 'has deduplication set' do + expect(described_class.get_deduplicate_strategy).to eq(:until_executing) + expect(described_class.get_deduplication_options).to include(ttl: 30.minutes) + end + end end |