diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-21 18:12:00 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-21 18:12:00 +0300 |
commit | 6323146895db2be6f04846b3c98060b7349207b9 (patch) | |
tree | 9b29de45421be0a9a6126001bd920d780467b1db /app | |
parent | 2779809e45970e7660521b94dbebcf24ed00d60d (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
20 files changed, 74 insertions, 34 deletions
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 adc789a205b..8ac7990c28d 100644 --- a/app/assets/javascripts/issues/list/components/issues_list_app.vue +++ b/app/assets/javascripts/issues/list/components/issues_list_app.vue @@ -915,7 +915,7 @@ export default { v-if="issuesDrawerEnabled" :open="isIssuableSelected" header-height="calc(var(--top-bar-height) + var(--performance-bar-height))" - class="gl-w-full gl-sm-w-40p" + class="gl-w-full gl-sm-w-40p gl-reset-line-height" @close="activeIssuable = null" > <template #title> @@ -927,6 +927,7 @@ export default { <work-item-detail :key="activeIssuable.iid" :work-item-iid="activeIssuable.iid" + class="gl-pt-0!" @work-item-updated="updateIssuablesCache" @work-item-emoji-updated="updateIssuableEmojis" @addChild="refetchIssuables" diff --git a/app/assets/javascripts/issues/list/index.js b/app/assets/javascripts/issues/list/index.js index 5a836e3e40a..ab6ff825554 100644 --- a/app/assets/javascripts/issues/list/index.js +++ b/app/assets/javascripts/issues/list/index.js @@ -137,6 +137,7 @@ export async function mountIssuesListApp() { hasOkrsFeature: parseBoolean(hasOkrsFeature), initialSort, isIssueRepositioningDisabled: parseBoolean(isIssueRepositioningDisabled), + isGroup: !parseBoolean(isProject), isProject: parseBoolean(isProject), isPublicVisibilityRestricted: parseBoolean(isPublicVisibilityRestricted), isSignedIn: parseBoolean(isSignedIn), diff --git a/app/graphql/resolvers/full_path_resolver.rb b/app/graphql/resolvers/full_path_resolver.rb index b8df54f49ab..2c64d08a219 100644 --- a/app/graphql/resolvers/full_path_resolver.rb +++ b/app/graphql/resolvers/full_path_resolver.rb @@ -4,10 +4,10 @@ module Resolvers module FullPathResolver extend ActiveSupport::Concern - prepended do + included do argument :full_path, GraphQL::Types::ID, - required: true, - description: 'Full path of the project, group, or namespace. For example, `gitlab-org/gitlab-foss`.' + required: true, + description: "Full path of the #{target_type}. For example, `gitlab-org/gitlab-foss`." end def model_by_full_path(model, full_path) diff --git a/app/graphql/resolvers/group_resolver.rb b/app/graphql/resolvers/group_resolver.rb index 4260e18829e..e3b651b6493 100644 --- a/app/graphql/resolvers/group_resolver.rb +++ b/app/graphql/resolvers/group_resolver.rb @@ -2,7 +2,11 @@ module Resolvers class GroupResolver < BaseResolver - prepend FullPathResolver + def self.target_type + 'group' + end + + include FullPathResolver type Types::GroupType, null: true diff --git a/app/graphql/resolvers/namespace_resolver.rb b/app/graphql/resolvers/namespace_resolver.rb index 17b3800d151..a0b16758625 100644 --- a/app/graphql/resolvers/namespace_resolver.rb +++ b/app/graphql/resolvers/namespace_resolver.rb @@ -2,7 +2,11 @@ module Resolvers class NamespaceResolver < BaseResolver - prepend FullPathResolver + def self.target_type + 'namespace' + end + + include FullPathResolver type Types::NamespaceType, null: true diff --git a/app/graphql/resolvers/project_resolver.rb b/app/graphql/resolvers/project_resolver.rb index 2132447da5e..931fefcea50 100644 --- a/app/graphql/resolvers/project_resolver.rb +++ b/app/graphql/resolvers/project_resolver.rb @@ -2,7 +2,11 @@ module Resolvers class ProjectResolver < BaseResolver - prepend FullPathResolver + def self.target_type + 'project' + end + + include FullPathResolver type Types::ProjectType, null: true diff --git a/app/mailers/emails/issues.rb b/app/mailers/emails/issues.rb index f859294960c..bec37610594 100644 --- a/app/mailers/emails/issues.rb +++ b/app/mailers/emails/issues.rb @@ -37,8 +37,10 @@ module Emails def reassigned_issue_email(recipient_id, issue_id, previous_assignee_ids, updated_by_user_id, reason = nil) setup_issue_mail(issue_id, recipient_id) - @previous_assignees = [] - @previous_assignees = User.where(id: previous_assignee_ids) if previous_assignee_ids.any? + previous_assignees = [] + previous_assignees = User.where(id: previous_assignee_ids) if previous_assignee_ids.any? + @added_assignees = @issue.assignees.map(&:name) - previous_assignees.map(&:name) + @removed_assignees = previous_assignees.map(&:name) - @issue.assignees.map(&:name) mail_answer_thread( @issue, diff --git a/app/mailers/emails/merge_requests.rb b/app/mailers/emails/merge_requests.rb index c702b107b7e..07d033ec53c 100644 --- a/app/mailers/emails/merge_requests.rb +++ b/app/mailers/emails/merge_requests.rb @@ -42,8 +42,10 @@ module Emails def reassigned_merge_request_email(recipient_id, merge_request_id, previous_assignee_ids, updated_by_user_id, reason = nil) setup_merge_request_mail(merge_request_id, recipient_id) - @previous_assignees = [] - @previous_assignees = User.where(id: previous_assignee_ids) if previous_assignee_ids.any? + previous_assignees = [] + previous_assignees = User.where(id: previous_assignee_ids) if previous_assignee_ids.any? + @added_assignees = @merge_request.assignees.map(&:name) - previous_assignees.map(&:name) + @removed_assignees = previous_assignees.map(&:name) - @merge_request.assignees.map(&:name) mail_answer_thread(@merge_request, merge_request_thread_options(updated_by_user_id, reason)) end diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb index 9d5b2e5a0b1..f8ccbbe63bd 100644 --- a/app/models/ci/pipeline.rb +++ b/app/models/ci/pipeline.rb @@ -621,7 +621,7 @@ module Ci end def valid_commit_sha - if self.sha == Gitlab::Git::BLANK_SHA + if self.sha == Gitlab::Git::SHA1_BLANK_SHA self.errors.add(:sha, " cant be 00000000 (branch removal)") end end @@ -675,7 +675,7 @@ module Ci end def before_sha - super || Gitlab::Git::BLANK_SHA + super || Gitlab::Git::SHA1_BLANK_SHA end def short_sha diff --git a/app/models/commit.rb b/app/models/commit.rb index 886e6e9fbd7..9c8d7604031 100644 --- a/app/models/commit.rb +++ b/app/models/commit.rb @@ -359,7 +359,7 @@ class Commit def diff_refs Gitlab::Diff::DiffRefs.new( - base_sha: self.parent_id || Gitlab::Git::BLANK_SHA, + base_sha: self.parent_id || Gitlab::Git::SHA1_BLANK_SHA, head_sha: self.sha ) end diff --git a/app/services/ci/create_web_ide_terminal_service.rb b/app/services/ci/create_web_ide_terminal_service.rb index db8f61c81fa..ce4400e9f4f 100644 --- a/app/services/ci/create_web_ide_terminal_service.rb +++ b/app/services/ci/create_web_ide_terminal_service.rb @@ -52,7 +52,7 @@ module Ci ref: ref, sha: sha, tag: false, - before_sha: Gitlab::Git::BLANK_SHA + before_sha: Gitlab::Git::SHA1_BLANK_SHA ) end diff --git a/app/views/admin/application_settings/general.html.haml b/app/views/admin/application_settings/general.html.haml index 39f1ec7056c..2e16161cde4 100644 --- a/app/views/admin/application_settings/general.html.haml +++ b/app/views/admin/application_settings/general.html.haml @@ -120,8 +120,5 @@ = render_if_exists 'admin/application_settings/add_license' = render 'admin/application_settings/jira_connect' = render 'admin/application_settings/slack' -- if Feature.enabled?(:updated_ai_powered_features_menu_for_sm) - = render_if_exists 'admin/application_settings/ai_powered' -- else - = render_if_exists 'admin/application_settings/ai_access' += render_if_exists 'admin/application_settings/ai_powered' = render 'admin/application_settings/security_txt', expanded: expanded_by_default? diff --git a/app/views/notify/_reassigned_issuable_email.html.haml b/app/views/notify/_reassigned_issuable_email.html.haml index ead8e5d0a7e..b89d897a81b 100644 --- a/app/views/notify/_reassigned_issuable_email.html.haml +++ b/app/views/notify/_reassigned_issuable_email.html.haml @@ -1,7 +1,12 @@ -- to_names = content_tag(:strong, issuable.assignees.any? ? sanitize_name(issuable.assignee_list) : _('Unassigned')) +- added_names = content_tag(:strong, sanitize_name(added_assignees.to_sentence(locale: I18n.locale))) +- removed_names = content_tag(:strong, sanitize_name(removed_assignees.to_sentence(locale: I18n.locale))) -%p - - if previous_assignees.any? - = html_escape(s_('Notify|Assignee changed from %{fromNames} to %{toNames}').html_safe % { fromNames: content_tag(:strong, sanitize_name(previous_assignees.map(&:name).to_sentence)), toNames: to_names }) - - else - = html_escape(s_('Notify|Assignee changed to %{toNames}').html_safe % { toNames: to_names}) +- if added_assignees.any? + %p + = html_escape(n_(s_('Notify|%{added} was added as an assignee.'), s_('Notify|%{added} were added as assignees.'), added_assignees.length).html_safe % { added: added_names }) +- if removed_assignees.any? && issuable.assignees.any? + %p + = html_escape(n_(s_('Notify|%{removed} was removed as an assignee.'), s_('Notify|%{removed} were removed as assignees.'), removed_assignees.length).html_safe % { removed: removed_names }) +- if removed_assignees.any? && issuable.assignees.empty? + %p + = html_escape(s_('Notify|All assignees were removed.')) diff --git a/app/views/notify/reassigned_issue_email.html.haml b/app/views/notify/reassigned_issue_email.html.haml index 6b088927623..e5860c1672a 100644 --- a/app/views/notify/reassigned_issue_email.html.haml +++ b/app/views/notify/reassigned_issue_email.html.haml @@ -1 +1 @@ -= render 'reassigned_issuable_email', issuable: @issue, previous_assignees: @previous_assignees += render 'reassigned_issuable_email', issuable: @issue, added_assignees: @added_assignees, removed_assignees: @removed_assignees diff --git a/app/views/notify/reassigned_issue_email.text.erb b/app/views/notify/reassigned_issue_email.text.erb index f37c8ffa515..b5e5abbbccf 100644 --- a/app/views/notify/reassigned_issue_email.text.erb +++ b/app/views/notify/reassigned_issue_email.text.erb @@ -1,6 +1,15 @@ +<% added_names = sanitize_name(@added_assignees.to_sentence(locale: I18n.locale)) -%> +<% removed_names = sanitize_name(@removed_assignees.to_sentence(locale: I18n.locale)) -%> Reassigned Issue <%= @issue.iid %> <%= url_for([@issue.project, @issue, { only_path: false }]) %> -Assignee changed<%= " from #{sanitize_name(@previous_assignees.map(&:name).to_sentence)}" if @previous_assignees.any? -%> - to <%= "#{@issue.assignees.any? ? @issue.assignee_list : 'Unassigned'}" %> +<%- if @added_assignees.any? %> +<%= html_escape(n_(s_('Notify|%{added} was added as an assignee.'), s_('Notify|%{added} were added as assignees.'), @added_assignees.length).html_safe % { added: added_names }) %> +<% end -%> +<%- if @removed_assignees.any? && @issue.assignees.any? %> +<%= html_escape(n_(s_('Notify|%{removed} was removed as an assignee.'), s_('Notify|%{removed} were removed as assignees.'), @removed_assignees.length).html_safe % { removed: removed_names }) %> +<% end -%> +<%- if @removed_assignees.any? && @issue.assignees.empty? %> +<%= html_escape(s_('Notify|All assignees were removed.')) %> +<% end -%> diff --git a/app/views/notify/reassigned_merge_request_email.html.haml b/app/views/notify/reassigned_merge_request_email.html.haml index 0aefca6b14a..74de6767fe2 100644 --- a/app/views/notify/reassigned_merge_request_email.html.haml +++ b/app/views/notify/reassigned_merge_request_email.html.haml @@ -1 +1 @@ -= render 'reassigned_issuable_email', issuable: @merge_request, previous_assignees: @previous_assignees += render 'reassigned_issuable_email', issuable: @merge_request, added_assignees: @added_assignees, removed_assignees: @removed_assignees diff --git a/app/views/notify/reassigned_merge_request_email.text.erb b/app/views/notify/reassigned_merge_request_email.text.erb index 888b995b67c..7929349c439 100644 --- a/app/views/notify/reassigned_merge_request_email.text.erb +++ b/app/views/notify/reassigned_merge_request_email.text.erb @@ -1,6 +1,15 @@ +<% added_names = sanitize_name(@added_assignees.to_sentence(locale: I18n.locale)) -%> +<% removed_names = sanitize_name(@removed_assignees.to_sentence(locale: I18n.locale)) -%> Reassigned merge request <%= @merge_request.iid %> <%= url_for([@merge_request.project, @merge_request, { only_path: false }]) %> -Assignee changed <%= "from #{sanitize_name(@previous_assignees.map(&:name).to_sentence)}" if @previous_assignees.any? -%> - to <%= "#{@merge_request.assignees.any? ? @merge_request.assignee_list : 'Unassigned'}" %> +<%- if @added_assignees.any? %> +<%= html_escape(n_(s_('Notify|%{added} was added as an assignee.'), s_('Notify|%{added} were added as assignees.'), @added_assignees.length).html_safe % { added: added_names }) %> +<% end -%> +<%- if @removed_assignees.any? && @merge_request.assignees.any? %> +<%= html_escape(n_(s_('Notify|%{removed} was removed as an assignee.'), s_('Notify|%{removed} were removed as assignees.'), @removed_assignees.length).html_safe % { removed: removed_names }) %> +<% end -%> +<%- if @removed_assignees.any? && @merge_request.assignees.empty? %> +<%= html_escape(s_('Notify|All assignees were removed.')) %> +<% end -%> diff --git a/app/workers/all_queues.yml b/app/workers/all_queues.yml index e4329ae2a8b..30476f4aefc 100644 --- a/app/workers/all_queues.yml +++ b/app/workers/all_queues.yml @@ -2602,7 +2602,7 @@ :urgency: :low :resource_boundary: :unknown :weight: 1 - :idempotent: false + :idempotent: true :tags: [] - :name: bulk_import :worker_name: BulkImportWorker diff --git a/app/workers/gitlab/bitbucket_server_import/stage/import_users_worker.rb b/app/workers/gitlab/bitbucket_server_import/stage/import_users_worker.rb index dd18139fc9e..4c323a11755 100644 --- a/app/workers/gitlab/bitbucket_server_import/stage/import_users_worker.rb +++ b/app/workers/gitlab/bitbucket_server_import/stage/import_users_worker.rb @@ -3,9 +3,11 @@ module Gitlab module BitbucketServerImport module Stage - class ImportUsersWorker # rubocop:disable Scalability/IdempotentWorker -- ImportPullRequestsWorker is not idempotent + class ImportUsersWorker include StageMethods + idempotent! + private def import(project) diff --git a/app/workers/gitlab/github_gists_import/start_import_worker.rb b/app/workers/gitlab/github_gists_import/start_import_worker.rb index f7d3eb1d759..d6c637f6d49 100644 --- a/app/workers/gitlab/github_gists_import/start_import_worker.rb +++ b/app/workers/gitlab/github_gists_import/start_import_worker.rb @@ -17,7 +17,7 @@ module Gitlab Gitlab::GithubGistsImport::Status.new(msg['args'][0]).fail! user = User.find(msg['args'][0]) - Gitlab::GithubImport::PageCounter.new(user, :gists, 'github-gists-importer').expire! + Gitlab::Import::PageCounter.new(user, :gists, 'github-gists-importer').expire! end def perform(user_id, encrypted_token) |