Repository navigation
fix(load): put CDS DOI only on latest version - #634
Open
TahaKhan998 wants to merge 1 commit into
Open
TahaKhan998 wants to merge 1 commit into
TahaKhan998 wants to merge 1 commit into
Conversation
TahaKhan998
force-pushed
the
fix/doi-latest-version-only
branch
from
October 12, 2026 13:57
a88e955 to
2a7d1da
Compare
sakshamarora1
requested changes
Oct 14, 2026
|
|
||
|
|
||
| def test_create_payload_keeps_cds_doi_for_single_version(): | ||
| """Single-version CDS DOI records keep the DOI on create (#628).""" |
Contributor
There was a problem hiding this comment.
nit: Can the issue # be removed? I'm not sure we need it
TahaKhan998
force-pushed
the
fix/doi-latest-version-only
branch
2 times, most recently
from
October 16, 2026 07:28
cf517d3 to
6aa3461
Compare
kpsherva
reviewed
Oct 21, 2026
| def _cds_doi(self): | ||
| """Return the CDS DataCite DOI dict, or ``None``.""" | ||
| doi = (self.record_entry.body.get("pids") or {}).get("doi") | ||
| if doi and doi.get("provider") == "datacite": |
Contributor
There was a problem hiding this comment.
I would check if it has correct DATACITE_PREFIX, what if the record entry mapper assigned datacite incorrectly as provider? comparing the prefix is safer
kpsherva
reviewed
Oct 21, 2026
| f"Report number {report_number} already exists." | ||
| ) | ||
|
|
||
| def _cds_doi(self): |
Contributor
There was a problem hiding this comment.
general comment - I am wondering why did you decide to do this on load phase?
TahaKhan998
force-pushed
the
fix/doi-latest-version-only
branch
from
October 21, 2026 13:43
6aa3461 to
5a5ce7a
Compare
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 #628
when a record has a CDS DOI and multiple versions,
new_version()clears pids so the DOI was sticking on v1 instead of the latest.this strips the CDS DOI from the first create when there are multiple versions, puts it back on the latest draft before publish, and skips the post-publish DOI update on versions that dont carry the DOI.