Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display job reexecutions and job id #225

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/helpers/mission_control/jobs/jobs_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ def job_delayed?(job)
job.scheduled_at.before?(MissionControl::Jobs.scheduled_job_delay_threshold.ago)
end

def job_reexecution(job)
(job.executions + 1).ordinalize if job.executions > 1
end

private
def renderable_job_arguments_for(job)
job.serialized_arguments.collect do |argument|
Expand Down
10 changes: 10 additions & 0 deletions app/views/mission_control/jobs/jobs/_general_information.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@
<th>Scheduled</th>
<td>
<%= bidirectional_time_distance_in_words_with_title(job.scheduled_at) %>
<% if job_reexecution(job) %>
<div class="is-warning tag ml-4">
<%= job_reexecution(job) %> reexecution
</div>
<% end %>
<% if job_delayed?(job) %>
<div class="is-danger tag ml-4">delayed</div>
<% end %>
Expand All @@ -50,6 +55,11 @@
<th>Finished at</th>
<td>
<%= time_distance_in_words_with_title(job.finished_at) %> ago
<% if job_reexecution(job) %>
<div class="is-warning tag ml-4">
<%= job_reexecution(job) %> reexecution
</div>
<% end %>
</td>
</tr>
<% end %>
Expand Down
5 changes: 4 additions & 1 deletion app/views/mission_control/jobs/jobs/_job.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<tr class="job">
<td>
<%= link_to job_title(job), application_job_path(@application, job.job_id) %>
<div>
<%= link_to job_title(job), application_job_path(@application, job.job_id) %>
<span class="is-family-monospace ml-2 has-text-grey"><%= job.job_id[0...8] %>…</span>
</div>

<% if job.serialized_arguments.present? %>
<div class="is-family-monospace"><%= job_arguments(job) %></div>
Expand Down
5 changes: 5 additions & 0 deletions app/views/mission_control/jobs/jobs/scheduled/_job.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<td><%= link_to job.queue_name, application_queue_path(@application, job.queue) %></td>
<td>
<%= bidirectional_time_distance_in_words_with_title(job.scheduled_at) %>
<% if job_reexecution(job) %>
<div class="is-warning tag ml-4">
<%= job_reexecution(job) %> reexecution
</div>
<% end %>
<% if job_delayed?(job) %>
<div class="is-danger tag ml-4">delayed</div>
<% end %>
Expand Down