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 {