Skip to content

Commit 326c35a

Browse files
author
GitLab Bot
committed
Add latest changes from gitlab-org/gitlab@master
1 parent 3bb07f4 commit 326c35a

File tree

66 files changed

+407
-194
lines changed

Some content is hidden

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

66 files changed

+407
-194
lines changed

.rubocop_todo/rspec/be_eq.yml

-1
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,6 @@ RSpec/BeEq:
313313
- 'ee/spec/requests/api/graphql/audit_events/streaming/http/namespace_filters/create_spec.rb'
314314
- 'ee/spec/requests/api/graphql/audit_events/streaming/instance_headers/create_spec.rb'
315315
- 'ee/spec/requests/api/graphql/boards/boards_query_spec.rb'
316-
- 'ee/spec/requests/api/graphql/gitlab_subscriptions/namespaces/add_on_purchase_spec.rb'
317316
- 'ee/spec/requests/api/graphql/group/ci_cd_settings_spec.rb'
318317
- 'ee/spec/requests/api/graphql/group/dast_profile_schedule_spec.rb'
319318
- 'ee/spec/requests/api/graphql/group/flow_metrics_spec.rb'

app/assets/javascripts/content_editor/services/highlight_js_language_loader.js

+26
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,32 @@ export default {
9292
gcode: () => import(/* webpackChunkName: 'hl-gcode' */ 'highlight.js/lib/languages/gcode'),
9393
gherkin: () => import(/* webpackChunkName: 'hl-gherkin' */ 'highlight.js/lib/languages/gherkin'),
9494
gleam: () => import(/* webpackChunkName: 'hl-gleam' */ '@gleam-lang/highlight.js-gleam'),
95+
glimmer: async () => [
96+
[
97+
'javascript',
98+
await import(/* webpackChunkName: 'hl-javascript' */ 'highlight.js/lib/languages/javascript'),
99+
],
100+
[
101+
'glimmer',
102+
{
103+
default: (await import(/* webpackChunkName: 'hl-glimmer' */ 'highlightjs-glimmer')).glimmer,
104+
},
105+
],
106+
],
107+
'glimmer-javascript': async () => [
108+
[
109+
'javascript',
110+
await import(/* webpackChunkName: 'hl-javascript' */ 'highlight.js/lib/languages/javascript'),
111+
],
112+
[
113+
'glimmer-javascript',
114+
{
115+
default: (
116+
await import(/* webpackChunkName: 'hl-glimmer-javascript' */ 'highlightjs-glimmer')
117+
).glimmerJavascript,
118+
},
119+
],
120+
],
95121
glsl: () => import(/* webpackChunkName: 'hl-glsl' */ 'highlight.js/lib/languages/glsl'),
96122
gml: () => import(/* webpackChunkName: 'hl-gml' */ 'highlight.js/lib/languages/gml'),
97123
go: () => import(/* webpackChunkName: 'hl-go' */ 'highlight.js/lib/languages/go'),

app/assets/javascripts/highlight_js/index.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@ import { registerPlugins } from './plugins/index';
55

66
const loadLanguage = async (language, hljs) => {
77
const languageDefinition = await languageLoader[language]();
8-
hljs.registerLanguage(language, languageDefinition.default);
8+
if (Array.isArray(languageDefinition)) {
9+
languageDefinition.forEach(([languageDependency, languageDependencyDefinition]) =>
10+
hljs.registerLanguage(languageDependency, languageDependencyDefinition.default),
11+
);
12+
} else {
13+
hljs.registerLanguage(language, languageDefinition.default);
14+
}
915
};
1016

1117
const loadSubLanguages = async (languageDefinition, hljs) => {

app/assets/javascripts/repository/constants.js

+7
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,10 @@ export const CONFLICTS_MODAL_ID = 'fork-sync-conflicts-modal';
102102

103103
export const FORK_UPDATED_EVENT = 'fork:updated';
104104
export const EVENT_FILE_SIZE_LIMIT_EXCEEDED = 'repository_file_size_limit_exceeded';
105+
106+
export const FILE_EXTENSION_MAPPING_HLJS = {
107+
'.gleam': 'gleam',
108+
'.glimmer': 'glimmer',
109+
'.gjs': 'glimmer-javascript',
110+
'.gts': 'glimmer-javascript',
111+
};

app/assets/javascripts/repository/mixins/highlight_mixin.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { splitIntoChunks } from '~/vue_shared/components/source_viewer/workers/h
99
import languageLoader from '~/content_editor/services/highlight_js_language_loader';
1010
import Tracking from '~/tracking';
1111
import axios from '~/lib/utils/axios_utils';
12-
import { TEXT_FILE_TYPE } from '../constants';
12+
import { TEXT_FILE_TYPE, FILE_EXTENSION_MAPPING_HLJS } from '../constants';
1313

1414
/*
1515
* This mixin is intended to be used as an interface between our highlight worker and Vue components
@@ -50,8 +50,12 @@ export default {
5050
const { rawTextBlob, name, fileType, externalStorageUrl, rawPath, simpleViewer } = blob;
5151
let { language } = blob;
5252

53-
if (name.endsWith('.gleam')) {
54-
language = 'gleam';
53+
const fileExtensionOverride = Object.keys(FILE_EXTENSION_MAPPING_HLJS).find((extension) =>
54+
name.endsWith(extension),
55+
);
56+
57+
if (fileExtensionOverride) {
58+
language = FILE_EXTENSION_MAPPING_HLJS[fileExtensionOverride];
5559
}
5660

5761
if (simpleViewer?.fileType !== TEXT_FILE_TYPE) return;

app/assets/javascripts/vue_shared/components/source_viewer/constants.js

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ export const ROUGE_TO_HLJS_LANGUAGE_MAP = {
1111
docker: 'dockerfile',
1212
batchfile: 'dos',
1313
elixir: 'elixir',
14+
glimmer: 'glimmer',
15+
'glimmer-javascript': 'glimmer-javascript',
1416
html: 'xml',
1517
hylang: 'hy',
1618
tex: 'latex',

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ export default {
204204
</script>
205205
206206
<template>
207-
<div class="work-item-attributes-wrapper">
207+
<div class="work-item-attributes-wrapper work-item-sidebar-container">
208208
<work-item-status
209209
v-if="showWorkItemStatus"
210210
class="work-item-attributes-item"

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ export default {
274274
/>
275275
</gl-form-group>
276276
<gl-form-group
277-
class="gl-m-0 gl-flex gl-items-center gl-gap-3"
277+
class="gl-m-0 gl-flex gl-flex-wrap gl-items-center gl-gap-3"
278278
:label="s__('WorkItem|Due')"
279279
:label-for="$options.dueDateInputId"
280280
label-class="!gl-font-normal !gl-pb-0 gl-min-w-7 sm:gl-min-w-fit md:gl-min-w-7 gl-break-words"

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

+45-33
Original file line numberDiff line numberDiff line change
@@ -141,46 +141,58 @@ export default {
141141
/>
142142
</div>
143143
144-
<div class="gl-flex gl-items-center gl-gap-2" data-testid="time-tracking-body">
144+
<div
145+
class="time-tracking-body gl-flex gl-flex-wrap gl-items-center gl-gap-2"
146+
data-testid="time-tracking-body"
147+
>
145148
<template v-if="totalTimeSpent || timeEstimate">
146-
<span class="gl-text-subtle">{{ s__('TimeTracking|Spent') }}</span>
147-
<gl-button
148-
v-if="canUpdate"
149-
v-gl-modal="timeTrackingModalId"
150-
v-gl-tooltip="s__('TimeTracking|View time tracking report')"
151-
variant="link"
152-
data-testid="view-time-spent-button"
149+
<div
150+
class="time-tracking-spent-and-progress gl-flex gl-grow gl-flex-wrap-reverse gl-items-center gl-justify-between gl-gap-2"
153151
>
154-
{{ humanTotalTimeSpent }}
155-
</gl-button>
156-
<template v-else>
157-
{{ humanTotalTimeSpent }}
158-
</template>
159-
<template v-if="timeEstimate">
160-
<gl-progress-bar
161-
v-gl-tooltip="progressBarTooltipText"
162-
class="gl-mx-2 gl-grow"
163-
:value="timeRemainingPercent"
164-
:variant="progressBarVariant"
165-
/>
166-
<span class="gl-text-subtle">{{ s__('TimeTracking|Estimate') }}</span>
167-
<gl-button
168-
v-if="canUpdate"
169-
v-gl-modal="setTimeEstimateModalId"
170-
v-gl-tooltip="s__('TimeTracking|Set estimate')"
171-
variant="link"
172-
data-testid="set-estimate-button"
173-
>
174-
{{ humanTimeEstimate }}
175-
</gl-button>
176-
<template v-else>
177-
{{ humanTimeEstimate }}
152+
<div class="gl-flex gl-items-center gl-gap-2">
153+
<span class="gl-text-subtle">{{ s__('TimeTracking|Spent') }}</span>
154+
<gl-button
155+
v-if="canUpdate"
156+
v-gl-modal="timeTrackingModalId"
157+
v-gl-tooltip="s__('TimeTracking|View time tracking report')"
158+
variant="link"
159+
data-testid="view-time-spent-button"
160+
>
161+
{{ humanTotalTimeSpent }}
162+
</gl-button>
163+
<template v-else>
164+
{{ humanTotalTimeSpent }}
165+
</template>
166+
</div>
167+
<template v-if="timeEstimate">
168+
<gl-progress-bar
169+
v-gl-tooltip="progressBarTooltipText"
170+
class="time-tracking-progress gl-min-w-11 gl-grow"
171+
:value="timeRemainingPercent"
172+
:variant="progressBarVariant"
173+
/>
178174
</template>
175+
</div>
176+
<template v-if="timeEstimate">
177+
<div class="gl-flex gl-items-center gl-gap-2">
178+
<span class="gl-text-subtle">{{ s__('TimeTracking|Estimate') }}</span>
179+
<gl-button
180+
v-if="canUpdate"
181+
v-gl-modal="setTimeEstimateModalId"
182+
v-gl-tooltip="s__('TimeTracking|Set estimate')"
183+
variant="link"
184+
data-testid="set-estimate-button"
185+
>
186+
{{ humanTimeEstimate }}
187+
</gl-button>
188+
<template v-else>
189+
{{ humanTimeEstimate }}
190+
</template>
191+
</div>
179192
</template>
180193
<gl-button
181194
v-else-if="canUpdate"
182195
v-gl-modal="setTimeEstimateModalId"
183-
class="gl-ml-auto"
184196
variant="link"
185197
data-testid="add-estimate-button"
186198
>

app/assets/stylesheets/page_bundles/work_items.scss

+49-4
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ $work-item-overview-gap-width: 2rem;
5454
// allow the main content area to shrink
5555
// grid items have "max-width: auto" so without the minmax the content can
5656
// spill outside of the overview container
57-
grid-template-columns: minmax(0, 1fr) $work-item-overview-right-sidebar-width;
57+
$work-item-sidebar-min-width: 13rem;
58+
grid-template-columns: minmax(67%, 1fr) minmax($work-item-sidebar-min-width, $work-item-overview-right-sidebar-width);
5859
column-gap: $work-item-overview-gap-width;
5960
}
6061
}
@@ -364,8 +365,38 @@ $disclosure-hierarchy-chevron-dimension: 1.2rem;
364365
}
365366
}
366367

367-
// Safari-specific override to avoid container stacking context problems
368-
@supports (-webkit-appearance:none) and (stroke-color:transparent) {
368+
.work-item-sidebar-container {
369+
container-type: inline-size;
370+
container-name: work-item-sidebar;
371+
372+
@container work-item-sidebar (max-width: #{calc($work-item-overview-right-sidebar-width - 3rem)}) {
373+
.time-tracking-body {
374+
@apply gl-flex-col gl-items-start;
375+
376+
.time-tracking-spent-and-progress {
377+
@apply gl-flex-col-reverse gl-w-full gl-items-stretch;
378+
379+
.time-tracking-progress {
380+
@apply gl-mx-0 gl-my-2;
381+
}
382+
}
383+
}
384+
385+
.work-item-date-input {
386+
@apply gl-flex-col gl-items-stretch;
387+
388+
.work-item-datepicker {
389+
@apply gl-max-w-full;
390+
}
391+
}
392+
}
393+
}
394+
395+
// Temporary fallback for browsers that do not properly support container queries.
396+
// Should be removed once container queries are fully stable across all browsers.
397+
// This is implemnted below for specific browsers.
398+
// Cf. https://gitlab.com/gitlab-org/gitlab/-/merge_requests/186598
399+
@mixin browser-specific-overrides {
369400
.work-item-design-widget-container {
370401
container-type: unset;
371402

@@ -395,4 +426,18 @@ $disclosure-hierarchy-chevron-dimension: 1.2rem;
395426
}
396427
}
397428
}
398-
}
429+
430+
.work-item-sidebar-container {
431+
container-type: unset;
432+
}
433+
}
434+
435+
// Safari
436+
@supports (-webkit-appearance:none) and (stroke-color:transparent) {
437+
@include browser-specific-overrides;
438+
}
439+
440+
// Firefox
441+
@-moz-document url-prefix() {
442+
@include browser-specific-overrides;
443+
}

app/controllers/admin/users_controller.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ def disable_two_factor
212212

213213
def create
214214
opts = user_params.merge(reset_password: true, skip_confirmation: true)
215-
opts[:organization_id] ||= Current.organization&.id
215+
opts[:organization_id] ||= Current.organization.id
216216

217217
response = Users::CreateService.new(current_user, opts).execute
218218
@user = response.payload[:user]

app/controllers/omniauth_callbacks_controller.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ def build_auth_user(auth_user_class)
229229

230230
# Overridden in EE
231231
def build_auth_user_params
232-
{ organization_id: Current.organization&.id }
232+
{ organization_id: Current.organization.id }
233233
end
234234

235235
# Overridden in EE

app/graphql/mutations/snippets/create.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def process_args_for_params!(args)
8585
# We need to rename `uploaded_files` into `files` because
8686
# it's the expected key param
8787
args[:files] = args.delete(:uploaded_files)
88-
args[:organization_id] = Current.organization&.id
88+
args[:organization_id] = Current.organization.id
8989
# Return nil to make it explicit that this method is mutating the args parameter, and that
9090
# the return value is not relevant and is not to be used.
9191
nil

app/graphql/resolvers/topics_resolver.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class TopicsResolver < BaseResolver
1717
description: 'Global ID of the organization.'
1818

1919
def resolve(**args)
20-
organization = authorized_find!(id: args[:organization_id] || ::Current.organization&.id)
20+
organization = authorized_find!(id: args[:organization_id] || ::Current.organization.id)
2121

2222
return organization_topics(organization.id) unless args[:search].present?
2323

app/models/application_setting.rb

+4
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,10 @@ def self.kroki_formats_attributes
441441

442442
validates :allowed_key_types, presence: true
443443

444+
validates :deletion_adjourned_period,
445+
presence: true,
446+
numericality: { only_integer: true, greater_than: 0, less_than_or_equal_to: 90 }
447+
444448
validates_each :restricted_visibility_levels do |record, attr, value|
445449
value&.each do |level|
446450
unless Gitlab::VisibilityLevel.options.value?(level)

app/models/application_setting_implementation.rb

+2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ module ApplicationSettingImplementation
3131
].freeze
3232

3333
DEFAULT_MINIMUM_PASSWORD_LENGTH = 8
34+
DEFAULT_NUMBER_OF_DAYS_BEFORE_REMOVAL = 7
3435

3536
class_methods do
3637
def defaults # rubocop:disable Metrics/AbcSize
@@ -70,6 +71,7 @@ def defaults # rubocop:disable Metrics/AbcSize
7071
default_projects_limit: Settings.gitlab['default_projects_limit'],
7172
default_snippet_visibility: Settings.gitlab.default_projects_features['visibility_level'],
7273
default_syntax_highlighting_theme: 1,
74+
deletion_adjourned_period: DEFAULT_NUMBER_OF_DAYS_BEFORE_REMOVAL,
7375
deny_all_requests_except_allowed: false,
7476
diff_max_patch_bytes: Gitlab::Git::Diff::DEFAULT_MAX_PATCH_BYTES,
7577
diff_max_files: Commit::DEFAULT_MAX_DIFF_FILES_SETTING,

app/models/namespace_setting.rb

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ class NamespaceSetting < ApplicationRecord
55
include Sanitizable
66
include ChronicDurationAttribute
77
include EachBatch
8+
include SafelyChangeColumnDefault
9+
10+
columns_changing_default :require_dpop_for_manage_api_endpoints
811

912
ignore_column :token_expiry_notify_inherited, remove_with: '17.9', remove_after: '2025-01-11'
1013
enum pipeline_variables_default_role: ProjectCiCdSetting::PIPELINE_VARIABLES_OVERRIDE_ROLES, _prefix: true

app/views/groups/settings/_permissions.html.haml

-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
= render_if_exists 'groups/settings/service_access_tokens_expiration_enforced', f: f, group: @group
4141
= render_if_exists 'groups/settings/enforce_ssh_certificates', f: f, group: @group
4242
= render_if_exists 'groups/settings/extended_grat_expiry_webhook_execute', f: f, group: @group
43-
= render_if_exists 'groups/settings/require_dpop_for_manage_api_endpoints', f: f, group: @group
4443
= render 'groups/settings/two_factor_auth', f: f, group: @group
4544
= render_if_exists 'groups/personal_access_token_expiration_policy', f: f, group: @group
4645
= render 'groups/settings/membership', f: f, group: @group

db/docs/batched_background_migrations/enable_restrict_user_defined_variables.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ feature_category: ci_variables
55
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/181856
66
milestone: '17.10'
77
queued_migration_version: 20250220113009
8-
finalized_by: # version of the migration that finalized this BBM
8+
finalized_by: 20250429133944
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# frozen_string_literal: true
2+
3+
class AddLdapColumnToUserMemberRole < Gitlab::Database::Migration[2.2]
4+
milestone '18.0'
5+
6+
def change
7+
add_column :user_member_roles, :ldap, :boolean, null: false, default: false, if_not_exists: true
8+
end
9+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# frozen_string_literal: true
2+
3+
class ChangeNamespaceSettingsDefault < Gitlab::Database::Migration[2.2]
4+
milestone '18.0'
5+
6+
TABLE_NAME = :namespace_settings
7+
COLUMN_NAME = :require_dpop_for_manage_api_endpoints
8+
9+
def change
10+
change_column_default(TABLE_NAME, COLUMN_NAME, from: true, to: false)
11+
end
12+
end

0 commit comments

Comments
 (0)