-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add invenio GitHub #1337
Add invenio GitHub #1337
Conversation
a5c00e3
to
95a03cf
Compare
Tests are failing because We need to:
|
95a03cf
to
6efa690
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice job! massive including the invenio-github PR. Could I ask you to transform the TODO
into issues? we know TODO
die burried in the code.
Needs tests 😇
def process_release(self): | ||
"""Processes a github release. | ||
|
||
The release might be first validated, in terms of sender, and then published. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean validated before the process_release
is called?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Basically, I and @slint were discussing whether the public interface of GithubRelease
should be just a publish
method or also a process_release
. But then we agreed that maybe the release "manager" (in this case in RDM) might want to do something before publishing the record - even though for now the release processing only publishes a record.
Conceptually, processing the release and publishing the record are distinct actions thus we separated them.
from invenio_records_resources.services.uow import UnitOfWork | ||
|
||
|
||
class RDMGithubRelease(GitHubRelease): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class seems to:
- Extract information from a release and create a dictionary of data via underscored methods (see comment below)
- Do record resolution manually, e.g. calls to
PersistentIdentifiers
and implement a pseudo resolver. Can we use existing resolvers/api classes? - Process the release (missing validation?)
- Publish the release via rdm-records services
It seems to be a bit cluttered between an api class and a "service" (does not have to be a full fledge one, but split what's an object with information and data layer and what's management of it with service calls).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Point-by-point replies:
1 - totally agree :)
2 - I ended up using PersistentIdentifier.get_by_object_uuid
because we associate the record id (UUID) to the release as a weak reference to the record. Therefore, when we have a release with an associated record UUID, we can't use the PID resolver as it expects a pid_value
and not object_uuid
. I did not find any resolver for such a case but maybe I missed it
3 - see the reply below. This method is part of the public interface of invenio_github.api.GithubRelease
and, in this case, simply calls the record publishing part. Which validation do you refer to?
90c5266
to
c5ce68c
Compare
23c2750
to
abb80f7
Compare
closes inveniosoftware/invenio-github#98