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

autoupdate CITATION.cff #398

Open
navidcy opened this issue Jan 27, 2023 · 10 comments
Open

autoupdate CITATION.cff #398

navidcy opened this issue Jan 27, 2023 · 10 comments

Comments

@navidcy
Copy link
Contributor

navidcy commented Jan 27, 2023

So the CITATION.cff points to an old version:

doi: 10.5281/zenodo.4749736
repository-code: https://github.com/xarray-contrib/cf-xarray
license: Apache-2.0
version: 0.5.2

I've been hitting this issue before when I used CITATION.cff to point to a zenodo repo. I thought I could add the "cite all versions zenodo link", e.g., 10.5281/zenodo.4749735. But then the version in the CITATION.cff file wouldn't be updated... I thought that surely there should be a way that the version of CITATION.cff is updated every time there is a new release but I haven't figured it out.

Any thoughts or solutions to this issue?

@dcherian
Copy link
Contributor

No! I keep looking too, it seems like a no-brainer.

It seems like we need a github action to use doi2cff (https://github.com/citation-file-format/doi2cff) and open a PR.

Maybe @keewis is interested in implementing this :)

@dcherian dcherian changed the title CITATION.cff points to old version autoupdate CITATION.cff Jan 27, 2023
@navidcy
Copy link
Contributor Author

navidcy commented Jan 28, 2023

If you implement a github action that auto updates the cff file on every release I’m definitely copying it!

@keewis
Copy link
Contributor

keewis commented Mar 30, 2023

if I understand correctly, we'd need a post-release workflow that queries zenodo to find the doi of the most recent release and creates a PR from that (using doi2cff). Does that sound about right?

I wonder if we should try to push this into the zenodo webhook?

Edit: actually, the referencing issue above mentions a script that does all the tricky parts (fetch the doi of the most recent release): newhinton/Zettlr@d8d9edb

@dcherian
Copy link
Contributor

Well it's a bit circular that way.

IMO we want to update CITATION.cff for every PR from a new contributor. That way CITATION.cff is updated at release time and the Zeonodo metadata will be correct.

@keewis
Copy link
Contributor

keewis commented Mar 30, 2023

I don't think we can automate adding new contributors to the authors: Where would you get the information to put into CITATION.cff from? AFAICT, the only thing we would be able to get without the help of the contributor is the github handle, which does not seem to be part of CITATION.cff (and some people might not want to be part of that file). So I think the only thing we can do is ask each new contributor to add their information manually to CITATION.cff or a special file that can be synchronized with CITATION.cff (AUTHORS.yaml).

For the version / doi, I agree, this is a bit circular. To make it less circular, we'd have to: create a new doi and put that and the new version into CITATION.cff, then create a commit and tag it as the release, and only after that do the usual uploading to pypi and zenodo. I don't think that's possible, though.

Of course, that assumes the authors don't have to be modified on release as well, but the case where you want to collect authors that contributed to a specific release can be easily implemented by clearing the authors after each release, and have another action add contributors from AUTHORS.yaml on the first PR after the release.

@dcherian
Copy link
Contributor

I used https://con.github.io/tributors/docs/getting-started in #399

I can't remember now but it is bootstrap-able. You can create a CITATION.cff entry using First Name, Last Name, possible affiliation from github data basically. And ask the contributor to update the rest

@navidcy
Copy link
Contributor Author

navidcy commented Mar 30, 2023

You can always make the CFF point to the "cite-all-versions" zenodo DOI.
This way you only need somehow to auto-update the version in the CFF file, right?

@keewis
Copy link
Contributor

keewis commented Apr 2, 2023

If we can use the "cite-all-versions" doi that makes it much simpler. I wonder if creating a pre-commit hook that checks the changelog for version sections with dates and synchronizes that with the version in CITATION.cff would be sufficient?

For example, the commit that changes the version section from

v1.0.1 (*unreleased*)
---------------------

to

v1.0.1 (2023-04-02)
-------------------

would automatically be detected as a release commit and the hook would update CITATION.cff to point to 1.0.1 (run either through the local pre-commit install and included in the release commit, or as a new commit created by pre-commit-ci).

@dcherian
Copy link
Contributor

dcherian commented Apr 3, 2023

You can always make the CFF point to the "cite-all-versions" zenodo DOI.

yes just did this.

ou only need somehow to auto-update the version in the CFF file,

Ah now I see the confusion. I had totally forgotten that there is a version and release date in CITATION.cff. This is OK to be manual, it can be part of the release process.

I think it's most important to be prompted to add a new contributor to CITATION.cff. I think the easiest place to do this is when a PR is opened. Or perhaps when its merged, then an action can open a PR to update CITATION.cff, and ping the author to check for corrections and add info.

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

3 participants