A Telegram bot for managing code reviews with GitLab and Jira integration.
- Clone the repository:
git clone https://github.com/yourusername/review-bot.git
cd review-bot
- 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
- Install dependencies:
pip install -e .
- Copy
.env.example
to.env
and fill in your credentials:
cp .env.example .env
# Edit .env with your favorite text editor
python -m bot.main
TELEGRAM_TOKEN
: Your Telegram bot token from @BotFatherGITLAB_URL
: GitLab instance URL (e.g., https://gitlab.com)GITLAB_TOKEN
: Your GitLab personal access tokenJIRA_URL
: Your Jira instance URLJIRA_USER
: Jira username (email)JIRA_TOKEN
: Jira API tokenDB_PATH
: (Optional) Path to SQLite database file
Now, here are the step-by-step instructions to install and run the bot:
- First, make sure you have Python 3.7 or higher installed:
python --version
- Create and navigate to project directory:
mkdir review_bot
cd review_bot
-
Create all the files as shown in the structure above with the code we've written previously.
-
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
- Install the project in editable mode:
pip install -e .
- Create and configure your .env file:
cp .env.example .env
# Edit .env with your credentials
- Run the bot:
python -m bot.main
To test if the bot is working:
- Open Telegram
- Find your bot using the username you created with @BotFather
- Send the
/start
command - Try registering with
/register
Common troubleshooting:
- If you get import errors, make sure you're running from the correct directory and the virtual environment is activated
- If the bot doesn't respond, check your TELEGRAM_TOKEN
- If you get database errors, check if the DB_PATH directory is writable
- 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?