Carol should not remove tasks related to Online Carol App that are still running

Description

PRDE - Story default text according to the team DoR (Definition of Ready)

01 - PERSON OF CONTACT (PERSON THAT CAN ANSWER QUESTIONS ABOUT THE PROBLEM):
03 - PROBLEM (WHAT'S THE CURRENT PROBLEM SCENARIO OR PAIN TO BE RESOLVED?):

Some Online Apps (Clock-In Web) are getting problems when the task that started the service is deleted, it happens 1 month after starting it.

We are using this task to store needed logs related to this service.

Stackdriver: https://cloudlogging.app.goo.gl/25Afj9Dk9U8cs4DG7

04 - GOAL (DESCRIBE THE PROPOSED SOLUTION):

Avoid impact on Online Apps when the task was removed because the retention policy for Tasks (30 days).

10 - ACCEPTANCE CRITERIA:

  • Do not stop Online Apps when the task was removed because of 30 days (data retention):
    • How to validate it on QA in a faster way.

Activity

Gabriel DAmore Marciano 26 January 2024, 18:46 Jira Internal Users

@Bruno Furtado Ran a validation on the new query for the postgres job, and here is the evidence:

select
    task_type,
    process_type,
    count(id) as total
from (
    select
        id,
        task_type,
        data ->> 'mdmAiProcessType' as process_type
    from
        task as t
    where
        t.task_status in ('COMPLETED', 'FAILED', 'CANCELED')
        and t.last_updated < (now() - interval '30d')
        and (task_type != 'AI_PROCESS' or data ->> 'mdmAiProcessType' = 'BATCH')
) as r
group by
    task_type,
    process_type
order by
    total desc

The where conditional is the new search to clear the tasks older than 30 days after the last update

And here are the evidences that shows no task of type AI_PROCESS and process type ONLINE is brought.

Gabriel DAmore Marciano 26 January 2024, 18:41 Jira Internal Users

This card is a workaround for the card

. We’re not going to delete tasks of type AI_PROCESS / ONLINE.

Automation for Jira 26 January 2024, 18:39 Jira Internal Users

@MARCOS STUMPF ,
@Gabriel DAmore Marciano ,
@Geny Isam Hamud Herrera ,
This issue was planned to be delivered until 2024-02-12. You can check that by consulting the issue in the Due Date field.

Dates already planned for this issue: 2024-02-12

If External Issue Link field is filled, customer was also informed on JIRA TOTVS.