Repository navigation
fix: BagIt manifest incomplete for recently uploaded datasets - #113
Merged
Merged
Conversation
- `bag_dataset` downloaded the condensed file for all resources ending with ".rtdc", but `write_manifest` only listed it for resources with mimetype "RT-DC", which DCOR sets in the background after the upload; use `is_dc_resource_dict` in both places and always list existing condensed files in the manifest - if DCOR did not yet compute the SHA256 sum of a resource, compute it from the downloaded (ETag-verified) file instead of writing "None" Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #113 +/- ##
==========================================
+ Coverage 71.48% 72.38% +0.90%
==========================================
Files 66 71 +5
Lines 5842 5997 +155
==========================================
+ Hits 4176 4341 +165
+ Misses 1666 1656 -10 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Fixes invalid BagIt archives for datasets archived shortly after their upload. In the earlier full test run on dcor-dev, this made
test_bag_datasetfail intermittently. bagit reported thatdata/calibration_beads_47_condensed.rtdc"exists on filesystem but is not in the manifest".Cause
DCOR sets a resource's
mimetypeandsha256in background jobs after the upload. The BagIt code used two different criteria for condensed files:archive.bag_datasetdownloads the condensed file for every resource whose name ends with.rtdc.manifest.write_manifestonly listed it if the mimetype was alreadyRT-DC.Before DCOR has processed the resource, the condensed file is therefore in the payload but not in the manifest, and the bag is invalid. On top of that, if
sha256was still missing, the manifest contained the lineNone data/<name>.Fix
common.is_dc_resource_dict(), which checks the mimetype or the.rtdc/.dcsuffix.DownloadJobuses the same check to decide whether a condensed version exists.write_manifestlists a condensed file whenever it exists in the payload, so payload and manifest cannot diverge. It only warns if a DC resource has no condensed file.sha256is not available yet, the hash is computed from the downloaded file, whichDownloadJobalready verified via its ETag.Tests
test_bag_dataset_fresh_metadata, with mocked downloads, for both cases: with and without server metadata (mimetype/sha256). The bag is validated with thebagitpackage. Without the fix, the case without metadata fails.dcoraid-archive-circletests pass locally against dcor-dev (27 passed).🤖 Generated with Claude Code