GithubHelp home page GithubHelp logo

tooangel / worlddriven Goto Github PK

View Code? Open in Web Editor NEW
17.0 2.0 14.0 4.27 MB

Automatic and well-defined pull request merged based on contribution-based weighted voting

License: GNU Affero General Public License v3.0

Python 44.54% HTML 15.54% CSS 3.38% JavaScript 36.11% Shell 0.06% Mako 0.36%
automerge reviewer vote weight hacktoberfest showdev contributorswanted

worlddriven's Introduction

world driven

CircleCI discord Code climate

World driven introduces a contribution based weighted voting system for time-based auto-merges. It defines a process and automates the process of merging Pull Requests based on Reviews.

World driven automatically merges Pull Requests after a certain amount of time, this gives interested people time to review and approve or request changes (in world driven speech: vote). Positive votes reduce the time to merge to speed up the release. Previous contributions are the factor of this merge boost (think of number of commits). Voting against the Pull Request increases the time to merge. Reaching a certain threshold blocks the merge.

The configuration for the repository is:

  • Merge duration for a pull request: 10 days
  • Per commit time: 0 days
  • Merge method: squash

Read more on https://www.worlddriven.org

Setup

Run with docker compose

Copy .env-example to .env and add your environment variables.

docker compose up

Manual

The application uses MongoDB as back end, the default configuration is localhost:27017 This can be overwritten with the environment variable: MONGODB_URI

Gunicorn serves as the server, checkout the Procfile or use gunicorn --workers=1 --worker-class=flask_sockets.worker server:app --chdir src.

The authentication and authorization uses GitHub OAuth and API.

For OAuth and merging of pull requests create an GitHub OAuth App (https://docs.github.com/en/free-pro-team@latest/developers/apps/creating-an-oauth-app) and set GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET as environment variable. The GitHub callback path is: /github-callback.

For commenting create and set a personal token (https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/creating-a-personal-access-token) as: GITHUB_USER_TOKEN

Set Session secret as SESSION_SECRET initial a random string.

To disable https in a local environment set DEBUG=true as environment variable.

Prepare PostgreSQL server

sudo -u postgres psql
postgres=# create database mydb;
postgres=# create user myuser with encrypted password 'mypass';
postgres=# grant all privileges on database mydb to myuser;

Testing

Run JavaScript tests with: npm run test Run python tests with: pytest

Configuration

To allow different configurations on different repositories you can place a .worlddriven.ini (see .worlddriven.ini-example) in the root of your repository and adapt the values. When World Driven checks new Pull Requests it fetches the .worlddriven.ini from your default branch (fetching from the Pull Request could be a security issue) and applies the configuration.

Front end

The Front end has three views:

  • / the front page
  • /dashboard a dashboard with an overview of the repositories and a button to enable World Driven for the repository
  • /:org/:repo/pull/:pull_number A detailed calculation breakdown for the pull request

Use the following endpoints to more easily work on the dashboard with mock data:

  • /test/dashboard - for the dashboard
  • /test/:org/:repo/pull/:pull_number - for the pull request view

Production environment

The World Driven auto-merge service is:

  • hosted on Heroku
  • tested via CircleCI,
  • merged via World Driven and automatically deployed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.