Skip to content
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

connect to GitLab just as to GitHub #1404

Open
katrinleinweber opened this issue Jan 11, 2018 · 23 comments
Open

connect to GitLab just as to GitHub #1404

katrinleinweber opened this issue Jan 11, 2018 · 23 comments

Comments

@katrinleinweber
Copy link
Contributor

katrinleinweber commented Jan 11, 2018

Dear Zenodo team,

the integration described on https://guides.github.com/activities/citable-code/ is built in a generalisable way on your end, correct? I just wanted to notify you of a discussion about Zenodo integration over at GitLab.

Cheers :-)

@katrinleinweber
Copy link
Contributor Author

PS: I searched through invenio attic & contrib issues but since nothing about GitLab showed up, I hope posting this here is OK.

@krzysztof
Copy link
Contributor

Hey @katrinleinweber , thanks for putting this forward. Such integration will require integration on our side, i.e. something akin to https://github.com/inveniosoftware/invenio-github

Seems like the main difficultly here would be support for custom GitLab installations. For similar reasons we're currently not supporting enterprise GitHub, which is similar to custom a GitLab instance.

@remram44
Copy link

May I ask why changes from your end are necessary? Can't GitLab deposit tarballs on release using your API?

@krzysztof
Copy link
Contributor

krzysztof commented Jan 12, 2018

Hey @remram44 You mean something like a GitLab module talking to our REST API? In fact yes, it's possible.

May I ask why changes from your end are necessary?

The changes on our end would be writing something like invenio-github module for gitlab (i.e. connecting GitLab-Zenodo accounts, registering webhooks, payload handling etc.). For example, our GitHub integration is a GitHub third party app, which requests write access to GitHub user's public repositories. User first needs to connect his GitHub account on Zenodo, so it's clear who is the "owner" of the Zenodo records is once the repo is released. So when the user enables archiving on one of his repositories (flips the switch), we register a webhook on the repo, and handle the payload when it arrives to us. At this point we can link the github user with the zenodo user.

Can't GitLab deposit tarballs on release using your API?

So now if you want to reverse it and have GitLab write to us, I can see that one could have a custom GitLab module pushing a tarball with metadata of a given repository to Zenodo, but it's not clear for which Zenodo user. I guess the easiest way would be to configure said module with the Zenodo user's API key, which would work.

@remram44
Copy link

one could have a custom GitLab module pushing a tarball with metadata of a given repository to Zenodo, but it's not clear for which Zenodo user. I guess the easiest way would be to configure said module with the Zenodo user's API key, which would work.

This is what I had in mind! I didn't know there Zenodo API allowed anonymous deposits anyway. Does Zenodo have something like OAuth? That might be more friendly than pasting an API key.

@katrinleinweber
Copy link
Contributor Author

Thanks for taking the time to explain, @krzysztof :-)

[…] configure said module with the Zenodo user's API key, which would work.

In that case, would the module need it's own user management or refer to the GitLab instance's secrets management (EE-only?), because there would be several users on one instance, wanting their repos to hooked-up to several Zenodo accounts.

Or maybe (just speculating!) to a shared, institutional Zenodo account? But maybe this case can be ignored initially.

@krzysztof
Copy link
Contributor

I didn't know there Zenodo API allowed anonymous deposits anyway

@remram44 It doesn't, you need API key. Zenodo does not have OAuth.

In that case, would the module need it's own user management or refer to the GitLab instance's secrets management (EE-only?), because there would be several users on one instance, wanting their repos to hooked-up to several Zenodo accounts.

@katrinleinweber At the moment it's not possible to have multiple owners for given records, and we wouldn't want for each repo user to have their own copy of the repository either - this would mean multiple DOIs for the same content which is bad. For that reason, given GH repo can be archived by only one user.

Several users do use something like an "institutional" account, mainly journals, but then the "burden" of record curation lies on the librarian/owner of the account, so that would technically work, but in the long term we wouldn't want this to become a mainstream solution to this problem. Instead in the future we might extend the communities feature to resemble something like a "team", and probably have some form of multiple-owners (or at least multiple curators) per record.

@remram44
Copy link

If the GitLab plugin takes a Zenodo API token as configuration, this seems very usable. Would also work on private installations of GitLab. It would be up to the team to decide which Zenodo account the records are created under.

screen shot 2018-01-15 at 11 47 29

Zenodo does not have OAuth.

Actually it seems to support OAuth 2.0: http://developers.zenodo.org/#authentication So entering a token by hand might not even be required.

@katrinleinweber

This comment has been minimized.

@katrinleinweber
Copy link
Contributor Author

GitLab suggests:

web hooks, like when a new tag is created […] seem to be the equivalent APIs used by the Zenodo integration with GitHub. […] best way would be a Project Integration configured on the GitLab side that pushes an archive of every tag when it is created.

@katrinleinweber
Copy link
Contributor Author

@remram44 The above screenshot is a mock-up, right? How did you create it?

@remram44
Copy link

remram44 commented Dec 4, 2018

@katrinleinweber Firefox inspector/dev-tool 😉

@katrinleinweber
Copy link
Contributor Author

katrinleinweber commented Dec 4, 2018

Specifically for the Zenodo module in self-hosted GitLabs, @schlauch & me posted https://gitlab.com/gitlab-org/gitlab/issues/25587.

In response to that, an experimental Invenio module was shared: https://gitlab.hzdr.de/rodare/invenio-gitlab by @tobiashuste.

@gerazov
Copy link

gerazov commented Mar 16, 2020

This feature would be useful, how can we upvote it?

@tamasgal
Copy link

tamasgal commented Nov 4, 2020

Just keep posting until it reaches more attention 😉

@andyuex
Copy link

andyuex commented Dec 18, 2020

This would be an interesting feature for Zenodo, no doubt at all.

@Grelot
Copy link

Grelot commented Mar 1, 2021

Yes please !

@smiddy
Copy link

smiddy commented May 11, 2021

I would like to use such a plugin as well!

@PatricHolmvall
Copy link

Great idea, would be very useful!

@Karel-van-de-Plassche
Copy link

Karel-van-de-Plassche commented May 28, 2021

A big thumbsup from me! Would simplify the pipeline of the next generation of https://zenodo.org/record/3497066!

@penyuan
Copy link

penyuan commented Aug 23, 2022

Are there any updates on GitLab integration for Zenodo? I literally have something from GitLab that I have to publish to Zenodo right now. Even if integration is not fully supported yet, if anyone has published from GitLab to Zenodo before, I'd love to hear how you did it.

Thanks everyone.

@CaptainSifff
Copy link

https://pypi.org/project/gitlab2zenodo/ can be used for this, e.g. together with https://github.com/citation-file-format/cff-converter-python .
I wrote a small, incomplete blog post about it here: https://www.florian-goth.de/node/18

@LDalby
Copy link

LDalby commented Jul 14, 2023

Could use this feature too!

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

No branches or pull requests