Caseflow: Remove old-style hold code and db column

Created on 28 May 2019  路  7Comments  路  Source: department-of-veterans-affairs/caseflow

Completes the work from #9207.

Acceptance criteria:

  • [ ] Remove code that assumes old-style holds
  • [ ] Remove the vestigial on_hold_duration column from the tasks table

    • Wait until all old-style holds have expired before doing this so we don't have to migrate any holds from the old-style to the new style. Queries that demonstrate when we are okay to drop the old style columns (https://caseflow-looker.va.gov/sql/g6f2tszfv3g2hn and https://caseflow-looker.va.gov/sql/ty7pnnrfzccftk).

    • Save data from any columns we will delete to a file or database table so we retain the option to recover that information.

Backend Work Group generic-queue caseflow-queue Echo 馃惉 Tech-Improvement

Most helpful comment

There are no more tasks on hold with the old-style hold! https://caseflow-looker.va.gov/sql/7vrsydq8xs2dd2

All 7 comments

Still waiting on old-style holds to expire. Exactly 100 remaining!

select count(*)
, type
from tasks
where on_hold_duration is not null
  and status not in ('cancelled', 'completed')
  and updated_at = placed_on_hold_at
group by 2
order by 1 desc;

Count | Type
--- | ---
81 | ColocatedTask
18 | NoShowHearingTask
1 | HearingAdminActionOtherTask

Of the 84 open non-NoShowHearingTask tasks that have at one time been placed on an old-style hold, 29 have passed their hold expiration date. 28 of those 29 correctly have the "in_progress" status. I'm guessing the other task (HearingAdminActionOtherTask ID 201617) has not had its status updated because the user it is assigned to (ID 1955) has not logged in to Caseflow since 23 May 2019 and the task has not been picked up by the code in GenericQueue where the task's status would be updated. I think we should manually update the status of this task so that it can be acted on by members of the hearings management branch (the organization to which the parent task is assigned).

In addition, I think we should null out the "on_hold_duration" columns for all 29 tasks so that we don't prematurely take those tasks off hold if folks create child tasks from those tasks (one of the bugs mentioned in the tech spec--another bug predicted the issue we are in with HearingAdminActionOtherTask ID 201617 being stuck because somebody hasn't logged in to Caseflow for a long time!).

select id
, type
, status
, placed_on_hold_at +  on_hold_duration * interval '1 day' as old_style_hold_expiration
, placed_on_hold_at
, on_hold_duration
from tasks
where on_hold_duration is not null
  and status not in ('cancelled', 'completed')
  and type <> 'NoShowHearingTask'
order by old_style_hold_expiration asc;

TODO:

  • [ ] Update status of HearingAdminActionOtherTask ID 201617 to "in_progress"
  • [ ] Null out "on_hold_duration" of the 29 tasks past their old style hold deadlines

    • Make sure those 29 tasks don't have active children tasks (which would indicate that they should actually be on hold and that we've already encountered the premature hold-ending bug we are seeking to avoid).

  • [ ] Do more investigation into the status of the on hold NoShowHearingTasks that using the old style holds

Currently have 53 tasks on hold using the old-style holds:

select id
, type
, status
, placed_on_hold_at +  on_hold_duration * interval '1 day' as old_style_hold_expiration
, placed_on_hold_at
, on_hold_duration
from tasks
where on_hold_duration is not null
  and status = 'on_hold'
order by old_style_hold_expiration asc;

Down to 15 tasks on hold using the old style hold. Revisit this ticket in mid-September after nearly all old-style holds have expired.

image

Down to 6 tasks on hold using the old style hold.

Screenshot from 2019-09-05 13-56-01

1 | ||||
2 | ||||||
3 | ||||
5 | |
8 |

Fields in Tasks table, placed_on_hold_at and on_hold_duration, switched to new system documented in new wiki (https://github.com/department-of-veterans-affairs/caseflow/wiki/Timed-Tasks).

Begin by ignoring on_hold_duration, then remove it later. placed_on_hold_at is still useful (updated when status is updated to on_hold - while imprecise, still often useful).

Probably could delete some tests.

If we wait to do this until after Nov 13, we don't have to worry about old-style hold. If we want to make transition before then, we will need to create new-style holds for old holds.

There are no more tasks on hold with the old-style hold! https://caseflow-looker.va.gov/sql/7vrsydq8xs2dd2

Was this page helpful?
0 / 5 - 0 ratings