digitaloceanforpoosd / ladybug

Bug Localization Copy
0 stars 0 forks source link

Ladybug Documentation

Ladybug is a project that integrates a Probot GitHub bot with a Flask backend to automate bug localization in your repositories. This guide provides step-by-step instructions to set up and run both components locally.


Table of Contents


Overview

Ladybug automates bug localization by triggering an analysis whenever a new issue is created in your GitHub repository. The Probot bot listens for new issues, and the Flask backend processes the issue data to provide bug localization results.


Prerequisites


Setup

Flask Backend Setup

Initialize Virtual Environment

Create a virtual environment to manage Python dependencies:

python -m venv myenv

Activate the virtual environment:

Install Dependencies

pip install -r requirements.txt

Run the Backend

Navigate to the backend directory and start the Flask application:

cd backend
python index.py

Probot Bot Setup

Install Dependencies

Navigate to the Probot directory and install the necessary npm packages:

cd ../probot
npm install

Create a GitHub App

  1. Start the Bot Setup

    npm start
  2. Register a New GitHub App

    • Follow the prompts in the terminal.
    • You'll be directed to GitHub to register a new GitHub App.
    • Important: When setting up the app, grant access only to the specific repository you intend to use. Do not select all repositories.
  3. Configure Webhooks and Permissions

    • Set the required webhook URLs and permissions if instructed.
    • The setup process will automatically configure your environment variables.

Run the Bot

After setting up the GitHub App, restart the bot to apply the changes:

npm start

Usage

With both the backend and bot running:


Additional Commands

Installing New Python Packages

To add new packages to the Flask backend:

pip install <package-name>
pip freeze > requirements.txt

Deactivating the Virtual Environment

After you're done working:

deactivate

Troubleshooting