Repository navigation
fix(api): stream archives in constant memory and tidy execution routes - #172
Conversation
Streams execution archives as a hand-built tar.gz, so memory stays bounded by the chunk size. Names log downloads after the resolved execution rather than the optional query parameter. Caps the execution group list at 1000 per page. Removes the unused execution_groups id list from diagnostic summaries.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 52 minutes. View limit details
Walkthrough
Priority: Change: Bug fix Merge Risk:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🔇 Additional comments: 1
backend/src/ref_backend/models/diagnostics.py-67-67: 1
67-67:Minor · Data Integrity & Integration · Quick win
⚠️ Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.Keep a way to list historical groups by diagnostic.
The removed
execution_groupsfield included IDs from earlier diagnostic versions. Both diagnostic and recent-execution listings exclude superseded and retracted groups, so clients cannot use those routes to discover the old IDs. The dataset route requires a matching dataset ID. (github.com)Add options to a listing route to include superseded and retracted groups.

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Organization UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
55f3c7c3-2803-4b3d-bb85-8b764dc33d7d
Files selected for processing: 11-
backend/src/ref_backend/api/routes/diagnostics.pybackend/src/ref_backend/api/routes/executions.pybackend/src/ref_backend/core/file_handling.pybackend/src/ref_backend/models/diagnostics.pybackend/tests/test_api/test_routes/test_executions.pybackend/tests/test_core/test_file_handling.pychangelog/172.breaking.mdchangelog/172.fix.mdchangelog/172.improvement.mdfrontend/src/client/types.gen.tsfrontend/src/lib/resourceUsageCsv.test.ts
Files with no reviewable changes: 2-
- frontend/src/client/types.gen.ts
- frontend/src/lib/resourceUsageCsv.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
-
Streams execution archives as a hand-built tar.gz, so
/executions/{group_id}/archiveholds at most one chunk in memory instead of writing the whole archive to a temp file before the first byte. It also fixes a few smaller API issues found in an audit.tar_gz_iteratorwrites each tar header withTarInfo.tobuf, then the file in 64 KB chunks through onezlibcompressor. Streaming 512 MB of random data peaks at 0.7 MB undertracemalloc, against 35 MB for a 32 MB file withtarfileon a buffer.test_memory_does_not_grow_with_file_sizeguards this.execution_result_None.logwhen noexecution_idwas passed. They now use the resolved execution's id.GET /executions/capslimitat 1000, the page size the failures view uses.execution_groups: list[int], which loaded every group id per request. The frontend never read it, but this is a public response change, so external scripts reading that field will break.Summary by CodeRabbit