fix(load): skip hand-submitted CDS records on migrate - #603
Open
TahaKhan998 wants to merge 1 commit into
Open
TahaKhan998 wants to merge 1 commit into
TahaKhan998 wants to merge 1 commit into
Conversation
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.
Closes CERNDocumentServer/cds-rdm#347
Right now the migrator only skips if we already minted an lrecid. That misses the manually submitted new CDS papers that later come back through the old CDS dump (new CDS → INSPIRE → old CDS → migrate), so we would create a second copy.
Before create, _should_skip_recid now checks if this is already on the new CDS under another id
it looks for that record from the dump in this order: repository.cern urls, structured CDSRDM ids, CERN DOI suffixes (10.17181/), then DOI pidstore (including arXiv DataCite DOIs), then arXiv related identifiers. If exactly one parent matches we skip, mint lrecid on that parent, and log it. Dry run does the same lookups but does not mint. If two parents match we raise and do not pick one.
EP load uses the same path, so it now passes entry into _should_skip_recid instead of only the recid.