Skip to content

chore: remove oai-pmh sync dead code - #2903

Open
fpotier wants to merge 3 commits into
masterfrom
delete-oaipmh-resync
Open

chore: remove oai-pmh sync dead code#2903
fpotier wants to merge 3 commits into
masterfrom
delete-oaipmh-resync

Conversation

@fpotier

@fpotier fpotier commented Aug 26, 2026

Copy link
Copy Markdown
Member

Description

Remove dead code for OAI-PMH sync.

Motivation

This feature is no longer supported by the oai-provider service and it seems like it was only used by PSI who is now using Datacite API directly.

Fixes

  • Bug fixed (#X)

Changes:

  • changes made

Tests included

  • Included for each change/fix?
  • Passing?

Documentation

  • swagger documentation updated (required for API changes)
  • official documentation updated

official documentation info

Summary by Sourcery

Remove unsupported OAI-PMH synchronization and streamline published-data updates around DataCite registration.

Enhancements:

  • Remove obsolete OAI-PMH synchronization from published-data registration and update flows.
  • Simplify published-data service dependencies and return updated DOI information directly.
  • Set the legacy registration endpoint to return HTTP 200 responses consistently.

Documentation:

  • Remove the obsolete OAI provider environment variable from project documentation.

Tests:

  • Remove tests and setup for the deleted OAI-PMH resynchronization functionality.

Chores:

  • Remove the unused OAI provider configuration and related dead code.

@fpotier
fpotier marked this pull request as ready for review August 26, 2026 07:50
@fpotier
fpotier requested a review from a team as a code owner August 26, 2026 07:50

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've found 2 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="src/published-data/published-data.controller.ts" line_range="616" />
<code_context>

-        return res ? { doi: res.data } : null;
-      }
+      return res;
     }

</code_context>
<issue_to_address>
**issue:** The resync endpoint documentation still says that the endpoint synchronizes with the OAI Provider and returns the OAI resynchronization result or null, but the implementation no longer calls OAI and now returns `{ doi: publishedData.doi }` after only updating MongoDB.

**Suggested fix:** Update the `@ApiOperation`/`@ApiResponse` descriptions and surrounding comments to describe the new local-update behavior, or remove the deprecated resync routes if they are no longer supported.
</issue_to_address>

### Comment 2
<location path="src/published-data/published-data.controller.ts" line_range="614-616" />
<code_context>
-        } catch (error) {
-          console.error(error);
-        }
+      const res = await this.publishedDataService.update(filter, data);

-        return res ? { doi: res.data } : null;
-      }
+      return res;
     }

</code_context>
<issue_to_address>
**issue (bug_risk):** The register endpoint changes its response from `{ doi: res.data }`, where `res.data` is the Datacite registration result, to the entire value returned by `publishedDataService.update`, exposing the complete published-data document and changing the endpoint's response contract despite the method still being declared as `Promise<IRegister | null>`.

**Triggers:** When clients consume the response of `POST /publisheddata/:id/register`.

**Suggested fix:** Preserve the previous response shape by returning `{ doi: res?.doi }` or explicitly update the endpoint's DTO, return type, and documented API contract if the full document is intentional.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread src/published-data/published-data.controller.ts Outdated
Comment thread src/published-data/published-data.controller.ts Outdated
@fpotier
fpotier force-pushed the delete-oaipmh-resync branch from d3484b3 to afa63c7 Compare August 27, 2026 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants