Skip to content

Commit ed79d7c

Browse files
author
GitLab Bot
committed
Add latest changes from gitlab-org/gitlab@master
1 parent e8d1500 commit ed79d7c

File tree

106 files changed

+2097
-288
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+2097
-288
lines changed

GITLAB_KAS_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7e94489bc9d892e3cb25f9f9e7f4f7ce15ac0ee8
1+
d19af9f22edb454a615b9bb90fdcaa24f72eb488

app/assets/javascripts/admin/application_settings/setup_metrics_and_profiling.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import initSetHelperText, {
22
initOptionMetricsState,
33
} from '~/pages/admin/application_settings/metrics_and_profiling/usage_statistics';
44
import PayloadPreviewer from '~/pages/admin/application_settings/payload_previewer';
5+
import initProductUsageData from '~/pages/admin/application_settings/metrics_and_profiling/product_usage_data';
56

67
export default () => {
78
Array.from(document.querySelectorAll('.js-payload-preview-trigger')).forEach((trigger) => {
@@ -11,3 +12,4 @@ export default () => {
1112

1213
initSetHelperText();
1314
initOptionMetricsState();
15+
initProductUsageData();

app/assets/javascripts/ci/pipeline_details/graph/components/job_group_dropdown.vue

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22
import {
33
GlBadge,
44
GlDisclosureDropdown,
5+
GlDisclosureDropdownGroup,
56
GlTooltipDirective,
67
GlResizeObserverDirective,
78
} from '@gitlab/ui';
89
import { GlBreakpointInstance } from '@gitlab/ui/dist/utils';
910
import JobDropdownItem from '~/ci/common/private/job_dropdown_item.vue';
11+
import { FAILED_STATUS } from '~/ci/constants';
1012
import { JOB_DROPDOWN } from '../constants';
1113
import JobItem from './job_item.vue';
1214
@@ -22,6 +24,7 @@ export default {
2224
JobItem,
2325
GlBadge,
2426
GlDisclosureDropdown,
27+
GlDisclosureDropdownGroup,
2528
},
2629
directives: {
2730
GlTooltip: GlTooltipDirective,
@@ -75,6 +78,15 @@ export default {
7578
isFailed() {
7679
return this.group?.status?.group === 'failed';
7780
},
81+
nonFailedJobs() {
82+
return this.group?.jobs.filter((job) => job.status?.group !== FAILED_STATUS);
83+
},
84+
failedJobs() {
85+
return this.group?.jobs.filter((job) => job.status?.group === FAILED_STATUS);
86+
},
87+
hasFailedJobs() {
88+
return this.failedJobs.length > 0;
89+
},
7890
},
7991
methods: {
8092
handleResize() {
@@ -122,12 +134,26 @@ export default {
122134
</button>
123135
</template>
124136
<ul class="gl-m-0 gl-w-34 gl-overflow-y-auto gl-p-0" @click.stop>
125-
<job-dropdown-item
126-
v-for="job in group.jobs"
127-
:key="job.id"
128-
:job="job"
129-
@jobActionExecuted="$emit('pipelineActionRequestComplete')"
130-
/>
137+
<gl-disclosure-dropdown-group v-if="hasFailedJobs" data-testid="failed-jobs">
138+
<template #group-label>
139+
{{ s__('Pipelines|Failed jobs') }}
140+
</template>
141+
<job-dropdown-item
142+
v-for="job in failedJobs"
143+
:key="job.id"
144+
:job="job"
145+
@jobActionExecuted="$emit('pipelineActionRequestComplete')"
146+
/>
147+
</gl-disclosure-dropdown-group>
148+
149+
<gl-disclosure-dropdown-group :bordered="hasFailedJobs">
150+
<job-dropdown-item
151+
v-for="job in nonFailedJobs"
152+
:key="job.id"
153+
:job="job"
154+
@jobActionExecuted="$emit('pipelineActionRequestComplete')"
155+
/>
156+
</gl-disclosure-dropdown-group>
131157
</ul>
132158
</gl-disclosure-dropdown>
133159
</template>

app/assets/javascripts/pages/admin/application_settings/metrics_and_profiling/constants.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,6 @@ export const ELEMENT_IDS = Object.freeze({
2222
USAGE_PING_FEATURES_ENABLED: 'application_setting_usage_ping_features_enabled',
2323
USAGE_PING_ENABLED: 'application_setting_usage_ping_enabled',
2424
OPTIONAL_METRICS_IN_SERVICE_PING: 'application_setting_include_optional_metrics_in_service_ping',
25+
PRODUCT_USAGE_DATA: 'application_setting_gitlab_product_usage_data_enabled',
26+
SNOWPLOW_ENABLED: 'application_setting_snowplow_enabled',
2527
});
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { ELEMENT_IDS } from './constants';
2+
3+
export default function initProductUsageData() {
4+
const productUsageCheckbox = document.getElementById(ELEMENT_IDS.PRODUCT_USAGE_DATA);
5+
const snowplowCheckbox = document.getElementById(ELEMENT_IDS.SNOWPLOW_ENABLED);
6+
const snowplowSettings = document.getElementById('js-snowplow-settings');
7+
8+
const toggleSnowplowSettings = () => {
9+
if (!snowplowCheckbox || !snowplowSettings) return;
10+
11+
if (snowplowCheckbox.checked) {
12+
snowplowSettings.style.display = 'block';
13+
} else {
14+
snowplowSettings.style.display = 'none';
15+
}
16+
};
17+
18+
toggleSnowplowSettings();
19+
20+
productUsageCheckbox?.addEventListener('change', () => {
21+
if (productUsageCheckbox.checked) {
22+
snowplowCheckbox.checked = false;
23+
toggleSnowplowSettings();
24+
}
25+
});
26+
27+
snowplowCheckbox?.addEventListener('change', () => {
28+
if (snowplowCheckbox.checked) {
29+
productUsageCheckbox.checked = false;
30+
}
31+
toggleSnowplowSettings();
32+
});
33+
}

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,9 @@ export default {
340340
canSummarizeComments() {
341341
return this.workItem.userPermissions?.summarizeComments;
342342
},
343+
hasBlockedWorkItemsFeature() {
344+
return this.workItem.userPermissions?.blockedWorkItems;
345+
},
343346
isDiscussionLocked() {
344347
return this.workItemNotes?.discussionLocked;
345348
},
@@ -1208,6 +1211,7 @@ export default {
12081211
:work-item-type="workItem.workItemType.name"
12091212
:can-admin-work-item-link="canAdminWorkItemLink"
12101213
:active-child-item-id="activeChildItemId"
1214+
:has-blocked-work-items-feature="hasBlockedWorkItemsFeature"
12111215
@showModal="openContextualView"
12121216
/>
12131217

app/assets/javascripts/work_items/components/work_item_relationships/work_item_add_relationship_form.vue

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ export default {
5252
required: false,
5353
default: () => [],
5454
},
55+
hasBlockedWorkItemsFeature: {
56+
type: Boolean,
57+
required: true,
58+
default: false,
59+
},
5560
},
5661
data() {
5762
return {
@@ -182,22 +187,24 @@ export default {
182187
<gl-alert v-if="error" variant="danger" class="gl-mb-3" @dismiss="unsetError">
183188
{{ error }}
184189
</gl-alert>
185-
<gl-form-group
186-
:label="linkItemFormHeaderLabel"
187-
label-for="linked-item-type-radio"
188-
label-class="label-bold"
189-
class="gl-mb-3"
190-
>
191-
<gl-form-radio-group
192-
id="linked-item-type-radio"
193-
v-model="linkedItemType"
194-
:options="linkedItemTypes"
195-
:checked="linkedItemType"
196-
/>
197-
</gl-form-group>
198-
<p class="gl-mb-2 gl-font-bold">
199-
{{ $options.i18n.linkItemInputLabel }}
200-
</p>
190+
<template v-if="hasBlockedWorkItemsFeature">
191+
<gl-form-group
192+
:label="linkItemFormHeaderLabel"
193+
label-for="linked-item-type-radio"
194+
label-class="label-bold"
195+
class="gl-mb-3"
196+
>
197+
<gl-form-radio-group
198+
id="linked-item-type-radio"
199+
v-model="linkedItemType"
200+
:options="linkedItemTypes"
201+
:checked="linkedItemType"
202+
/>
203+
</gl-form-group>
204+
<p class="gl-mb-2 gl-font-bold">
205+
{{ $options.i18n.linkItemInputLabel }}
206+
</p>
207+
</template>
201208
<div class="gl-mb-5">
202209
<work-item-token-input
203210
v-model="workItemsToAdd"

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

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ export default {
7878
required: false,
7979
default: null,
8080
},
81+
hasBlockedWorkItemsFeature: {
82+
type: Boolean,
83+
required: false,
84+
default: false,
85+
},
8186
},
8287
apollo: {
8388
linkedWorkItems: {
@@ -146,6 +151,13 @@ export default {
146151
isEmptyRelatedWorkItems() {
147152
return !this.error && this.linkedWorkItems.length === 0;
148153
},
154+
emptyStateMessage() {
155+
return this.hasBlockedWorkItemsFeature
156+
? s__(
157+
"WorkItem|Link items together to show that they're related or that one is blocking others.",
158+
)
159+
: s__("WorkItem|Link items together to show that they're related.");
160+
},
149161
displayableLinksCount() {
150162
return this.displayableLinks(this.linkedWorkItems)?.length;
151163
},
@@ -307,9 +319,6 @@ export default {
307319
i18n: {
308320
title: s__('WorkItem|Linked items'),
309321
fetchError: s__('WorkItem|Something went wrong when fetching items. Please refresh this page.'),
310-
emptyStateMessage: s__(
311-
"WorkItem|Link items together to show that they're related or that one is blocking others.",
312-
),
313322
noLinkedItemsOpen: s__('WorkItem|No linked items are currently open.'),
314323
removeLinkedItemErrorMessage: s__(
315324
'WorkItem|Something went wrong when removing item. Please refresh this page.',
@@ -371,13 +380,14 @@ export default {
371380
:work-item-full-path="workItemFullPath"
372381
:children-ids="childrenIds"
373382
:work-item-type="workItemType"
383+
:has-blocked-work-items-feature="hasBlockedWorkItemsFeature"
374384
@submitted="hideLinkItemForm"
375385
@cancel="hideLinkItemForm"
376386
/>
377387
</template>
378388
379389
<template v-if="isEmptyRelatedWorkItems" #empty>
380-
{{ $options.i18n.emptyStateMessage }}
390+
{{ emptyStateMessage }}
381391
</template>
382392
383393
<template #default>

app/assets/stylesheets/page_bundles/pipeline.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,8 @@
223223
border-color: var(--gl-control-border-color-error);
224224
}
225225

226-
.ci-job-item-failed {
226+
.ci-job-component > .ci-job-item-failed,
227+
.ci-job-component.ci-job-item-failed:not(:hover):not(:focus) > a {
227228
@apply gl-bg-feedback-danger;
228229

229230
// stylelint-disable-next-line gitlab/no-gl-class

app/components/rapid_diffs/viewers/no_preview_component.html.haml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
%p.rd-no-preview-paragraph
77
= no_preview_reason
88
.rd-no-preview-actions
9-
- if @diff_file.collapsed? && expandable?
10-
= action_button(button_options: { data: { click: 'showChanges' } }) do
9+
- if @diff_file.collapsed? && expandable? || @diff_file.whitespace_only?
10+
- click = @diff_file.whitespace_only? ? 'showWhitespaceChanges' : 'showChanges'
11+
= action_button(button_options: { data: { click: click } }) do
1112
= _('Show changes')
1213
- elsif expandable?
1314
= action_button(button_options: { data: { click: 'showFileContents' } }) do

app/components/rapid_diffs/viewers/no_preview_component.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ def no_preview_reason
3737
_("Preview size limit exceeded, changes collapsed.")
3838
elsif !@diff_file.diffable?
3939
_("Preview suppressed by a .gitattributes entry or the file's encoding is unsupported.")
40+
elsif @diff_file.whitespace_only?
41+
_("Contains only whitespace changes.")
4042
elsif @diff_file.new_file? || @diff_file.content_changed?
4143
_("No diff preview for this file type.")
4244
end

app/controllers/search_controller.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,11 @@ def opensearch; end
140140
def authenticate?
141141
return false if action_name == 'opensearch'
142142
return true if public_visibility_restricted?
143-
return true if search_service.global_search? && ::Feature.enabled?(:block_anonymous_global_searches, type: :ops)
143+
144+
if search_service.global_search? && ::Gitlab::CurrentSettings.global_search_block_anonymous_searches_enabled?
145+
return true
146+
end
147+
144148
return true if ::Feature.disabled?(:allow_anonymous_searches, type: :ops)
145149

146150
false

app/helpers/application_settings_helper.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,13 @@ def enabled_protocol_button(container, protocol)
7474

7575
def global_search_settings_checkboxes(form)
7676
[
77+
form.gitlab_ui_checkbox_component(
78+
:global_search_block_anonymous_searches_enabled,
79+
_("Enable blocking of anonymous global search requests"),
80+
checkbox_options: {
81+
checked: @application_setting.global_search_block_anonymous_searches_enabled, multiple: false
82+
}
83+
),
7784
form.gitlab_ui_checkbox_component(
7885
:global_search_issues_enabled,
7986
_("Enable issues tab in global search results"),
@@ -488,6 +495,7 @@ def visible_attributes
488495
:snowplow_database_collector_hostname,
489496
:snowplow_enabled,
490497
:snowplow_app_id,
498+
:gitlab_product_usage_data_enabled,
491499
:push_event_hooks_limit,
492500
:push_event_activities_limit,
493501
:custom_http_clone_url_root,

app/models/application_setting.rb

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ class ApplicationSetting < ApplicationRecord
2828
lock_pypi_package_requests_forwarding
2929
], remove_with: '18.1', remove_after: '2025-05-20'
3030

31+
ignore_column :duo_nano_features_enabled, remove_with: '18.1', remove_after: '2025-06-19'
32+
3133
KROKI_URL_ERROR_MESSAGE = 'Please check your Kroki URL setting in ' \
3234
'Admin area > Settings > General > Kroki'
3335

@@ -460,6 +462,8 @@ def self.kroki_formats_attributes
460462

461463
validate :check_valid_runner_registrars
462464

465+
validate :snowplow_and_product_usage_data_are_mutually_exclusive
466+
463467
validate :terms_exist, if: :enforce_terms?
464468

465469
validates :external_authorization_service_default_label,
@@ -680,7 +684,8 @@ def self.kroki_formats_attributes
680684
validates :clickhouse, json_schema: { filename: "application_setting_clickhouse" }
681685

682686
jsonb_accessor :service_ping_settings,
683-
gitlab_environment_toolkit_instance: [:boolean, { default: false }]
687+
gitlab_environment_toolkit_instance: [:boolean, { default: false }],
688+
gitlab_product_usage_data_enabled: [:boolean, { default: true }]
684689

685690
jsonb_accessor :rate_limits_unauthenticated_git_http,
686691
throttle_unauthenticated_git_http_enabled: [:boolean, { default: false }],
@@ -1157,6 +1162,15 @@ def parsed_kroki_url
11571162
)
11581163
end
11591164

1165+
def snowplow_and_product_usage_data_are_mutually_exclusive
1166+
return unless gitlab_product_usage_data_enabled_changed? || snowplow_enabled_changed?
1167+
return unless snowplow_enabled && gitlab_product_usage_data_enabled
1168+
1169+
message = _('Snowplow tracking and Product event tracking cannot be enabled at the same time. ' \
1170+
'Please disable one of them.')
1171+
errors.add(:base, message)
1172+
end
1173+
11601174
def validate_url(parsed_url, name, error_message)
11611175
return if parsed_url
11621176

app/models/application_setting_implementation.rb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ def defaults # rubocop:disable Metrics/AbcSize
103103
gitaly_timeout_default: 55,
104104
gitaly_timeout_fast: 10,
105105
gitaly_timeout_medium: 30,
106+
gitlab_product_usage_data_enabled: Settings.gitlab['initial_gitlab_product_usage_data'],
106107
gitpod_enabled: false,
107108
gitpod_url: 'https://gitpod.io/',
108109
gravatar_enabled: Settings.gravatar['enabled'],
@@ -593,10 +594,6 @@ def allow_signup?
593594
signup_enabled? && password_authentication_enabled_for_web?
594595
end
595596

596-
def product_usage_data_enabled?
597-
true
598-
end
599-
600597
def password_authentication_enabled?
601598
password_authentication_enabled_for_web? || password_authentication_enabled_for_git?
602599
end

app/models/ci/trigger.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ class Trigger < Ci::ApplicationRecord
55
include Presentable
66
include Limitable
77
include Expirable
8+
include Gitlab::EncryptedAttribute
89

910
TRIGGER_TOKEN_PREFIX = 'glptt-'
1011

@@ -26,7 +27,7 @@ class Trigger < Ci::ApplicationRecord
2627
attribute: :encrypted_token,
2728
mode: :per_attribute_iv,
2829
algorithm: 'aes-256-gcm',
29-
key: Settings.attr_encrypted_db_key_base_32,
30+
key: :db_key_base_32,
3031
encode: false
3132

3233
before_validation :set_default_values

0 commit comments

Comments
 (0)