Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2025-05-16 06:09:15 +00:00
parent 84c9f1fc10
commit 0cdf3ec515
18 changed files with 157 additions and 107 deletions

View File

@ -585,7 +585,6 @@ lib/gitlab/checks/**
/doc/administration/broadcast_messages.md @sselhorn
/doc/administration/cicd/ @lyspin
/doc/administration/cicd/job_logs.md @rsarangadharan
/doc/administration/clusters/ @z_painter
/doc/administration/compliance/ @eread
/doc/administration/configure.md @axil
/doc/administration/consul.md @axil
@ -617,7 +616,6 @@ lib/gitlab/checks/**
/doc/administration/integration/kroki.md @msedlakjakubowski
/doc/administration/integration/mailgun.md @msedlakjakubowski
/doc/administration/integration/plantuml.md @brendan777
/doc/administration/integration/terminal.md @z_painter
/doc/administration/internal_users.md @eread
/doc/administration/invalidate_markdown_cache.md @msedlakjakubowski
/doc/administration/issue_closing_pattern.md @aqualls
@ -702,7 +700,6 @@ lib/gitlab/checks/**
/doc/administration/settings/security_and_compliance.md @rdickenson
/doc/administration/settings/security_contact_information.md @eread
/doc/administration/settings/slack_app.md @ashrafkhamis
/doc/administration/settings/terraform_limits.md @z_painter
/doc/administration/settings/third_party_offers.md @phillipwells
/doc/administration/settings/visibility_and_access_controls.md @brendan777
/doc/administration/settings/vscode_extension_marketplace.md @brendan777
@ -713,7 +710,6 @@ lib/gitlab/checks/**
/doc/administration/snippets/ @brendan777
/doc/administration/static_objects_external_storage.md @brendan777
/doc/administration/system_hooks.md @ashrafkhamis
/doc/administration/terraform_state.md @z_painter
/doc/administration/timezone.md @axil
/doc/administration/troubleshooting/ @axil
/doc/administration/uploads.md @axil
@ -733,8 +729,6 @@ lib/gitlab/checks/**
/doc/api/branches.md @brendan777
/doc/api/bulk_imports.md @ashrafkhamis
/doc/api/chat.md @jglassman1
/doc/api/cluster_agents.md @z_painter
/doc/api/cluster_discovery.md @z_painter
/doc/api/code_suggestions.md @jglassman1
/doc/api/commits.md @brendan777
/doc/api/container_registry.md @z_painter
@ -743,23 +737,15 @@ lib/gitlab/checks/**
/doc/api/dependencies.md @rdickenson
/doc/api/dependency_list_export.md @rlehmann1
/doc/api/dependency_proxy.md @z_painter
/doc/api/deploy_keys.md @z_painter
/doc/api/deploy_tokens.md @z_painter
/doc/api/deployments.md @z_painter
/doc/api/discussions.md @brendan777
/doc/api/dora/ @lciutacu
/doc/api/draft_notes.md @aqualls
/doc/api/emoji_reactions.md @msedlakjakubowski
/doc/api/environments.md @z_painter
/doc/api/epic_issues.md @msedlakjakubowski
/doc/api/epic_links.md @msedlakjakubowski
/doc/api/epics.md @msedlakjakubowski
/doc/api/error_tracking.md @lciutacu
/doc/api/external_controls.md @eread
/doc/api/feature_flag_user_lists.md @z_painter
/doc/api/feature_flags.md @z_painter
/doc/api/features.md @z_painter
/doc/api/freeze_periods.md @z_painter
/doc/api/geo_nodes.md @axil
/doc/api/geo_sites.md @axil
/doc/api/google_cloud_integration.md @idurham
@ -781,7 +767,6 @@ lib/gitlab/checks/**
/doc/api/group_activity_analytics.md @lciutacu
/doc/api/group_badges.md @phillipwells
/doc/api/group_boards.md @msedlakjakubowski
/doc/api/group_clusters.md @z_painter
/doc/api/group_enterprise_users.md @idurham
/doc/api/group_epic_boards.md @msedlakjakubowski
/doc/api/group_import_export.md @ashrafkhamis
@ -794,10 +779,8 @@ lib/gitlab/checks/**
/doc/api/group_milestones.md @msedlakjakubowski
/doc/api/group_placeholder_reassignments.md @ashrafkhamis
/doc/api/group_protected_branches.md @brendan777
/doc/api/group_protected_environments.md @z_painter
/doc/api/group_push_rules.md @brendan777
/doc/api/group_relations_export.md @ashrafkhamis
/doc/api/group_releases.md @z_painter
/doc/api/group_repository_storage_moves.md @brendan777
/doc/api/group_service_accounts.md @idurham
/doc/api/group_ssh_certificates.md @brendan777
@ -805,7 +788,6 @@ lib/gitlab/checks/**
/doc/api/group_wikis.md @msedlakjakubowski
/doc/api/groups.md @phillipwells
/doc/api/import.md @ashrafkhamis
/doc/api/instance_clusters.md @z_painter
/doc/api/instance_level_ci_variables.md @marcel.amirault
/doc/api/invitations.md @phillipwells
/doc/api/issue_links.md @msedlakjakubowski
@ -828,7 +810,6 @@ lib/gitlab/checks/**
/doc/api/merge_request_context_commits.md @aqualls
/doc/api/merge_requests.md @aqualls
/doc/api/merge_trains.md @lyspin
/doc/api/metadata.md @z_painter
/doc/api/milestones.md @msedlakjakubowski
/doc/api/namespaces.md @phillipwells
/doc/api/notes.md @msedlakjakubowski
@ -849,7 +830,6 @@ lib/gitlab/checks/**
/doc/api/project_access_tokens.md @idurham
/doc/api/project_aliases.md @brendan777
/doc/api/project_badges.md @brendan777
/doc/api/project_clusters.md @z_painter
/doc/api/project_forks.md @phillipwells
/doc/api/project_import_export.md @ashrafkhamis
/doc/api/project_integrations.md @ashrafkhamis
@ -870,14 +850,11 @@ lib/gitlab/checks/**
/doc/api/project_webhooks.md @ashrafkhamis
/doc/api/projects.md @phillipwells
/doc/api/protected_branches.md @brendan777
/doc/api/protected_environments.md @z_painter
/doc/api/protected_tags.md @brendan777
/doc/api/releases/ @z_painter
/doc/api/remote_mirrors.md @brendan777
/doc/api/repositories.md @brendan777
/doc/api/repository_files.md @brendan777
/doc/api/repository_submodules.md @brendan777
/doc/api/resource_groups.md @z_painter
/doc/api/resource_iteration_events.md @msedlakjakubowski
/doc/api/resource_label_events.md @eread
/doc/api/resource_milestone_events.md @msedlakjakubowski
@ -912,7 +889,6 @@ lib/gitlab/checks/**
/doc/api/user_service_accounts.md @idurham
/doc/api/user_tokens.md @idurham
/doc/api/users.md @idurham
/doc/api/version.md @z_painter
/doc/api/vulnerabilities.md @rlehmann1
/doc/api/vulnerability_exports.md @rlehmann1
/doc/api/vulnerability_findings.md @rlehmann1
@ -920,17 +896,13 @@ lib/gitlab/checks/**
/doc/api/wikis.md @msedlakjakubowski
/doc/ci/_index.md @lyspin
/doc/ci/caching/ @marcel.amirault
/doc/ci/chatops/ @z_painter
/doc/ci/ci_cd_for_external_repos/ @lyspin
/doc/ci/cloud_deployment/ @z_painter
/doc/ci/cloud_services/ @marcel.amirault
/doc/ci/components/ @marcel.amirault
/doc/ci/debugging.md @marcel.amirault
/doc/ci/docker/ @lyspin
/doc/ci/docker/using_docker_images.md @rsarangadharan
/doc/ci/environments/ @z_painter
/doc/ci/examples/ @lyspin
/doc/ci/examples/deployment/ @z_painter
/doc/ci/examples/semantic-release.md @z_painter
/doc/ci/gitlab_google_cloud_integration/ @z_painter
/doc/ci/inputs/ @marcel.amirault
@ -952,7 +924,6 @@ lib/gitlab/checks/**
/doc/ci/pipelines/pipeline_architectures.md @marcel.amirault
/doc/ci/pipelines/pipeline_security.md @marcel.amirault
/doc/ci/quick_start/ @marcel.amirault
/doc/ci/resource_groups/ @z_painter
/doc/ci/review_apps/ @lyspin
/doc/ci/runners/ @rsarangadharan
/doc/ci/runners/git_submodules.md @lyspin
@ -1035,9 +1006,7 @@ lib/gitlab/checks/**
/doc/integration/snowflake.md @eread
/doc/integration/sourcegraph.md @brendan777
/doc/integration/trello_power_up.md @ashrafkhamis
/doc/integration/vault.md @z_painter
/doc/operations/ @lciutacu
/doc/operations/feature_flags.md @z_painter
/doc/policy/ @axil
/doc/security/ @idurham
/doc/security/asset_proxy.md @msedlakjakubowski
@ -1047,7 +1016,6 @@ lib/gitlab/checks/**
/doc/subscriptions/gitlab_com/ @lyspin
/doc/subscriptions/gitlab_dedicated/ @lyspin
/doc/topics/ @msedlakjakubowski
/doc/topics/autodevops/ @z_painter
/doc/topics/git/ @brendan777
/doc/topics/git/project.md @phillipwells
/doc/topics/offline/ @axil
@ -1085,8 +1053,6 @@ lib/gitlab/checks/**
/doc/tutorials/website_project_with_analytics/ @lciutacu
/doc/update/ @axil
/doc/user/analytics/ @lciutacu
/doc/user/analytics/ci_cd_analytics.md @z_painter
/doc/user/analytics/dora_metrics_charts.md @z_painter
/doc/user/application_security/ @rdickenson
/doc/user/application_security/api_fuzzing/ @phillipwells
/doc/user/application_security/api_security/ @phillipwells
@ -1106,7 +1072,6 @@ lib/gitlab/checks/**
/doc/user/application_security/vulnerability_archival/ @rlehmann1
/doc/user/application_security/vulnerability_report/ @rlehmann1
/doc/user/asciidoc.md @brendan777
/doc/user/clusters/ @z_painter
/doc/user/compliance/ @eread
/doc/user/compliance/license_approval_policies.md @rlehmann1
/doc/user/compliance/license_scanning_of_cyclonedx_files/ @rdickenson
@ -1118,7 +1083,6 @@ lib/gitlab/checks/**
/doc/user/emoji_reactions.md @msedlakjakubowski
/doc/user/enterprise_user/ @idurham
/doc/user/get_started/get_started_managing_code.md @brendan777
/doc/user/get_started/get_started_managing_infrastructure.md @z_painter
/doc/user/get_started/get_started_monitoring.md @lciutacu
/doc/user/get_started/get_started_planning_work.md @msedlakjakubowski
/doc/user/get_started/get_started_projects.md @phillipwells
@ -1129,7 +1093,6 @@ lib/gitlab/checks/**
/doc/user/glql/ @msedlakjakubowski
/doc/user/group/_index.md @phillipwells
/doc/user/group/access_and_permissions.md @phillipwells
/doc/user/group/clusters/ @z_painter
/doc/user/group/contribution_analytics/ @lciutacu
/doc/user/group/credentials_inventory.md @idurham
/doc/user/group/custom_project_templates.md @brendan777
@ -1150,13 +1113,10 @@ lib/gitlab/checks/**
/doc/user/group/subgroups/ @phillipwells
/doc/user/group/troubleshooting.md @phillipwells
/doc/user/group/value_stream_analytics/ @lciutacu
/doc/user/infrastructure/ @z_painter
/doc/user/infrastructure/clusters/manage/management_project_applications/ @z_painter
/doc/user/infrastructure/clusters/manage/management_project_applications/runner.md @rsarangadharan
/doc/user/infrastructure/clusters/manage/management_project_applications/ @rsarangadharan
/doc/user/markdown.md @msedlakjakubowski
/doc/user/namespace/ @phillipwells
/doc/user/okrs.md @msedlakjakubowski
/doc/user/operations_dashboard/ @z_painter
/doc/user/organization/ @phillipwells
/doc/user/packages/ @z_painter
/doc/user/permissions.md @idurham
@ -1174,12 +1134,8 @@ lib/gitlab/checks/**
/doc/user/project/autocomplete_characters.md @brendan777
/doc/user/project/badges.md @phillipwells
/doc/user/project/changelogs.md @brendan777
/doc/user/project/clusters/ @z_painter
/doc/user/project/code_intelligence.md @aqualls
/doc/user/project/codeowners/ @brendan777
/doc/user/project/deploy_boards.md @z_painter
/doc/user/project/deploy_keys/ @z_painter
/doc/user/project/deploy_tokens/ @z_painter
/doc/user/project/description_templates.md @msedlakjakubowski
/doc/user/project/file_lock.md @brendan777
/doc/user/project/import/ @ashrafkhamis
@ -1212,8 +1168,7 @@ lib/gitlab/checks/**
/doc/user/project/project_topics.md @phillipwells
/doc/user/project/protected_tags.md @brendan777
/doc/user/project/quick_actions.md @msedlakjakubowski
/doc/user/project/releases/ @z_painter
/doc/user/project/releases/release_evidence.md @eread
/doc/user/project/releases/ @eread
/doc/user/project/remote_development/ @brendan777
/doc/user/project/repository/ @brendan777
/doc/user/project/repository/code_explain.md @jglassman1

View File

@ -1 +1 @@
a6759e58c21ed1c1238cc9a67abfdb0de9f87bd8
8fc6c779703b039264b24dc38cd311c3f8a2150c

View File

@ -189,6 +189,9 @@ export default {
showCompactCodeDropdown() {
return this.glFeatures.directoryCodeDropdownUpdates;
},
showBlobControls() {
return this.$route.params.path && this.$route.name === 'blobPathDecoded';
},
},
methods: {
onInput(selectedRef) {
@ -272,7 +275,11 @@ export default {
</h1>
<!-- Tree controls -->
<div v-if="isTreeView" class="tree-controls gl-mb-3 gl-flex gl-flex-wrap gl-gap-3 sm:gl-mb-0">
<div
v-if="!showBlobControls"
class="tree-controls gl-mb-3 gl-flex gl-flex-wrap gl-gap-3 sm:gl-mb-0"
data-testid="tree-controls-container"
>
<add-to-tree
v-if="!isReadmeView && showCompactCodeDropdown"
class="gl-hidden sm:gl-block"
@ -411,6 +418,7 @@ export default {
<!-- Blob controls -->
<blob-controls
v-if="showBlobControls"
:project-path="projectPath"
:project-id-as-number="projectIdAsNumber"
:ref-type="getRefType"

View File

@ -23,7 +23,6 @@ import {
import { sanitize } from '~/lib/dompurify';
import { InternalEvents } from '~/tracking';
import { FIND_FILE_BUTTON_CLICK, BLAME_BUTTON_CLICK } from '~/tracking/constants';
import { updateElementsVisibility } from '~/repository/utils/dom';
import {
showSingleFileEditorForkSuggestion,
showWebIdeForkSuggestion,
@ -148,9 +147,6 @@ export default {
filePath() {
return this.$route.params.path;
},
showBlobControls() {
return this.filePath && this.$route.name === 'blobPathDecoded';
},
blobInfo() {
return this.project?.repository?.blobs?.nodes[0] || {};
},
@ -219,9 +215,6 @@ export default {
},
},
watch: {
showBlobControls(shouldShow) {
updateElementsVisibility('.tree-controls', !shouldShow);
},
blobInfo() {
initSourcegraph();
this.$nextTick(() => {
@ -281,7 +274,6 @@ export default {
</script>
<template>
<div
v-if="showBlobControls"
class="gl-flex gl-flex-wrap gl-items-center gl-gap-3 gl-self-end"
data-testid="blob-controls"
>

View File

@ -38,6 +38,7 @@ module MergeRequests
if merge_request.previous_changes.include?('title') ||
merge_request.previous_changes.include?('description')
todo_service.update_merge_request(merge_request, current_user, old_mentioned_users)
handle_title_and_desc_edits(merge_request, merge_request.previous_changes.keys)
end
handle_target_branch_change(merge_request, changed_fields)
@ -134,6 +135,24 @@ module MergeRequests
update_task_event(merge_request) || update(merge_request)
end
def handle_title_and_desc_edits(merge_request, changed_fields)
fields = %w[title description]
return unless changed_fields.any? { |field| fields.include?(field) }
return unless merge_request.auto_merge_enabled?
return unless should_publish_update_event?(merge_request, changed_fields)
::Gitlab::EventStore.publish(
::MergeRequests::AutoMerge::TitleDescriptionUpdateEvent.new(data: { current_user_id: current_user.id, merge_request_id: merge_request.id })
)
end
def should_publish_update_event?(merge_request, changed_fields)
::Feature.enabled?(:merge_request_title_regex, merge_request.project) &&
changed_fields.include?('title') &&
merge_request.project.merge_request_title_regex.present?
end
def track_title_and_desc_edits(changed_fields)
tracked_fields = %w[title description]

View File

@ -8,14 +8,6 @@ description: Rpm package metadata
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/96019
milestone: '15.4'
gitlab_schema: gitlab_main_cell
desired_sharding_key:
project_id:
references: projects
backfill_via:
parent:
foreign_key: package_id
table: packages_packages
sharding_key: project_id
belongs_to: package
desired_sharding_key_migration_job_name: BackfillPackagesRpmMetadataProjectId
sharding_key:
project_id: projects
table_size: small

View File

@ -0,0 +1,14 @@
# frozen_string_literal: true
class AddPackagesRpmMetadataProjectIdNotNull < Gitlab::Database::Migration[2.3]
milestone '18.1'
disable_ddl_transaction!
def up
add_not_null_constraint :packages_rpm_metadata, :project_id
end
def down
remove_not_null_constraint :packages_rpm_metadata, :project_id
end
end

View File

@ -0,0 +1,13 @@
# frozen_string_literal: true
class RemoveProjectFingerprintFromVulnerabilityOccurrences < Gitlab::Database::Migration[2.3]
milestone '18.1'
def up
remove_column :vulnerability_occurrences, :project_fingerprint
end
def down
add_column :vulnerability_occurrences, :project_fingerprint, :bytea
end
end

View File

@ -0,0 +1 @@
ca76429105fb0c90cfa978e4efc2aed255b9afbae1c52390ea39581f0ccee8a7

View File

@ -0,0 +1 @@
ad394e4fc56fd19ba1d2c5cc324cec94127f65587cba3484c1665ebc6b3ecdfa

View File

@ -19486,6 +19486,7 @@ CREATE TABLE packages_rpm_metadata (
epoch integer DEFAULT 0 NOT NULL,
project_id bigint,
CONSTRAINT check_3798bae3d6 CHECK ((char_length(arch) <= 255)),
CONSTRAINT check_4506c26fc1 CHECK ((project_id IS NOT NULL)),
CONSTRAINT check_5d29ba59ac CHECK ((char_length(description) <= 5000)),
CONSTRAINT check_6e8cbd536d CHECK ((char_length(url) <= 1000)),
CONSTRAINT check_845ba4d7d0 CHECK ((char_length(license) <= 1000)),
@ -25077,7 +25078,6 @@ CREATE TABLE vulnerability_occurrences (
project_id bigint NOT NULL,
scanner_id bigint NOT NULL,
primary_identifier_id bigint NOT NULL,
project_fingerprint bytea,
location_fingerprint bytea NOT NULL,
name character varying NOT NULL,
metadata_version character varying NOT NULL,

View File

@ -50,7 +50,7 @@ namespace :tw do
CodeOwnerRule.new('Dynamic Analysis', '@phillipwells'),
CodeOwnerRule.new('Editor Extensions', '@aqualls'),
# CodeOwnerRule.new('Environment Automation', ''),
CodeOwnerRule.new('Environments', '@z_painter'),
# CodeOwnerRule.new('Environments', ''),
# CodeOwnerRule.new('Fulfillment Platform', ''),
CodeOwnerRule.new('Fuzz Testing', '@rdickenson'),
CodeOwnerRule.new('Geo', '@axil'),

View File

@ -65,7 +65,7 @@ class Cli
3) Define metric (using CLI)
4) View data in Tableau (after merge & deploy)
This CLI will help you create the correct defintion files, then provide code examples for instrumentation and testing.
This CLI will help you create the correct definition files, then provide code examples for instrumentation and testing.
Learn more: https://docs.gitlab.com/ee/development/internal_analytics/#fundamental-concepts

View File

@ -128,6 +128,9 @@ module InternalEventsCli
When the built-in properties are insufficient, properties of any name can be provided.
This option becomes available after both property and label are defined, or after value is defined.
WARNING: Make sure the additional properties dont contain any sensitive information, like customer data or PII.
For more information, see the Data Classification Standard at https://about.gitlab.com/handbook/security/data-classification-standard/
TEXT
ADDITIONAL_PROPERTIES_ADD_MORE_HELP = <<~TEXT.freeze

View File

@ -21,7 +21,6 @@ import blobControlsQuery from '~/repository/queries/blob_controls.query.graphql'
import userGitpodInfo from '~/repository/queries/user_gitpod_info.query.graphql';
import applicationInfoQuery from '~/blob/queries/application_info.query.graphql';
import createRouter from '~/repository/router';
import { updateElementsVisibility } from '~/repository/utils/dom';
import OpenMrBadge from '~/repository/components/header_area/open_mr_badge.vue';
import ForkSuggestionModal from '~/repository/components/header_area/fork_suggestion_modal.vue';
import {
@ -90,7 +89,6 @@ describe('Blob controls component', () => {
currentUserResolver = currentUserSuccessResolver,
applicationInfoResolver = applicationInfoSuccessResolver,
glFeatures = { blobOverflowMenu: false },
routerOverride = {},
} = {}) => {
const projectPath = 'some/project';
router = createRouter(projectPath, refMock);
@ -98,7 +96,6 @@ describe('Blob controls component', () => {
await router.push({
name: 'blobPathDecoded',
params: { path: '/some/file.js' },
...routerOverride,
});
await resetShortcutsForTests();
@ -150,40 +147,6 @@ describe('Blob controls component', () => {
fakeApollo = null;
});
describe('showBlobControls', () => {
it('should not render blob controls when filePath does not exist', async () => {
await createComponent({
routerOverride: { name: 'blobPathDecoded', params: null },
});
expect(wrapper.element).not.toBeVisible();
});
it('should not render blob controls when route name is not blobPathDecoded', async () => {
await createComponent({
routerOverride: { name: 'blobPath', params: { path: '/some/file.js' } },
});
expect(wrapper.element).not.toBeVisible();
});
});
it.each`
name | path
${'blobPathDecoded'} | ${null}
${'treePathDecoded'} | ${'myFile.js'}
`(
'does not render any buttons if router name is $name and router path is $path',
async ({ name, path }) => {
await router.replace({ name, params: { path } });
await nextTick();
expect(findFindButton().exists()).toBe(false);
expect(findBlameButton().exists()).toBe(false);
expect(findPermalinkButton().exists()).toBe(false);
expect(updateElementsVisibility).toHaveBeenCalledWith('.tree-controls', true);
},
);
it('loads the ShortcutsBlob', () => {
expect(ShortcutsBlob).toHaveBeenCalled();
});

View File

@ -43,6 +43,7 @@ describe('HeaderArea', () => {
const findFileIcon = () => wrapper.findComponent(FileIcon);
const findRepositoryOverflowMenu = () => wrapper.findComponent(RepositoryOverflowMenu);
const findBlobControls = () => wrapper.findComponent(BlobControls);
const findTreeControls = () => wrapper.findByTestId('tree-controls-container');
const { bindInternalEventDocument } = useMockInternalEventsTracking();
@ -72,6 +73,10 @@ describe('HeaderArea', () => {
$route: {
...defaultMockRoute,
...route,
params: {
...defaultMockRoute.params,
...(route.params || {}),
},
},
},
});
@ -97,6 +102,13 @@ describe('HeaderArea', () => {
expect(findPageHeading().exists()).toBe(true);
});
describe('showTreeControls', () => {
it('should not render tree controls for blob view', () => {
wrapper = createComponent({}, { name: 'blobPathDecoded' });
expect(findTreeControls().exists()).toBe(false);
});
});
describe('when rendered for tree view', () => {
beforeEach(() => {
wrapper = createComponent({
@ -236,6 +248,20 @@ describe('HeaderArea', () => {
});
describe('when rendered for blob view', () => {
describe('showBlobControls', () => {
it('should not render blob controls when filePath does not exist', () => {
wrapper = createComponent({ route: { name: 'blobPathDecoded', params: { path: null } } });
expect(findBlobControls().exists()).toBe(false);
});
it('should not render blob controls when route name is not blobPathDecoded', () => {
wrapper = createComponent({
route: { name: 'blobPath', params: { path: '/some/file.js' } },
});
expect(findBlobControls().exists()).toBe(false);
});
});
it('renders BlobControls component with correct props', () => {
wrapper = createComponent({ props: { refType: 'branch' } });
expect(findBlobControls().exists()).toBe(true);

View File

@ -1109,6 +1109,46 @@ RSpec.describe MergeRequests::UpdateService, :mailer, feature_category: :code_re
end
end
describe 'AutoMerge::TitleDescriptionUpdateEvent' do
let(:auto_merge_enabled) { true }
let(:title_regex) { 'test' }
before do
merge_request.update!(auto_merge_enabled: true, merge_user: user) if auto_merge_enabled
project.update!(merge_request_title_regex: title_regex)
end
context 'when the title changes' do
let(:update_params) { { title: 'New title' } }
context 'when project has a required regex' do
context 'when auto merge is enabled' do
it_behaves_like 'it publishes the AutoMerge::TitleDescriptionUpdateEvent once'
context 'when merge_request_title_regex ff is off' do
before do
stub_feature_flags(merge_request_title_regex: false)
end
it_behaves_like 'it does not publish the AutoMerge::TitleDescriptionUpdateEvent'
end
end
context 'when auto merge is not enabled' do
let(:auto_merge_enabled) { false }
it_behaves_like 'it does not publish the AutoMerge::TitleDescriptionUpdateEvent'
end
end
context 'when project has no required regex' do
let(:title_regex) { nil }
it_behaves_like 'it does not publish the AutoMerge::TitleDescriptionUpdateEvent'
end
end
end
context 'while saving references to issues that the updated merge request closes', :aggregate_failures do
let_it_be(:user) { create(:user) }
let_it_be(:group) { create(:group, :public) }

View File

@ -147,3 +147,26 @@ RSpec.shared_examples 'with an existing branch but no open MR' do |count|
it_behaves_like 'when coupled with the `create` push option', count
end
RSpec.shared_examples 'it does not publish the AutoMerge::TitleDescriptionUpdateEvent' do
it 'does not publish a AutoMerge::TitleDescriptionUpdateEvent' do
expect do
update_merge_request(update_params)
end.to not_publish_event(MergeRequests::AutoMerge::TitleDescriptionUpdateEvent)
end
end
RSpec.shared_examples 'it publishes the AutoMerge::TitleDescriptionUpdateEvent once' do
it 'publishes a AutoMerge::TitleDescriptionUpdateEvent' do
expect(::MergeRequests::AutoMerge::TitleDescriptionUpdateEvent).to receive(:new).once.and_call_original
expected_data = {
current_user_id: user.id,
merge_request_id: merge_request.id
}
expect do
update_merge_request(update_params)
end.to publish_event(MergeRequests::AutoMerge::TitleDescriptionUpdateEvent).with(expected_data)
end
end