Add portfolio-grade data evidence - #3
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b1ab083477
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| -- name: incomplete_ingestion_runs | ||
| SELECT COUNT(*) AS violations | ||
| FROM ingestion_runs | ||
| WHERE status = 'running'; |
There was a problem hiding this comment.
Ignore currently active ingestion runs
When /api/v1/data-quality is requested while a normal refresh is still fetching or validating source data, this condition counts that legitimate active run as an incomplete_ingestion_runs violation and changes the overall report from passed to warning. The check is described as detecting runs left running indefinitely, so it should apply an age threshold rather than flag every row whose current state is running.
Useful? React with 👍 / 👎.
| WHERE status = 'success' | ||
| ORDER BY run_id DESC | ||
| LIMIT 1 |
There was a problem hiding this comment.
Order successful ingestions by completion time
When two refresh commands overlap and the earlier-started run finishes after the later-started run, ordering by run_id returns the earlier completion timestamp even though the other run committed the currently persisted data afterward. This makes lastSuccessfulIngestion inaccurate in both the summary and data-quality provenance; select the latest completed_at instead.
Useful? React with 👍 / 👎.
Summary
New endpoints
GET /api/v1/summaryGET /api/v1/data-qualityGET /api/v1/ingestion-runsGET /openapi/openapi.yamlValidation target
passed