fix(#8852): Statistics event processor now uses oaiPrefix instead of getHost#11160
Merged
tdonohue merged 1 commit intoDSpace:mainfrom Aug 21, 2025
Merged
Conversation
52601ff to
c8fe80c
Compare
tdonohue
approved these changes
Aug 21, 2025
Member
tdonohue
left a comment
There was a problem hiding this comment.
👍 Thanks @JohnnyMendesC ! This looks very obviously correct, and it aligns with the definition of the oai.identifier.prefix in our configuration which says it should be used for all OAI-PMH identifiers here: https://github.com/DSpace/DSpace/blob/main/dspace/config/modules/oai.cfg#L32
Contributor
|
Successfully created backport PR for |
Contributor
|
Successfully created backport PR for |
Contributor
|
Successfully created backport PR for |
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.
References
Description
This pull request resolves the statistics event processor removing www prefixes from OAI identifiers.
The root cause of the bug was that the
ExportEventProcessorwas incorrectly using thedspace.ui.urlconfiguration and processing it withUtils.getHostName(). This resulted in OAI identifiers being generated with the wrong hostname (e.g.,localhostin test environments) or having necessary prefixes likewww.stripped.This fix ensures the processor uses the dedicated
oai.identifier.prefixconfiguration, guaranteeing that the OAI identifier sent in statistics events is always correct and complete.Instructions for Reviewers
This PR modifies ExportEventProcessor.java to use the correct configuration property for building the OAI identifier (
rft.artnumparameter) for statistics events.List of changes in this PR:
hostNamefromdspace.ui.urlis preserved, as it is correctly used for therfr_idparameter.oaiPrefix, is added to fetch its value directly from theoai.identifier.prefixconfiguration property.rft.artnumparameter is now built using this newoaiPrefixvariable, ensuring the identifier is correct.ExportEventProcessorIT.javaandITIrusExportUsageEventListener.java) to provide the newoai.identifier.prefixconfiguration, ensuring they align with the new code logic and pass successfully.How to test this PR:
1. Setup your test environment:
In your
local.cfg, ensure the following properties are set:2. Start a local HTTP listener:
In a separate terminal, run the following command to listen for the events sent by DSpace:
3. How to reproduce the bug (on the main branch):
(Note how this contradicts the correct identifier shown in the Identify verb above)
4. How to verify the fix (on this PR's branch):
...&rft.artnum=oai%3Awww.my-dspace-repo.com%3A...(Note that "www." is now correctly included)
Checklist
This checklist provides a reminder of what we are going to look for when reviewing your PR. You need not complete this checklist prior to creating your PR (draft PRs are always welcome).
However, reviewers may request that you complete any actions in this list if you have not done so. If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!
mainbranch of code (unless it is a backport or is fixing an issue specific to an older branch).ExportEventProcessorIT.javaandITIrusExportUsageEventListener.java) to provide the newoai.identifier.prefixconfiguration, ensuring they align with the new code logic and pass successfully.)pom.xml), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.