From 800c3eceda37c4bcc70f950c2ab55c5e82140433 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 15 May 2025 09:12:59 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- .rubocop_todo/gitlab/bounded_contexts.yml | 6 +- .rubocop_todo/rspec/be_eq.yml | 1 - GITALY_SERVER_VERSION | 2 +- Gemfile | 6 +- Gemfile.checksum | 1 + Gemfile.lock | 10 +- Gemfile.next.checksum | 1 + Gemfile.next.lock | 10 +- .../graphql_shared/possible_types.json | 8 + .../access_tokens/stores/access_tokens.js | 7 +- .../nested_groups_projects_list_item.vue | 2 +- .../components/notes/work_item_discussion.vue | 125 +++++----- .../components/notes/work_item_note.vue | 10 +- .../work_items/components/work_item_notes.vue | 15 +- .../javascripts/work_items/constants.js | 1 + .../create_work_item_note.mutation.graphql | 6 + ...m_note_resolve_discussion.mutation.graphql | 6 + ...work_item_discussion_note.fragment.graphql | 6 + .../notes/work_item_note.fragment.graphql | 9 - .../work_item_notes_by_iid.query.graphql | 6 + app/helpers/access_tokens_helper.rb | 2 +- app/models/application_setting.rb | 4 +- .../application_setting_implementation.rb | 2 +- .../concerns/gitlab/sensitive_attributes.rb | 10 +- .../concerns/integrations/base/integration.rb | 4 +- app/models/concerns/web_hooks/hook.rb | 8 +- app/models/deploy_token.rb | 4 +- app/models/grafana_integration.rb | 2 +- app/models/operations/feature_flags_client.rb | 11 +- app/models/sent_notification.rb | 34 ++- app/models/user.rb | 4 +- app/models/user_preference.rb | 4 + .../bbm_retry_sidekiq_shutdown_exception.yml | 6 +- ...s_searches_flag_to_application_settings.rb | 23 +- ...ization_groups_projects_display_default.rb | 13 + ...lt_from_sent_notifications_namespace_id.rb | 9 + ...r_p_ci_pipeline_variables_on_project_id.rb | 19 ++ db/schema_migrations/20250506091513 | 1 + db/schema_migrations/20250512143054 | 1 + db/schema_migrations/20250513134112 | 1 + db/structure.sql | 4 +- doc/administration/cells.md | 2 +- doc/administration/geo/glossary.md | 4 +- .../geo/replication/security_review.md | 1 - .../settings/account_and_limit_settings.md | 3 +- doc/api/graphql/reference/_index.md | 181 ++++++++++++++ doc/user/group/import/troubleshooting.md | 13 + doc/user/organization/_index.md | 12 +- doc/user/project/_index.md | 2 +- lib/authn/token_field/prefix_helper.rb | 9 - lib/authn/tokens/deploy_token.rb | 2 +- .../tokens/feature_flags_client_token.rb | 7 +- lib/authn/tokens/feed_token.rb | 6 +- lib/gitlab/doctor/secrets.rb | 4 +- .../import_export/base/relation_factory.rb | 4 +- lib/gitlab/otp_key_rotator.rb | 2 +- locale/gitlab.pot | 5 +- .../application_settings_controller_spec.rb | 3 +- .../sent_notifications_controller_spec.rb | 3 +- .../components/access_tokens_spec.js | 4 +- .../stores/access_tokens_spec.js | 11 +- .../notes/work_item_discussion_spec.js | 93 ++++---- .../components/work_item_notes_spec.js | 50 ++-- spec/frontend/work_items/mock_data.js | 223 +++++------------- spec/helpers/access_tokens_helper_spec.rb | 2 +- .../organizations/organization_helper_spec.rb | 6 +- .../authn/agnostic_token_identifier_spec.rb | 2 +- .../authn/token_field/prefix_helper_spec.rb | 58 +---- spec/lib/authn/tokens/deploy_token_spec.rb | 2 +- spec/lib/authn/tokens/feed_token_spec.rb | 2 +- .../email/handler/unsubscribe_handler_spec.rb | 6 +- .../attribute_configuration_spec.rb | 2 +- .../references_configuration_spec.rb | 2 +- spec/mailers/notify_spec.rb | 17 +- ...rches_flag_to_application_settings_spec.rb | 63 ----- spec/models/application_setting_spec.rb | 2 +- spec/models/attr_encrypted_patches_spec.rb | 64 ----- spec/models/concerns/bulk_insert_safe_spec.rb | 16 +- .../gitlab/encrypted_attribute_spec.rb | 4 +- .../sensitive_serializable_hash_spec.rb | 4 +- spec/models/integration_spec.rb | 2 +- .../integrations/issue_tracker_data_spec.rb | 2 +- .../integrations/jira_tracker_data_spec.rb | 2 +- .../integrations/zentao_tracker_data_spec.rb | 2 +- .../operations/feature_flags_client_spec.rb | 4 +- spec/models/sent_notification_spec.rb | 72 +++++- spec/models/user_preference_spec.rb | 4 +- spec/models/user_spec.rb | 4 +- spec/services/notification_service_spec.rb | 4 +- spec/support/finder_collection_allowlist.yml | 1 + .../authn/token_shared_examples.rb | 4 +- .../encrypted_attribute_shared_examples.rb | 2 +- .../web_hooks/web_hook_shared_examples.rb | 2 +- 93 files changed, 714 insertions(+), 691 deletions(-) rename config/feature_flags/{experiment => gitlab_com_derisk}/bbm_retry_sidekiq_shutdown_exception.yml (70%) create mode 100644 db/post_migrate/20250506091513_change_user_preference_organization_groups_projects_display_default.rb create mode 100644 db/post_migrate/20250512143054_remove_default_from_sent_notifications_namespace_id.rb create mode 100644 db/post_migrate/20250513134112_schedule_index_for_p_ci_pipeline_variables_on_project_id.rb create mode 100644 db/schema_migrations/20250506091513 create mode 100644 db/schema_migrations/20250512143054 create mode 100644 db/schema_migrations/20250513134112 delete mode 100644 spec/migrations/20250502055316_migrate_anonymous_searches_flag_to_application_settings_spec.rb delete mode 100644 spec/models/attr_encrypted_patches_spec.rb diff --git a/.rubocop_todo/gitlab/bounded_contexts.yml b/.rubocop_todo/gitlab/bounded_contexts.yml index f27f9b17bf0..9a5f0b2fbf4 100644 --- a/.rubocop_todo/gitlab/bounded_contexts.yml +++ b/.rubocop_todo/gitlab/bounded_contexts.yml @@ -2339,12 +2339,14 @@ Gitlab/BoundedContexts: - 'ee/app/graphql/resolvers/security_orchestration/policy_violations_resolver.rb' - 'ee/app/graphql/resolvers/security_orchestration/scan_execution_policy_resolver.rb' - 'ee/app/graphql/resolvers/security_orchestration/scan_result_policy_resolver.rb' - - 'ee/app/graphql/types/security_orchestration/scan_execution_policy_attributes_type.rb' + - 'ee/app/graphql/resolvers/security_orchestration/security_policy_resolver.rb' - 'ee/app/graphql/types/security_orchestration/approval_policy_attributes_type.rb' + - 'ee/app/graphql/types/security_orchestration/scan_execution_policy_attributes_type.rb' + - 'ee/app/graphql/types/security_orchestration/policy_attributes_union.rb' - 'ee/app/graphql/types/security_orchestration/pipeline_execution_scheduled_policy_attributes_type.rb' - 'ee/app/graphql/types/security_orchestration/pipeline_execution_policy_attributes_type.rb' - - 'ee/app/graphql/types/security_orchestration/pipeline_execution_policy_scheduled_fields_type.rb' - 'ee/app/graphql/types/security/vulnerability_management_policy_attributes_type.rb' + - 'ee/app/graphql/types/security_orchestration/security_policy_type.rb' - 'ee/app/graphql/resolvers/security_orchestration/security_policy_project_suggestions_resolver.rb' - 'ee/app/graphql/resolvers/security_report/finding_reports_comparer_resolver.rb' - 'ee/app/graphql/resolvers/security_report/finding_resolver.rb' diff --git a/.rubocop_todo/rspec/be_eq.yml b/.rubocop_todo/rspec/be_eq.yml index 8185fbb9be7..ba80190af5f 100644 --- a/.rubocop_todo/rspec/be_eq.yml +++ b/.rubocop_todo/rspec/be_eq.yml @@ -1003,7 +1003,6 @@ RSpec/BeEq: - 'spec/models/anti_abuse/reports/note_spec.rb' - 'spec/models/anti_abuse/user_trust_score_spec.rb' - 'spec/models/appearance_spec.rb' - - 'spec/models/attr_encrypted_patches_spec.rb' - 'spec/models/authentication_event_spec.rb' - 'spec/models/batched_git_ref_updates/deletion_spec.rb' - 'spec/models/blob_spec.rb' diff --git a/GITALY_SERVER_VERSION b/GITALY_SERVER_VERSION index fb6761ba883..444db4108ad 100644 --- a/GITALY_SERVER_VERSION +++ b/GITALY_SERVER_VERSION @@ -1 +1 @@ -c2df26faa831df5935081aad4833580a791d0002 +da07ea6b72e37e8d07020e7be6cd4a378ddc442a diff --git a/Gemfile b/Gemfile index c0eadbe75fa..b84664cc0cc 100644 --- a/Gemfile +++ b/Gemfile @@ -19,10 +19,6 @@ extend ignore_feature_category gem 'bundler-checksum', '~> 0.1.0', path: 'vendor/gems/bundler-checksum', require: false, feature_category: :shared -# NOTE: When incrementing the major or minor version here, also increment activerecord_version -# in vendor/gems/attr_encrypted/attr_encrypted.gemspec until we resolve -# https://gitlab.com/gitlab-org/gitlab/-/issues/375713 -# # See https://docs.gitlab.com/ee/development/gemfile.html#upgrade-rails for guidelines when upgrading Rails gem 'rails', '~> 7.1.5.1', feature_category: :shared @@ -128,7 +124,7 @@ gem 'invisible_captcha', '~> 2.1.0', feature_category: :insider_threat gem 'devise-two-factor', '~> 4.1.1', feature_category: :system_access gem 'rqrcode', '~> 2.2', feature_category: :system_access -gem 'attr_encrypted', '~> 3.2.4', path: 'vendor/gems/attr_encrypted', feature_category: :shared +gem 'attr_encrypted', '~> 4.2', feature_category: :shared # GitLab Pages gem 'validates_hostname', '~> 1.0.13', feature_category: :pages diff --git a/Gemfile.checksum b/Gemfile.checksum index 116d60a8d0f..bfa6fdb663c 100644 --- a/Gemfile.checksum +++ b/Gemfile.checksum @@ -30,6 +30,7 @@ {"name":"ast","version":"2.4.2","platform":"ruby","checksum":"1e280232e6a33754cde542bc5ef85520b74db2aac73ec14acef453784447cc12"}, {"name":"async","version":"2.23.1","platform":"ruby","checksum":"612c97346948a5dbfb6b4aef12976416b01aef48ec2d41677efb25c8c32a5006"}, {"name":"atlassian-jwt","version":"0.2.1","platform":"ruby","checksum":"2fd2d87418773f2e140c038cb22e049069708aff2bd0a423a7e1740574e97823"}, +{"name":"attr_encrypted","version":"4.2.0","platform":"ruby","checksum":"7e5c80159e6e38ed40dc4e2e65c4f57234fe1f376bddc40c8b773bfb9b81ad51"}, {"name":"attr_required","version":"1.0.2","platform":"ruby","checksum":"f0ebfc56b35e874f4d0ae799066dbc1f81efefe2364ca3803dc9ea6a4de6cb99"}, {"name":"awesome_print","version":"1.9.2","platform":"ruby","checksum":"e99b32b704acff16d768b3468680793ced40bfdc4537eb07e06a4be11133786e"}, {"name":"awrence","version":"1.2.1","platform":"ruby","checksum":"dd1d214c12a91f449d1ef81d7ee3babc2816944e450752e7522c65521872483e"}, diff --git a/Gemfile.lock b/Gemfile.lock index b8d455bceb4..78cbd510b48 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -126,12 +126,6 @@ PATH diffy (~> 3.4) oj (~> 3.16, >= 3.16.10) -PATH - remote: vendor/gems/attr_encrypted - specs: - attr_encrypted (3.2.4) - encryptor (~> 3.0.0) - PATH remote: vendor/gems/bundler-checksum specs: @@ -352,6 +346,8 @@ GEM traces (~> 0.15) atlassian-jwt (0.2.1) jwt (~> 2.1) + attr_encrypted (4.2.0) + encryptor (~> 3.0.0) attr_required (1.0.2) awesome_print (1.9.2) awrence (1.2.1) @@ -2079,7 +2075,7 @@ DEPENDENCIES asciidoctor-plantuml (~> 0.0.16) async (~> 2.23.0) atlassian-jwt (~> 0.2.1) - attr_encrypted (~> 3.2.4)! + attr_encrypted (~> 4.2) awesome_print aws-sdk-cloudformation (~> 1) aws-sdk-core (~> 3.223.0) diff --git a/Gemfile.next.checksum b/Gemfile.next.checksum index 116d60a8d0f..bfa6fdb663c 100644 --- a/Gemfile.next.checksum +++ b/Gemfile.next.checksum @@ -30,6 +30,7 @@ {"name":"ast","version":"2.4.2","platform":"ruby","checksum":"1e280232e6a33754cde542bc5ef85520b74db2aac73ec14acef453784447cc12"}, {"name":"async","version":"2.23.1","platform":"ruby","checksum":"612c97346948a5dbfb6b4aef12976416b01aef48ec2d41677efb25c8c32a5006"}, {"name":"atlassian-jwt","version":"0.2.1","platform":"ruby","checksum":"2fd2d87418773f2e140c038cb22e049069708aff2bd0a423a7e1740574e97823"}, +{"name":"attr_encrypted","version":"4.2.0","platform":"ruby","checksum":"7e5c80159e6e38ed40dc4e2e65c4f57234fe1f376bddc40c8b773bfb9b81ad51"}, {"name":"attr_required","version":"1.0.2","platform":"ruby","checksum":"f0ebfc56b35e874f4d0ae799066dbc1f81efefe2364ca3803dc9ea6a4de6cb99"}, {"name":"awesome_print","version":"1.9.2","platform":"ruby","checksum":"e99b32b704acff16d768b3468680793ced40bfdc4537eb07e06a4be11133786e"}, {"name":"awrence","version":"1.2.1","platform":"ruby","checksum":"dd1d214c12a91f449d1ef81d7ee3babc2816944e450752e7522c65521872483e"}, diff --git a/Gemfile.next.lock b/Gemfile.next.lock index b8d455bceb4..78cbd510b48 100644 --- a/Gemfile.next.lock +++ b/Gemfile.next.lock @@ -126,12 +126,6 @@ PATH diffy (~> 3.4) oj (~> 3.16, >= 3.16.10) -PATH - remote: vendor/gems/attr_encrypted - specs: - attr_encrypted (3.2.4) - encryptor (~> 3.0.0) - PATH remote: vendor/gems/bundler-checksum specs: @@ -352,6 +346,8 @@ GEM traces (~> 0.15) atlassian-jwt (0.2.1) jwt (~> 2.1) + attr_encrypted (4.2.0) + encryptor (~> 3.0.0) attr_required (1.0.2) awesome_print (1.9.2) awrence (1.2.1) @@ -2079,7 +2075,7 @@ DEPENDENCIES asciidoctor-plantuml (~> 0.0.16) async (~> 2.23.0) atlassian-jwt (~> 0.2.1) - attr_encrypted (~> 3.2.4)! + attr_encrypted (~> 4.2) awesome_print aws-sdk-cloudformation (~> 1) aws-sdk-core (~> 3.223.0) diff --git a/app/assets/javascripts/graphql_shared/possible_types.json b/app/assets/javascripts/graphql_shared/possible_types.json index 0b89a6021e1..7fec0ce32e3 100644 --- a/app/assets/javascripts/graphql_shared/possible_types.json +++ b/app/assets/javascripts/graphql_shared/possible_types.json @@ -172,6 +172,7 @@ "PipelineExecutionSchedulePolicy", "ScanExecutionPolicy", "ScanResultPolicy", + "SecurityPolicyType", "VulnerabilityManagementPolicy" ], "PackageFileMetadata": [ @@ -194,6 +195,13 @@ "Pipeline", "PipelineMinimalAccess" ], + "PolicyAttributesUnion": [ + "ApprovalPolicyAttributesType", + "PipelineExecutionPolicyAttributesType", + "PipelineExecutionScheduledPolicyAttributesType", + "ScanExecutionPolicyAttributesType", + "VulnerabilityManagementPolicyAttributesType" + ], "ProjectInterface": [ "Project", "ProjectMinimalAccess" diff --git a/app/assets/javascripts/vue_shared/access_tokens/stores/access_tokens.js b/app/assets/javascripts/vue_shared/access_tokens/stores/access_tokens.js index 8e47175ac3f..a9fe6d92132 100644 --- a/app/assets/javascripts/vue_shared/access_tokens/stores/access_tokens.js +++ b/app/assets/javascripts/vue_shared/access_tokens/stores/access_tokens.js @@ -23,13 +23,12 @@ import { serializeParams, update2WeekFromNow, updateUrlWithQueryParams } from '. * * @param {Object} options * @param {string} options.url - * @param {string|number} options.id * @param {Object} options.params * @param {string} options.sort */ -const fetchTokens = async ({ url, id, params, sort }) => { +const fetchTokens = async ({ url, params, sort }) => { const { data, headers } = await axios.get(url, { - params: { user_id: id, sort, ...params }, + params: { sort, ...params }, }); const { perPage, total } = parseIntPagination(normalizeHeaders(headers)); @@ -105,7 +104,6 @@ export const useAccessTokens = defineStore('accessTokens', { const url = Api.buildUrl(this.urlShow.replace(':id', this.id)); const { total } = await fetchTokens({ url, - id: this.id, params, sort: this.sort, }); @@ -136,7 +134,6 @@ export const useAccessTokens = defineStore('accessTokens', { updateUrlWithQueryParams({ params: this.params, sort: this.sort }); const { data, perPage, total } = await fetchTokens({ url, - id: this.id, params: this.params, sort: this.sort, }); diff --git a/app/assets/javascripts/vue_shared/components/nested_groups_projects_list/nested_groups_projects_list_item.vue b/app/assets/javascripts/vue_shared/components/nested_groups_projects_list/nested_groups_projects_list_item.vue index 1acc6f9088d..7a1188853a3 100644 --- a/app/assets/javascripts/vue_shared/components/nested_groups_projects_list/nested_groups_projects_list_item.vue +++ b/app/assets/javascripts/vue_shared/components/nested_groups_projects_list/nested_groups_projects_list_item.vue @@ -80,7 +80,7 @@ export default { }, moreChildrenLinkText() { return n__( - 'View all (one more item)', + 'View all (%d more item)', 'View all (%d more items)', this.item.childrenCount - this.item.children.length, ); diff --git a/app/assets/javascripts/work_items/components/notes/work_item_discussion.vue b/app/assets/javascripts/work_items/components/notes/work_item_discussion.vue index 803dd2aa11c..6c4020d8d3d 100644 --- a/app/assets/javascripts/work_items/components/notes/work_item_discussion.vue +++ b/app/assets/javascripts/work_items/components/notes/work_item_discussion.vue @@ -37,8 +37,9 @@ export default { required: true, }, discussion: { - type: Array, + type: Object, required: true, + default: () => ({}), }, sortOrder: { type: String, @@ -110,23 +111,26 @@ export default { }; }, computed: { - note() { - return this.discussion[0]; + notes() { + return this.discussion.notes.nodes; }, - noteId() { - return getIdFromGraphQLId(this.note.id); + firstNote() { + return this.notes[0]; + }, + firstNoteId() { + return getIdFromGraphQLId(this.firstNote.id); }, hasReplies() { return Boolean(this.replies?.length); }, replies() { - if (this.discussion?.length > 1) { - return this.discussion.slice(1); + if (this.notes?.length > 1) { + return this.notes.slice(1); } return null; }, discussionId() { - return this.firstComment?.id || ''; + return this.discussion.id || ''; }, shouldShowReplyForm() { return this.showForm || this.hasReplies; @@ -134,20 +138,17 @@ export default { isOnlyCommentOfAThread() { return !this.hasReplies && !this.showForm; }, - firstComment() { - return this.discussion[0]?.discussion; - }, isDiscussionResolved() { - return this.firstComment?.resolved; + return this.discussion.resolved; }, isDiscussionResolvable() { - return this.firstComment?.resolvable && this.note?.userPermissions?.resolveNote; + return this.discussion.resolvable && this.firstNote?.userPermissions?.resolveNote; }, }, watch: { discussion: { handler(newDiscussion) { - if (newDiscussion[0].discussion.resolved === false) { + if (newDiscussion.resolved === false) { this.isExpanded = true; } }, @@ -163,7 +164,7 @@ export default { methods: { handleQuoteReply({ event, discussionId, text }) { // Ensure we're using correct discussion block for reply form. - if (this.note.discussion.id === discussionId) { + if (this.discussion.id === discussionId) { // Prevent 'r' being written. if (event && typeof event.preventDefault === 'function') { event.preventDefault(); @@ -214,21 +215,11 @@ export default { __typename: 'UserCore', }; } - const toggledDiscussionNotes = [...this.discussion].map((note) => { - return { - ...note, - discussion: { - ...note.discussion, - resolved, - resolvedBy, - }, - }; - }); + return { - id: this.discussionId, - notes: { - nodes: [...toggledDiscussionNotes], - }, + ...this.discussion, + resolved, + resolvedBy, }; }, async resolveDiscussion() { @@ -259,7 +250,7 @@ export default { @@ -300,7 +292,7 @@ export default {