33module Travis ::API ::V3
44 class Renderer ::Job < ModelRenderer
55 representation ( :minimal , :id )
6- representation ( :standard , *representations [ :minimal ] , :allow_failure , :number , :state , :started_at , :finished_at , :build , :queue , :repository , :commit , :owner , :stage , :created_at , :updated_at , :private )
6+ representation ( :standard , *representations [ :minimal ] , :allow_failure , :number , :state , :started_at , :finished_at , :build , :queue , :repository , :commit , :owner , :stage , :created_at , :updated_at , :private , :restarted_at , :restarted_by )
77 representation ( :active , *representations [ :standard ] )
88
99 # TODO: I don't want to config be visible in the regular representation
1010 # as I want it to be visible only after adding include=job.config
1111 # we probably need to have a better way of doing this
12- representation ( :with_config , *representations [ :minimal ] , :allow_failure , :number , :state , :started_at , :finished_at , :build , :queue , :repository , :commit , :owner , :stage , :created_at , :updated_at , :config )
12+ representation ( :with_config , *representations [ :minimal ] , :allow_failure , :number , :state , :started_at , :finished_at , :build , :queue , :repository , :commit , :owner , :stage , :created_at , :updated_at , :restarted_at , :restarted_by , : config)
1313
1414 hidden_representations ( :with_config )
1515 hidden_representations ( :active )
@@ -26,6 +26,16 @@ def updated_at
2626 json_format_time_with_ms ( model . updated_at )
2727 end
2828
29+ def restarted_by
30+ return nil unless restarter = model . restarter
31+ {
32+ '@type' => 'user' ,
33+ '@representation' => 'minimal' . freeze ,
34+ 'id' => restarter . id ,
35+ 'login' => restarter . login
36+ }
37+ end
38+
2939 def config
3040 if include_config?
3141 ConfigObfuscator . new ( model . config , model . repository . key ) . obfuscate
0 commit comments