Skip to content

feat: add Crossref DOI provider#2249

Open
mfenner wants to merge 4 commits intoinveniosoftware:masterfrom
front-matter:crossref_doi_provider
Open

feat: add Crossref DOI provider#2249
mfenner wants to merge 4 commits intoinveniosoftware:masterfrom
front-matter:crossref_doi_provider

Conversation

@mfenner
Copy link
Copy Markdown
Contributor

@mfenner mfenner commented Feb 3, 2026

  • register DOIs with Crossref, functionality analogous to DataCitePIDProvider
  • CrossrefXMLSerializer with metadata export

❤️ Thank you for your contribution!

Description

This pull-request adds Crossref DOI registration support to InvenioRDM. The configuration is very similar to DataCite DOI registration, and the new PID provider should not interfere with DataCite DOI registration.

The Crossref PID provider makes heavy use of the commonmeta-py library, similar to how the datacite library is used in the DataCite PID provider. commonmeta-py already was a dependency, but a newer version (>= 0.183) is required for Crossref DOI registration functionality.

Checklist

Ticks in all boxes and 🟢 on all GitHub actions status checks are required to merge:

Frontend

Reminder

By using GitHub, you have already agreed to the GitHub’s Terms of Service including that:

  1. You license your contribution under the same terms as the current repository’s license.
  2. You agree that you have the right to license your contribution under the current repository’s license.

@mfenner
Copy link
Copy Markdown
Contributor Author

mfenner commented Feb 3, 2026

Opened this PR instead of #2177 as the PR was open for too long.

Copy link
Copy Markdown
Contributor

@tmorrell tmorrell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a nice well-tested addition. I have one question about the vocabulary changes that should be addressed, but otherwise looks good to go

@mfenner
Copy link
Copy Markdown
Contributor Author

mfenner commented Feb 4, 2026

Sorry for the extra commits, I accidentally named one test file with a capital T, and MacOS doesn't care. And there are issues with tests that I need to again look into.

@mfenner mfenner force-pushed the crossref_doi_provider branch 2 times, most recently from 33607ea to 9816716 Compare February 4, 2026 17:24
@mfenner
Copy link
Copy Markdown
Contributor Author

mfenner commented Feb 4, 2026

I have fixed most tests and added one new feature. I will do more cleanup via rebasing.

Aware that the Invenio partner meeting is less than three weeks away and that this is the best chance to get this PR discussed and approved, I added the following functionality:

  • Allow Crossref and DataCite DOI registration in the same instance
  • Allow multiple DOI prefixed per provider in addition to the default prefix both for Crossref and DataCite
  • Control the DOI Provider and DOI prefix in the REST API call when creating the record

All of the above is optional, the DataCite defaults have not changed, and Crossref is (almost) a drop in replacement, i.e. all DOIs are registered via Crossref and with one prefix. I say almost, as there are some subtle differences.

I left out the decision flow and UI part of how a DOI provider and prefix are picked if there are multiple. This is tricky and needs more discussion. There is strong interest in one prefix per community, but records can be registered before a community is added and moved to a different community. The other major decision point is content type, as Crossref only supports text content types. But the UI of changing the content type of a record then becomes more complicated. A good discussion topic at the workshop.

This PR can be merged before or at the workshop. It provides a good foundation for more flexibility in DOI registration in v14. Instances can build on that addressing their use cases, or we might have a good discussion at the workshop about a first UI implementation. I will deploy the branch (or the merged master) in my production instance this week, so that I can test DOI registration for a few hundred DOIs (my usual quota) until the workshop.

@mfenner mfenner force-pushed the crossref_doi_provider branch 17 times, most recently from d897466 to 7b04995 Compare February 9, 2026 22:59
@mfenner
Copy link
Copy Markdown
Contributor Author

mfenner commented Feb 10, 2026

I fixed all tests - the Python 3.9 tests fail because the commonmeta-py dependency requires 3.10 in recent versions. Also seing no issues in my production instance so far, with a few hundred records registered with Crossref with this latest version.

@utnapischtim utnapischtim added this to v14 Feb 17, 2026
@tmorrell tmorrell moved this to 👀 In review in v14 Feb 24, 2026
@mfenner mfenner force-pushed the crossref_doi_provider branch 3 times, most recently from f0191ef to 3d3ebc2 Compare March 2, 2026 15:06
mfenner added 4 commits March 2, 2026 16:11
* address breaking changes (caused by adding type hints) in commonmeta-py 0.182
* optionally pass in prefix via kwargs from list of allowed prefixes
* adjust blocked prefixes for external DOI provider
* register DOIs with Crossref, functionality analogous to DataCitePIDProvider
* CrossrefXMLSerializer for metadata export
* includes test coverage similar to DataCite PID provider
* Make parent PID registration not break with multiple PID providers and/or prefixes
* Copy provider from child to parent
* Extract prefix from the child's identifier
@mfenner mfenner force-pushed the crossref_doi_provider branch from f1f4999 to 3906233 Compare March 2, 2026 15:28
@utnapischtim utnapischtim moved this from 👀 In review to Needed in v14 Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Needed

Development

Successfully merging this pull request may close these issues.

5 participants