Skip to content

Commit 9c194a7

Browse files
committed
docs(amqp): cover usage examples of amqp and slack integration
Includes: - What openQA publishes - shortly describes slacky integration - real event body as examples Anything else seems is provided by linked references, so no need to be verbose. Issue: https://progress.opensuse.org/issues/190737 Signed-off-by: Ioannis Bonatakis <ybonatakis@suse.com>
1 parent 654d76e commit 9c194a7

1 file changed

Lines changed: 50 additions & 0 deletions

File tree

docs/Installing.asciidoc

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,6 +1100,56 @@ topic_prefix = suse
11001100

11011101
For a TLS connection use `amqps://` and port `5671`.
11021102

1103+
The message topic follows the format `SCOPE.APPLICATION.OBJECT.ACTION`, for
1104+
example `opensuse.openqa.job.done` or `opensuse.openqa.comment.create`.
1105+
The `topic_prefix` setting controls the `SCOPE` part; if left empty the topic
1106+
starts with `openqa.` directly.
1107+
Consumers can use `#` to match any number of words or `*` to match exactly one
1108+
word. `suse.openqa.#` subscribe to all openQA events, for instance.
1109+
1110+
Here is what events are triggerred and published by openQA per Topic:
1111+
1112+
1. `openqa.job.create` when A job is created
1113+
2. `openqa.job.delete` when A job is deleted
1114+
3. `openqa.job.cancel` when A job is cancelled
1115+
4. `openqa.job.restart` when A job is restarted or duplicated
1116+
5. `openqa.job.update_result` when A job result is updated
1117+
6. `openqa.job.done` when A job finishes
1118+
1119+
Job event bodies include the job settings (e.g. `BUILD`, `TEST`, `ARCH`,
1120+
`MACHINE`, `FLAVOR`, asset fields like `ISO` or `HDD_1`) plus `id`, `group_id`,
1121+
and `remaining` (number of pending jobs for the same build). Finished jobs
1122+
additionally include `result`, `reason`, `newbuild`, `failedmodules`, `bugref`,
1123+
and `bugurl` (only present when a bug reference exists).
1124+
1125+
Example (at the time of writing) `suse.openqa.job.done` message body:
1126+
1127+
[source,json]
1128+
--------------------------------------------------------------------------------
1129+
{"ARCH":"x86_64","BUILD":"N.487.1","FLAVOR":"Staging-DVD","ISO":"openSUSE-Staging:N-Tumbleweed-DVD-x86_64-Build487.1-Media.iso","MACHINE":"64bit","TEST":"autoyast_mini","bugref":null,"failedmodules":[],"group_id":2,"id":5735489,"newbuild":null,"reason":null,"remaining":13,"result":"passed"}
1130+
--------------------------------------------------------------------------------
1131+
1132+
comments which are also published and are self-explanatory too:
1133+
1134+
1. `openqa.comment.create`
1135+
2. `openqa.comment.update`
1136+
3. `openqa.comment.delete`
1137+
1138+
Comment event bodies include: `id`, `job_id`, `group_id`, `parent_group_id`,
1139+
`user`, `text`, `created`, `updated`.
1140+
1141+
Example `suse.openqa.comment.create` message body:
1142+
1143+
[source,json]
1144+
--------------------------------------------------------------------------------
1145+
{"created":"2026-03-11T14:35:23Z","group_id":null,"id":865726,"job_id":5735489,"parent_group_id":null,"text":"amqp sent","updated":"2026-03-11T14:35:23Z","user":"demo"}
1146+
--------------------------------------------------------------------------------
1147+
1148+
A real-world example of an AMQP consumer built on top of openQA events is
1149+
https://github.com/dirkmueller/slacky[slacky], a bot that monitors CI/build
1150+
pipelines and posts failure notifications to Slack. It subscribes to openQA job
1151+
events and tracks job results per build group.
1152+
11031153

11041154
=== Configuring worker to use more than one openQA server
11051155

0 commit comments

Comments
 (0)