Skip to content

Persist findings to SQLite on every scan completion #2

@ionfwsrijan

Description

@ionfwsrijan

Description

With the schema in place, the /scan and /scan-url endpoints need to write their findings into the database after each scan completes. This is what builds the training dataset over time.

What to implement

  • After findings are aggregated from Semgrep, OSV-Scanner, and Gitleaks, insert each finding into the findings table using the schema from Issue 1.1
  • Insert a row into the jobs table for each new job
  • Each finding should get a stable id — use uuid4() so it can be referenced later
  • Wrap the insert in a try/except so a DB write failure never crashes the scan response

Acceptance criteria

  • Every completed /scan and /scan-url call writes to findings and jobs
  • A DB write failure logs a warning but does not affect the API response
  • Findings are queryable with sqlite3 patchpilot.db "SELECT * FROM findings LIMIT 5;"

Metadata

Metadata

Labels

SSoC26backendBackend issuesmediumMedium difficultymlML related issuestier-1TIER 1 Upgrade issues

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions