DevMate
is your friendly assistant for managing repositories. From tagging issues to adding comments, DevMate
streamlines collaboration and helps developers stay organized. Whether you're handling pull requests, tracking bugs, or reviewing code, DevMate
is here to make your workflow smoother and more efficient.
To install DevMate
, first install the required dependencies:
pip install -r requirements.txt
Before using DevMate
, make sure to configure the following environment variables to integrate with GitLab and the RAG system. These variables allow DevMate
to interact with your GitLab repository and generate comments and labels for issues.
- GITLAB_API_TOKEN: The API token for authenticating with the GitLab API.
- GITLAB_API_BASE_URL: The base URL of your GitLab API instance.
- RAG_API_TOKEN: The API token for authenticating with the RAG system, which helps generate comments and labels for issues.
- RAG_URL: The URL of the RAG service that assists in generating the comments and labels.
You can set these variables in your .env file or directly in your environment:
export GITLAB_API_TOKEN="your_gitlab_api_token"
export GITLAB_API_BASE_URL="https://gitlab.com"
export RAG_API_TOKEN="your_rag_api_token"
export RAG_URL="https://rag_service_url"
To enable DevMate
to receive issue events from GitLab, you need to set up a webhook in your GitLab project. This webhook will send issue events to your local server or production environment.
Navigate to your GitLab project and go to Settings > Webhooks.
Add the public URL of your running server (e.g., the URL generated by Ngrok, see below) as the URL for the webhook + /issues/webhook
.
Select the Issues events checkbox to ensure that GitLab sends issue-related events to your webhook.
Save the webhook settings. Now, every time an issue event occurs (e.g., a new issue is created or an issue is updated), GitLab will send the corresponding event to DevMate
.
Once you have set up everything, you can start DevMate
by running the following command:
make run
This command will start the DevMate
application and make it ready to receive issue events and interact with the GitLab API.
To receive real traffic from GitLab, you can use Ngrok, which allows you to expose your local server to the internet. Follow these steps:
-
Install Ngrok by downloading it from the official website and extracting the binary.
-
Start Ngrok by running the following command:
ngrok http <port-number>
Replace port-number
with the port your Go application is running on. By default, 8080
.
Ngrok will generate a public URL (e.g., http://random-string.ngrok-free.app
).