Skip to content

Conversation

@zyzzyxdonta
Copy link
Contributor

@zyzzyxdonta zyzzyxdonta commented Oct 7, 2025

This pull request establishes a base class for curation plugins and implements the old dummy curation in terms of this class.

Closes #440

@zyzzyxdonta zyzzyxdonta marked this pull request as ready for review October 7, 2025 09:57

def process_decision_positive(self):
"""In case of positive curation result, copy files to next step."""
ctx = CodeMetaContext()
Copy link
Contributor

Choose a reason for hiding this comment

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

Why a new CodeMetaContext() and not self.ctx? Does that work?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It did work. But it was just moved over from the old code I replaced it with self.ctx in d8ce5f8 :-)

Copy link
Contributor

@sdruskat sdruskat left a comment

Choose a reason for hiding this comment

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

Thanks! Some comments, of which only one is more than minor:

Should the default case be a plugin? It's an architectural (and project management) decision to be made. All plugins are meant to be extracted, should there be an exemption for default cases on the command level?

Comment on lines +61 to +62
[project.entry-points."hermes.curate"]
accept = "hermes.commands.curate.accept:AcceptCuratePlugin"
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we've made a decision to let the default plugins for each command live in hermes, but that's fine for now (#360).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You mean directly in hermes, i.e. accept = "hermes:AcceptCuratePlugin"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, as a separate repository you mean. I also missed the first "don't" 🤦🏻‍♂️

Comment on lines +14 to +20
class AcceptCuratePlugin(BaseCuratePlugin):
"""Accept plugin for the curation step.
This plugin creates a positive curation result, i.e. it accepts the produced
metadata as correct and lets the execution continue without human intervention. It
also copies the metadata produced in the process step to the "curate" directory.
"""
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this a plugin and not the default implementation in the base plugin?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To me, this felt like the right way to do this. Accepting everything without check is one curation strategy, and this strategy is the default choice.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I could make the base class an ABC to make this clearer.

Comment on lines +23 to +24
#: Parameter by which the plugin is selected. By default, the accept plugin is used.
method: str = "accept"
Copy link
Contributor

Choose a reason for hiding this comment

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

See above re plugin. method: str may be enough.

class BaseCuratePlugin(HermesPlugin):
"""Base class for curation plugins.
Objects of this class are callables.
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I'll move it 😄

"""
pass

def get_decision(self) -> bool:
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
def get_decision(self) -> bool:
def is_publication_ready(self) -> bool:

Better naming, alternatively is_publication_allowed, is_approved, or similar.

Co-authored-by: Stephan Druskat <sdruskat@users.noreply.github.com>
@sdruskat sdruskat self-assigned this Nov 7, 2025
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.

Create more elaborate base class for curation step

4 participants