Skip to content

[FEATURE] Add job cancellation endpoint and frontend button for long-running scans #71

Description

@adikulkarni006

Problem
Scans can take several minutes (especially large repos). If a user starts a scan by mistake or it's taking too long, there's no way to cancel it. The UI just waits or the user has to refresh/close.

Expected behavior

  • Backend: POST /jobs/{job_id}/cancel that sets a cancellation flag.
  • The scanning process (SAST, dependency, secrets) should periodically check this flag and abort cleanly.
  • Frontend: Add "Cancel Scan" button on the dashboard while scanning is in progress.
  • After cancellation, job status becomes "cancelled".

Technical hints

  • Use asyncio cancellation or a shared cancel_event dict.
  • Modify scanner functions to accept a cancel_event and check it between major steps.
  • Update frontend to poll job status and show cancel button when status is "running".

Labels: enhancement, good first issue, SSoC26

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions