Skip to content

Commit ef211f6

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

File tree

93 files changed

+962
-713
lines changed

Some content is hidden

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

93 files changed

+962
-713
lines changed

.rubocop_todo/layout/argument_alignment.yml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1405,23 +1405,6 @@ Layout/ArgumentAlignment:
14051405
- 'spec/lib/gitlab/auth/otp/strategies/forti_token_cloud_spec.rb'
14061406
- 'spec/lib/gitlab/auth/saml/auth_hash_spec.rb'
14071407
- 'spec/lib/gitlab/auth/saml/user_spec.rb'
1408-
- 'spec/lib/gitlab/background_migration/batched_migration_job_spec.rb'
1409-
- 'spec/lib/gitlab/background_migration/copy_column_using_background_migration_job_spec.rb'
1410-
- 'spec/lib/gitlab/background_migration/delete_orphaned_operational_vulnerabilities_spec.rb'
1411-
- 'spec/lib/gitlab/background_migration/delete_orphans_approval_merge_request_rules_spec.rb'
1412-
- 'spec/lib/gitlab/background_migration/delete_orphans_approval_project_rules_spec.rb'
1413-
- 'spec/lib/gitlab/background_migration/destroy_invalid_group_members_spec.rb'
1414-
- 'spec/lib/gitlab/background_migration/destroy_invalid_members_spec.rb'
1415-
- 'spec/lib/gitlab/background_migration/destroy_invalid_project_members_spec.rb'
1416-
- 'spec/lib/gitlab/background_migration/disable_legacy_open_source_licence_for_recent_public_projects_spec.rb'
1417-
- 'spec/lib/gitlab/background_migration/disable_legacy_open_source_license_for_inactive_public_projects_spec.rb'
1418-
- 'spec/lib/gitlab/background_migration/disable_legacy_open_source_license_for_no_issues_no_repo_projects_spec.rb'
1419-
- 'spec/lib/gitlab/background_migration/disable_legacy_open_source_license_for_one_member_no_repo_projects_spec.rb'
1420-
- 'spec/lib/gitlab/background_migration/disable_legacy_open_source_license_for_projects_less_than_five_mb_spec.rb'
1421-
- 'spec/lib/gitlab/background_migration/disable_legacy_open_source_license_for_projects_less_than_one_mb_spec.rb'
1422-
- 'spec/lib/gitlab/background_migration/expire_o_auth_tokens_spec.rb'
1423-
- 'spec/lib/gitlab/background_migration/fix_incoherent_packages_size_on_project_statistics_spec.rb'
1424-
- 'spec/lib/gitlab/background_migration/legacy_upload_mover_spec.rb'
14251408
- 'spec/lib/gitlab/bitbucket_import/importer_spec.rb'
14261409
- 'spec/lib/gitlab/bitbucket_import/project_creator_spec.rb'
14271410
- 'spec/lib/gitlab/bitbucket_import/wiki_formatter_spec.rb'

app/assets/javascripts/ci/runner/components/registration/registration_instructions.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,11 @@ export default {
100100
tokenMessage() {
101101
if (this.token) {
102102
return s__(
103-
'Runners|The %{boldStart}runner token%{boldEnd} %{token} displays %{boldStart}only for a short time%{boldEnd}, and is stored in the %{codeStart}config.toml%{codeEnd} after you register the runner. It will not be visible once the runner is registered.',
103+
'Runners|The %{boldStart}runner authentication token%{boldEnd} %{token} displays here %{boldStart}for a short time only%{boldEnd}. After you register the runner, this token is stored in the %{codeStart}config.toml%{codeEnd} and cannot be accessed again from the UI.',
104104
);
105105
}
106106
return s__(
107-
'Runners|The %{boldStart}runner token%{boldEnd} is no longer visible, it is stored in the %{codeStart}config.toml%{codeEnd} if you have registered the runner.',
107+
'Runners|The %{boldStart}runner authentication token%{boldEnd} is no longer visible, it is stored in the %{codeStart}config.toml%{codeEnd} if you have registered the runner.',
108108
);
109109
},
110110
commandPrompt() {

app/assets/javascripts/main.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import initBreadcrumbs from './breadcrumb';
2929
import initPersistentUserCallouts from './persistent_user_callouts';
3030
import { initUserTracking, initDefaultTrackers } from './tracking';
3131
import { initSidebarTracking } from './pages/shared/nav/sidebar_tracking';
32-
import initServicePingConsent from './service_ping_consent';
3332
import GlFieldErrors from './gl_field_errors';
3433
import initUserPopovers from './user_popovers';
3534
import initBroadcastNotifications from './broadcast_notification';
@@ -93,7 +92,6 @@ function deferredInitialisation() {
9392
initBreadcrumbs();
9493
initPrefetchLinks('.js-prefetch-document');
9594
initLogoAnimation();
96-
initServicePingConsent();
9795
initUserPopovers();
9896
initBroadcastNotifications();
9997
initPersistentUserCallouts();

app/assets/javascripts/observability/client.js

Lines changed: 62 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ const SUPPORTED_FILTERS = {
7070
serviceName: ['=', '!='],
7171
period: ['='],
7272
traceId: ['=', '!='],
73+
attribute: ['='],
7374
// free-text 'search' temporarily ignored https://gitlab.com/gitlab-org/opstrace/opstrace/-/issues/2309
7475
};
7576

@@ -82,6 +83,7 @@ const FILTER_TO_QUERY_PARAM = {
8283
serviceName: 'service_name',
8384
period: 'period',
8485
traceId: 'trace_id',
86+
attribute: 'attribute',
8587
};
8688

8789
const FILTER_OPERATORS_PREFIX = {
@@ -113,6 +115,25 @@ function getFilterParamName(filterName, operator) {
113115
return undefined;
114116
}
115117

118+
/**
119+
* Process `filterValue` and append the proper query params to the `searchParams` arg
120+
*
121+
* It mutates `searchParams`
122+
*
123+
* @param {String} filterValue The filter value, in the format `attribute_name=attribute_value`
124+
* @param {String} filterOperator The filter operator
125+
* @param {URLSearchParams} searchParams The URLSearchParams object where to append the proper query params
126+
*/
127+
function handleAttributeFilter(filterValue, filterOperator, searchParams) {
128+
const [attrName, attrValue] = filterValue.split('=');
129+
if (attrName && attrValue) {
130+
if (filterOperator === '=') {
131+
searchParams.append('attr_name', attrName);
132+
searchParams.append('attr_value', attrValue);
133+
}
134+
}
135+
}
136+
116137
/**
117138
* Builds URLSearchParams from a filter object of type { [filterName]: undefined | null | Array<{operator: String, value: any} }
118139
* e.g:
@@ -133,20 +154,22 @@ function filterObjToQueryParams(filterObj) {
133154

134155
Object.keys(SUPPORTED_FILTERS).forEach((filterName) => {
135156
const filterValues = filterObj[filterName] || [];
136-
const supportedFilters = filterValues.filter((f) =>
157+
const validFilters = filterValues.filter((f) =>
137158
SUPPORTED_FILTERS[filterName].includes(f.operator),
138159
);
139-
supportedFilters.forEach(({ operator, value: rawValue }) => {
140-
const paramName = getFilterParamName(filterName, operator);
141-
142-
let value = rawValue;
143-
if (filterName === 'durationMs') {
144-
// converting durationMs to duration_nano
145-
value *= 1000000;
146-
}
147-
148-
if (paramName && value) {
149-
filterParams.append(paramName, value);
160+
validFilters.forEach(({ operator, value: rawValue }) => {
161+
if (filterName === 'attribute') {
162+
handleAttributeFilter(rawValue, operator, filterParams);
163+
} else {
164+
const paramName = getFilterParamName(filterName, operator);
165+
let value = rawValue;
166+
if (filterName === 'durationMs') {
167+
// converting durationMs to duration_nano
168+
value *= 1000000;
169+
}
170+
if (paramName && value) {
171+
filterParams.append(paramName, value);
172+
}
150173
}
151174
});
152175
});
@@ -248,19 +271,40 @@ async function fetchMetrics() {
248271
/* eslint-enable @gitlab/require-i18n-strings */
249272
}
250273

251-
export function buildClient({ provisioningUrl, tracingUrl, servicesUrl, operationsUrl } = {}) {
252-
if (!provisioningUrl || !tracingUrl || !servicesUrl || !operationsUrl) {
253-
throw new Error(
254-
'missing required params. provisioningUrl, tracingUrl, servicesUrl, operationsUrl are required',
255-
);
274+
export function buildClient(options) {
275+
if (!options) {
276+
throw new Error('No options object provided'); // eslint-disable-line @gitlab/require-i18n-strings
256277
}
278+
279+
const { provisioningUrl, tracingUrl, servicesUrl, operationsUrl, metricsUrl } = options;
280+
281+
if (typeof provisioningUrl !== 'string') {
282+
throw new Error('provisioningUrl param must be a string');
283+
}
284+
285+
if (typeof tracingUrl !== 'string') {
286+
throw new Error('tracingUrl param must be a string');
287+
}
288+
289+
if (typeof servicesUrl !== 'string') {
290+
throw new Error('servicesUrl param must be a string');
291+
}
292+
293+
if (typeof operationsUrl !== 'string') {
294+
throw new Error('operationsUrl param must be a string');
295+
}
296+
297+
if (typeof metricsUrl !== 'string') {
298+
throw new Error('metricsUrl param must be a string');
299+
}
300+
257301
return {
258302
enableObservability: () => enableObservability(provisioningUrl),
259303
isObservabilityEnabled: () => isObservabilityEnabled(provisioningUrl),
260304
fetchTraces: (filters) => fetchTraces(tracingUrl, filters),
261305
fetchTrace: (traceId) => fetchTrace(tracingUrl, traceId),
262306
fetchServices: () => fetchServices(servicesUrl),
263307
fetchOperations: (serviceName) => fetchOperations(operationsUrl, serviceName),
264-
fetchMetrics: () => fetchMetrics(),
308+
fetchMetrics: () => fetchMetrics(metricsUrl),
265309
};
266310
}

app/assets/javascripts/observability/components/observability_container.vue

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,8 @@ export default {
1010
ObservabilityLoader,
1111
},
1212
props: {
13-
oauthUrl: {
14-
type: String,
15-
required: true,
16-
},
17-
provisioningUrl: {
18-
type: String,
19-
required: true,
20-
},
21-
tracingUrl: {
22-
type: String,
23-
required: true,
24-
},
25-
servicesUrl: {
26-
type: String,
27-
required: true,
28-
},
29-
operationsUrl: {
30-
type: String,
13+
apiConfig: {
14+
type: Object,
3115
required: true,
3216
},
3317
},
@@ -55,7 +39,7 @@ export default {
5539
},
5640
methods: {
5741
messageHandler(e) {
58-
const isExpectedOrigin = e.origin === new URL(this.oauthUrl).origin;
42+
const isExpectedOrigin = e.origin === new URL(this.apiConfig.oauthUrl).origin;
5943
if (!isExpectedOrigin) return;
6044
6145
const { data } = e;
@@ -65,12 +49,7 @@ export default {
6549
6650
const { status, message, statusCode } = data;
6751
if (status === 'success') {
68-
this.observabilityClient = buildClient({
69-
provisioningUrl: this.provisioningUrl,
70-
tracingUrl: this.tracingUrl,
71-
servicesUrl: this.servicesUrl,
72-
operationsUrl: this.operationsUrl,
73-
});
52+
this.observabilityClient = buildClient(this.apiConfig);
7453
this.$emit('observability-client-ready', this.observabilityClient);
7554
this.loaderContentState = CONTENT_STATE.LOADED;
7655
} else if (status === 'error') {
@@ -92,7 +71,7 @@ export default {
9271
v-if="!authCompleted"
9372
sandbox="allow-same-origin allow-forms allow-scripts"
9473
hidden
95-
:src="oauthUrl"
74+
:src="apiConfig.oauthUrl"
9675
data-testid="observability-oauth-iframe"
9776
></iframe>
9877

app/assets/javascripts/observability/components/provisioned_observability_container.vue

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,8 @@ export default {
1212
GlLoadingIcon,
1313
},
1414
props: {
15-
oauthUrl: {
16-
type: String,
17-
required: true,
18-
},
19-
tracingUrl: {
20-
type: String,
21-
required: true,
22-
},
23-
servicesUrl: {
24-
type: String,
25-
required: true,
26-
},
27-
provisioningUrl: {
28-
type: String,
29-
required: true,
30-
},
31-
operationsUrl: {
32-
type: String,
15+
apiConfig: {
16+
type: Object,
3317
required: true,
3418
},
3519
},
@@ -91,11 +75,7 @@ export default {
9175

9276
<template>
9377
<observability-container
94-
:oauth-url="oauthUrl"
95-
:tracing-url="tracingUrl"
96-
:provisioning-url="provisioningUrl"
97-
:services-url="servicesUrl"
98-
:operations-url="operationsUrl"
78+
:api-config="apiConfig"
9979
@observability-client-ready="onObservabilityClientReady"
10080
>
10181
<div v-if="loading" class="gl-py-5">

app/assets/javascripts/profile/edit/components/profile_edit_app.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,11 @@ export default {
109109
async syncHeaderAvatars() {
110110
const dataURL = await readFileAsDataURL(this.avatarBlob);
111111
112-
// TODO: implement sync for super sidebar
113-
['.header-user-avatar', '.js-sidebar-user-avatar'].forEach((selector) => {
112+
const elements = gon?.use_new_navigation
113+
? ['[data-testid="user-dropdown"] .gl-avatar']
114+
: ['.header-user-avatar', '.js-sidebar-user-avatar'];
115+
116+
elements.forEach((selector) => {
114117
const node = document.querySelector(selector);
115118
if (!node) return;
116119

app/assets/javascripts/profile/profile.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,12 @@ export default class Profile {
8989
}
9090

9191
updateHeaderAvatar() {
92-
$('.header-user-avatar').attr('src', this.avatarGlCrop.dataURL);
93-
$('.js-sidebar-user-avatar').attr('src', this.avatarGlCrop.dataURL);
92+
if (gon?.use_new_navigation) {
93+
$('[data-testid="user-dropdown"] .gl-avatar').attr('src', this.avatarGlCrop.dataURL);
94+
} else {
95+
$('.header-user-avatar').attr('src', this.avatarGlCrop.dataURL);
96+
$('.js-sidebar-user-avatar').attr('src', this.avatarGlCrop.dataURL);
97+
}
9498
}
9599

96100
setRepoRadio() {

app/assets/javascripts/projects/settings_service_desk/components/service_desk_root.vue

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ export default {
5555
projectKey: {
5656
default: '',
5757
},
58+
addExternalParticipantsFromCc: {
59+
default: false,
60+
},
5861
templates: {
5962
default: [],
6063
},
@@ -109,13 +112,20 @@ export default {
109112
});
110113
},
111114
112-
onSaveTemplate({ selectedTemplate, fileTemplateProjectId, outgoingName, projectKey }) {
115+
onSaveTemplate({
116+
selectedTemplate,
117+
fileTemplateProjectId,
118+
outgoingName,
119+
projectKey,
120+
addExternalParticipantsFromCc,
121+
}) {
113122
this.isTemplateSaving = true;
114123
115124
const body = {
116125
issue_template_key: selectedTemplate,
117126
outgoing_name: outgoingName,
118127
project_key: projectKey,
128+
add_external_participants_from_cc: addExternalParticipantsFromCc,
119129
service_desk_enabled: this.isEnabled,
120130
file_template_project_id: fileTemplateProjectId,
121131
};
@@ -187,6 +197,7 @@ export default {
187197
:initial-selected-file-template-project-id="selectedFileTemplateProjectId"
188198
:initial-outgoing-name="outgoingName"
189199
:initial-project-key="projectKey"
200+
:initial-add-external-participants-from-cc="addExternalParticipantsFromCc"
190201
:templates="templates"
191202
:is-template-saving="isTemplateSaving"
192203
@save="onSaveTemplate"

0 commit comments

Comments
 (0)