fidgit

An ungodly union of GitHub and Figshare

https://github.com/arfon/fidgit

Science Score: 57.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 6 DOI reference(s) in README
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.8%) to scientific vocabulary
Last synced: 7 months ago · JSON representation ·

Repository

An ungodly union of GitHub and Figshare

Basic Info
  • Host: GitHub
  • Owner: arfon
  • License: other
  • Language: Ruby
  • Default Branch: master
  • Homepage: fidgit.arfon.org
  • Size: 1.16 MB
Statistics
  • Stars: 62
  • Watchers: 19
  • Forks: 47
  • Open Issues: 6
  • Releases: 3
Created over 12 years ago · Last pushed about 3 years ago
Metadata Files
Readme License Citation

README.md

Fidgit

Figshare and Git(Hub). By Arfon Smith (@github), Kaitlin Thaney (@MozillaScience) and Mark Hahnel (@figshare).

License

Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)

What this does

This is a proof of concept integration between a GitHub repo and Figshare in an effort to get a DOI for a GitHub repository. When a repository is tagged for release on GitHub Fidgit will import the release into Figshare thus giving the code bundle a DOI. In a somewhat meta fashion, Fidgit is publishing itself to Figshare. Its DOI is https://doi.org/10.6084/m9.figshare.828487.

Fidgit isn't really designed for 'production' use, for example there's little or no error handling but hopefully there's some value here.

How it does it

Both GitHub and Figshare have pretty fully-featured APIs. Fidgit sits inbetween them listening out for releases and when it hears about one (through the webhook POST from GitHub) it downloads the release and pushes it to a predefined Figshare dataset.

Internally, Fidgit represents a Repository and has the concept of a Release which means it's also keeping track of the releases from your GitHub repository.

Getting started

Access codes

First you need to get yourself a personal access token from your GitHub profile (this is going to be the 'github_token' key in setup.toml) and get some OAuth tokens from Figshare. You need to create an application - any URL will work, it's not important for this - and keep a record all four access codes (consumer_key, consumer_token etc).

Important - If you want to publish code bundles to public articles on Figshare then you'll need to set the permissions for this application to allow public read/write access. Currently this isn't a huge issue though as Fidgit won't publish an unpublished article on Figshare (it will just upload a new code bundle to the unpublished article).

Figshare

Heroku stuff

Fidgit is designed to run nicely on Heroku with two dynos, one web and one worker and a couple of free addons for MongoDB and a Redis server for Sidekiq (that does all of the background download from GitHub and then upload to Figshare).

Heroku

Describing all of the Heroku setup is out of the scope of this introduction but as long as you configure it with a single web dyno and a single worker, a MongoHQ and Redistogo free account then you should be golden.

GitHub stuff

You'll need an open source repository that you want to push to Figshare.

Figshare stuff

You'll need an article to push to on Figshare. This can be made through the user-interface or API. You just need the integer id of the article for the configuration later.

Configuring Fidgit

Once you have your Heroku application up and running and your Figshare and GitHub keys you'll need to copy the setup.toml.example file to 'setup.toml'. An example config is below:

```toml

[setup] githubtoken = "a3133YBT45aW3auFd95n" fidgitlocation = "http://fidgit.arfon.org" figshareconsumerkey = "a3133YBT45aW3auFd95n" figshareconsumertoken = "a3133YBT45aW3auFd95n" figshareoauthtoken = "a3133YBT45aW3auFd95n" figshareoauthsecret = "a3133YBT45aW3auFd95n"

[repos] [repos.fidgit] name = "fidgit" location = "https://github.com/arfon/fidgit" figsharearticleid = 828487 secret = "a3133YBT45aW3auFd95n" ```

Here we're setting the location of your Fidgit instance (your Heroku application address), your GitHub personal access token and your Figshare OAuth credentials.

Next we're setting the repositories that we'd like to create DOIs for on Figshare. Note this is an array in the TOML config, that is, we can support a number of linkages. Important things to realise here:

  • 'name' is the name of your repository on GitHub
  • 'location' is the HTML url of the repository. Note that at this time Fidgit only supports open source repos.
  • 'figshare_article_id' is the integer article id of your Figshare
  • 'secret' is a string that you have made up that is used in the webhook push from GitHub to Fidgit. It's basically an API key to Fidgit for a repo.

Bootstraping Fidgit

Now you've got your configuration file setup you need to push the code to your Heroku application and run a couple of rake tasks to initialize the application. They are:

ruby rake bootstrap_repos rake setup_payloads

If everything goes to plan then these tasks should run without error and should produce a small amount of debug information. Significantly the second task uses the GitHub API to configure a webhook that posts a JSON payload to your Fidgit application each time a new release is issued. You can check that this is working by going to the service hooks page under 'settings' for your repo.

Webhook

That's a wrap!

And that's about it. If you now create a new release on GitHub then you should see this code bundle being mirrored to your specified location on Figshare. Check out the Fidgit one here. Any questions, comments, concerns post an issue.

DOIed

Owner

  • Name: Arfon Smith
  • Login: arfon
  • Kind: user
  • Location: Edinburgh

Schmidt Sciences. Previously product @github, data science @spacetelescope, @zooniverse co-founder. Editor-in-chief of the Journal of Open Source Software

Citation (CITATION.cff)

Hi this probably doesn't need to be cited. But thanks anyway!

GitHub Events

Total
Last Year

Committers

Last synced: over 1 year ago

All Time
  • Total Commits: 44
  • Total Committers: 2
  • Avg Commits per committer: 22.0
  • Development Distribution Score (DDS): 0.023
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Arfon Smith a****n 43
Katrin Leinweber k****r@t****u 1
Committer Domains (Top 20 + Academic)
tib.eu: 1

Issues and Pull Requests

Last synced: 7 months ago

All Time
  • Total issues: 0
  • Total pull requests: 7
  • Average time to close issues: N/A
  • Average time to close pull requests: 2 days
  • Total issue authors: 0
  • Total pull request authors: 3
  • Average comments per issue: 0
  • Average comments per pull request: 0.29
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 5
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
  • dependabot[bot] (5)
  • katrinleinweber (1)
  • arfon (1)
Top Labels
Issue Labels
Pull Request Labels
dependencies (5)

Dependencies

Gemfile rubygems
  • bson_ext >= 0
  • mongo_mapper >= 0
  • multi_json = 1.6.1
  • oauth >= 0
  • octokit >= 0
  • pry >= 0
  • rake >= 0
  • sidekiq >= 0
  • sinatra >= 0
  • toml ~> 0.0.3
Gemfile.lock rubygems
  • activemodel 3.2.13
  • activesupport 3.2.13
  • addressable 2.3.5
  • blankslate 2.1.2.4
  • bson 1.9.1
  • bson_ext 1.9.1
  • builder 3.0.4
  • celluloid 0.15.2
  • coderay 1.0.9
  • connection_pool 1.1.0
  • faraday 0.8.8
  • i18n 0.6.1
  • json 1.8.0
  • method_source 0.8.2
  • mongo 1.9.1
  • mongo_mapper 0.12.0
  • multi_json 1.6.1
  • multipart-post 1.2.0
  • oauth 0.4.7
  • octokit 2.3.1
  • parslet 1.5.0
  • plucky 0.5.2
  • pry 0.9.12.2
  • rack 1.5.2
  • rack-protection 1.5.0
  • rake 10.0.4
  • redis 3.0.5
  • redis-namespace 1.3.1
  • sawyer 0.5.1
  • sidekiq 2.15.1
  • sinatra 1.4.3
  • slop 3.4.6
  • tilt 1.4.1
  • timers 1.1.0
  • toml 0.0.4
.github/workflows/draft-pdf.yml actions
  • actions/checkout v2 composite
  • actions/upload-artifact v1 composite
  • openjournals/openjournals-draft-action master composite