Git Product home page Git Product logo

github-rebase-review-bot's Introduction

GitHub Rebase Review Bot

A GitHub App built with Probot to re-approve dismissed Pull Request reviews, given the code changes remain the same after the last approval. All infrastructure orchestration is done with Amazon Web Services.

It compares changes through a calculated through a hash, which if stored in a AWS DynamoDB Hash Table.

Test

npm install
npm test

Development

A DYNAMODB_TABLE value needs to be set in the env (or put into the .env file).

# Install dependencies
npm install

# Run with hot reload
npm run dev

# Compile and run
npm run build
npm run start

Create App

Start Server

npm run dev

Register at GitHub

Open http://localhost:3000/probot and follow instructions to install it to some repository or organisation.

Deploy

Package Lambda Bundle

npm run package

Template and Deploy SAM Stack

You need to set the AppId variable as a CloudFormation stack parameter. It should be generated and stored in your local .env file.

aws cloudformation package \
  --template-file deploy/app.yaml \
  --s3-bucket cf-templates-106qhq40bhwiu-eu-west-1 \
  --output-template-file output.yaml
aws cloudformation deploy \
  --stack-name github-rebase-review-bot \
  --template-file output.yaml \
  --parameter-overrides AppId=12345 \
  --capabilities CAPABILITY_IAM

Secrets

WEBHOOK_SECRET and PRIVATE_KEY can be retrieved from your local .env file. They need to be stored in the AWS SecretManager objects that have been created in the Stack. PRIVATE_KEY should be a pem file and encoded as base64:

echo "$PRIVATE_KEY"
-----BEGIN RSA PRIVATE KEY-----
...
-----END RSA PRIVATE KEY-----
export SECRET=$(echo "$PRIVATE_KEY" | base64)

Webhook Url

After the CloudFormation stack's been deployed, the ApiGateway's URL (something like https://swmwkyi6rf.execute-api.eu-west-1.amazonaws.com) needs to be configured as Webhook URL in the "General" pane of the GitHub App.

Debug

You can inspect the lambda logs or the activity log in the GitHub App's "Advanced" tab.

Contributing

If you have suggestions for how github-rebase-review-bot could be improved, or want to report a bug, open an issue! We'd love all and any contributions.

For more, check out the Contributing Guide.

License

Apache 2.0 © 2020 moovel Group GmbH

github-rebase-review-bot's People

Contributors

dependabot[bot] avatar mkulke avatar nelspike avatar

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.