summaryrefslogtreecommitdiff
path: root/app/services/post_receive_service.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/services/post_receive_service.rb')
-rw-r--r--app/services/post_receive_service.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/app/services/post_receive_service.rb b/app/services/post_receive_service.rb
index f12e45d701a..65e6ebc17d2 100644
--- a/app/services/post_receive_service.rb
+++ b/app/services/post_receive_service.rb
@@ -29,6 +29,8 @@ class PostReceiveService
response.add_alert_message(message)
end
+ response.add_alert_message(storage_size_limit_alert)
+
broadcast_message = BroadcastMessage.current_banner_messages&.last&.message
response.add_alert_message(broadcast_message)
@@ -74,4 +76,19 @@ class PostReceiveService
::MergeRequests::GetUrlsService.new(project).execute(params[:changes])
end
+
+ private
+
+ def storage_size_limit_alert
+ return unless repository&.repo_type&.project?
+
+ payload = Namespaces::CheckStorageSizeService.new(project.namespace, user).execute.payload
+ return unless payload.present?
+
+ alert_level = "##### #{payload[:alert_level].to_s.upcase} #####"
+
+ [alert_level, payload[:usage_message], payload[:explanation_message]].join("\n")
+ end
end
+
+PostReceiveService.prepend_if_ee('EE::PostReceiveService')