blob: 3e9c8acb5df1265049264baaff0824e9e9b45b26 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
**Qt API Review Bot**
**What is this?**
This is a bot designed to evaluate changes in the Qt public API by analyzing diff files and
identifying significant changes that may require review. The bot uses a Large Language
Model (LLM) provided by OpenAI to classify changes as either significant or insignificant.
This bot is a supplement to the existing API Review process which uses other scripts
to generate a collection of interesting changes for each module for review, immediately
prior to release.
**How does it work?**
1. The bot listens for webhook events on the Gerrit Code Review system.
2. When a new comment is added to a change, the bot processes the diff file and
evaluates each changed file.
3. For each file, the bot uses the LLM to analyze the diff and determine whether the changes
are significant or insignificant.
4. The bot generates a summary of the significant changes and posts a comment on the Gerrit
review page with the results.
**Installation**
1. Clone this repository.
2. Install dependencies: `npm install`
3. Modify the `config.json` file with the following contents:
```json
{
"gerritUsername": "your-gerrit-username",
"gerritPassword": "your-gerrit-password",
"webhook_port": 8091,
"azureKey": "your-openai-api-key",
"deploymentId": "",
"deploymentId35": ""
}
```
Replace `your-gerrit-username`, `your-gerrit-password`, and `your-openai-api-key` with your
actual Gerrit credentials and OpenAI API key.
**Running the bot**
1. Start the bot by running: `node api_review_GPT.js`
2. The bot will start listening for webhook events on the specified port.
**Notes**
* Webhooks from gerrit are configured server-side by gerrit-admin@qt-project.org
* The bot uses an LLM to determine whether a change is significant or not. False positives
or false negatives may occur.
|