Investigating and diagnosing issues - department-of-veterans-affairs/caseflow GitHub Wiki

Tools

You can render task trees in the production console with the structure_render method. To render a task and all its descendants:

> puts Task.find(12345).structure_render(:id, :status)

RootTask 12345, on_hold
├── DistributionTask 23456, completed
│   ├── InformalHearingPresentationTask 34567, cancelled
│   └── HearingTask 45678, completed
│       ├── ScheduleHearingTask 56789, cancelled
│       └── EvidenceSubmissionWindowTask 67890, completed
├── TrackVeteranTask 78901, in_progress
└── JudgeAssignTask 89012, on_hold
    └── AttorneyTask 90123, on_hold
        └── ScheduleHearingColocatedTask 01234, completed
            └── ScheduleHearingColocatedTask 98765, completed

or for all tasks and their descendants attached to an appeal:

> puts LegacyAppeal.find(98765).structure_render(:id, :status, :closed_at)

LegacyAppeal 98765
├── RootTask 87654, on_hold, (closed_at)
│   └── HearingTask 76543, on_hold, (closed_at)
│       └── ScheduleHearingTask 65432, assigned, (closed_at)
├── AddressVerificationColocatedTask 54321, completed, 2019-02-11 15:22:17 UTC
│   └── AddressVerificationColocatedTask 43210, completed, 2019-02-11 15:22:17 UTC
└── ScheduleHearingColocatedTask 32109, completed, 2019-02-11 15:21:31 UTC
    └── ScheduleHearingColocatedTask 21098, completed, 2019-02-11 15:21:31 UTC

The symbols you pass the method are the attributes that'll be printed next to each task in the tree.