fix: propagate failures in multi-accession prefetch#70
Merged
noamteyssier merged 4 commits intoMay 29, 2026
Conversation
- Expanded .gitignore to include additional file types and directories. - Introduced CLAUDE.md to provide comprehensive guidance on using the `xsra` CLI, including commands, architecture, and conventions. - Enhanced error handling in `prefetch` module to report per-accession failures.
There was a problem hiding this comment.
Code Review
This pull request updates the .gitignore configuration, adds a comprehensive CLAUDE.md guide for development, and significantly improves error handling in the prefetch module. Specifically, it ensures that failures during concurrent URL resolution and downloads (both HTTPS and GCP) are properly attributed to their respective accessions and accumulated, allowing the command to fail loudly at the end with a detailed summary. The review feedback suggests a minor performance optimization to pre-allocate the processed_results vector with the known capacity of accessions to avoid unnecessary re-allocations.
- Changed initialization of processed_results to use Vec::with_capacity for improved performance by preallocating memory based on the length of accessions.
Collaborator
|
nice add - new version with addition just published to crates |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Multi-accession
xsra prefetchcould exit0even when some accessions failed to resolve or download, because failures in that path were only logged. Sinceprefetchis typically an upstream step in a batch workflow, a zero exit code after a partial failure lets downstream steps run on missing/partial inputs.Changes
src/prefetch/mod.rs): the multi-accession path now accumulates every failure and returns a single summary error naming all failed accessions, while preserving the existing best-effort, concurrent behavior (every accession is still attempted). Covered failure points: URL resolution, missing GCP project ID, unsupported provider, and HTTPS/GCP download errors. Each download future now carries its accession so failures are attributable by name.identify_urls: taskJoinErrors were previously logged and discarded along with their accession. Sincejoin_allpreserves order, results are zipped against the input accessions so a join failure becomes a reportableErrentry instead of vanishing.prefetch_multi_fails_when_any_url_resolution_failsruns fully offline (via the testquery_entrezstub) and asserts the command errors and the message names all failed accessions, not just the first.CLAUDE.md(build/test/architecture guidance) and expanded.gitignore.The single-accession path already propagated errors correctly and is unchanged.