Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2025-06-23 12:07:46 +00:00
parent a53577eedf
commit 3a77f46d09
73 changed files with 352 additions and 245 deletions

View File

@ -2448,7 +2448,6 @@ Layout/LineLength:
- 'spec/controllers/registrations_controller_spec.rb'
- 'spec/controllers/repositories/git_http_controller_spec.rb'
- 'spec/controllers/repositories/lfs_storage_controller_spec.rb'
- 'spec/controllers/search_controller_spec.rb'
- 'spec/controllers/sessions_controller_spec.rb'
- 'spec/controllers/uploads_controller_spec.rb'
- 'spec/db/schema_spec.rb'

View File

@ -41,27 +41,3 @@ RSpec/ChangeByZero:
- 'spec/lib/gitlab/seeders/project_environment_seeder_spec.rb'
- 'spec/migrations/db/migrate/20240806100120_remove_records_without_project_from_project_saved_replies_table_spec.rb'
- 'spec/models/integrations/slack_workspace/api_scope_spec.rb'
- 'spec/services/ci/create_downstream_pipeline_service_spec.rb'
- 'spec/services/ci/delete_objects_service_spec.rb'
- 'spec/services/ci/job_artifacts/destroy_all_expired_service_spec.rb'
- 'spec/services/ci/job_artifacts/destroy_batch_service_spec.rb'
- 'spec/services/import/gitlab_projects/create_project_service_spec.rb'
- 'spec/services/incident_management/timeline_events/update_service_spec.rb'
- 'spec/services/merge_requests/create_from_issue_service_spec.rb'
- 'spec/services/merge_requests/refresh_service_spec.rb'
- 'spec/services/packages/composer/create_package_service_spec.rb'
- 'spec/services/packages/npm/create_metadata_cache_service_spec.rb'
- 'spec/services/packages/nuget/sync_metadatum_service_spec.rb'
- 'spec/services/packages/nuget/update_package_from_metadata_service_spec.rb'
- 'spec/services/packages/protection/create_rule_service_spec.rb'
- 'spec/services/packages/pypi/create_package_service_spec.rb'
- 'spec/services/projects/transfer_service_spec.rb'
- 'spec/services/projects/update_pages_service_spec.rb'
- 'spec/services/routes/rename_descendants_service_spec.rb'
- 'spec/support/shared_examples/controllers/todos_shared_examples.rb'
- 'spec/support/shared_examples/graphql/mutations/timelogs/create_shared_examples.rb'
- 'spec/support/shared_examples/models/relative_positioning_shared_examples.rb'
- 'spec/support/shared_examples/requests/api/pypi_packages_shared_examples.rb'
- 'spec/support/shared_examples/services/clusters/create_service_shared_examples.rb'
- 'spec/support/shared_examples/services/schedule_bulk_repository_shard_moves_shared_examples.rb'
- 'spec/support/shared_examples/services/wiki_pages/update_service_shared_examples.rb'

View File

@ -904,7 +904,6 @@ RSpec/ContextWording:
- 'spec/controllers/projects/web_ide_terminals_controller_spec.rb'
- 'spec/controllers/projects_controller_spec.rb'
- 'spec/controllers/root_controller_spec.rb'
- 'spec/controllers/search_controller_spec.rb'
- 'spec/controllers/sessions_controller_spec.rb'
- 'spec/controllers/snippets/notes_controller_spec.rb'
- 'spec/controllers/snippets_controller_spec.rb'

View File

@ -228,7 +228,6 @@ RSpec/ExampleWithoutDescription:
- 'spec/controllers/projects/releases/evidences_controller_spec.rb'
- 'spec/controllers/projects/releases_controller_spec.rb'
- 'spec/controllers/projects/templates_controller_spec.rb'
- 'spec/controllers/search_controller_spec.rb'
- 'spec/features/admin/users/admin_sees_user_spec.rb'
- 'spec/features/admin/users/users_spec.rb'
- 'spec/features/commits_spec.rb'

View File

@ -87,7 +87,6 @@ RSpec/ExpectInHook:
- 'spec/controllers/projects/settings/ci_cd_controller_spec.rb'
- 'spec/controllers/projects/settings/operations_controller_spec.rb'
- 'spec/controllers/projects_controller_spec.rb'
- 'spec/controllers/search_controller_spec.rb'
- 'spec/controllers/snippets/notes_controller_spec.rb'
- 'spec/features/admin/admin_mode/login_spec.rb'
- 'spec/features/admin/admin_projects_spec.rb'

View File

@ -1195,7 +1195,6 @@ RSpec/NamedSubject:
- 'spec/controllers/registrations_controller_spec.rb'
- 'spec/controllers/repositories/lfs_storage_controller_spec.rb'
- 'spec/controllers/root_controller_spec.rb'
- 'spec/controllers/search_controller_spec.rb'
- 'spec/controllers/sessions_controller_spec.rb'
- 'spec/controllers/snippets/blobs_controller_spec.rb'
- 'spec/controllers/snippets/notes_controller_spec.rb'

View File

@ -110,7 +110,6 @@ Style/StringConcatenation:
- 'spec/controllers/projects/labels_controller_spec.rb'
- 'spec/controllers/projects/uploads_controller_spec.rb'
- 'spec/controllers/projects_controller_spec.rb'
- 'spec/controllers/search_controller_spec.rb'
- 'spec/experiments/application_experiment_spec.rb'
- 'spec/factories/ci/daily_build_group_report_results.rb'
- 'spec/factories/gitaly/commit.rb'

View File

@ -96,7 +96,7 @@ export default {
<gl-button
v-if="pipeline.flags.retryable"
v-gl-tooltip.hover
v-gl-tooltip
:aria-label="$options.BUTTON_TOOLTIP_RETRY"
:title="$options.BUTTON_TOOLTIP_RETRY"
:disabled="isRetrying"
@ -111,7 +111,7 @@ export default {
<gl-button
v-if="pipeline.flags.cancelable"
v-gl-tooltip.hover
v-gl-tooltip
:aria-label="$options.BUTTON_TOOLTIP_CANCEL"
:title="$options.BUTTON_TOOLTIP_CANCEL"
:loading="isCanceling"

View File

@ -178,7 +178,7 @@ export const INCIDENTS_I18N = {
fetchError: s__(
'IncidentManagement|An error occurred while fetching the incident status. Please reload the page.',
),
title: s__('IncidentManagement|Status'),
title: s__('IncidentManagement|Paging status'),
updateError: s__(
'IncidentManagement|An error occurred while updating the incident status. Please reload the page and try again.',
),

View File

@ -52,7 +52,7 @@ module Types
fallback_value: nil
field :new_comment_template,
GraphQL::Types::String,
[Types::Namespaces::LinkPaths::CommentTemplateType],
null: true,
description: 'Namespace new_comment_template_paths.',
fallback_value: nil

View File

@ -0,0 +1,21 @@
# frozen_string_literal: true
module Types
module Namespaces
module LinkPaths
class CommentTemplateType < BaseObject # rubocop:disable Graphql/AuthorizeTypes -- parent is already authorized
graphql_name 'CommentTemplatePath'
field :href,
GraphQL::Types::String,
null: false,
description: 'Path of the comment template.'
field :text,
GraphQL::Types::String,
null: false,
description: 'Text used on the template path.'
end
end
end
end

View File

@ -26,7 +26,7 @@ module Types
end
def new_comment_template
url_helpers.new_comment_template_paths(group)&.dig(0, :href)
url_helpers.new_comment_template_paths(group)
end
end
end

View File

@ -20,7 +20,7 @@ module Types
end
def new_comment_template
url_helpers.new_comment_template_paths(group, project)&.dig(0, :href)
url_helpers.new_comment_template_paths(group, project)
end
def contribution_guide_path

View File

@ -2740,6 +2740,7 @@ class Project < ApplicationRecord
.append(key: 'CI_PROJECT_REPOSITORY_LANGUAGES', value: repository_languages.map(&:name).join(',').downcase)
.append(key: 'CI_PROJECT_CLASSIFICATION_LABEL', value: external_authorization_classification_label)
.append(key: 'CI_DEFAULT_BRANCH', value: default_branch)
.append(key: 'CI_DEFAULT_BRANCH_SLUG', value: Gitlab::Utils.slugify(default_branch.to_s))
.append(key: 'CI_CONFIG_PATH', value: ci_config_path_or_default)
end
end

View File

@ -9,7 +9,7 @@
= header_message
= render 'peek/bar'
= render 'layouts/published_experiments'
= render "layouts/header/empty" unless @hide_empty_navbar
= render "layouts/header/empty" unless content_for(:hide_empty_navbar).present?
.layout-page.gl-h-full.borderless.gl-flex.gl-flex-wrap
.content-wrapper.gl-pt-6{ class: 'md:!gl-pt-11' }
%div{ class: container_class }

View File

@ -1103,5 +1103,9 @@
- 1
- - work_items_validate_epic_work_item_sync
- 1
- - work_items_weights_update_rolled_up_weights_event_handler
- 1
- - work_items_weights_update_weights
- 1
- - x509_certificate_revoke
- 1

View File

@ -3,6 +3,6 @@ migration_job_name: BackfillArchivedAndTraversalIdsToVulnerabilityStatistics
description: Backfill project.archived and project.namespace.traversal_ids values to the denormalized columns of the same name on vulnerability_statistics
feature_category: vulnerability_management
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/177993
milestone: '17.11'
queued_migration_version: 20250404035239
milestone: '18.2'
queued_migration_version: 20250620051921
finalized_by: 20250422130050

View File

@ -5,4 +5,4 @@ feature_category: package_registry
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/183806
milestone: '17.10'
queued_migration_version: 20250307100241
finalized_by: # version of the migration that finalized this BBM
finalized_by: '20250617193751'

View File

@ -5,4 +5,4 @@ feature_category: security_policy_management
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/181736
milestone: '17.10'
queued_migration_version: 20250214214518
finalized_by: # version of the migration that finalized this BBM
finalized_by: 20250616151232

View File

@ -5,4 +5,4 @@ feature_category: wiki
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/183332
milestone: '17.10'
queued_migration_version: 20250304103246
finalized_by: # version of the migration that finalized this BBM
finalized_by: '20250619174731'

View File

@ -0,0 +1,21 @@
# frozen_string_literal: true
class FinalizeBackfillSoftwareLicensePolicies < Gitlab::Database::Migration[2.3]
milestone '18.2'
disable_ddl_transaction!
restrict_gitlab_migration gitlab_schema: :gitlab_main_cell
def up
ensure_batched_background_migration_is_finished(
job_class_name: 'BackfillSoftwareLicensePolicies',
table_name: :software_license_policies,
column_name: :id,
job_arguments: [],
finalize: true
)
end
def down
# no-op
end
end

View File

@ -0,0 +1,20 @@
# frozen_string_literal: true
class FinalizeBackfillPackagesDebianProjectComponentFilesProjectId < Gitlab::Database::Migration[2.3]
milestone '18.2'
disable_ddl_transaction!
restrict_gitlab_migration gitlab_schema: :gitlab_main_cell
def up
ensure_batched_background_migration_is_finished(
job_class_name: 'BackfillPackagesDebianProjectComponentFilesProjectId',
table_name: :packages_debian_project_component_files,
column_name: :id,
job_arguments: [:project_id, :packages_debian_project_components, :project_id, :component_id],
finalize: true
)
end
def down; end
end

View File

@ -0,0 +1,20 @@
# frozen_string_literal: true
class FinalizeBackfillWikiPageSlugsNamespaceId < Gitlab::Database::Migration[2.3]
milestone '18.2'
disable_ddl_transaction!
restrict_gitlab_migration gitlab_schema: :gitlab_main_cell
def up
ensure_batched_background_migration_is_finished(
job_class_name: 'BackfillWikiPageSlugsNamespaceId',
table_name: :wiki_page_slugs,
column_name: :id,
job_arguments: [:namespace_id, :wiki_page_meta, :namespace_id, :wiki_page_meta_id],
finalize: true
)
end
def down; end
end

View File

@ -0,0 +1,28 @@
# frozen_string_literal: true
class RequeueBackfillArchivedAndTraversalIdsToVulnerabilityStatisticsAgain < Gitlab::Database::Migration[2.3]
milestone '18.2'
restrict_gitlab_migration gitlab_schema: :gitlab_sec
MIGRATION = "BackfillArchivedAndTraversalIdsToVulnerabilityStatistics"
DELAY_INTERVAL = 2.minutes
BATCH_SIZE = 1000
SUB_BATCH_SIZE = 100
def up
delete_batched_background_migration(MIGRATION, :vulnerability_statistics, :id, [])
queue_batched_background_migration(
MIGRATION,
:vulnerability_statistics,
:id,
job_interval: DELAY_INTERVAL,
batch_size: BATCH_SIZE,
sub_batch_size: SUB_BATCH_SIZE
)
end
def down
delete_batched_background_migration(MIGRATION, :vulnerability_statistics, :id, [])
end
end

View File

@ -0,0 +1 @@
748c255b95bb64621a55013b9f490ce4a2fce1def258bc5348f5736db2be5bf8

View File

@ -0,0 +1 @@
4a16e2cbfff5a8fedcf46d6cf7d02abad709d497db671767df7c764888bcfeca

View File

@ -0,0 +1 @@
f8c910d41bc9359f16d257404906f91380b8225be6363747a8b970a96734b988

View File

@ -0,0 +1 @@
23dd926e75d6bb123aa65918825066acc466c604122d55b38a7d1fc04870a587

View File

@ -24325,6 +24325,15 @@ Represents a summary of the compared codequality report.
| <a id="codequalityreportscomparerreportsummaryresolved"></a>`resolved` | [`Int`](#int) | Count of resolved code quality degradations. |
| <a id="codequalityreportscomparerreportsummarytotal"></a>`total` | [`Int`](#int) | Total count of code quality degradations. |
### `CommentTemplatePath`
#### Fields
| Name | Type | Description |
| ---- | ---- | ----------- |
| <a id="commenttemplatepathhref"></a>`href` | [`String!`](#string) | Path of the comment template. |
| <a id="commenttemplatepathtext"></a>`text` | [`String!`](#string) | Text used on the template path. |
### `CommentTemplatePathType`
#### Fields
@ -24585,6 +24594,7 @@ Represents a ComplianceRequirement associated with a ComplianceFramework.
| ---- | ---- | ----------- |
| <a id="compliancerequirementcompliancerequirementscontrols"></a>`complianceRequirementsControls` | [`ComplianceRequirementsControlConnection`](#compliancerequirementscontrolconnection) | Compliance controls of the compliance requirement. (see [Connections](#connections)) |
| <a id="compliancerequirementdescription"></a>`description` | [`String!`](#string) | Description of the compliance requirement. |
| <a id="compliancerequirementframework"></a>`framework` | [`ComplianceFramework`](#complianceframework) | Compliance framework associated with the requirement. |
| <a id="compliancerequirementid"></a>`id` | [`ID!`](#id) | Compliance requirement ID. |
| <a id="compliancerequirementname"></a>`name` | [`String!`](#string) | Name of the compliance requirement. |
@ -24606,6 +24616,7 @@ Represents a ComplianceRequirementsControl associated with a ComplianceRequireme
| Name | Type | Description |
| ---- | ---- | ----------- |
| <a id="compliancerequirementscontrolcompliancerequirement"></a>`complianceRequirement` | [`ComplianceRequirement`](#compliancerequirement) | Compliance requirement associated with the control. |
| <a id="compliancerequirementscontrolcontroltype"></a>`controlType` | [`String!`](#string) | Type of the compliance control. |
| <a id="compliancerequirementscontrolexpression"></a>`expression` | [`String`](#string) | Expression of the compliance control. |
| <a id="compliancerequirementscontrolexternalcontrolname"></a>`externalControlName` | [`String`](#string) | Name of the external control. |
@ -30315,7 +30326,7 @@ Limited group data accessible to users without full group read access (e.g. non-
| <a id="groupnamespacelinksissueslist"></a>`issuesList` | [`String`](#string) | Namespace issues_list. |
| <a id="groupnamespacelinkslabelsfetch"></a>`labelsFetch` | [`String`](#string) | Namespace labels_fetch. |
| <a id="groupnamespacelinkslabelsmanage"></a>`labelsManage` | [`String`](#string) | Namespace labels_manage. |
| <a id="groupnamespacelinksnewcommenttemplate"></a>`newCommentTemplate` | [`String`](#string) | Namespace new_comment_template_paths. |
| <a id="groupnamespacelinksnewcommenttemplate"></a>`newCommentTemplate` | [`[CommentTemplatePath!]`](#commenttemplatepath) | Namespace new_comment_template_paths. |
| <a id="groupnamespacelinksnewproject"></a>`newProject` | [`String`](#string) | Namespace new_project. |
| <a id="groupnamespacelinksregister"></a>`register` | [`String`](#string) | Namespace register_path. |
| <a id="groupnamespacelinksreportabuse"></a>`reportAbuse` | [`String`](#string) | Namespace report_abuse. |
@ -38577,7 +38588,7 @@ Returns [`UserMergeRequestInteraction`](#usermergerequestinteraction).
| <a id="projectnamespacelinksissueslist"></a>`issuesList` | [`String`](#string) | Namespace issues_list. |
| <a id="projectnamespacelinkslabelsfetch"></a>`labelsFetch` | [`String`](#string) | Namespace labels_fetch. |
| <a id="projectnamespacelinkslabelsmanage"></a>`labelsManage` | [`String`](#string) | Namespace labels_manage. |
| <a id="projectnamespacelinksnewcommenttemplate"></a>`newCommentTemplate` | [`String`](#string) | Namespace new_comment_template_paths. |
| <a id="projectnamespacelinksnewcommenttemplate"></a>`newCommentTemplate` | [`[CommentTemplatePath!]`](#commenttemplatepath) | Namespace new_comment_template_paths. |
| <a id="projectnamespacelinksnewproject"></a>`newProject` | [`String`](#string) | Namespace new_project. |
| <a id="projectnamespacelinksregister"></a>`register` | [`String`](#string) | Namespace register_path. |
| <a id="projectnamespacelinksreportabuse"></a>`reportAbuse` | [`String`](#string) | Namespace report_abuse. |
@ -41452,7 +41463,7 @@ fields relate to interactions between the two entities.
| <a id="usernamespacelinksissueslist"></a>`issuesList` | [`String`](#string) | Namespace issues_list. |
| <a id="usernamespacelinkslabelsfetch"></a>`labelsFetch` | [`String`](#string) | Namespace labels_fetch. |
| <a id="usernamespacelinkslabelsmanage"></a>`labelsManage` | [`String`](#string) | Namespace labels_manage. |
| <a id="usernamespacelinksnewcommenttemplate"></a>`newCommentTemplate` | [`String`](#string) | Namespace new_comment_template_paths. |
| <a id="usernamespacelinksnewcommenttemplate"></a>`newCommentTemplate` | [`[CommentTemplatePath!]`](#commenttemplatepath) | Namespace new_comment_template_paths. |
| <a id="usernamespacelinksnewproject"></a>`newProject` | [`String`](#string) | Namespace new_project. |
| <a id="usernamespacelinksregister"></a>`register` | [`String`](#string) | Namespace register_path. |
| <a id="usernamespacelinksreportabuse"></a>`reportAbuse` | [`String`](#string) | Namespace report_abuse. |
@ -49725,7 +49736,7 @@ Implementations:
| <a id="namespaceslinkpathsissueslist"></a>`issuesList` | [`String`](#string) | Namespace issues_list. |
| <a id="namespaceslinkpathslabelsfetch"></a>`labelsFetch` | [`String`](#string) | Namespace labels_fetch. |
| <a id="namespaceslinkpathslabelsmanage"></a>`labelsManage` | [`String`](#string) | Namespace labels_manage. |
| <a id="namespaceslinkpathsnewcommenttemplate"></a>`newCommentTemplate` | [`String`](#string) | Namespace new_comment_template_paths. |
| <a id="namespaceslinkpathsnewcommenttemplate"></a>`newCommentTemplate` | [`[CommentTemplatePath!]`](#commenttemplatepath) | Namespace new_comment_template_paths. |
| <a id="namespaceslinkpathsnewproject"></a>`newProject` | [`String`](#string) | Namespace new_project. |
| <a id="namespaceslinkpathsregister"></a>`register` | [`String`](#string) | Namespace register_path. |
| <a id="namespaceslinkpathsreportabuse"></a>`reportAbuse` | [`String`](#string) | Namespace report_abuse. |

View File

@ -65,6 +65,7 @@ Predefined variables become available at three different phases of pipeline exec
| `CI_DEBUG_TRACE` | Pipeline | `true` if [debug logging (tracing)](variables_troubleshooting.md#enable-debug-logging) is enabled. |
| `CI_DEBUG_SERVICES` | Pipeline | `true` if [service container logging](../services/_index.md#capturing-service-container-logs) is enabled. Introduced in GitLab 15.7. Requires GitLab Runner 15.7. |
| `CI_DEFAULT_BRANCH` | Pre-pipeline | The name of the project's default branch. |
| `CI_DEFAULT_BRANCH_SLUG` | Pre-pipeline | `CI_DEFAULT_BRANCH` in lowercase, shortened to 63 bytes, and with everything except `0-9` and `a-z` replaced with `-`. No leading / trailing `-`. Use in URLs, host names and domain names. |
| `CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX` | Pre-pipeline | The direct group image prefix for pulling images through the Dependency Proxy. |
| `CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX` | Pre-pipeline | The top-level group image prefix for pulling images through the Dependency Proxy. |
| `CI_DEPENDENCY_PROXY_PASSWORD` | Pipeline | The password to pull images through the Dependency Proxy. |

View File

@ -43,6 +43,7 @@ To upgrade GitLab:
1. If available in your starting version, consider [turning on maintenance mode](../administration/maintenance_mode/_index.md)
during the upgrade.
1. Consult changes for different versions of GitLab to ensure compatibility before upgrading:
- [GitLab 18 changes](versions/gitlab_18_changes.md)
- [GitLab 17 changes](versions/gitlab_17_changes.md)
- [GitLab 16 changes](versions/gitlab_16_changes.md)
- [GitLab 15 changes](versions/gitlab_15_changes.md)
@ -240,6 +241,7 @@ If you're using Geo:
- Review [Geo upgrade documentation](../administration/geo/replication/upgrading_the_geo_sites.md).
- Read about the Geo version-specific update instructions:
- [GitLab 18](versions/gitlab_18_changes.md)
- [GitLab 17](versions/gitlab_17_changes.md)
- [GitLab 16](versions/gitlab_16_changes.md)
- [GitLab 15](versions/gitlab_15_changes.md)

View File

@ -317,7 +317,7 @@ To install the Helm chart for the GitLab workspaces proxy:
helm upgrade --install gitlab-workspaces-proxy \
gitlab-workspaces-proxy/gitlab-workspaces-proxy \
--version=0.1.18 \
--version=0.1.19 \
--namespace="gitlab-workspaces" \
--set="ingress.enabled=true" \
--set="ingress.hosts[0].host=${GITLAB_WORKSPACES_PROXY_DOMAIN}" \

View File

@ -268,7 +268,7 @@ module Gitlab
end
def generic_package_file_name_regex
generic_package_name_regex
@generic_package_file_name_regex ||= /\A(?!~)[A-Za-z0-9\.\_\-\+~]+(?<!~)\z/
end
def sha256_regex

View File

@ -105,10 +105,6 @@ module Search
attr_reader :user, :project, :group, :options
def show_elasticsearch_tabs?
!!options[:show_elasticsearch_tabs]
end
def search_tab_ability_map
{
milestones: :read_milestone,
@ -155,9 +151,7 @@ module Search
end
def show_comments_search_tab?
return true if tab_enabled_for_project?(:notes)
project.nil? && show_elasticsearch_tabs?
tab_enabled_for_project?(:notes)
end
def show_snippets_search_tab?

View File

@ -15294,6 +15294,9 @@ msgstr ""
msgid "Company"
msgstr ""
msgid "Company email"
msgstr ""
msgid "Company name"
msgstr ""
@ -32533,6 +32536,9 @@ msgstr ""
msgid "InProductMarketing|Ship secure software faster"
msgstr ""
msgid "InProductMarketing|Start a Self-Managed trial"
msgstr ""
msgid "InProductMarketing|Start with Self-Managed"
msgstr ""
@ -32653,6 +32659,9 @@ msgstr ""
msgid "IncidentManagement|Paged"
msgstr ""
msgid "IncidentManagement|Paging status"
msgstr ""
msgid "IncidentManagement|Published"
msgstr ""

View File

@ -60,7 +60,7 @@ fi
if [ -z "${GITLAB_WORKSPACES_PROXY_HELM_CHART_VERSION}" ]; then
echo "GITLAB_WORKSPACES_PROXY_HELM_CHART_VERSION is not explicitly set. Using default."
GITLAB_WORKSPACES_PROXY_HELM_CHART_VERSION="0.1.18"
GITLAB_WORKSPACES_PROXY_HELM_CHART_VERSION="0.1.19"
fi
if [ -z "${GITLAB_WORKSPACES_PROXY_HELM_RELEASE_NAMESPACE}" ]; then

View File

@ -5,8 +5,8 @@ require 'spec_helper'
RSpec.describe SearchController, feature_category: :global_search do
include ExternalAuthorizationServiceHelpers
context 'authorized user' do
let(:user) { create(:user) }
context 'for authorized user' do
let_it_be(:user) { create(:user) }
before do
sign_in(user)
@ -53,6 +53,38 @@ RSpec.describe SearchController, feature_category: :global_search do
end
end
shared_examples_for 'rate limit scope handling' do |action, base_params|
describe 'rate limit scope' do
it 'uses current_user and search scope' do
%w[projects blobs users issues merge_requests].each do |scope|
expect(::Gitlab::ApplicationRateLimiter).to receive(:throttled?).with(:search_rate_limit,
scope: [user, scope], users_allowlist: [])
get action, params: base_params.merge(scope: scope)
end
end
it 'uses just current_user when search scope is abusive' do
expect(::Gitlab::ApplicationRateLimiter).to receive(:throttled?).with(:search_rate_limit,
scope: [user], users_allowlist: [])
get action, params: base_params.merge(scope: 'hack-the-mainframe')
expect(::Gitlab::ApplicationRateLimiter).to receive(:throttled?).with(:search_rate_limit,
scope: [user], users_allowlist: [])
get action, params: base_params.merge(scope: 'blobs' * 1000)
end
end
end
shared_examples_for 'sets correct cache control headers' do |action, params|
it 'sets correct cache control headers' do
get action, params: params
expect(response).to have_gitlab_http_status(:ok)
expect(response.headers['Cache-Control']).to eq('max-age=60, private')
expect(response.headers['Pragma']).to be_nil
end
end
describe 'GET #show', :snowplow do
it_behaves_like 'when the user cannot read cross project', :show, { search: 'hello' } do
it 'still allows accessing the search page' do
@ -97,43 +129,21 @@ RSpec.describe SearchController, feature_category: :global_search do
get :show, params: { search: 'hello', scope: 'blobs' }
end
describe 'rate limit scope' do
it 'uses current_user and search scope' do
%w[projects blobs users issues merge_requests].each do |scope|
expect(::Gitlab::ApplicationRateLimiter).to receive(:throttled?).with(:search_rate_limit,
scope: [user, scope], users_allowlist: [])
get :show, params: { search: 'hello', scope: scope }
end
end
it_behaves_like 'rate limit scope handling', :show, { search: 'hello' }
it 'uses just current_user when no search scope is used' do
expect(::Gitlab::ApplicationRateLimiter).to receive(:throttled?).with(:search_rate_limit,
scope: [user], users_allowlist: [])
get :show, params: { search: 'hello' }
end
it 'uses just current_user when search scope is abusive' do
expect(::Gitlab::ApplicationRateLimiter).to receive(:throttled?).with(:search_rate_limit,
scope: [user], users_allowlist: [])
get(:show, params: { search: 'hello', scope: 'hack-the-mainframe' })
expect(::Gitlab::ApplicationRateLimiter).to receive(:throttled?).with(:search_rate_limit,
scope: [user], users_allowlist: [])
get :show, params: { search: 'hello', scope: 'blobs' * 1000 }
end
it 'uses just current_user when no search scope is used' do
expect(::Gitlab::ApplicationRateLimiter).to receive(:throttled?).with(:search_rate_limit,
scope: [user], users_allowlist: [])
get :show, params: { search: 'hello' }
end
context 'uses the right partials depending on scope' do
context 'when uses the right partials depending on scope' do
using RSpec::Parameterized::TableSyntax
render_views
let_it_be(:project) { create(:project, :public, :repository, :wiki_repo) }
before do
expect(::Gitlab::GitalyClient).to receive(:allow_ref_name_caching).and_call_original
end
subject { get(:show, params: { project_id: project.id, scope: scope, search: 'merge' }) }
subject(:request) { get(:show, params: { project_id: project.id, scope: scope, search: 'merge' }) }
where(:partial, :scope) do
'_blob' | :blobs
@ -142,16 +152,18 @@ RSpec.describe SearchController, feature_category: :global_search do
end
with_them do
it do
it 'renders the correct partial template for the search scope' do
expect(::Gitlab::GitalyClient).to receive(:allow_ref_name_caching).and_call_original
project_wiki = create(:project_wiki, project: project, user: user)
create(:wiki_page, wiki: project_wiki, title: 'merge', content: 'merge')
expect(subject).to render_template("search/results/#{partial}")
expect(request).to render_template("search/results/#{partial}")
end
end
end
context 'global search' do
context 'for global search' do
using RSpec::Parameterized::TableSyntax
render_views
@ -169,14 +181,14 @@ RSpec.describe SearchController, feature_category: :global_search do
expect(assigns[:search_objects].first).to eq project
end
context 'check search term length' do
context 'when checking search term length' do
let(:search_queries) do
char_limit = Gitlab::Search::Params::SEARCH_CHAR_LIMIT
term_limit = Gitlab::Search::Params::SEARCH_TERM_LIMIT
term_char_limit = Gitlab::Search::AbuseDetection::ABUSIVE_TERM_SIZE
{
chars_under_limit: ((('a' * (term_char_limit - 1)) + ' ') * (term_limit - 1))[0, char_limit],
chars_over_limit: ((('a' * (term_char_limit - 1)) + ' ') * (term_limit - 1))[0, char_limit + 1],
chars_under_limit: ("#{'a' * (term_char_limit - 1)} " * (term_limit - 1))[0, char_limit],
chars_over_limit: ("#{'a' * (term_char_limit - 1)} " * (term_limit - 1))[0, char_limit + 1],
terms_under_limit: ('abc ' * (term_limit - 1)),
terms_over_limit: ('abc ' * (term_limit + 1)),
term_length_over_limit: ('a' * (term_char_limit + 1)),
@ -196,7 +208,7 @@ RSpec.describe SearchController, feature_category: :global_search do
end
with_them do
it do
it 'validates search term length and sets appropriate flash messages' do
get :show, params: { scope: 'projects', search: search_queries[string_name] }
case expectation
@ -243,9 +255,10 @@ RSpec.describe SearchController, feature_category: :global_search do
end
end
context 'handling abusive search_terms' do
context 'when handling abusive search_terms' do
it 'succeeds but does NOT do anything' do
get :show, params: { scope: 'projects', search: '*', repository_ref: '-1%20OR%203%2B640-640-1=0%2B0%2B0%2B1' }
get :show,
params: { scope: 'projects', search: '*', repository_ref: '-1%20OR%203%2B640-640-1=0%2B0%2B0%2B1' }
expect(response).to have_gitlab_http_status(:ok)
expect(assigns(:search_results)).to be_a ::Search::EmptySearchResults
end
@ -310,7 +323,7 @@ RSpec.describe SearchController, feature_category: :global_search do
expect(assigns[:search_objects].first).to eq note
end
context 'unique users tracking' do
context 'with unique users tracking' do
before do
allow(Gitlab::UsageDataCounters::HLLRedisCounter).to receive(:track_event)
end
@ -335,7 +348,7 @@ RSpec.describe SearchController, feature_category: :global_search do
[Gitlab::Tracking::ServicePingContext.new(data_source: :redis_hll, event: property).to_context]
end
let(:namespace) { create(:group) }
let_it_be(:namespace) { create(:group) }
end
context 'on restricted projects' do
@ -400,7 +413,7 @@ RSpec.describe SearchController, feature_category: :global_search do
get :show, params: { scope: 'issues', search: 'hello world' }
end
context 'custom search sli error rate' do
context 'with custom search sli error rate' do
context 'when the search is successful' do
it 'increments the custom search sli error rate with error: false' do
expect(Gitlab::Metrics::GlobalSearchSlis).to receive(:record_error_rate).with(
@ -478,7 +491,8 @@ RSpec.describe SearchController, feature_category: :global_search do
describe 'GET #count', :aggregate_failures do
it_behaves_like 'when the user cannot read cross project', :count, { search: 'hello', scope: 'projects' }
it_behaves_like 'with external authorization service enabled', :count, { search: 'hello', scope: 'projects' }
it_behaves_like 'support for active record query timeouts', :count, { search: 'hello', scope: 'projects' }, :search_results, :json
it_behaves_like 'support for active record query timeouts', :count, { search: 'hello', scope: 'projects' },
:search_results, :json
it_behaves_like 'metadata is set', :count
it 'returns the result count for the given term and scope' do
@ -491,25 +505,7 @@ RSpec.describe SearchController, feature_category: :global_search do
expect(json_response).to eq({ 'count' => '1' })
end
describe 'rate limit scope' do
it 'uses current_user and search scope' do
%w[projects blobs users issues merge_requests].each do |scope|
expect(::Gitlab::ApplicationRateLimiter).to receive(:throttled?).with(:search_rate_limit,
scope: [user, scope], users_allowlist: [])
get :count, params: { search: 'hello', scope: scope }
end
end
it 'uses just current_user when search scope is abusive' do
expect(::Gitlab::ApplicationRateLimiter).to receive(:throttled?).with(:search_rate_limit,
scope: [user], users_allowlist: [])
get :count, params: { search: 'hello', scope: 'hack-the-mainframe' }
expect(::Gitlab::ApplicationRateLimiter).to receive(:throttled?).with(:search_rate_limit,
scope: [user], users_allowlist: [])
get :count, params: { search: 'hello', scope: 'blobs' * 1000 }
end
end
it_behaves_like 'rate limit scope handling', :count, { search: 'hello' }
it 'raises an error if search term is missing' do
expect do
@ -523,14 +519,7 @@ RSpec.describe SearchController, feature_category: :global_search do
end.to raise_error(ActionController::ParameterMissing)
end
it 'sets correct cache control headers' do
get :count, params: { search: 'hello', scope: 'projects' }
expect(response).to have_gitlab_http_status(:ok)
expect(response.headers['Cache-Control']).to eq('max-age=60, private')
expect(response.headers['Pragma']).to be_nil
end
it_behaves_like 'sets correct cache control headers', :count, { search: 'hello', scope: 'projects' }
it 'does NOT blow up if search param is NOT a string' do
get :count, params: { search: ['hello'], scope: 'projects' }
@ -545,7 +534,8 @@ RSpec.describe SearchController, feature_category: :global_search do
it 'does NOT blow up if repository_ref contains abusive characters' do
get :count, params: {
search: 'hello',
repository_ref: "(nslookup%20hitqlwv501f.somewhere.bad%7C%7Cperl%20-e%20%22gethostbyname('hitqlwv501f.somewhere.bad')%22)",
repository_ref: "(nslookup%20hitqlwv501f.somewhere.bad%7C%7Cperl%20-e%20%22gethostbyname" \
"('hitqlwv501f.somewhere.bad')%22)",
scope: 'projects'
}
expect(response).to have_gitlab_http_status(:ok)
@ -616,25 +606,7 @@ RSpec.describe SearchController, feature_category: :global_search do
expect(json_response).to be_empty
end
describe 'rate limit scope' do
it 'uses current_user and search scope' do
%w[projects blobs users issues merge_requests].each do |scope|
expect(::Gitlab::ApplicationRateLimiter).to receive(:throttled?).with(:search_rate_limit,
scope: [user, scope], users_allowlist: [])
get :autocomplete, params: { term: 'hello', scope: scope }
end
end
it 'uses just current_user when search scope is abusive' do
expect(::Gitlab::ApplicationRateLimiter).to receive(:throttled?).with(:search_rate_limit,
scope: [user], users_allowlist: [])
get :autocomplete, params: { term: 'hello', scope: 'hack-the-mainframe' }
expect(::Gitlab::ApplicationRateLimiter).to receive(:throttled?).with(:search_rate_limit,
scope: [user], users_allowlist: [])
get :autocomplete, params: { term: 'hello', scope: 'blobs' * 1000 }
end
end
it_behaves_like 'rate limit scope handling', :autocomplete, { term: 'hello' }
it_behaves_like 'rate limited endpoint', rate_limit_key: :search_rate_limit do
let(:current_user) { user }
@ -671,16 +643,9 @@ RSpec.describe SearchController, feature_category: :global_search do
get :autocomplete, params: { term: 'setting', filter: 'generic' }
end
it 'sets correct cache control headers' do
get :autocomplete, params: { term: 'setting', filter: 'generic' }
it_behaves_like 'sets correct cache control headers', :autocomplete, { term: 'setting', filter: 'generic' }
expect(response).to have_gitlab_http_status(:ok)
expect(response.headers['Cache-Control']).to eq('max-age=60, private')
expect(response.headers['Pragma']).to be_nil
end
context 'unique users tracking' do
context 'with unique users tracking' do
before do
allow(Gitlab::UsageDataCounters::HLLRedisCounter).to receive(:track_event)
end
@ -705,7 +670,7 @@ RSpec.describe SearchController, feature_category: :global_search do
[Gitlab::Tracking::ServicePingContext.new(data_source: :redis_hll, event: property).to_context]
end
let(:namespace) { create(:group) }
let_it_be(:namespace) { create(:group) }
end
end
@ -764,7 +729,7 @@ RSpec.describe SearchController, feature_category: :global_search do
end
end
context 'abusive searches', :aggregate_failures do
context 'for abusive searches', :aggregate_failures do
let(:project) { create(:project, :public, name: 'hello world') }
let(:make_abusive_request) do
get :show, params: { scope: '1;drop%20tables;boom', search: 'hello world', project_id: project.id }
@ -782,7 +747,7 @@ RSpec.describe SearchController, feature_category: :global_search do
end
end
context 'unauthorized user' do
context 'with unauthorized user' do
describe 'redirecting' do
using RSpec::Parameterized::TableSyntax
@ -823,7 +788,7 @@ RSpec.describe SearchController, feature_category: :global_search do
describe 'search rate limits' do
using RSpec::Parameterized::TableSyntax
let(:project) { create(:project, :public) }
let_it_be(:project) { create(:project, :public) }
where(:endpoint, :params) do
:show | { search: 'hello', scope: 'projects' }
@ -839,7 +804,8 @@ RSpec.describe SearchController, feature_category: :global_search do
end
it 'uses request IP as rate limiting scope' do
expect(::Gitlab::ApplicationRateLimiter).to receive(:throttled?).with(:search_rate_limit_unauthenticated, scope: [request.ip])
expect(::Gitlab::ApplicationRateLimiter)
.to receive(:throttled?).with(:search_rate_limit_unauthenticated, scope: [request.ip])
get endpoint, params: params.merge(project_id: project.id)
end
end
@ -855,7 +821,8 @@ RSpec.describe SearchController, feature_category: :global_search do
expect(response).to have_gitlab_http_status(:ok)
expect(doc.css('OpenSearchDescription ShortName').text).to eq('GitLab')
expect(doc.css('OpenSearchDescription *').map(&:name)).to eq(%w[ShortName Description InputEncoding Image Url SearchForm])
expect(doc.css('OpenSearchDescription *').map(&:name))
.to eq(%w[ShortName Description InputEncoding Image Url SearchForm])
end
end
end
@ -875,7 +842,7 @@ RSpec.describe SearchController, feature_category: :global_search do
with_them do
it 'returns false' do
result = subject.send(:multi_match?, search_type: search_type, scope: scope)
result = controller.send(:multi_match?, search_type: search_type, scope: scope)
expect(result).to be(false)
end
end

View File

@ -88,6 +88,11 @@ describe('SidebarEscalationStatus', () => {
expect(findSidebarComponent().exists()).toBe(true);
});
it('renders the label as `Paging status`', async () => {
await createComponent(mockApollo);
expect(findSidebarComponent().props('title')).toBe('Paging status');
});
describe('status icon', () => {
it('is visible', async () => {
await createComponent(mockApollo);
@ -102,7 +107,7 @@ describe('SidebarEscalationStatus', () => {
const tooltip = getBinding(findIcon().element, 'gl-tooltip');
expect(tooltip).toBeDefined();
expect(tooltip.value).toBe('Status: Triggered');
expect(tooltip.value).toBe('Paging status: Triggered');
});
});

View File

@ -17,7 +17,7 @@ RSpec.describe Types::Namespaces::LinkPaths::GroupNamespaceLinksType, feature_ca
:issues_list | lazy { "/groups/#{namespace.full_path}/-/issues" }
:labels_manage | lazy { "/groups/#{namespace.full_path}/-/labels" }
:new_project | lazy { "/projects/new?namespace_id=#{namespace.id}" }
:new_comment_template | "/-/profile/comment_templates"
:new_comment_template | [{ href: "/-/profile/comment_templates", text: "Your comment templates" }]
end
with_them do

View File

@ -19,7 +19,7 @@ RSpec.describe Types::Namespaces::LinkPaths::ProjectNamespaceLinksType, feature_
:issues_list | lazy { "/#{namespace.full_path}/-/issues" }
:labels_manage | lazy { "/#{namespace.full_path}/-/labels" }
:new_project | lazy { "/projects/new?namespace_id=#{group.id}" }
:new_comment_template | "/-/profile/comment_templates"
:new_comment_template | [{ href: "/-/profile/comment_templates", text: "Your comment templates" }]
:contribution_guide_path | nil
end

View File

@ -91,6 +91,8 @@ RSpec.describe Gitlab::Ci::Variables::Builder, :clean_gitlab_redis_cache, featur
value: project.external_authorization_classification_label },
{ key: 'CI_DEFAULT_BRANCH',
value: project.default_branch },
{ key: 'CI_DEFAULT_BRANCH_SLUG',
value: Gitlab::Utils.slugify(project.default_branch.to_s) },
{ key: 'CI_CONFIG_PATH',
value: project.ci_config_path_or_default },
{ key: 'CI_PAGES_DOMAIN',

View File

@ -780,7 +780,8 @@ RSpec.describe Gitlab::Regex, feature_category: :tooling do
it { is_expected.not_to match('..\..\foo') }
it { is_expected.not_to match('%2f%2e%2e%2f%2essh%2fauthorized_keys') }
it { is_expected.not_to match('$foo/bar') }
it { is_expected.not_to match('my file name') }
it { is_expected.not_to match('my package name') }
it { is_expected.not_to match('foo.bar.baz-2.0-20190901~47283-1') }
it { is_expected.not_to match('!!()()') }
end
@ -790,12 +791,15 @@ RSpec.describe Gitlab::Regex, feature_category: :tooling do
it { is_expected.to match('123') }
it { is_expected.to match('foo') }
it { is_expected.to match('foo.bar.baz-2.0-20190901.47283-1.jar') }
it { is_expected.to match('foo.bar.baz-2.0-20190901~47283-1') }
it { is_expected.not_to match('../../foo') }
it { is_expected.not_to match('..\..\foo') }
it { is_expected.not_to match('%2f%2e%2e%2f%2essh%2fauthorized_keys') }
it { is_expected.not_to match('$foo/bar') }
it { is_expected.not_to match('my file name') }
it { is_expected.not_to match('!!()()') }
it { is_expected.not_to match('~/../../filename') }
it { is_expected.not_to match('filename~') }
end
describe '.prefixed_semver_regex' do

View File

@ -179,20 +179,14 @@ RSpec.describe Search::Navigation, feature_category: :global_search do
end
context 'for comments tab' do
where(:tab_enabled, :show_elasticsearch_tabs, :project, :condition) do
true | true | nil | true
true | true | ref(:project_double) | true
false | false | nil | false
false | false | ref(:project_double) | false
false | true | nil | true
false | true | ref(:project_double) | false
true | false | nil | true
true | false | ref(:project_double) | true
where(:tab_enabled, :project, :condition) do
true | nil | true
true | ref(:project_double) | true
false | nil | false
false | ref(:project_double) | false
end
with_them do
let(:options) { { show_elasticsearch_tabs: show_elasticsearch_tabs } }
it 'data item condition is set correctly' do
allow(search_navigation).to receive(:tab_enabled_for_project?).with(:notes).and_return(tab_enabled)

View File

@ -0,0 +1,27 @@
# frozen_string_literal: true
require 'spec_helper'
require_migration!
RSpec.describe RequeueBackfillArchivedAndTraversalIdsToVulnerabilityStatisticsAgain, migration: :gitlab_sec, feature_category: :vulnerability_management do
let!(:batched_migration) { described_class::MIGRATION }
it 'schedules a new batched migration' do
reversible_migration do |migration|
migration.before -> {
expect(batched_migration).not_to have_scheduled_batched_migration
}
migration.after -> {
expect(batched_migration).to have_scheduled_batched_migration(
gitlab_schema: :gitlab_sec,
table_name: :vulnerability_statistics,
column_name: :id,
interval: described_class::DELAY_INTERVAL,
batch_size: described_class::BATCH_SIZE,
sub_batch_size: described_class::SUB_BATCH_SIZE
)
}
end
end
end

View File

@ -2590,6 +2590,7 @@ RSpec.describe Ci::Build, feature_category: :continuous_integration, factory_def
{ key: 'CI_PROJECT_REPOSITORY_LANGUAGES', value: project.repository_languages.map(&:name).join(',').downcase, public: true, masked: false },
{ key: 'CI_PROJECT_CLASSIFICATION_LABEL', value: project.external_authorization_classification_label, public: true, masked: false },
{ key: 'CI_DEFAULT_BRANCH', value: project.default_branch, public: true, masked: false },
{ key: 'CI_DEFAULT_BRANCH_SLUG', value: Gitlab::Utils.slugify(project.default_branch.to_s), public: true, masked: false },
{ key: 'CI_CONFIG_PATH', value: project.ci_config_path_or_default, public: true, masked: false },
{ key: 'CI_PAGES_DOMAIN', value: Gitlab.config.pages.host, public: true, masked: false },
{ key: 'CI_PAGES_HOSTNAME', value: pages_hostname, public: true, masked: false },

View File

@ -14,6 +14,7 @@ RSpec.describe Packages::Generic::Package, type: :model, feature_category: :pack
it { is_expected.not_to allow_value('$foo/bar').for(:name) }
it { is_expected.not_to allow_value('my file name').for(:name) }
it { is_expected.not_to allow_value('!!().for(:name)().for(:name)').for(:name) }
it { is_expected.not_to allow_value('test-packagename~with-tildes').for(:name) }
end
describe '#version' do

View File

@ -1116,7 +1116,7 @@ RSpec.describe Ci::CreateDownstreamPipelineService, '#execute', feature_category
it 'drops the bridge without creating a pipeline' do
expect { subject }
.to raise_error(RuntimeError, /undefined failure/)
.and change { Ci::Pipeline.count }.by(0)
.and not_change { Ci::Pipeline.count }
expect(bridge.reload).to be_failed
expect(bridge.failure_reason).to eq('data_integrity_failure')

View File

@ -102,7 +102,7 @@ RSpec.describe Ci::DeleteObjectsService, :aggregate_failures, feature_category:
expect { execute }
.to raise_error(Ci::DeleteObjectsService::TransactionInProgressError)
.and change { Ci::DeletedObject.count }.by(0)
.and not_change { Ci::DeletedObject.count }
end
end
end

View File

@ -245,7 +245,7 @@ RSpec.describe Ci::JobArtifacts::DestroyAllExpiredService, :clean_gitlab_redis_s
let!(:artifact) { create(:ci_job_artifact, :expired, job: locked_job, locked: locked_job.pipeline.locked) }
it 'destroys no artifacts' do
expect { subject }.to change { Ci::JobArtifact.count }.by(0)
expect { subject }.to not_change { Ci::JobArtifact.count }
end
end
end

View File

@ -235,7 +235,7 @@ RSpec.describe Ci::JobArtifacts::DestroyBatchService, feature_category: :job_art
expect { execute }
.to change { project_1.statistics.reload.build_artifacts_size }.by(expected_amount)
.and change { project_2.statistics.reload.build_artifacts_size }.by(0)
.and not_change { project_2.statistics.reload.build_artifacts_size }
end
it 'increments project statistics with artifact size as amount and job artifact id as ref' do

View File

@ -104,8 +104,7 @@ RSpec.describe ::Import::GitlabProjects::CreateProjectService, :aggregate_failur
end
response = nil
expect { response = subject.execute }
.to change(Project, :count).by(0)
expect { response = subject.execute }.to not_change(Project, :count)
expect(response).to be_error
expect(response.http_status).to eq(:bad_request)
@ -119,8 +118,7 @@ RSpec.describe ::Import::GitlabProjects::CreateProjectService, :aggregate_failur
params.delete(:path)
response = nil
expect { response = subject.execute }
.to change(Project, :count).by(0)
expect { response = subject.execute }.to not_change(Project, :count)
expect(response).to be_error
expect(response.http_status).to eq(:bad_request)
@ -133,8 +131,7 @@ RSpec.describe ::Import::GitlabProjects::CreateProjectService, :aggregate_failur
params.merge!(name: '_ an invalid name _', path: '_ an invalid path _')
response = nil
expect { response = subject.execute }
.to change(Project, :count).by(0)
expect { response = subject.execute }.to not_change(Project, :count)
expect(response).to be_error
expect(response.http_status).to eq(:bad_request)

View File

@ -249,12 +249,12 @@ RSpec.describe IncidentManagement::TimelineEvents::UpdateService, feature_catego
it 'adds the new tag and removes the old tag' do
# Since it adds a tag (+1) and removes old tag (-1) so next change in count in 0
expect { execute }.to change { timeline_event.timeline_event_tags.count }.by(0)
expect { execute }.to not_change { timeline_event.timeline_event_tags.count }
end
it 'adds the new tag link and removes the old tag link' do
# Since it adds a tag link (+1) and removes old tag link (-1) so next change in count in 0
expect { execute }.to change { IncidentManagement::TimelineEventTagLink.count }.by(0)
expect { execute }.to not_change { IncidentManagement::TimelineEventTagLink.count }
end
it 'returns the new tag and does not contain the old tag in response' do

View File

@ -261,7 +261,7 @@ RSpec.describe Issues::CloseService, feature_category: :team_planning do
it 'verifies the number of queries' do
recorded = ActiveRecord::QueryRecorder.new { close_issue }
expected_queries = 36
expected_queries = 40
expect(recorded.count).to be <= expected_queries
expect(recorded.cached_count).to eq(0)

View File

@ -204,7 +204,7 @@ RSpec.describe MergeRequests::CreateFromIssueService, feature_category: :code_re
end
it 'does not create merge request' do
expect { service.execute }.to change(target_project.merge_requests, :count).by(0)
expect { service.execute }.to not_change(target_project.merge_requests, :count)
end
end

View File

@ -240,7 +240,7 @@ RSpec.describe MergeRequests::RefreshService, feature_category: :code_review_wor
it 'create detached merge request pipeline with commits' do
expect { subject }
.to change { @merge_request.pipelines_for_merge_request.count }.by(1)
.and change { @another_merge_request.pipelines_for_merge_request.count }.by(0)
.and not_change { @another_merge_request.pipelines_for_merge_request.count }
expect(@merge_request.has_commits?).to be_truthy
expect(@another_merge_request.has_commits?).to be_falsy
@ -266,7 +266,7 @@ RSpec.describe MergeRequests::RefreshService, feature_category: :code_review_wor
it 'creates a detached merge request pipeline with commits' do
expect { subject }
.to change { @merge_request.pipelines_for_merge_request.count }.by(1)
.and change { @another_merge_request.pipelines_for_merge_request.count }.by(0)
.and not_change { @another_merge_request.pipelines_for_merge_request.count }
expect(@merge_request.has_commits?).to be_truthy
expect(@another_merge_request.has_commits?).to be_falsy
@ -282,7 +282,7 @@ RSpec.describe MergeRequests::RefreshService, feature_category: :code_review_wor
it 'creates a skipped detached merge request pipeline with commits' do
expect { subject }
.to change { @merge_request.pipelines_for_merge_request.count }.by(1)
.and change { @another_merge_request.pipelines_for_merge_request.count }.by(0)
.and not_change { @another_merge_request.pipelines_for_merge_request.count }
expect(@merge_request.has_commits?).to be_truthy
expect(@another_merge_request.has_commits?).to be_falsy

View File

@ -82,8 +82,8 @@ RSpec.describe Packages::Composer::CreatePackageService, feature_category: :pack
it 'does not create a new package' do
expect { subject }
.to change { ::Packages::Composer::Package.count }.by(0)
.and change { Packages::Composer::Metadatum.count }.by(0)
.to not_change { ::Packages::Composer::Package.count }
.and not_change { Packages::Composer::Metadatum.count }
end
end

View File

@ -37,7 +37,7 @@ RSpec.describe Packages::Npm::CreateMetadataCacheService, :clean_gitlab_redis_sh
let_it_be(:tag) { create(:packages_tag, package: package, name: tag_name) }
it 'does not create a new metadata cache' do
expect { subject }.to change { Packages::Npm::MetadataCache.count }.by(0)
expect { subject }.to not_change { Packages::Npm::MetadataCache.count }
end
it 'updates the metadata cache', :aggregate_failures do
@ -63,7 +63,7 @@ RSpec.describe Packages::Npm::CreateMetadataCacheService, :clean_gitlab_redis_sh
end
it 'does not create a new metadata cache' do
expect { subject }.to change { Packages::Npm::MetadataCache.count }.by(0)
expect { subject }.to not_change { Packages::Npm::MetadataCache.count }
end
it 'returns nil' do

View File

@ -39,7 +39,7 @@ RSpec.describe Packages::Nuget::SyncMetadatumService, feature_category: :package
let_it_be(:package) { create(:nuget_package, :with_metadatum) }
it 'does not create a nuget metadatum' do
expect { subject }.to change { ::Packages::Nuget::Metadatum.count }.by(0)
expect { subject }.to not_change { ::Packages::Nuget::Metadatum.count }
end
it_behaves_like 'saving metadatum attributes'

View File

@ -57,8 +57,8 @@ RSpec.describe Packages::Nuget::UpdatePackageFromMetadataService, :clean_gitlab_
expect(service).to receive(:try_obtain_lease).and_call_original
expect { subject }
.to change { ::Packages::Package.count }.by(0)
.and change { Packages::DependencyLink.count }.by(0)
.to not_change { ::Packages::Package.count }
.and not_change { Packages::DependencyLink.count }
expect(package_file.reload.file_name).not_to eq(package_file_name)
expect(package_file.package).to be_processing
expect(package_file.package.reload.name).not_to eq(package_name)
@ -99,9 +99,9 @@ RSpec.describe Packages::Nuget::UpdatePackageFromMetadataService, :clean_gitlab_
expect { subject }
.to change { ::Packages::Package.count }.by(-1)
.and change { Packages::Dependency.count }.by(0)
.and change { Packages::DependencyLink.count }.by(0)
.and change { Packages::Nuget::DependencyLinkMetadatum.count }.by(0)
.and not_change { Packages::Dependency.count }
.and not_change { Packages::DependencyLink.count }
.and not_change { Packages::Nuget::DependencyLinkMetadatum.count }
.and change { ::Packages::Nuget::Metadatum.count }.by(1)
.and change { existing_package.build_infos.count }.by(1)
expect(package_file.reload.file_name).to eq(package_file_name)
@ -278,10 +278,10 @@ RSpec.describe Packages::Nuget::UpdatePackageFromMetadataService, :clean_gitlab_
expect { subject }
.to change { ::Packages::Package.count }.by(-1)
.and change { Packages::Dependency.count }.by(0)
.and change { Packages::DependencyLink.count }.by(0)
.and change { Packages::Nuget::DependencyLinkMetadatum.count }.by(0)
.and change { ::Packages::Nuget::Metadatum.count }.by(0)
.and not_change { Packages::Dependency.count }
.and not_change { Packages::DependencyLink.count }
.and not_change { Packages::Nuget::DependencyLinkMetadatum.count }
.and not_change { ::Packages::Nuget::Metadatum.count }
.and change { existing_package.nuget_symbols.count }.by(1)
expect(package_file.reload.file_name).to eq(package_file_name)
expect(package_file.package).to eq(existing_package)

View File

@ -36,7 +36,7 @@ RSpec.describe Packages::Protection::CreateRuleService, '#execute', feature_cate
end
it do
expect { subject }.to change { Packages::Protection::Rule.count }.by(0)
expect { subject }.to not_change { Packages::Protection::Rule.count }
expect(Packages::Protection::Rule.where(project: project).count).to eq package_protection_rule_count_expected
expect(Packages::Protection::Rule.where(project: project,
@ -102,7 +102,7 @@ RSpec.describe Packages::Protection::CreateRuleService, '#execute', feature_cate
it { is_expected.to be_error }
it do
expect { service_execute }.to change { Packages::Protection::Rule.count }.by(0)
expect { service_execute }.to not_change { Packages::Protection::Rule.count }
expect(Packages::Protection::Rule.where(project: project).count).to eq 1
expect(

View File

@ -173,7 +173,7 @@ RSpec.describe Packages::Pypi::CreatePackageService, :aggregate_failures, featur
it 'adds the file' do
expect { service_response }
.to change { Packages::Package.pypi.count }.by(0)
.to not_change { Packages::Package.pypi.count }
.and change { Packages::PackageFile.count }.by(1)
expect(created_package.package_files.size).to eq 2

View File

@ -272,7 +272,7 @@ RSpec.describe Projects::TransferService, feature_category: :groups_and_projects
it 'replaces inherited integrations', :aggregate_failures do
expect { execute_transfer }
.to change(Integration, :count).by(0)
.to not_change(Integration, :count)
.and change { project.slack_integration.webhook }.to eq(group_integration.webhook)
end
end

View File

@ -76,7 +76,7 @@ RSpec.describe Projects::UpdatePagesService, feature_category: :pages do
it 'assigns the deploy stage' do
expect { service.execute }
.to change(GenericCommitStatus, :count).by(1)
.and change(Ci::Stage.where(name: 'deploy'), :count).by(0)
.and not_change(Ci::Stage.where(name: 'deploy'), :count)
status = GenericCommitStatus.last

View File

@ -38,15 +38,11 @@ RSpec.describe Routes::RenameDescendantsService, feature_category: :groups_and_p
shared_examples_for 'descendant paths are not updated' do
it do
expect { execute }.to change {
subgroup_routes_with_old_path.size
}.by(0).and change {
subgroup_projects_routes_with_old_path.size
}.by(0).and change {
subgroup_routes_with_new_path.size
}.by(0).and change {
subgroup_projects_routes_with_new_path.size
}.by(0)
expect { execute }
.to not_change { subgroup_routes_with_old_path.size }
.and not_change { subgroup_projects_routes_with_old_path.size }
.and not_change { subgroup_routes_with_new_path.size }
.and not_change { subgroup_projects_routes_with_new_path.size }
end
end
@ -66,15 +62,11 @@ RSpec.describe Routes::RenameDescendantsService, feature_category: :groups_and_p
shared_examples_for 'descendant names are not updated' do
it do
expect { execute }.to change {
subgroup_routes_with_old_name.size
}.by(0).and change {
subgroup_projects_routes_with_old_name.size
}.by(0).and change {
subgroup_routes_with_new_name.size
}.by(0).and change {
subgroup_projects_routes_with_new_name.size
}.by(0)
expect { execute }
.to not_change { subgroup_routes_with_old_name.size }
.and not_change { subgroup_projects_routes_with_old_name.size }
.and not_change { subgroup_routes_with_new_name.size }
.and not_change { subgroup_projects_routes_with_new_name.size }
end
end

View File

@ -2604,7 +2604,6 @@
- './spec/controllers/repositories/git_http_controller_spec.rb'
- './spec/controllers/repositories/lfs_storage_controller_spec.rb'
- './spec/controllers/root_controller_spec.rb'
- './spec/controllers/search_controller_spec.rb'
- './spec/controllers/sent_notifications_controller_spec.rb'
- './spec/controllers/sessions_controller_spec.rb'
- './spec/controllers/snippets/blobs_controller_spec.rb'

View File

@ -29,7 +29,7 @@ RSpec.shared_examples 'todos actions' do
sign_in(user)
expect do
post_create
end.to change { user.todos.count }.by(0)
end.to not_change { user.todos.count }
expect(response).to have_gitlab_http_status(:not_found)
end
@ -37,7 +37,7 @@ RSpec.shared_examples 'todos actions' do
it 'does not create todo when user is not logged in' do
expect do
post_create
end.to change { user.todos.count }.by(0)
end.to not_change { user.todos.count }
expect(response).to have_gitlab_http_status(:found)
end

View File

@ -88,7 +88,7 @@ RSpec.shared_examples 'issuable supports timelog creation mutation' do
it 'returns an error' do
expect do
post_graphql_mutation(mutation, current_user: current_user)
end.to change { Timelog.count }.by(0)
end.to not_change { Timelog.count }
expect(response).to have_gitlab_http_status(:success)
expect(mutation_response['errors']).to match_array(

View File

@ -342,7 +342,7 @@ RSpec.shared_examples 'a class that supports relative positioning' do
it 'can leap-frog STEPS times before needing to rebalance' do
expect { RelativePositioning::STEPS.times { leap_frog } }
.to change { item3.reload.relative_position }.by(0)
.to not_change { item3.reload.relative_position }
.and change { item1.reload.relative_position }.by(be < 0)
.and change { item2.reload.relative_position }.by(be < 0)
@ -429,13 +429,13 @@ RSpec.shared_examples 'a class that supports relative positioning' do
it 'rebalances after STEPS jumps' do
RelativePositioning::STEPS.pred.times do
expect { leap_frog }
.to change { item3.reload.relative_position }.by(0)
.to not_change { item3.reload.relative_position }
.and change { item1.reset.relative_position }.by(be >= 0)
.and change { item2.reset.relative_position }.by(be >= 0)
end
expect { leap_frog }
.to change { item3.reload.relative_position }.by(0)
.to not_change { item3.reload.relative_position }
.and change { item1.reset.relative_position }.by(be < 0)
.and change { item2.reset.relative_position }.by(be < 0)
end

View File

@ -37,9 +37,9 @@ RSpec.shared_examples 'PyPI package creation' do |user_type, status, add_member
create(:package_file, :pypi, package: existing_package, file_name: params[:content].original_filename)
expect { subject }
.to change { Packages::Pypi::Package.for_projects(project).count }.by(0)
.and change { Packages::PackageFile.count }.by(0)
.and change { Packages::Pypi::Metadatum.count }.by(0)
.to not_change { Packages::Pypi::Package.for_projects(project).count }
.and not_change { Packages::PackageFile.count }
.and not_change { Packages::Pypi::Metadatum.count }
expect(response).to have_gitlab_http_status(:bad_request)
end

View File

@ -22,7 +22,7 @@ end
RSpec.shared_examples 'create cluster service error' do
it 'returns an error' do
expect { subject }.to change { Clusters::Cluster.count }.by(0)
expect { subject }.to not_change { Clusters::Cluster.count }
expect(subject.errors[:"provider_gcp.gcp_project_id"]).to be_present
end
end

View File

@ -29,7 +29,7 @@ RSpec.shared_examples 'moves repository shard in bulk' do
expect(subject).to receive(:log_info)
.with(/Container #{container.full_path} \(#{container.id}\) was skipped: #{expected_class} is read-only/)
expect { subject.execute(source_storage_name, destination_storage_name) }
.to change { move_service_klass.count }.by(0)
.to not_change { move_service_klass.count }
end
end
end

View File

@ -48,7 +48,7 @@ RSpec.shared_examples 'WikiPages::UpdateService#execute' do |container_type|
end
it 'doesn not create a WikiPage::Meta record' do
expect { service.execute(page) }.to change { WikiPage::Meta.count }.by 0
expect { service.execute(page) }.to not_change { WikiPage::Meta.count }
end
end

View File

@ -10,4 +10,16 @@ RSpec.describe 'layouts/minimal', feature_category: :notifications do
expect(rendered).not_to render_template('layouts/_broadcast')
end
end
context 'when content_for(:hide_empty_navbar) is present' do
before do
view.content_for(:hide_empty_navbar, true)
end
it 'does not render the empty navbar layout' do
render
expect(rendered).not_to render_template('layouts/header/_empty')
end
end
end