Radish alpha
r
rad:zwTxygwuz5LDGBq255RA2CbNGrz8
Radicle CI broker
Radicle
Git
docs: Update with protocol version and failure response
Merged did:key:z6MkkpTP...arsB opened 2 years ago
1 file changed +8 -7 db73047f a8a99468
modified doc/architecture.md
@@ -129,7 +129,7 @@ code.
~~~{.sh .numberLines}
$ cargo run -q --bin broker-messages
Trigger request:
-
{"request":"trigger","event_type":"push","repository":{"id":"rad:zwTxygwuz5LDGBq255RA2CbNGrz8","name":"radicle-ci-broker","description":"Radicle CI broker","private":false,"default_branch":"main","delegates":["did:key:z6MkgEMYod7Hxfy9qCvDv5hYHkZ4ciWmLFgfvm3Wn1b2w2FV"]},"pusher":{"id":"did:key:z6MkgEMYod7Hxfy9qCvDv5hYHkZ4ciWmLFgfvm3Wn1b2w2FV","alias":"liw"},"before":"b4fb1e347be7db19f0859717062f94116b5bec9f","after":"b4fb1e347be7db19f0859717062f94116b5bec9f","branch":"patches/8d8232ddcb217fa1402eec4d955e227ef3bb5881","commits":[]}
+
{"request":"trigger","event_type":"push","version":<PROTOCOL_VERSION>,repository":{"id":"rad:zwTxygwuz5LDGBq255RA2CbNGrz8","name":"radicle-ci-broker","description":"Radicle CI broker","private":false,"default_branch":"main","delegates":["did:key:z6MkgEMYod7Hxfy9qCvDv5hYHkZ4ciWmLFgfvm3Wn1b2w2FV"]},"pusher":{"id":"did:key:z6MkgEMYod7Hxfy9qCvDv5hYHkZ4ciWmLFgfvm3Wn1b2w2FV","alias":"liw"},"before":"b4fb1e347be7db19f0859717062f94116b5bec9f","after":"b4fb1e347be7db19f0859717062f94116b5bec9f","branch":"patches/8d8232ddcb217fa1402eec4d955e227ef3bb5881","commits":[]}

Triggered response:
{"response":"triggered","run_id":{"id":"any-string-works-as-run-id"}}
@@ -139,9 +139,6 @@ Successful response:

Failure response:
{"response":"finished","result":"failure"}
-

-
Error response:
-
{"response":"finished","result":{"error":"error message\nsecond line"}}
~~~

## Push Event Request
@@ -152,6 +149,7 @@ An example request that the broker sends looks like this:
{
    "request": "trigger",
    "event_type": "push",
+
    "version":<PROTOCOL_VERSION>,
    "pusher": {
        "id": "did:key:z6MkltRpzcq2ybm13yQpyre58JUeMvZY6toxoZVpLZ8YabRa",
        "alias": "node_alias"
@@ -180,6 +178,7 @@ An example request that the broker sends looks like this:

where:

+
  - `<PROTOCOL_VERSION>` is the version of the protocol messages that broker exchanges
  - `<RID>` is the repository ID, in its `rad:` URN format,
  - `<BRANCH_NAME>` is the branch name where the push occurred,
  - `<AFTER_COMMIT>` is the commit id of the last commit being pushed,
@@ -197,6 +196,7 @@ An example request that the broker sends looks like this:
{
    "request": "trigger",
    "event_type": "patch",
+
    "version":<PROTOCOL_VERSION>
    "action": "created|updated",
    "patch": {
        "id": "<PATCH_ID>",
@@ -261,7 +261,8 @@ An example request that the broker sends looks like this:

where:

-
  - `<RID>` is the reposiatory ID, in its `rad:` URN format,
+
  - `<PROTOCOL_VERSION>` is the version of the protocol messages that broker exchanges
+
  - `<RID>` is the repository ID, in its `rad:` URN format,
  - `<AFTER_COMMIT>` is the commit id of the last commit being pushed,
  - `<BEFORE_COMMIT>` is the commit id of the **parent** of the first
    commit being pushed (i.e. ` <SOME_OTHER_COMMIT_BEING_PUSHED>`),
@@ -305,12 +306,12 @@ report pages.
The report pages are HTML, generated from the information in the
database. The broker loads information for all runs when it starts,
from the database, and then pushed information about new runs when
-
they happens. This avoids the broker having to read everything every
+
they happen. This avoids the broker having to read everything every
time it updates the report pages.

The report page generation is done in its own thread, separate from
the main thread of the CI broker. This allows the reporting to happens
-
independently from what the main thread is doing. In particular, it
+
independently of what the main thread is doing. In particular, it
means the main thread does not need to do anything to trigger reports
from being updated.