Skip to content

feat: expose start and completion timestamps for task scan phases#1131

Open
diksha78dev wants to merge 1 commit into
utksh1:mainfrom
diksha78dev:fix/issue-802
Open

feat: expose start and completion timestamps for task scan phases#1131
diksha78dev wants to merge 1 commit into
utksh1:mainfrom
diksha78dev:fix/issue-802

Conversation

@diksha78dev

Copy link
Copy Markdown

Description

This PR resolves #802 by persisting granular started_at and completed_at timestamps for each scan phase, and exposing them in the get_task_status payload.

Changes Include:

  • Schema: Added phase_timestamps_json to the tasks table schema.
  • Executor: Initialized the queued timestamp upon task creation.
  • Executor: Updated _broadcast_phase to use SQLite's atomic json_set to safely mark the completion of the prior phase and the start of the new phase.
  • API: Updated get_task_status to parse and include phase_timestamps in the detail payload.
  • Tests: Updated mock task rows and test_broadcast_phase_persists_to_db assertions to handle the expanded JSON timestamp persistence logic.

Related Issues

Closes #802

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

How Has This Been Tested?

  • Ran unit tests covering task phase broadcasts test_broadcast_phase_persists_to_db to assert that correct SQLite json_set commands are generated.
  • Ran unit tests for API integration test_scan_phase_included_in_status_response to verify that phase_timestamps dict is correctly evaluated and serialized in the task status response.

Checklist

  • My code follows the code style of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TASK] Persist scan phase timestamps in task detail responses

1 participant