Skip to content

upteran/gitlab-review-slap-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Review Bot

A Telegram bot for managing code reviews with GitLab and Jira integration.

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/review-bot.git
cd review-bot
  1. Create and activate virtual environment:
# For Unix/macOS
python -m venv venv
source venv/bin/activate

# For Windows
python -m venv venv
.\venv\Scripts\activate
  1. Install dependencies:
pip install -e .
  1. Copy .env.example to .env and fill in your credentials:
cp .env.example .env
# Edit .env with your favorite text editor

Running the bot

python -m bot.main

Environment Variables

  • TELEGRAM_TOKEN: Your Telegram bot token from @BotFather
  • GITLAB_URL: GitLab instance URL (e.g., https://gitlab.com)
  • GITLAB_TOKEN: Your GitLab personal access token
  • JIRA_URL: Your Jira instance URL
  • JIRA_USER: Jira username (email)
  • JIRA_TOKEN: Jira API token
  • DB_PATH: (Optional) Path to SQLite database file

Now, here are the step-by-step instructions to install and run the bot:

  1. First, make sure you have Python 3.7 or higher installed:
python --version
  1. Create and navigate to project directory:
mkdir review_bot
cd review_bot
  1. Create all the files as shown in the structure above with the code we've written previously.

  2. Create and activate virtual environment:

# For Unix/macOS
python -m venv venv
source venv/bin/activate

# For Windows
python -m venv venv
.\venv\Scripts\activate
  1. Install the project in editable mode:
pip install -e .
  1. Create and configure your .env file:
cp .env.example .env
# Edit .env with your credentials
  1. Run the bot:
python -m bot.main

To test if the bot is working:

  1. Open Telegram
  2. Find your bot using the username you created with @BotFather
  3. Send the /start command
  4. Try registering with /register

Common troubleshooting:

  1. If you get import errors, make sure you're running from the correct directory and the virtual environment is activated
  2. If the bot doesn't respond, check your TELEGRAM_TOKEN
  3. If you get database errors, check if the DB_PATH directory is writable
  4. For GitLab/Jira integration issues, verify your API tokens and permissions

Would you like me to explain any part in more detail or help with specific issues?

About

gitlab auto review assign telegram bot

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages