5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-14 06:41:42 +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
unless @deployed[:deploy_local][:status]
# Hacer fallar la tarea
raise DeployException, deploy_local.build_stats.last.log
raise DeployException, 'Falló la compilación'
end
deploy_others
@ -52,7 +52,13 @@ class DeployJob < ApplicationJob
# @param :exception [StandardError]
# @param :deploy [Deploy]
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
def deploy_local

View file

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