Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Concurrent retries can attach the same file set to multiple works, while failed parent saves and thumbnail-only retries can report success despite missing membership or content.
3 open issues
What changed in this PR
This PR adds recovery for file-set imports interrupted before attachment, allowing reruns to attach orphaned file sets to their intended works.
Changes:
- Adds attachment recovery and ownership checks to both object factories.
- Restores missing Valkyrie file content and inherits work visibility when appropriate.
- Adds regression coverage for recovery, ownership conflicts, visibility, and repeated runs.
| File | Description |
|---|---|
spec/models/bulkrax/valkyrie_object_factory_spec.rb |
Tests attachment recovery, ingestion, visibility, and concurrent retries. |
spec/models/bulkrax/object_factory_spec.rb |
Tests orphan attachment and ownership checks. |
spec/models/bulkrax/csv_file_set_entry_spec.rb |
Tests visibility handling for orphaned file sets. |
app/models/concerns/bulkrax/file_set_entry_behavior.rb |
Leaves orphan visibility unset for inheritance from the work. |
app/factories/bulkrax/valkyrie_object_factory.rb |
Adds orphan attachment and missing-file recovery. |
app/factories/bulkrax/object_factory.rb |
Adds actor-based attachment recovery and ownership checks. |
app/factories/bulkrax/object_factory_interface.rb |
Defines the shared ownership-query interface. |
Review effort: Balanced
laritakr
force-pushed
the
fix-file-set-reattach-1304
branch
from
December 2, 2026 16:49
60e964f to
3d4fd8f
Compare
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Ownership validation occurs after metadata and file updates in both factories, allowing rows naming a different parent to modify existing file sets before failing.
2 open issues
3 resolved since last review
Review effort: Balanced
laritakr
force-pushed
the
fix-file-set-reattach-1304
branch
from
December 2, 2026 21:29
3d4fd8f to
effdcb5
Compare
A file set row that runs again now attaches its file set to the row's work when no work holds it, with the work's visibility and, on Valkyrie, the row's file; a file set another work holds fails the row. A row that stopped after saving its file set but before attaching it, such as on a worker restart or a failed work save, left the file set without a work, and on Valkyrie without its file, while every rerun reported success. A file set can't belong to more than one work, so one held elsewhere is not moved. Assisted by: Claude Opus 5.5
laritakr
marked this pull request as ready for review
December 2, 2026 22:27
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.


Refs #1304
🐛 Rerun attaches a file set left without a work
A file set row that runs again now attaches its file set to the row's
work when no work holds it, with the work's visibility and, on
Valkyrie, the row's file; a file set another work holds fails the row.
A row that stopped after saving its file set but before attaching it,
such as on a worker restart or a failed work save, left the file set
without a work, and on Valkyrie without its file, while every rerun
reported success. A file set can't belong to more than one work, so
one held elsewhere is not moved.