Coder Social home page Coder Social logo

oppiabot's Introduction

Oppiabot

Oppiabot is a GitHub app built with probot. It acts as a helper for the Oppia code repository to maintain the development workflow. It is hosted on Heroku.

Getting started

Please refer to the following instructions to setup Oppiabot for the first time on your machine:

  1. Create a new folder called opensource/ within your home folder (or use one that you already have). Navigate to it (cd opensource), then fork and clone the Oppiabot repo. This will create a new folder named opensource/oppiabot. Navigate to opensource/oppiabot/.

  2. Install Node.Js and NPM on your machine using the following commands:

    First check if you already have Node.js and NPM using:

    node -v
    npm -v

    If these commands show some versions, then you can jump to Point No. 3, else proceed in this point:

    Using Ubuntu

    curl -sL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
    sudo apt install -y nodejs

    Using MacOS

    sudo brew install node

    Using Windows

    Use WSL with Ubuntu and then follow the Ubuntu instructions.

  3. Setup probot and other dependencies by running the following command:

  npm install
  1. The Oppiabot uses environment variables. These are configured in the server settings. To deploy the bot locally, create a .env file and copy the contents of .env.example to it. You will need to adjust these variables accordingly following the instructions in the subsequent steps. Run following command to copy .env.example to .env

If you have Linux terminal type:

  cp .env.example .env
  1. Go to smee.io and click Start a new channel. Set WEBHOOK_PROXY_URL in .env to the URL that you are redirected to.

  2. Create a new GitHub App with:

    • GitHub App name: Use something like "My Oppiabot testing App"
    • Homepage URL: Use any random URL
    • Webhook URL: Use your WEBHOOK_PROXY_URL from the previous step.
    • Webhook Secret: development
    • Permissions & events The following permissions and events must be subscribed. If, for example, you only enable issue events, you will not be able to listen on pull request webhooks with the bot.

  1. Download the private key. It will be a .pem file. Move it to the root directory of the project. As long as it's in the root directory, it will be automatically detected regardless of the filename.

Make sure you remove

PRIVATE_KEY=example_private_key

from .env file, Otherwise app will not work locally.

  1. Edit .env and set APP_ID to the ID of the app you just created and also WEBHOOK_SECRET to development. The App ID can be found in your app settings page here.

Installing the bot on a repository

You'll need to identify a target repository and install the bot by clicking the Install button on the settings page of your app, e.g https://github.com/settings/apps/my-oppiabot-testing-app/installations. In the .env file put your github account name in WHITELISTED_ACCOUNTS and also add your repository (name in small caps) in the constants.js file locally.

Running the bot locally

You are now ready to run the bot on your local machine. Run npm run dev to start the server. The dev script will start the bot using nodemon, which will watch for any files changes in your local development environment and automatically restart the server.

Other available scripts

npm start to start the bot without watching files.

Debugging

Always run npm install and restart the server if package.json has changed. To turn on verbose logging, start server by running: LOG_LEVEL=trace npm start. Run npm test to run all the tests locally.

Support

If you have any feature requests or bug reports, please log them on our issue tracker.

Please report security issues directly to [email protected].

License

The Oppiabot code is released under the Apache v2 license.

oppiabot's People

Contributors

apb7 avatar jameesjohn avatar ankita240796 avatar kevinlee12 avatar gp201 avatar vojtechjelinek avatar nlok5923 avatar anandwana001 avatar naman-1234 avatar riyasingh1004 avatar mridul-netizen avatar harshkhilawala avatar seanlip avatar 462702985 avatar krishnarao22 avatar saeb-ai avatar winnie368c 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.