Skip to content

fairdataihub/codefair-app

Repository files navigation

logo

codefair

Your coding assistant to make research software reusable without breaking a sweat!


Get the app »

Learn more »

contributors stars open issues license Curated with FAIRshare



Description

codefair is your personal assistant when it comes to making your research software reusable and especially complying with the Findable, Accessible, Interoperable, Reusable (FAIR) Principles for Research Software. Whether you are developing artificial intelligence (AI)/machine learning (ML) models with Python, data visualization tools with Jupyter notebook, or data analysis code with R, codefair is here to assist you. By communicating with you through GitHub issues and submitting pull requests, codefair will make sure that your software follows best coding practices, provides metadata in standard format, includes a license file, is archived on Zenodo, and much more. With codefair by your side, you're not just developing software but you're advocating for better software practices. Learn more on the app's website codefair.io.

screenshot of the License issue up to where is it closed with the PR

Getting started

Installing

  1. Install codefair-app on the GitHub organizations or repositories of your choice
  2. Code and develop your software as usual
  3. Follow codefair-app's instructions when it opens an issue or submit a pull request

Permissions Required

codefair requires a few repository permissions to be able to listen to events happening on a repository and act accordingly to make software FAIR. The permissions required include:

  • Read access to:
    • Repository contents
    • Repository metadata
    • Repository pull requests
    • Repository issues
  • Write access to:
    • Repository pull requests
    • Repository issues
    • Repository contents

Features

List of features:

  • License checker (released): This feature checks for a LICENSE file in repositories that have at lease one commit and opens a GitHub issue if no LICENSE file is found. Users can find helpful ressources for selecting a license in the issue message. Users can also reply with the name of the desired license and the app automatically submits a pull request with a LICENSE file that contains license terms associated with the desired license.
  • CITATION.cff generator (released): This features checks for a CITATION.cff file in repositories that have a LICENSE file and opens a GitHub issue if no CITATION.cff file is found. Users can find helpful resources for preparing a CITATION.cff file. Users can also request the app to create one and submit a pull request while also being provided a link to edit within the GitHub UI if needed.
  • Zenodo archival (upcoming): This feature checks if a GitHub repository is already archived on Zenodo. If not, the app open a Github issue that guides users into linking their GitHub repository with their Zenodo account so every GitHub release of the software is automatically archived on Zenodo by the app with CITATION.cff file updated before the release.

More features are in the work!

Testing

You can follow these steps for testing the app:

  • Create a GitHub repository with e.g., a README file or some other code files included but no LICENSE specified
  • Install codefair on that repository from the GitHub markplace: https://github.com/marketplace/codefair-app
  • Check the GitHub issue opened by the app about missing license file.
  • Interact with the app by replying to the issue. E.g., reply with a non existing license name first like "@codefair-app random license" and then with an existing one like "@codefair-app MIT".
  • Check out and merge the pull request opened by the app to see the issue being closed automatically.

A demo video is available here.

Run the github app locally

Setup

This repository uses a pnpm workspace to handle both the bot and the frontend UI. You will need to install pnpm globally to run the app locally. You will also need to be on Node.js version 20 or higher.

npm install -g pnpm

To start both the bot and the frontend UI, run the following command at the root of the repository:

pnpm dev

This will start the bot and the frontend UI in development mode. The bot will be available at http://localhost:3001 and the frontend UI will be available at http://localhost:3000.

The .env files for each package are located in the respective package directories. You will need to create a .env file in the bot and ui directories. Use the .env.example files in each directory as a template.

To run the bot only, run the following command at the root of the repository:

cd bot
pnpm dev

To run the frontend UI only, run the following command at the root of the repository:

cd ui
pnpm dev

How codefair is developed

codefair is developed using Probot and is deployed on Vercel as a serverless function. The GitHub app is configured to receive webhooks for imoprtants actions such as pushing code, opening or closing issues, opening or merging pull requests and commenting on discussions. By leveraging a serverless environment on Vercel, codefair can automatically scale to handle the workload of the GitHub app. The app is written in Node.js and utilizes the Octokit library to interact with the GitHub APIenabling seamless integration with GitHub's features and functionality.

Contributing

Contributions are always welcome!

If you are interested in reporting/fixing issues and contributing directly to the code base, please see CONTRIBUTING.md for more information on what we're looking for and how to get started.

Issues and Feedback

To report any issues with the software, suggest improvements, or request a new feature, please open a new issue via the Issues tab. Provide adequate information (operating system, steps leading to error, screenshots) so we can help you efficiently.

License

This work is licensed under MIT. See LICENSE for more information.

How to cite

If you are using this package or reusing the source code from this repository for any purpose, please cite:

    Coming soon...

Acknowledgements

    Coming soon...