Skip to content

Commit 493820a

Browse files
author
GitLab Bot
committed
Add latest changes from gitlab-org/gitlab@master
1 parent 3e14ece commit 493820a

File tree

26 files changed

+357
-28
lines changed

26 files changed

+357
-28
lines changed

.prettierrc

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
{
2+
"plugins": ["prettier-plugin-tailwindcss"],
3+
"tailwindConfig": "./config/tailwind.config.js",
24
"printWidth": 100,
35
"singleQuote": true,
46
"arrowParens": "always",

app/assets/javascripts/ci/catalog/components/details/ci_resource_header.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ export default {
172172
</div>
173173
<div
174174
v-if="isLoadingData"
175-
class="gl-my-3 gl-h-4 !gl-max-w-20 gl-rounded-base gl-animate-skeleton-loader"
175+
class="gl-animate-skeleton-loader gl-my-3 gl-h-4 !gl-max-w-20 gl-rounded-base"
176176
></div>
177177
<markdown v-else class="gl-mb-5" :markdown="resource.description" />
178178
<abuse-category-selector

app/assets/javascripts/ci/catalog/components/details/ci_resource_header_skeleton_loader.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ export default {};
44

55
<template>
66
<div class="gl-flex">
7-
<div class="gl-h-11 gl-w-11 gl-rounded-base gl-animate-skeleton-loader"></div>
7+
<div class="gl-animate-skeleton-loader gl-h-11 gl-w-11 gl-rounded-base"></div>
88
<div class="gl-flex gl-flex-col gl-items-center gl-justify-center gl-pl-4">
9-
<div class="gl-mb-3 gl-h-4 gl-w-20 gl-rounded-base gl-animate-skeleton-loader"></div>
10-
<div class="gl-h-4 gl-w-20 gl-rounded-base gl-animate-skeleton-loader"></div>
9+
<div class="gl-animate-skeleton-loader gl-mb-3 gl-h-4 gl-w-20 gl-rounded-base"></div>
10+
<div class="gl-animate-skeleton-loader gl-h-4 gl-w-20 gl-rounded-base"></div>
1111
</div>
1212
</div>
1313
</template>

app/assets/javascripts/deploy_keys/components/keys_panel.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export default {
4343
:project-id="projectId"
4444
/>
4545
</template>
46-
<div v-else class="gl-text-subtle gl-bg-gray-10 gl-p-5" data-testid="empty-state">
46+
<div v-else class="gl-bg-gray-10 gl-p-5 gl-text-subtle" data-testid="empty-state">
4747
{{ s__('DeployKeys|No deploy keys found, start by adding a new one above.') }}
4848
</div>
4949
</div>

app/assets/javascripts/diffs/components/diff_gutter_avatars.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export default {
9090
v-if="moreText"
9191
v-gl-tooltip
9292
:title="moreText"
93-
class="diff-comments-more-count js-diff-comment-avatar js-diff-comment-plus gl-flex gl-justify-center gl-items-center gl-h-6 gl-min-w-6"
93+
class="diff-comments-more-count js-diff-comment-avatar js-diff-comment-plus gl-flex gl-h-6 gl-min-w-6 gl-items-center gl-justify-center"
9494
data-container="body"
9595
data-placement="top"
9696
role="button"

app/assets/javascripts/merge_requests/components/reviewers/reviewers_container.vue

+5-5
Original file line numberDiff line numberDiff line change
@@ -68,18 +68,18 @@ export default {
6868
<div>
6969
<div class="gl-mb-3 gl-flex gl-w-full gl-items-center gl-font-bold gl-leading-20">
7070
<template v-if="loadingReviewers">
71-
<div class="gl-h-4 gl-w-20 gl-rounded-base gl-animate-skeleton-loader"></div>
72-
<div class="gl-ml-auto gl-h-4 gl-w-4 gl-rounded-base gl-animate-skeleton-loader"></div>
71+
<div class="gl-animate-skeleton-loader gl-h-4 gl-w-20 gl-rounded-base"></div>
72+
<div class="gl-animate-skeleton-loader gl-ml-auto gl-h-4 gl-w-4 gl-rounded-base"></div>
7373
</template>
7474
<template v-else>
7575
{{ reviewersTitle }}
7676
<reviewer-dropdown :selected-reviewers="reviewers" class="gl-ml-auto" />
7777
</template>
7878
</div>
7979
<div v-if="loadingReviewers">
80-
<div class="gl-mb-3 gl-h-4 !gl-max-w-20 gl-rounded-base gl-animate-skeleton-loader"></div>
81-
<div class="gl-mb-3 gl-h-4 !gl-max-w-20 gl-rounded-base gl-animate-skeleton-loader"></div>
82-
<div class="gl-h-4 !gl-max-w-20 gl-rounded-base gl-animate-skeleton-loader"></div>
80+
<div class="gl-animate-skeleton-loader gl-mb-3 gl-h-4 !gl-max-w-20 gl-rounded-base"></div>
81+
<div class="gl-animate-skeleton-loader gl-mb-3 gl-h-4 !gl-max-w-20 gl-rounded-base"></div>
82+
<div class="gl-animate-skeleton-loader gl-h-4 !gl-max-w-20 gl-rounded-base"></div>
8383
</div>
8484
<uncollapsed-reviewer-list
8585
v-else-if="reviewers.length"

app/assets/javascripts/work_items/components/work_item_attributes_wrapper.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ export default {
336336
/>
337337
<template v-if="workItemCrmContacts">
338338
<work-item-crm-contacts
339-
class="gl-mb-5 gl-pt-5 gl-border-t gl-border-gray-50"
339+
class="gl-border-t gl-mb-5 gl-border-gray-50 gl-pt-5"
340340
:full-path="fullPath"
341341
:work-item-id="workItem.id"
342342
:work-item-iid="workItem.iid"

app/assets/javascripts/work_items/components/work_item_crm_contacts.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ export default {
290290
:key="organizationName"
291291
data-testid="organization"
292292
>
293-
<div class="gl-text-secondary gl-mt-3">{{ organizationName }}</div>
293+
<div class="gl-mt-3 gl-text-secondary">{{ organizationName }}</div>
294294
<div v-for="contact in contacts" :key="contact.id" data-testid="contact">
295295
<gl-link
296296
:id="`contact_${contact.id}`"
@@ -324,7 +324,7 @@ export default {
324324
</div>
325325
<div
326326
v-if="organizationName !== s__('Crm|No organization')"
327-
class="gl-bg-gray-50 gl-rounded-base gl-p-3 gl-flex gl-flex-col gl-gap-2"
327+
class="gl-flex gl-flex-col gl-gap-2 gl-rounded-base gl-bg-gray-50 gl-p-3"
328328
>
329329
<div class="gl-font-bold">{{ organizationName }}</div>
330330
<div
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# frozen_string_literal: true
2+
3+
module Mutations
4+
module WorkItems
5+
class BulkUpdate < BaseMutation
6+
graphql_name 'WorkItemBulkUpdate'
7+
8+
include ::Gitlab::Utils::StrongMemoize
9+
10+
MAX_WORK_ITEMS = 100
11+
12+
description 'Allows updating several properties for a set of issues. ' \
13+
'Does nothing if the `bulk_update_issues_mutation` feature flag is disabled.'
14+
15+
argument :ids, [::Types::GlobalIDType[::WorkItem]],
16+
required: true,
17+
description: 'Global ID array of the issues that will be updated. ' \
18+
"IDs that the user can\'t update will be ignored. A max of #{MAX_WORK_ITEMS} can be provided."
19+
argument :parent_id, ::Types::GlobalIDType[::WorkItems::Parent],
20+
required: true,
21+
description: 'Global ID of the parent to which the bulk update will be scoped. ' \
22+
'The parent can be a project. The parent can also be a group (Premium and Ultimate only). ' \
23+
'Example `WorkItemsParentID` are `"gid://gitlab/Project/1"` and `"gid://gitlab/Group/1"`.'
24+
25+
argument :labels_widget,
26+
::Types::WorkItems::Widgets::LabelsUpdateInputType,
27+
required: false,
28+
description: 'Input for labels widget.',
29+
prepare: ->(input, _) { input.to_h }
30+
31+
field :updated_work_item_count, GraphQL::Types::Int,
32+
null: true,
33+
description: 'Number of work items that were successfully updated.'
34+
35+
def ready?(**args)
36+
if Feature.disabled?(:bulk_update_work_items_mutation, parent_for!(args[:parent_id]))
37+
raise_resource_not_available_error!('`bulk_update_work_items_mutation` feature flag is disabled.')
38+
end
39+
40+
if args[:ids].size > MAX_WORK_ITEMS
41+
raise Gitlab::Graphql::Errors::ArgumentError,
42+
format(
43+
_('No more than %{max_work_items} work items can be updated at the same time'),
44+
max_work_items: MAX_WORK_ITEMS
45+
)
46+
end
47+
48+
super
49+
end
50+
51+
def resolve(ids:, parent_id:, **attributes)
52+
parent = parent_for!(parent_id)
53+
54+
result = ::WorkItems::BulkUpdateService.new(
55+
parent: parent,
56+
current_user: current_user,
57+
work_item_ids: ids.map(&:model_id),
58+
widget_params: attributes
59+
).execute
60+
61+
if result.success?
62+
{ updated_work_item_count: result[:updated_work_item_count], errors: result.errors }
63+
else
64+
{ errors: result.errors }
65+
end
66+
end
67+
68+
private
69+
70+
def parent_for!(parent_id)
71+
strong_memoize_with(:parent_for, parent_id) do
72+
parent = GitlabSchema.find_by_gid(parent_id).sync
73+
raise_resource_not_available_error! unless current_user.can?("read_#{parent.to_ability_name}", parent)
74+
75+
parent
76+
end
77+
end
78+
end
79+
end
80+
end
81+
82+
Mutations::WorkItems::BulkUpdate.prepend_mod

app/graphql/types/mutation_type.rb

+1
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ class MutationType < BaseObject
210210
mount_mutation Mutations::WorkItems::LinkedItems::Remove, alpha: { milestone: '16.3' }
211211
mount_mutation Mutations::WorkItems::AddClosingMergeRequest, alpha: { milestone: '17.1' }
212212
mount_mutation Mutations::WorkItems::Hierarchy::Reorder, alpha: { milestone: '17.3' }
213+
mount_mutation Mutations::WorkItems::BulkUpdate, alpha: { milestone: '17.4' }
213214
mount_mutation Mutations::Users::SavedReplies::Create
214215
mount_mutation Mutations::Users::SavedReplies::Update
215216
mount_mutation Mutations::Users::SavedReplies::Destroy
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# frozen_string_literal: true
2+
3+
# == WorkItemParent
4+
#
5+
# Used as a common ancestor for Group and Project so we can allow a polymorphic
6+
# Types::GlobalIDType[::WorkItems::Parent] in the GraphQL API
7+
#
8+
# Used by Project, Group
9+
#
10+
module WorkItems
11+
module Parent
12+
end
13+
end

app/models/project.rb

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class Project < ApplicationRecord
4242
include BlocksUnsafeSerialization
4343
include Subquery
4444
include IssueParent
45+
include WorkItems::Parent
4546
include UpdatedAtFilterable
4647
include IgnorableColumns
4748
include CrossDatabaseIgnoredTables
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
name: bulk_update_work_items_mutation
3+
feature_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/434296
4+
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/161507
5+
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/476586
6+
milestone: '17.4'
7+
group: group::project management
8+
type: beta
9+
default_enabled: true

config/gitlab_loose_foreign_keys.yml

+4
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,10 @@ p_ci_builds_metadata:
338338
- table: projects
339339
column: project_id
340340
on_delete: async_delete
341+
p_ci_finished_pipeline_ch_sync_events:
342+
- table: namespaces
343+
column: project_namespace_id
344+
on_delete: async_delete
341345
p_ci_job_artifacts:
342346
- table: projects
343347
column: project_id

db/docs/p_ci_finished_pipeline_ch_sync_events.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ description: Holds references to finished CI pipelines ready to be synced to Cli
88
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/158060
99
milestone: '17.2'
1010
gitlab_schema: gitlab_ci
11-
sharding_key_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/470152
11+
sharding_key:
12+
project_namespace_id: namespaces
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# frozen_string_literal: true
2+
3+
class AddIndexForCiFinishedPipelineChSyncEventOnProjectNamespaceId < Gitlab::Database::Migration[2.2]
4+
include Gitlab::Database::PartitioningMigrationHelpers
5+
6+
disable_ddl_transaction!
7+
milestone '17.4'
8+
9+
TABLE_NAME = :p_ci_finished_pipeline_ch_sync_events
10+
INDEX_NAME = 'idx_p_ci_finished_pipeline_ch_sync_evts_on_project_namespace_id'
11+
12+
def up
13+
add_concurrent_partitioned_index TABLE_NAME, :project_namespace_id, name: INDEX_NAME
14+
end
15+
16+
def down
17+
remove_concurrent_partitioned_index_by_name(TABLE_NAME, INDEX_NAME)
18+
end
19+
end

db/schema_migrations/20240826150820

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3d883cf651986305ab7e385512a462f9ae78869567ab4749cf43557f5c4a9828

db/structure.sql

+2
Original file line numberDiff line numberDiff line change
@@ -26528,6 +26528,8 @@ CREATE INDEX idx_on_protected_branch ON approval_group_rules_protected_branches
2652826528

2652926529
CREATE INDEX idx_open_issues_on_project_and_confidential_and_author_and_id ON issues USING btree (project_id, confidential, author_id, id) WHERE (state_id = 1);
2653026530

26531+
CREATE INDEX idx_p_ci_finished_pipeline_ch_sync_evts_on_project_namespace_id ON ONLY p_ci_finished_pipeline_ch_sync_events USING btree (project_namespace_id);
26532+
2653126533
CREATE INDEX idx_packages_debian_group_component_files_on_architecture_id ON packages_debian_group_component_files USING btree (architecture_id);
2653226534

2653326535
CREATE INDEX idx_packages_debian_project_component_files_on_architecture_id ON packages_debian_project_component_files USING btree (architecture_id);

doc/api/graphql/reference/index.md

+33
Original file line numberDiff line numberDiff line change
@@ -10372,6 +10372,33 @@ Input type: `WorkItemAddLinkedItemsInput`
1037210372
| <a id="mutationworkitemaddlinkeditemsmessage"></a>`message` | [`String`](#string) | Linked items update result message. |
1037310373
| <a id="mutationworkitemaddlinkeditemsworkitem"></a>`workItem` | [`WorkItem`](#workitem) | Updated work item. |
1037410374

10375+
### `Mutation.workItemBulkUpdate`
10376+
10377+
Allows updating several properties for a set of issues. Does nothing if the `bulk_update_issues_mutation` feature flag is disabled.
10378+
10379+
DETAILS:
10380+
**Introduced** in GitLab 17.4.
10381+
**Status**: Experiment.
10382+
10383+
Input type: `WorkItemBulkUpdateInput`
10384+
10385+
#### Arguments
10386+
10387+
| Name | Type | Description |
10388+
| ---- | ---- | ----------- |
10389+
| <a id="mutationworkitembulkupdateclientmutationid"></a>`clientMutationId` | [`String`](#string) | A unique identifier for the client performing the mutation. |
10390+
| <a id="mutationworkitembulkupdateids"></a>`ids` | [`[WorkItemID!]!`](#workitemid) | Global ID array of the issues that will be updated. IDs that the user can't update will be ignored. A max of 100 can be provided. |
10391+
| <a id="mutationworkitembulkupdatelabelswidget"></a>`labelsWidget` | [`WorkItemWidgetLabelsUpdateInput`](#workitemwidgetlabelsupdateinput) | Input for labels widget. |
10392+
| <a id="mutationworkitembulkupdateparentid"></a>`parentId` | [`WorkItemsParentID!`](#workitemsparentid) | Global ID of the parent to which the bulk update will be scoped. The parent can be a project. The parent can also be a group (Premium and Ultimate only). Example `WorkItemsParentID` are `"gid://gitlab/Project/1"` and `"gid://gitlab/Group/1"`. |
10393+
10394+
#### Fields
10395+
10396+
| Name | Type | Description |
10397+
| ---- | ---- | ----------- |
10398+
| <a id="mutationworkitembulkupdateclientmutationid"></a>`clientMutationId` | [`String`](#string) | A unique identifier for the client performing the mutation. |
10399+
| <a id="mutationworkitembulkupdateerrors"></a>`errors` | [`[String!]!`](#string) | Errors encountered during execution of the mutation. |
10400+
| <a id="mutationworkitembulkupdateupdatedworkitemcount"></a>`updatedWorkItemCount` | [`Int`](#int) | Number of work items that were successfully updated. |
10401+
1037510402
### `Mutation.workItemConvert`
1037610403

1037710404
Converts the work item to a new type.
@@ -39110,6 +39137,12 @@ An example `WorkItemID` is: `"gid://gitlab/WorkItem/1"`.
3911039137
While we transition from Issues into Work Items this type will temporarily support
3911139138
`IssueID` like: `"gid://gitlab/Issue/1"`. This behavior will be removed without notice in the future.
3911239139

39140+
### `WorkItemsParentID`
39141+
39142+
A `WorkItemsParentID` is a global ID. It is encoded as a string.
39143+
39144+
An example `WorkItemsParentID` is: `"gid://gitlab/WorkItems::Parent/1"`.
39145+
3911339146
### `WorkItemsRelatedWorkItemLinkID`
3911439147

3911539148
A `WorkItemsRelatedWorkItemLinkID` is a global ID. It is encoded as a string.

locale/gitlab.pot

+6
Original file line numberDiff line numberDiff line change
@@ -25757,6 +25757,9 @@ msgstr ""
2575725757
msgid "Group wikis"
2575825758
msgstr ""
2575925759

25760+
msgid "Group work item bulk edit is a licensed feature not available for this group."
25761+
msgstr ""
25762+
2576025763
msgid "Group-level wiki is disabled."
2576125764
msgstr ""
2576225765

@@ -35707,6 +35710,9 @@ msgstr ""
3570735710
msgid "No more than %{max_work_items} work items can be modified at the same time."
3570835711
msgstr ""
3570935712

35713+
msgid "No more than %{max_work_items} work items can be updated at the same time"
35714+
msgstr ""
35715+
3571035716
msgid "No open merge requests"
3571135717
msgstr ""
3571235718

qa/qa/page/project/secure/configuration_form.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def enable_secret_detection
8888
card = find_security_testing_card('Secret push protection')
8989
within(card) do
9090
# The GitLabUI toggle uses a Close Icon button
91-
click_element('close-icon')
91+
click_element('close-xs-icon')
9292
end
9393
end
9494

spec/initializers/00_deprecations_spec.rb

+4-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,10 @@ def load_initializer
9797
subject { ActiveSupport::Deprecation.warn('ABC will be removed') }
9898

9999
include_examples 'logs to Gitlab::DeprecationJsonLogger', 'DEPRECATION WARNING: ABC will be removed', 'rails'
100-
include_examples 'logs to stderr', 'DEPRECATION WARNING: ABC will be removed'
100+
101+
context 'when the test is flaky', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/478094' do
102+
include_examples 'logs to stderr', 'DEPRECATION WARNING: ABC will be removed'
103+
end
101104

102105
context 'when in production environment' do
103106
let(:rails_env) { 'production' }

0 commit comments

Comments
 (0)