Class: ChronoForge::Dashboard::TimelinePresenter
- Inherits:
-
Object
- Object
- ChronoForge::Dashboard::TimelinePresenter
- Defined in:
- app/presenters/chrono_forge/dashboard/timeline_presenter.rb
Defined Under Namespace
Classes: Entry
Constant Summary collapse
- RUN_PATTERN =
Per-iteration run logs of a durably_repeat step are excluded from the timeline (they get their own paginated page) and summarized instead.
"durably_repeat#{StepNameParser::DELIM}%#{StepNameParser::DELIM}%".freeze
Instance Attribute Summary collapse
-
#workflow ⇒ Object
readonly
Returns the value of attribute workflow.
Instance Method Summary collapse
- #current_position ⇒ Object
- #entries ⇒ Object
-
#initialize(workflow) ⇒ TimelinePresenter
constructor
A new instance of TimelinePresenter.
-
#orphan_errors ⇒ Object
Error logs not shown on any step — workflow-level failures whose step_name is nil and that aren’t linked to a $workflow_failure$ marker.
Constructor Details
#initialize(workflow) ⇒ TimelinePresenter
Returns a new instance of TimelinePresenter.
12 |
# File 'app/presenters/chrono_forge/dashboard/timeline_presenter.rb', line 12 def initialize(workflow) = @workflow = workflow |
Instance Attribute Details
#workflow ⇒ Object (readonly)
Returns the value of attribute workflow.
14 15 16 |
# File 'app/presenters/chrono_forge/dashboard/timeline_presenter.rb', line 14 def workflow @workflow end |
Instance Method Details
#current_position ⇒ Object
29 30 31 32 33 34 |
# File 'app/presenters/chrono_forge/dashboard/timeline_presenter.rb', line 29 def current_position logs = ordered_logs logs.reverse.find { |l| l.failed? } || logs.reverse.find { |l| l.pending? && StepNameParser.parse(l.step_name).kind == :wait } || logs.last end |
#entries ⇒ Object
16 17 18 |
# File 'app/presenters/chrono_forge/dashboard/timeline_presenter.rb', line 16 def entries @entries ||= build end |
#orphan_errors ⇒ Object
Error logs not shown on any step — workflow-level failures whose step_name is nil and that aren’t linked to a $workflow_failure$ marker. Surfaced so a failure is never invisible. (Repeat-run errors live on the repetitions page, so they’re excluded.)
24 25 26 27 |
# File 'app/presenters/chrono_forge/dashboard/timeline_presenter.rb', line 24 def orphan_errors entries @orphan_errors end |