Skip to content

Commit 2080cb5

Browse files
committed
link to build log in distros list in tstk
1 parent 9254d77 commit 2080cb5

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

app/models/task.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,8 @@ def reset_progress!
9090
update!(state: 'pending_build', agent_id: nil)
9191
end
9292
end
93+
94+
def log_artefact(distro_id)
95+
artefacts.failed.where(distro: distro_id).find { _1.filename.end_with?('.log') }
96+
end
9397
end

app/views/tasks/_task_show.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<% end %>
3131
<%= d.name %>
3232
<% if task.progress.failed.include?(d.id) %>
33-
<% log_artefact = task.artefacts.failed.where(distro: d.id).find { _1.filename.end_with?('.log') } %>
33+
<% log_artefact = task.log_artefact(d.id) %>
3434
<% if log_artefact.present? && log_artefact.attachment.present? && log_artefact.attachment.blob.present? %>
3535
<%= link_to 'log', rails_blob_path(log_artefact.attachment.blob) %>
3636
<% end %>

0 commit comments

Comments
 (0)