SIMS icon indicating copy to clipboard operation
SIMS copied to clipboard

#3565 - Virus Scanning - Retry on error

Open lewischen-aot opened this issue 1 year ago • 5 comments

  • Ensured that a scanned file returning something different than true or false will be retried later.
  • Investigate on what is returned during a virus scan failed and check if there is difference between null and undefined in the response and a way to capture the error thrown.
    • Created interface VirusScanCode to ensure expected behavior from method scanFile.
    • Added key isServerAvailable to the response for queue method performVirusScan.
  • Updated the virus-scan queue configuration as below (suggested 12 attempts every 30min).
{
  "retry": 12,
  "cleanUpPeriod": 604800000,
  "retryInterval": 900000,
  "dashboardReadonly": false
}
  • Removed the NotFound exception as it is not related to HTTP.
    • Made sure that error is thrown.
  • Added E2E Test(s) to ensure that exception is thrown when the scanning process does not complete. image

Step Not in AC (Discussion)

  • If the student file is not successfully scanned after 12 attempts, set virus_scan_status to Pending.

lewischen-aot avatar Aug 21 '24 23:08 lewischen-aot

  • Ensured that a scanned file returning something different than true or false will be retried later.

  • Investigate on what is returned during a virus scan failed and check if there is difference between null and undefined in the response and a way to capture the error thrown.

    • Created interface VirusScanCode to ensure expected behavior from method scanFile.
    • Added key isServerAvailable to the response for queue method performVirusScan.
  • Updated the virus-scan queue configuration as below (suggested 12 attempts every 30min).

{
  "retry": 12,
  "cleanUpPeriod": 604800000,
  "retryInterval": 900000,
  "dashboardReadonly": false
}
  • Removed the NotFound exception as it is not related to HTTP.

    • Made sure that error is thrown.
  • Added E2E Test(s) to ensure that exception is thrown when the scanning process does not complete. image

Step Not in AC (Discussion)

  • If the student file is not successfully scanned after 12 attempts, set virus_scan_status to Pending.

Screenshot of log messages for server unavailable during file scanning in queue-consumers image

Screenshot of log messages in bull dashboard image

For the step not in AC, I believe the expectation was to put the file in Failed Virus Scan status if retry attempts fail.

sh16011993 avatar Aug 26 '24 17:08 sh16011993

Backend Unit Tests Coverage Report

Totals Coverage
Statements: 21.92% ( 3419 / 15601 )
Methods: 10.01% ( 195 / 1949 )
Lines: 25.6% ( 3011 / 11764 )
Branches: 11.28% ( 213 / 1888 )

github-actions[bot] avatar Aug 28 '24 02:08 github-actions[bot]

E2E Workflow Workers Coverage Report

Totals Coverage
Statements: 58.64% ( 509 / 868 )
Methods: 52.88% ( 55 / 104 )
Lines: 62.27% ( 411 / 660 )
Branches: 41.35% ( 43 / 104 )

github-actions[bot] avatar Aug 28 '24 02:08 github-actions[bot]

E2E Queue Consumers Coverage Report

Totals Coverage
Statements: 84.15% ( 993 / 1180 )
Methods: 83.47% ( 101 / 121 )
Lines: 85.34% ( 850 / 996 )
Branches: 66.67% ( 42 / 63 )

github-actions[bot] avatar Aug 28 '24 02:08 github-actions[bot]

E2E SIMS API Coverage Report

Totals Coverage
Statements: 64.03% ( 5230 / 8168 )
Methods: 60.73% ( 631 / 1039 )
Lines: 68.3% ( 4144 / 6067 )
Branches: 42.84% ( 455 / 1062 )

github-actions[bot] avatar Aug 28 '24 02:08 github-actions[bot]