barbeque 0.0.18 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3b74360e927b8b8f90a69596aea81cc2f9633d8d
4
- data.tar.gz: e424b26777290d0b8166cec62a0a02e79127516d
3
+ metadata.gz: 4510b6adf348a1bda1e6c35d02826cfa019f0ab3
4
+ data.tar.gz: 8718974eaadf54ed119d8ef3b7e107117919bc59
5
5
  SHA512:
6
- metadata.gz: 5714b9963c40cd056785383f48c49b9bde795d527a949d5c5141840d7cf01357af70abb40d73d59362afb87a0e83affaf6021fe5c8abe3688d2319f8620a5efe
7
- data.tar.gz: e810b629aa2dbcb0331be1f9b0d3b0a2525f5b1abc911c03ca33a18bca9643823181a2dc255efe3edff9c40f5fd2dc5a4a7b5237dd84b8e5eb9a3275d5564aab
6
+ metadata.gz: a9c7801de72f8bd392b19c70adaa9b087638e434b66d75e565a3b7e2db3772545d3e95359d816801dc577e76b771649c1d2bf020648a698cd89a191ed68b8781
7
+ data.tar.gz: 49d35f54929f3e5906d7b5e673205cb2bdd3f64b8a3e4017a4cd2f43a74305c0b7874e257c0b745cd124350779a5eac3d2bde7e7f471b9c01024987ae091ad69
@@ -1,10 +1,7 @@
1
1
  class Barbeque::JobExecutionsController < Barbeque::ApplicationController
2
2
  def show
3
3
  @job_execution = Barbeque::JobExecution.find(params[:id])
4
- log = @job_execution.execution_log
5
- @message = log['message']
6
- @stdout = log['stdout']
7
- @stderr = log['stderr']
4
+ @log = @job_execution.execution_log
8
5
  end
9
6
 
10
7
  def retry
@@ -1,10 +1,9 @@
1
1
  class Barbeque::JobRetriesController < Barbeque::ApplicationController
2
2
  def show
3
3
  @job_execution = Barbeque::JobExecution.find(params[:job_execution_id])
4
- @message = @job_execution.execution_log['message']
4
+ @execution_log = @job_execution.execution_log
5
5
 
6
6
  @job_retry = Barbeque::JobRetry.find(params[:id])
7
- @stdout = @job_retry.execution_log['stdout']
8
- @stderr = @job_retry.execution_log['stderr']
7
+ @retry_log = @job_retry.execution_log
9
8
  end
10
9
  end
@@ -38,7 +38,10 @@
38
38
  %tr
39
39
  %th Message
40
40
  %td
41
- %code= @message
41
+ - if @log
42
+ %code= @log['message']
43
+ - else
44
+ Log was not found.
42
45
  .col-sm-5
43
46
  .box.box-primary
44
47
  .box-header
@@ -78,7 +81,10 @@
78
81
  Stdout
79
82
 
80
83
  .box-body
81
- %pre= rinku_auto_link(@stdout)
84
+ - if @log
85
+ %pre= rinku_auto_link(@log['stdout'])
86
+ - else
87
+ Log was not found.
82
88
 
83
89
  .col-sm-6
84
90
  .box.box-primary
@@ -87,6 +93,9 @@
87
93
  Stderr
88
94
 
89
95
  .box-body
90
- %pre= rinku_auto_link(@stderr)
96
+ - if @log
97
+ %pre= rinku_auto_link(@log['stderr'])
98
+ - else
99
+ Log was not found.
91
100
 
92
101
  = link_to 'Back', job_definition_path(@job_execution.job_definition)
@@ -35,7 +35,10 @@
35
35
  %tr
36
36
  %th Message
37
37
  %td
38
- %code= @message
38
+ - if @execution_log
39
+ %code= @execution_log['message']
40
+ - else
41
+ Execution log was not found.
39
42
 
40
43
  .row
41
44
  .col-sm-6
@@ -45,7 +48,10 @@
45
48
  Stdout
46
49
 
47
50
  .box-body
48
- %pre= @stdout
51
+ - if @retry_log
52
+ %pre= @retry_log['stdout']
53
+ - else
54
+ Retry log was not found.
49
55
 
50
56
  .col-sm-6
51
57
  .box.box-primary
@@ -54,6 +60,9 @@
54
60
  Stderr
55
61
 
56
62
  .box-body
57
- %pre= @stderr
63
+ - if @retry_log
64
+ %pre= @retry_log['stderr']
65
+ - else
66
+ Retry log was not found.
58
67
 
59
68
  = link_to 'Back', job_execution_path(@job_execution)
@@ -34,6 +34,8 @@ module Barbeque
34
34
  key: s3_key_for(execution: execution),
35
35
  )
36
36
  JSON.load(s3_object.body.read)
37
+ rescue Aws::S3::Errors::NoSuchKey
38
+ nil
37
39
  end
38
40
 
39
41
  private
@@ -5,6 +5,8 @@ require 'barbeque/slack_client'
5
5
 
6
6
  module Barbeque
7
7
  module MessageHandler
8
+ class MessageNotFound < StandardError; end
9
+
8
10
  class JobRetry
9
11
  # @param [Barbeque::Message::JobExecution] message
10
12
  # @param [Barbeque::JobQueue] job_queue
@@ -70,6 +72,10 @@ module Barbeque
70
72
  end
71
73
 
72
74
  def job_envs
75
+ if job_execution.execution_log.nil?
76
+ raise MessageNotFound.new('failed to fetch retried message')
77
+ end
78
+
73
79
  {
74
80
  'BARBEQUE_JOB' => job_execution.job_definition.job,
75
81
  'BARBEQUE_MESSAGE' => job_execution.execution_log['message'],
@@ -1,3 +1,3 @@
1
1
  module Barbeque
2
- VERSION = '0.0.18'
2
+ VERSION = '0.1.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: barbeque
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.18
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takashi Kokubun