aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
blob: e3be99851d7ba95c9ac59773e3fdc00d19714729 (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
# QtWaylandBot

## Purpose

The QtWaylandBot is a webhook service designed to monitor Gerrit for changes to the `qt/qtbase`
repository on the `dev` branch. Its primary function is to identify changes that modify
Wayland-related files and include "Pick-to:" targets for Qt versions 6.9 or older.

## Actions

When a relevant patchset is created that meets these criteria:

1. Targets the `qt/qtbase` project.
2. Is on the `dev` branch.
3. The change status is `NEW`.
4. Modifies files matching Wayland-specific patterns (e.g., in `/wayland/`, `/qtwaylandscanner/`).
5. The commit message contains a "Pick-to:" footer.
6. At least one of the "Pick-to:" targets is for Qt version 6.9 or an earlier version.

The bot will:

* Post a comment to the Gerrit change with `Sanity-Review: -1`.
* The comment will explain that Wayland-related changes targeting these older versions must be
    manually backported to the standalone `qt/qtwayland` repository.

If errors occur during processing, and a Microsoft Teams error webhook URL is configured,
the bot will send a notification to the specified Teams channel.

## Configuration

The bot is configured using environment variables:

* `QTWAYLANDBOT_GERRIT_USERNAME`: (Required) The username for Gerrit authentication.
* `QTWAYLANDBOT_GERRIT_PASSWORD`: (Required) The password or HTTP token for Gerrit authentication.
* `QTWAYLANDBOT_PORT`: (Optional) The port on which the bot's web server will listen.
    Defaults to `8089`.
* `QTWAYLANDBOT_TEAMS_ERROR_WEBHOOK_URL`: (Optional) The webhook URL for a Microsoft Teams channel
    where error notifications should be sent. If not set, error messages are only logged.
* `QTWAYLANDBOT_TEAMS_WEBHOOK_URL`: (Optional) General Teams webhook URL (currently not used for
    specific notifications by the bot but available in config).

## Running the Bot

The bot runs as an asynchronous web server. It is typically deployed as a system service. An example
systemd service file (`qtwayland_bot.service`) is provided, which demonstrates how to run the
bot using `pipenv`.

The bot listens for HTTP POST requests (typically from Gerrit webhooks) on its root path (`/`)
and provides a status endpoint at `/status`.