From c19944d9970b788d8523cee6ee05217a8afd7646 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 7 Mar 2023 21:13:36 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- .gitleaksignore | 2 + GITALY_SERVER_VERSION | 2 +- .../authentication/webauthn/authenticate.js | 3 +- .../webauthn/components/registration.vue | 4 +- .../authentication/webauthn/constants.js | 2 + .../javascripts/authentication/webauthn/error.js | 7 +- .../authentication/webauthn/register.js | 3 +- .../javascripts/authentication/webauthn/util.js | 3 - .../issues/create_merge_request_dropdown.js | 2 +- app/assets/javascripts/issues/issue.js | 2 +- .../issues/list/components/issues_list_app.vue | 2 +- app/assets/javascripts/issues/manual_ordering.js | 2 +- .../issues/related_merge_requests/store/actions.js | 2 +- .../javascripts/issues/show/components/app.vue | 15 +-- .../issues/show/components/description.vue | 2 +- .../issues/show/components/header_actions.vue | 2 +- .../components/incidents/create_timeline_event.vue | 2 +- .../show/components/incidents/incident_tabs.vue | 2 +- .../components/incidents/timeline_events_list.vue | 2 +- .../issues/show/components/incidents/utils.js | 2 +- .../pages/groups/new/components/app.vue | 9 +- app/assets/javascripts/pages/groups/new/index.js | 2 + .../pages/projects/commit/show/index.js | 2 +- .../javascripts/pages/users/activity_calendar.js | 2 + app/assets/javascripts/pages/users/user_tabs.js | 2 +- .../javascripts/projects/new/components/app.vue | 10 +- app/assets/javascripts/projects/new/index.js | 2 + .../components/system_notes/system_note.vue | 6 +- .../filtered_search_bar/tokens/branch_token.vue | 2 +- .../tokens/crm_contact_token.vue | 2 +- .../filtered_search_bar/tokens/release_token.vue | 2 +- .../filtered_search_bar/tokens/user_token.vue | 2 +- .../components/user_popover/user_popover.vue | 2 +- .../merge_request_artifact_download.vue | 2 +- .../security_reports/security_reports_app.vue | 2 +- app/graphql/mutations/design_management/update.rb | 39 ++++++++ app/graphql/types/design_management/design_type.rb | 7 ++ app/graphql/types/mutation_type.rb | 1 + app/policies/issue_policy.rb | 1 + app/policies/project_policy.rb | 2 + .../resource_access_tokens/create_service.rb | 28 +++--- app/views/groups/new.html.haml | 2 +- app/views/projects/new.html.haml | 10 +- doc/api/graphql/reference/index.md | 22 +++++ .../application_security/dast/authentication.md | 2 +- .../application_security/dast/browser_based.md | 24 ++--- .../license_scanning_of_cyclonedx_files/index.md | 4 +- doc/user/group/settings/group_access_tokens.md | 2 +- lib/api/commits.rb | 4 + lib/generators/batched_background_migration/USAGE | 1 + .../batched_background_migration_generator.rb | 7 ++ ...atched_background_migration_dictionary.template | 6 ++ lib/gitlab/gitaly_client/ref_service.rb | 2 +- lib/gitlab/utils/username_and_email_generator.rb | 42 +++++++++ locale/gitlab.pot | 11 ++- qa/qa/page/component/dropdown.rb | 18 +++- qa/qa/page/project/monitor/alerts/index.rb | 4 + qa/qa/page/project/monitor/alerts/show.rb | 25 +++++ qa/qa/page/project/sub_menus/monitor.rb | 16 ++++ qa/qa/support/matchers/have_matcher.rb | 1 + scripts/create-pipeline-failure-incident.rb | 2 - spec/controllers/projects_controller_spec.rb | 13 +++ spec/features/calendar_spec.rb | 60 ++++++++++++ spec/features/dashboard/projects_spec.rb | 2 +- .../webauthn/components/registration_spec.js | 7 +- .../frontend/authentication/webauthn/error_spec.js | 13 +-- spec/frontend/blob_edit/blob_bundle_spec.js | 4 +- .../admin_new_runner_app_spec.js | 4 +- .../admin_runner_show_app_spec.js | 4 +- .../registration_token_reset_dropdown_item_spec.js | 4 +- .../runner/components/runner_bulk_delete_spec.js | 4 +- .../runner/components/runner_delete_button_spec.js | 4 +- .../ci/runner/components/runner_jobs_spec.js | 4 +- .../runner/components/runner_pause_button_spec.js | 4 +- .../ci/runner/components/runner_projects_spec.js | 4 +- .../runner/components/runner_update_form_spec.js | 4 +- .../components/search_tokens/tag_token_spec.js | 4 +- .../group_runner_show_app_spec.js | 4 +- .../show_alert_from_local_storage_spec.js | 4 +- .../content_editor/extensions/attachment_spec.js | 2 +- .../extensions/paste_markdown_spec.js | 2 +- spec/frontend/error_tracking/store/actions_spec.js | 4 +- .../error_tracking/store/details/actions_spec.js | 6 +- .../error_tracking/store/list/actions_spec.js | 6 +- .../utils/trigger_successful_invite_alert_spec.js | 4 +- .../pages/groups/new/components/app_spec.js | 15 ++- spec/frontend/persistent_user_callout_spec.js | 4 +- spec/frontend/projects/new/components/app_spec.js | 27 +++++- .../design_at_version_type_spec.rb | 2 +- .../types/design_management/design_type_spec.rb | 7 +- .../batched_background_migration_generator_spec.rb | 5 + .../my_batched_migration_dictionary.txt | 6 ++ spec/lib/gitlab/gitaly_client/ref_service_spec.rb | 20 +++- .../utils/username_and_email_generator_spec.rb | 24 +++++ .../design_management/design_policy_spec.rb | 4 +- spec/requests/api/commits_spec.rb | 25 ++++- .../mutations/design_management/update_spec.rb | 77 +++++++++++++++ .../resource_access_tokens/create_service_spec.rb | 31 +++--- ...username_and_email_generator_shared_examples.rb | 104 +++++++++++++++++++++ .../requests/api/status_shared_examples.rb | 17 ++++ .../project_templates/learn_gitlab_ultimate.tar.gz | Bin 115431 -> 0 bytes 101 files changed, 755 insertions(+), 179 deletions(-) create mode 100644 .gitleaksignore create mode 100644 app/graphql/mutations/design_management/update.rb create mode 100644 lib/generators/batched_background_migration/templates/batched_background_migration_dictionary.template create mode 100644 lib/gitlab/utils/username_and_email_generator.rb create mode 100644 qa/qa/page/project/monitor/alerts/show.rb create mode 100644 spec/lib/generators/batched_background_migration/expected_files/my_batched_migration_dictionary.txt create mode 100644 spec/lib/gitlab/utils/username_and_email_generator_spec.rb create mode 100644 spec/requests/api/graphql/mutations/design_management/update_spec.rb create mode 100644 spec/support/shared_examples/lib/gitlab/utils/username_and_email_generator_shared_examples.rb delete mode 100644 vendor/project_templates/learn_gitlab_ultimate.tar.gz diff --git a/.gitleaksignore b/.gitleaksignore new file mode 100644 index 00000000000..eab7926138c --- /dev/null +++ b/.gitleaksignore @@ -0,0 +1,2 @@ +7e07fe42d34916b276a7b068f4faa8bdc0ebc984:doc/architecture/blueprints/runner_tokens/index.md:gitlab-rrt:485 +f6504b498548380198ad38295d9caa71412115f0:doc/architecture/blueprints/runner_tokens/index.md:generic-api-key:506 diff --git a/GITALY_SERVER_VERSION b/GITALY_SERVER_VERSION index f60c9678b67..6d17d4c34e2 100644 --- a/GITALY_SERVER_VERSION +++ b/GITALY_SERVER_VERSION @@ -1 +1 @@ -65769c7a58d3339fe94a809bf6fd34f2f300a700 +998d1f6dbf9856c51d548814371cc6b8276086a6 diff --git a/app/assets/javascripts/authentication/webauthn/authenticate.js b/app/assets/javascripts/authentication/webauthn/authenticate.js index 47cb7a40f76..748945a680b 100644 --- a/app/assets/javascripts/authentication/webauthn/authenticate.js +++ b/app/assets/javascripts/authentication/webauthn/authenticate.js @@ -1,3 +1,4 @@ +import { WEBAUTHN_AUTHENTICATE } from './constants'; import WebAuthnError from './error'; import WebAuthnFlow from './flow'; import { supported, convertGetParams, convertGetResponse } from './util'; @@ -44,7 +45,7 @@ export default class WebAuthnAuthenticate { this.renderAuthenticated(JSON.stringify(convertedResponse)); }) .catch((err) => { - this.flow.renderError(new WebAuthnError(err, 'authenticate')); + this.flow.renderError(new WebAuthnError(err, WEBAUTHN_AUTHENTICATE)); }); } diff --git a/app/assets/javascripts/authentication/webauthn/components/registration.vue b/app/assets/javascripts/authentication/webauthn/components/registration.vue index 1cc57046562..9a3644e0325 100644 --- a/app/assets/javascripts/authentication/webauthn/components/registration.vue +++ b/app/assets/javascripts/authentication/webauthn/components/registration.vue @@ -30,10 +30,10 @@ import { STATE_UNSUPPORTED, STATE_WAITING, WEBAUTHN_DOCUMENTATION_PATH, + WEBAUTHN_REGISTER, } from '~/authentication/webauthn/constants'; import WebAuthnError from '~/authentication/webauthn/error'; import { - FLOW_REGISTER, convertCreateParams, convertCreateResponse, isHTTPS, @@ -123,7 +123,7 @@ export default { this.credentials = JSON.stringify(convertCreateResponse(credentials)); this.state = STATE_SUCCESS; } catch (error) { - this.errorMessage = new WebAuthnError(error, FLOW_REGISTER).message(); + this.errorMessage = new WebAuthnError(error, WEBAUTHN_REGISTER).message(); this.state = STATE_ERROR; } }, diff --git a/app/assets/javascripts/authentication/webauthn/constants.js b/app/assets/javascripts/authentication/webauthn/constants.js index 6646cb2eb3f..c41e6d2bd58 100644 --- a/app/assets/javascripts/authentication/webauthn/constants.js +++ b/app/assets/javascripts/authentication/webauthn/constants.js @@ -38,6 +38,8 @@ export const STATE_SUCCESS = 'success'; export const STATE_UNSUPPORTED = 'unsupported'; export const STATE_WAITING = 'waiting'; +export const WEBAUTHN_AUTHENTICATE = 'authenticate'; +export const WEBAUTHN_REGISTER = 'register'; export const WEBAUTHN_DOCUMENTATION_PATH = helpPagePath( 'user/profile/account/two_factor_authentication', { anchor: 'set-up-a-webauthn-device' }, diff --git a/app/assets/javascripts/authentication/webauthn/error.js b/app/assets/javascripts/authentication/webauthn/error.js index a1a3f861c25..40dbecd8bc9 100644 --- a/app/assets/javascripts/authentication/webauthn/error.js +++ b/app/assets/javascripts/authentication/webauthn/error.js @@ -1,5 +1,6 @@ import { __ } from '~/locale'; -import { isHTTPS, FLOW_AUTHENTICATE, FLOW_REGISTER } from './util'; +import { WEBAUTHN_AUTHENTICATE, WEBAUTHN_REGISTER } from './constants'; +import { isHTTPS } from './util'; export default class WebAuthnError { constructor(error, flowType) { @@ -13,9 +14,9 @@ export default class WebAuthnError { message() { if (this.errorName === 'NotSupportedError') { return __('Your device is not compatible with GitLab. Please try another device'); - } else if (this.errorName === 'InvalidStateError' && this.flowType === FLOW_AUTHENTICATE) { + } else if (this.errorName === 'InvalidStateError' && this.flowType === WEBAUTHN_AUTHENTICATE) { return __('This device has not been registered with us.'); - } else if (this.errorName === 'InvalidStateError' && this.flowType === FLOW_REGISTER) { + } else if (this.errorName === 'InvalidStateError' && this.flowType === WEBAUTHN_REGISTER) { return __('This device has already been registered with us.'); } else if (this.errorName === 'SecurityError' && this.httpsDisabled) { return __( diff --git a/app/assets/javascripts/authentication/webauthn/register.js b/app/assets/javascripts/authentication/webauthn/register.js index 62ebf85abe4..c00d3ede2c1 100644 --- a/app/assets/javascripts/authentication/webauthn/register.js +++ b/app/assets/javascripts/authentication/webauthn/register.js @@ -2,6 +2,7 @@ import { __ } from '~/locale'; import WebAuthnError from './error'; import WebAuthnFlow from './flow'; import { supported, isHTTPS, convertCreateParams, convertCreateResponse } from './util'; +import { WEBAUTHN_REGISTER } from './constants'; // Register WebAuthn devices for users to authenticate with. // @@ -40,7 +41,7 @@ export default class WebAuthnRegister { publicKey: this.webauthnOptions, }) .then((cred) => this.renderRegistered(JSON.stringify(convertCreateResponse(cred)))) - .catch((err) => this.flow.renderError(new WebAuthnError(err, 'register'))); + .catch((err) => this.flow.renderError(new WebAuthnError(err, WEBAUTHN_REGISTER))); } renderSetup() { diff --git a/app/assets/javascripts/authentication/webauthn/util.js b/app/assets/javascripts/authentication/webauthn/util.js index 4e1409b9ed9..0ff0f0e6a29 100644 --- a/app/assets/javascripts/authentication/webauthn/util.js +++ b/app/assets/javascripts/authentication/webauthn/util.js @@ -8,9 +8,6 @@ export function isHTTPS() { return window.location.protocol.startsWith('https'); } -export const FLOW_AUTHENTICATE = 'authenticate'; -export const FLOW_REGISTER = 'register'; - /** * Converts a base64 string to an ArrayBuffer * diff --git a/app/assets/javascripts/issues/create_merge_request_dropdown.js b/app/assets/javascripts/issues/create_merge_request_dropdown.js index caf82e482ea..c821c18bcb9 100644 --- a/app/assets/javascripts/issues/create_merge_request_dropdown.js +++ b/app/assets/javascripts/issues/create_merge_request_dropdown.js @@ -7,7 +7,7 @@ import { import confidentialMergeRequestState from '~/confidential_merge_request/state'; import DropLab from '~/filtered_search/droplab/drop_lab_deprecated'; import ISetter from '~/filtered_search/droplab/plugins/input_setter'; -import { createAlert } from '~/flash'; +import { createAlert } from '~/alert'; import axios from '~/lib/utils/axios_utils'; import { __, sprintf } from '~/locale'; import { mergeUrlParams } from '~/lib/utils/url_utility'; diff --git a/app/assets/javascripts/issues/issue.js b/app/assets/javascripts/issues/issue.js index de1c689e590..b7fd99d8042 100644 --- a/app/assets/javascripts/issues/issue.js +++ b/app/assets/javascripts/issues/issue.js @@ -1,6 +1,6 @@ import $ from 'jquery'; import { joinPaths } from '~/lib/utils/url_utility'; -import { createAlert } from '~/flash'; +import { createAlert } from '~/alert'; import { EVENT_ISSUABLE_VUE_APP_CHANGE } from '~/issuable/constants'; import axios from '~/lib/utils/axios_utils'; import { addDelimiter } from '~/lib/utils/text_utility'; diff --git a/app/assets/javascripts/issues/list/components/issues_list_app.vue b/app/assets/javascripts/issues/list/components/issues_list_app.vue index 35727566fba..f03ecdc4125 100644 --- a/app/assets/javascripts/issues/list/components/issues_list_app.vue +++ b/app/assets/javascripts/issues/list/components/issues_list_app.vue @@ -7,7 +7,7 @@ import IssueCardStatistics from 'ee_else_ce/issues/list/components/issue_card_st import IssueCardTimeInfo from 'ee_else_ce/issues/list/components/issue_card_time_info.vue'; import getIssuesQuery from 'ee_else_ce/issues/list/queries/get_issues.query.graphql'; import getIssuesCountsQuery from 'ee_else_ce/issues/list/queries/get_issues_counts.query.graphql'; -import { createAlert, VARIANT_INFO } from '~/flash'; +import { createAlert, VARIANT_INFO } from '~/alert'; import { TYPENAME_USER } from '~/graphql_shared/constants'; import { convertToGraphQLId, getIdFromGraphQLId } from '~/graphql_shared/utils'; import CsvImportExportButtons from '~/issuable/components/csv_import_export_buttons.vue'; diff --git a/app/assets/javascripts/issues/manual_ordering.js b/app/assets/javascripts/issues/manual_ordering.js index 1bb53dfd50d..f22062cf048 100644 --- a/app/assets/javascripts/issues/manual_ordering.js +++ b/app/assets/javascripts/issues/manual_ordering.js @@ -1,5 +1,5 @@ import Sortable from 'sortablejs'; -import { createAlert } from '~/flash'; +import { createAlert } from '~/alert'; import axios from '~/lib/utils/axios_utils'; import { s__ } from '~/locale'; import { getSortableDefaultOptions, sortableStart } from '~/sortable/utils'; diff --git a/app/assets/javascripts/issues/related_merge_requests/store/actions.js b/app/assets/javascripts/issues/related_merge_requests/store/actions.js index 4c81f1d9bc1..ad5b61424dc 100644 --- a/app/assets/javascripts/issues/related_merge_requests/store/actions.js +++ b/app/assets/javascripts/issues/related_merge_requests/store/actions.js @@ -1,4 +1,4 @@ -import { createAlert } from '~/flash'; +import { createAlert } from '~/alert'; import axios from '~/lib/utils/axios_utils'; import { normalizeHeaders } from '~/lib/utils/common_utils'; import { __ } from '~/locale'; diff --git a/app/assets/javascripts/issues/show/components/app.vue b/app/assets/javascripts/issues/show/components/app.vue index 0be11c5c537..851808b628e 100644 --- a/app/assets/javascripts/issues/show/components/app.vue +++ b/app/assets/javascripts/issues/show/components/app.vue @@ -1,7 +1,7 @@