GithubHelp home page GithubHelp logo

symfu / backstroke-worker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from backstrokeapp/worker

0.0 1.0 0.0 118 KB

The Backstroke worker eats off a queue of link operations, creating pull requests for the Backstroke server.

Dockerfile 0.33% JavaScript 99.67%

backstroke-worker's Introduction

Backstroke Worker

The Backstroke Worker eats off of a rsmq queue, performing a link update. In order, here's roughly what happens:

  • A new operation is pulled off the queue.
  • The link's type is checked:
    • If the type is repo:
      • Check to make sure the fork didn't opt out of Backstroke pull requests.
        • If so, return an error.
      • Create a pull request to propose the new changes.
    • If the type is fork-all:
      • Get all forks of the upstream.
      • Loop through each:
        • Check to make sure the fork didn't opt out of Backstroke pull requests.
          • If so, return an error.
        • Create a pull request to propose the new changes.
  • Add the response back into the Redis instance under the operation id, so it can be fetched by the main server.

Usage

GITHUB_TOKEN=XXX REDIS_URL=redis://XXX yarn start

Environment variables

  • GITHUB_TOKEN (required): The Github token for the user that creates pull requests. When deployed, this is a token for backstroke-bot.
  • REDIS_URL (required): A url to a redis instance with a rsmq queue inside. Takes the form of redis://user:password@host:port.
  • THROTTLE: Provide an optional delay between handling each webhook operation. This is potentially handy to keep a worker from exhausing the rate limit on a token.
  • GITHUB_BOT_USERNAME: The username of the bot user that creates pull requests (defaults to backstroke-bot). Used to grant permissions to the bot user on private repositories.

Arguments

  • --pr mock: Tell the worker not to actually make pull requests, but only log out when it is about to make a pull request. This is handy for repeated testing or for testing against repositories that you don't own. This option is off by default.

Running tests

yarn test

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.