Skip to content

Fix #454: Add end-to-end tests for the plugin-related SoftwareMetadata API#456

Open
sdruskat wants to merge 53 commits intorefactor/423-implement-public-apifrom
feature/454-e2e-test-plugin-api
Open

Fix #454: Add end-to-end tests for the plugin-related SoftwareMetadata API#456
sdruskat wants to merge 53 commits intorefactor/423-implement-public-apifrom
feature/454-e2e-test-plugin-api

Conversation

@sdruskat
Copy link
Contributor

No description provided.

@sdruskat sdruskat changed the base branch from develop to refactor/data-model November 21, 2025 10:12
@sdruskat sdruskat changed the base branch from refactor/data-model to refactor/423-implement-public-api November 21, 2025 10:17
@sdruskat sdruskat closed this Nov 21, 2025
@sdruskat sdruskat force-pushed the feature/454-e2e-test-plugin-api branch from f45d9b4 to 9be8041 Compare November 21, 2025 10:23
@sdruskat sdruskat deleted the feature/454-e2e-test-plugin-api branch November 21, 2025 10:24
@sdruskat sdruskat restored the feature/454-e2e-test-plugin-api branch November 21, 2025 10:24
@sdruskat sdruskat reopened this Nov 21, 2025
@sdruskat
Copy link
Contributor Author

Re-opening after rebase on correct branch.

@notactuallyfinn notactuallyfinn marked this pull request as ready for review March 16, 2026 10:40
The full code and structure is available at [hermes-plugin-git](https://github.com/softwarepub/hermes-plugin-git).
This tutorial will present the basic steps for writing additional plugins.

The full code and structure of a harvest plugin is available at [hermes-plugin-git](https://github.com/softwarepub/hermes-plugin-git).
Copy link
Contributor

Choose a reason for hiding this comment

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

Made an Issue to update the plugin for later: softwarepub/hermes-plugin-git#3

# That would be able to replace _search_license_info.
# FIXME: Some licenses in valid_licenses["hits"]["hits"]["props"]["url"] are only http although
# https://spdx.org/licenses/license.json lists them in crossRef as https

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes that should be possible.
We should fix the licenses to https.

if license_info is not None:
break
else:
# FIXME: Why is this only raised here and not always when license_info is None?
Copy link
Contributor

Choose a reason for hiding this comment

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

I think, it was originally because that was were the deposit step broke two years ago, when Zenodo implemented the need of the correct license identifier. But you are right, we should fix that.

try:
cff = yaml.load(open('CITATION.cff', 'r'), yaml.Loader)
new_identifier = {
class cff_doi(HermesPostprocessPlugin):
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe also for codemeta, because we can not be sure the user has a cff

"Or".join(types): MergeSet(match_multiple_types(
*(("schema:" + type, MATCH_FUNCTION_FOR_TYPE.get("schema:" + type, DEFAULT_MATCH)) for type in types)
))
for types in [
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we can curl this information? Or automate the mapping?
But really good work 👍

Copy link
Collaborator

@notactuallyfinn notactuallyfinn Mar 20, 2026

Choose a reason for hiding this comment

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

Maybe.
I'll think about whether or not this can be (easily) done.
Edit: It seems doable, I'll implement it in the next days.


@pytest.fixture
def sandbox_auth():
path = Path("./../auth.txt")
Copy link
Contributor

Choose a reason for hiding this comment

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

We need to tell users how to provide auth or skip the test for ci

Copy link
Contributor

Choose a reason for hiding this comment

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

Especially for our testsuite ci

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, implementing a way to provide auth seems reasonable.
(But the test is already skipped if the file doesn't exist.)



@pytest.mark.parametrize(
"metadata, invenio_metadata",
Copy link
Contributor

Choose a reason for hiding this comment

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

invenio_metada can change, maybe we should test the format as well?

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe also test for 3-way-merges. And test strategies in different files would be great.

@SKernchen
Copy link
Contributor

SKernchen commented Mar 20, 2026

Findings from user test:
process step:

  • process step fails when one harvester failed in the harvest step
    (maybe process should not look into toml?)

deposit step:
error:

  • 'ld_list' object has no attribute 'startswith'

  • for file add log.info where to find file would be good

@notactuallyfinn
Copy link
Collaborator

Could you please provide more information on this error?

'ld_list' object has no attribute 'startswith'

return None


class IvenioRDMDepositPlugin(InvenioDepositPlugin):
Copy link
Contributor

@SKernchen SKernchen Mar 20, 2026

Choose a reason for hiding this comment

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

Suggested change
class InvenioRDMDepositPlugin(InvenioDepositPlugin):

[project.entry-points."hermes.deposit"]
file = "hermes.commands.deposit.file:FileDepositPlugin"
invenio = "hermes.commands.deposit.invenio:InvenioDepositPlugin"
invenio_rdm = "hermes.commands.deposit.invenio_rdm:IvenioRDMDepositPlugin"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
invenio_rdm = "hermes.commands.deposit.invenio_rdm:InvenioRDMDepositPlugin"

@SKernchen
Copy link
Contributor

Could you please provide more information on this error?

'ld_list' object has no attribute 'startswith'

That is the only information provided for this error:
1774021073.908437: hermes.cli: ERROR | An error occurred during execution of deposit (Find details in './hermes.log') 1774021073.910363: hermes.cli: DEBUG | Original exception was: 'ld_list' object has no attribute 'startswith'
I do not know where it is coming from. Everything with startswith seemed fine to me 🤷‍♀️

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