Skip to content

fix(harvester): map copyright as holder and year only - #1112

Open
TahaKhan998 wants to merge 1 commit into
CERNDocumentServer:masterfrom
TahaKhan998:fix/harvester-copyright-holder-year
Open

TahaKhan998 wants to merge 1 commit into
CERNDocumentServer:masterfrom
TahaKhan998:fix/harvester-copyright-holder-year

Conversation

@TahaKhan998

@TahaKhan998 TahaKhan998 commented Dec 1, 2026 •

Copy link
Copy Markdown

Summary by CodeRabbit

  • Bug Fixes
    • Copyright information now displays available holder and year details alongside URLs, with whitespace trimmed and entries separated by line breaks.
    • Entries with only a holder or year are retained, while entries with no holder, URL, or year are skipped.

@coderabbitai

coderabbitai Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

An error occurred during the review process. Please try again later.

Walkthrough

The copyright mapper trims holder and URL values and converts nonempty years to stripped text. It omits statement values, skips entries with no holder, URL, or year, and returns None when no formatted entries remain. Tests cover complete, multiple, holder-only, and year-only entries.

Changes: Copyright metadata

Layer / File(s) Summary
Format copyright entries
site/cds_rdm/inspire_harvester/transform/mappers/basic_metadata.py, site/tests/inspire_harvester/test_transformer.py
The mapper formats available holder and year values with the copyright symbol, and formats URL values without statement text. It skips entries with no holder, URL, or year and returns None when no formatted entries remain. Tests cover complete, multiple, holder-only, and year-only entries.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: kpsherva

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share


def test_transform_copyrights_complete(running_app):
"""Test CopyrightMapper with complete copyright info."""
"""Test CopyrightMapper keeps holder + year; drops statement/url."""

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

couple of tests cases are missing now (year-only, holder only inputs)

@TahaKhan998
TahaKhan998 force-pushed the fix/harvester-copyright-holder-year branch 2 times, most recently from ebeef37 to f7da749 Compare December 1, 2026 16:23
@TahaKhan998 TahaKhan998 removed their assignment Dec 1, 2026
@TahaKhan998 TahaKhan998 removed their assignment Dec 2, 2026
@TahaKhan998
TahaKhan998 force-pushed the fix/harvester-copyright-holder-year branch from f7da749 to 0e1d457 Compare December 4, 2026 12:33
@TahaKhan998 TahaKhan998 removed their assignment Dec 4, 2026

This branch has not been deployed

No deployments
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.

2 participants