5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-23 00:06:21 +00:00

fix: el log completo hace un título demasiado largo

This commit is contained in:
f 2023-03-13 20:04:53 -03:00
parent 8c5a109610
commit a0263ad3fb
2 changed files with 22 additions and 2 deletions

View file

@ -33,7 +33,7 @@ class DeployJob < ApplicationJob
# No es opcional # No es opcional
unless @deployed[:deploy_local][:status] unless @deployed[:deploy_local][:status]
# Hacer fallar la tarea # Hacer fallar la tarea
raise DeployException, deploy_local.build_stats.last.log raise DeployException, 'Falló la compilación'
end end
deploy_others deploy_others
@ -52,7 +52,13 @@ class DeployJob < ApplicationJob
# @param :exception [StandardError] # @param :exception [StandardError]
# @param :deploy [Deploy] # @param :deploy [Deploy]
def notify_exception(exception, deploy = nil) def notify_exception(exception, deploy = nil)
ExceptionNotifier.notify_exception(exception, data: { site: @site.id, deploy: deploy&.type }) data = {
site: @site.id,
deploy: deploy&.type,
log: deploy&.build_stats&.last&.log
}
ExceptionNotifier.notify_exception(exception, data: data)
end end
def deploy_local def deploy_local

View file

@ -112,6 +112,7 @@ class GitlabNotifierJob < ApplicationJob
# @return [String] # @return [String]
def description def description
@description ||= ''.dup.tap do |d| @description ||= ''.dup.tap do |d|
d << log_section
d << request_section d << request_section
d << javascript_section d << javascript_section
d << javascript_footer d << javascript_footer
@ -159,6 +160,19 @@ class GitlabNotifierJob < ApplicationJob
@client ||= GitlabApiClient.new @client ||= GitlabApiClient.new
end end
# @return [String]
def log_section
return '' unless options[:log]
<<~LOG
# Log
```
#{options[:log]}
```
LOG
end
# Muestra información de la petición # Muestra información de la petición
# #
# @return [String] # @return [String]