open-sustainable-technology icon indicating copy to clipboard operation
open-sustainable-technology copied to clipboard

Automatically add contributors to CITATION.cff

Open Ly0n opened this issue 2 years ago • 11 comments

I was wondering if we should/could automatically add contributors to CITATION.cff. After a quick search, I can't find a GitHub action or similar that does this. People might like such an action for various OS projects. @andrew @RichardLitt.

Ly0n avatar Nov 16 '23 07:11 Ly0n

That sounds like a great idea 💡

andrew avatar Nov 16 '23 08:11 andrew

There is generally little development on the automatic creation of the CITATION.cff. Most of the parts to do this can be found here: https://github.com/citation-file-format

Ly0n avatar Nov 16 '23 08:11 Ly0n

It’s funny you mention that, I wrote a script to generate some CITATION.cff files last week: https://github.com/ecosyste-ms/home/blob/main/lib/tasks/citation.rake

andrew avatar Nov 16 '23 11:11 andrew

@andrew I will now start working on this issue using ruby^^. My programming skills in this language are very limited, but I found this that should make it much easier: https://github.com/citation-file-format/ruby-cff

Ly0n avatar Nov 24 '23 14:11 Ly0n

The ruby part was easy:

require 'cff'


CFF::File.open('CITATION.cff') do |cff|
  cff.version = CFF::VERSION
  cff.authors << CFF::Person.new(ARGV[0], ARGV[1])
end

Ly0n avatar Nov 24 '23 15:11 Ly0n

One thing I was thinking we could do is search for each committers ORCID via email/name via the api: https://info.orcid.org/documentation/api-tutorials/api-tutorial-searching-the-orcid-registry/

andrew avatar Nov 25 '23 18:11 andrew

@andrew Good idea. That should not be that hard.

I'm just thinking about what such a CI job would look like in general. I think it makes sense to have a weekly scheduelded CI job that does the following:

  1. Do weekly:
  2. Compare all the contributors with the people in the CITATION.cff. If no new human contributor has been found quit here.
  3. Add first and last name from GitHub profile or search ORCID for author first and last name by email address.
  4. Create a pull request with the new CITATION.cff. Mention the new user_name in the pull request to check if the entry is valid.

Ly0n avatar Nov 26 '23 08:11 Ly0n

It might be tricky to handle a combination of an automatically generated CITATION.cff file and one that has custom changes based on user requests, perhaps the action could simply open an issue to add the contributor, with a suggested automatically generated addition?

andrew avatar Jun 18 '24 15:06 andrew

It might be tricky to handle a combination of an automatically generated CITATION.cff file and one that has custom changes based on user requests, perhaps the action could simply open an issue to add the contributor, with a suggested automatically generated addition?

I think it makes sense to tackle this issue with a command line tool first. We can tackle the entire automation process as soon as we have experience with the manual steps. For most projects, it should be sufficient to run the tool once a year. This would also give people more control and the option to change the automated suggestions based on their needs. Once we have good experience with this, we can integrate the command line tool into a CI.

Ly0n avatar Jun 18 '24 15:06 Ly0n

As discussed yesterday with @andrew, this tool is a better fit for ecosyste.ms, but I happy to help maintain and test this project in the future.

Ly0n avatar Jun 26 '24 08:06 Ly0n

Added some thoughts on the steps over here: https://github.com/ecosyste-ms/roadmap/issues/17#issuecomment-2191891840

andrew avatar Jun 26 '24 14:06 andrew

Back online. Should we close this thread here and just keep it at the ecoyste.ms issue?

RichardLitt avatar Jul 02 '24 23:07 RichardLitt