Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2023-08-17 06:09:46 +00:00
parent 9faa254d07
commit 2511fbfa2c
12 changed files with 19 additions and 46 deletions

View File

@ -1 +1 @@
b2a3b6ba03e6f2c2ad60582733fd27f050d8aa3f
5bdafbc7693c7dfacc1c0932cfa8d62004c7097b

View File

@ -55,6 +55,7 @@ module Emails
@previous_reviewers = []
@previous_reviewers = User.where(id: previous_reviewer_ids) if previous_reviewer_ids.any?
@updated_by_user = User.find(updated_by_user_id)
mail_answer_thread(@merge_request, merge_request_thread_options(updated_by_user_id, reason))
end

View File

@ -3,6 +3,7 @@
class ProjectGroupLink < ApplicationRecord
include Expirable
include EachBatch
include AfterCommitQueue
belongs_to :project
belongs_to :group

View File

@ -67,13 +67,7 @@ class ProjectStatistics < ApplicationRecord
end
def update_repository_size
size = if Feature.enabled?(:recent_objects_for_project_statistics, project)
project.repository.recent_objects_size
else
project.repository.size
end
self.repository_size = size.megabytes
self.repository_size = project.repository.recent_objects_size.megabytes
end
def update_wiki_size

View File

@ -1,2 +1,4 @@
= render_if_exists 'notify/address_new_reviewer_with_diff_summary'
%p
= change_reviewer_notification_text(@merge_request.reviewers, @previous_reviewers, :strong)

View File

@ -1 +1,2 @@
<%= render_if_exists 'notify/address_new_reviewer_with_diff_summary' -%>
<%= change_reviewer_notification_text(@merge_request.reviewers, @previous_reviewers) %>

View File

@ -21,9 +21,6 @@
= s_('Preferences|Color theme')
%p.gl-text-secondary
= s_('Preferences|Customize the color of GitLab.')
- if show_super_sidebar?
%p
= s_('Preferences|Note: You have the new navigation enabled, so only Dark Mode theme significantly changes GitLab\'s appearance.')
.application-theme.row
- Gitlab::Themes.each do |theme|
%label.col-6.col-sm-4.col-md-3.col-xl-2.gl-mb-5

View File

@ -1,8 +0,0 @@
---
name: recent_objects_for_project_statistics
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/127867
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/420125
milestone: '16.3'
type: development
group: group::utilization
default_enabled: false

View File

@ -35473,9 +35473,6 @@ msgstr ""
msgid "Preferences|Must be a number between %{min} and %{max}"
msgstr ""
msgid "Preferences|Note: You have the new navigation enabled, so only Dark Mode theme significantly changes GitLab's appearance."
msgstr ""
msgid "Preferences|Preview"
msgstr ""

View File

@ -12,8 +12,10 @@ FactoryBot.define do
trait(:developer) { group_access { Gitlab::Access::DEVELOPER } }
trait(:maintainer) { group_access { Gitlab::Access::MAINTAINER } }
after(:create) do |project_group_link, evaluator|
AuthorizedProjectUpdate::ProjectRecalculateService.new(project_group_link.project).execute
after(:create) do |project_group_link|
project_group_link.run_after_commit_or_now do
AuthorizedProjectUpdate::ProjectRecalculateService.new(project_group_link.project).execute
end
end
end
end

View File

@ -114,7 +114,9 @@ FactoryBot.define do
end
if project.group
AuthorizedProjectUpdate::ProjectRecalculateService.new(project).execute
project.run_after_commit_or_now do
AuthorizedProjectUpdate::ProjectRecalculateService.new(project).execute
end
end
# assign the delegated `#ci_cd_settings` attributes after create

View File

@ -308,30 +308,14 @@ RSpec.describe ProjectStatistics do
end
describe '#update_repository_size' do
context 'with recent_objects_for_project_statistics enabled' do
before do
stub_feature_flags(recent_objects_for_project_statistics: true)
allow(project.repository).to receive(:recent_objects_size).and_return(5)
before do
allow(project.repository).to receive(:recent_objects_size).and_return(5)
statistics.update_repository_size
end
it 'stores the size of the repository' do
expect(statistics.repository_size).to eq 5.megabytes
end
statistics.update_repository_size
end
context 'with use_recent_objects_for_project_statistics disabled' do
before do
stub_feature_flags(recent_objects_for_project_statistics: false)
allow(project.repository).to receive(:size).and_return(10)
statistics.update_repository_size
end
it 'stores the size of the repository' do
expect(statistics.repository_size).to eq 10.megabytes
end
it 'stores the size of the repository' do
expect(statistics.repository_size).to eq 5.megabytes
end
end