Coder Social home page Coder Social logo

bunto / pr-comment-bot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from deborah-digges/pr-bot

0.0 1.0 0.0 17 KB

A Pull Request Hook that comments on pull requests from users who are contributing to the repository for the first time

Home Page: https://bunto-pr-bot.herokuapp.com

License: Apache License 2.0

Python 100.00%

pr-comment-bot's Introduction

pr-bot

A Pull Request Hook that comments on pull requests from users who are contributing to the repository for the first time

Instructions to set up pr-bot

  1. Clone this repository: git clone https://github.com/Deborah-Digges/pr-bot.git
  2. Fill in your github credentials(username & password) in app.properties
  3. Create a heroku account and download the heroku toolbelt
  4. Navigate to the folder where you cloned this repo: cd pr-bot
  5. Create a heroku app: heroku create
  6. Deploy the code: git push heroku master
  7. Ensure that atleast one instance of the app is running: heroku ps:scale web=1
  8. List your app with: heroku apps
  9. The service is now running at <heroku-app-name>.herokuapp.com
  10. Go to the settings page of the repository of interest.
  11. Navigate to WebHooks and Services
  12. Click on Add WebHook
  13. For Payload URL enter http://<heroku-app-name>.herokuapp.com/v1/PREvent
  14. Choose Let me select Individual Events and choose the Pull Request Event
  15. Add Webhook
  16. Get Someone to Open a PR on your repository :-)

To self-host using Docker

  1. Install Docker and Compose. OSX users can skip above two and install Docker Toolbox
  2. Move to this directory, and run docker-compose up web. It will install all the requirements on the first run
  3. Follow steps 8 through 14 in the previous list. In the Payload URL section of the Add webhook page of your Github repo settings, add <your-public-ip:5000|Public-URL>/v1/PREvent
  4. For development purposes, you can use Ngrok to set up a temporary local tunnel and make your local server accessible via a public URL.

To Deploy on Google App Engine

  1. Install Google App Engine SDK for Python.
  2. Go to Google Cloud Console and Create a project. Here is a quickstart.
  3. Copy the application id of the created project and paste it in application parameter of app.yaml file.
  4. Follow steps 8 through 14 in the instruction list. In the Payload URL section of the Add webhook page of your Github repo settings, add <your-application-id>.appspot.com/v1/PREvent
  5. Open the folder in Google App Engine Launcher as an existing project by Going to File -> Add Existing Application and deploy.
  6. Alternatively, deploy through command line by running appcfg.py -A <YOUR_APPLICATION_ID> update path-to-root-appengine-dir/.

Configuration

  1. Customize the message in app.properties
  2. Customize new-users in app.properties. When set to true, a comment is only made on a PR made by a new contributor.

Try It Out!

Submit a PR to this repository

Made with ❤️ - @Deborah-Digges

pr-comment-bot's People

Contributors

deborah-digges avatar hannanabdul55 avatar oh-penguin avatar shrikrishnaholla avatar

Watchers

 avatar

pr-comment-bot's Issues

Install PR Bot software for buntobot

Run this:

C:\Users\Suriyaa\Downloads>git clone https://github.com/bunto/pr-bot.git
fatal: Could not switch to 'pr-bot/': Permission denied

C:\Users\Suriyaa\Downloads>git clone https://github.com/bunto/pr-bot.git
Cloning into 'pr-bot'...
remote: Counting objects: 71, done.
remote: Total 71 (delta 0), reused 0 (delta 0), pack-reused 71Unpacking objects:  45% (32/71)
Unpacking objects: 100% (71/71), done.
Checking connectivity... done.

C:\Users\Suriyaa\Downloads>cd pr-bot

C:\Users\Suriyaa\Downloads\pr-bot>heroku create
Creating app... done, stack is cedar-14
https://boiling-plateau-44162.herokuapp.com/ | https://git.heroku.com/boiling-plateau-44162.git

C:\Users\Suriyaa\Downloads\pr-bot>heroku apps:rename pr-bot
Renaming boiling-plateau-44162 to pr-bot... failed
 !    Name is already taken

C:\Users\Suriyaa\Downloads\pr-bot>heroku apps:rename bunto-pr-bot
Renaming boiling-plateau-44162 to bunto-pr-bot... done
https://bunto-pr-bot.herokuapp.com/ | https://git.heroku.com/bunto-pr-bot.git
Git remote heroku updated
heroku-cli: Updating... done.

C:\Users\Suriyaa\Downloads\pr-bot>git push heroku master
Counting objects: 71, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (68/68), done.
Writing objects: 100% (71/71), 15.39 KiB | 0 bytes/s, done.
Total 71 (delta 28), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: -----> Installing python-2.7.11
remote:      $ pip install -r requirements.txt
remote:        Collecting requests==2.7.0 (from -r requirements.txt (line 1))
remote:          Downloading requests-2.7.0-py2.py3-none-any.whl (470kB)
remote:        Collecting Flask==0.10.1 (from -r requirements.txt (line 2))
remote:          Downloading Flask-0.10.1.tar.gz (544kB)
remote:        Collecting configparser==3.5.0b2 (from -r requirements.txt (line 3))
remote:          Downloading configparser-3.5.0b2.tar.gz
remote:        Collecting Werkzeug>=0.7 (from Flask==0.10.1->-r requirements.txt (line 2))
remote:          Downloading Werkzeug-0.11.4-py2.py3-none-any.whl (305kB)
remote:        Collecting Jinja2>=2.4 (from Flask==0.10.1->-r requirements.txt (line 2))
remote:          Downloading Jinja2-2.8-py2.py3-none-any.whl (263kB)
remote:        Collecting itsdangerous>=0.21 (from Flask==0.10.1->-r requirements.txt (line 2))
remote:          Downloading itsdangerous-0.24.tar.gz (46kB)
remote:        Collecting MarkupSafe (from Jinja2>=2.4->Flask==0.10.1->-r requirements.txt (line 2))
remote:          Downloading MarkupSafe-0.23.tar.gz
remote:        Installing collected packages: requests, Werkzeug, MarkupSafe, Jinja2, itsdangerous, Flask, configparser
remote:          Running setup.py install for MarkupSafe: started
remote:            Running setup.py install for MarkupSafe: finished with status 'done'
remote:          Running setup.py install for itsdangerous: started
remote:            Running setup.py install for itsdangerous: finished with status 'done'
remote:          Running setup.py install for Flask: started
remote:            Running setup.py install for Flask: finished with status 'done'
remote:          Running setup.py install for configparser: started
remote:            Running setup.py install for configparser: finished with status 'done'
remote:        Successfully installed Flask-0.10.1 Jinja2-2.8 MarkupSafe-0.23 Werkzeug-0.11.4 configparser-3.5.0b2 itsdangerous-0.24 requests-2.7.0
remote:
remote: -----> Discovering process types
remote:        Procfile declares types -> web
remote:
remote: -----> Compressing...
remote:        Done: 34.5M
remote: -----> Launching...
remote:        Released v3
remote:        https://bunto-pr-bot.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.
To https://git.heroku.com/bunto-pr-bot.git
 * [new branch]      master -> master

C:\Users\Suriyaa\Downloads\pr-bot>heroku ps:scale web=1
Scaling dynos... done, now running web at 1:Free.

C:\Users\Suriyaa\Downloads\pr-bot>heroku apps
=== My Apps
bunto-pr-bot
hubot-gitter
hubot-pr-status
notenoteplatform


C:\Users\Suriyaa\Downloads\pr-bot>git push heroku master
Everything up-to-date

Update bot project wth Heroku

Run this:

Microsoft Windows [Version 10.0.10586]
(c) 2015 Microsoft Corporation. Alle Rechte vorbehalten.

C:\Users\Suriyaa>cd Downloads

C:\Users\Suriyaa\Downloads>git clone https://github.com/bunto/pr-comment-bot.git
Cloning into 'pr-comment-bot'...
remote: Counting objects: 74, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 74 (delta 0), reused 0 (delta 0), pack-reused 71Unpacking objects:  43% (32/74)
Unpacking objects: 100% (74/74), done.
Checking connectivity... done.

C:\Users\Suriyaa\Downloads>cd pr-comment-bot

C:\Users\Suriyaa\Downloads\pr-comment-bot>git push heroku master
fatal: 'heroku' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

C:\Users\Suriyaa\Downloads\pr-comment-bot>heroku git:remote -a pr-comment-bot
set git remote heroku to https://git.heroku.com/pr-comment-bot.git

C:\Users\Suriyaa\Downloads\pr-comment-bot>git push heroku master
Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 381 bytes | 0 bytes/s, done.
Total 3 (delta 2), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Using set buildpack heroku/python
remote: -----> Python app detected
remote:      $ pip install -r requirements.txt
remote:
remote:
remote: -----> Discovering process types
remote:        Procfile declares types -> web
remote:
remote: -----> Compressing...
remote:        Done: 34.5M
remote: -----> Launching...
remote:        Released v4
remote:        https://pr-comment-bot.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy.... done.
To https://git.heroku.com/pr-comment-bot.git
   85eeb18..0b8aa95  master -> master

C:\Users\Suriyaa\Downloads\pr-comment-bot>

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.