Commit Graph
64 Commits
Author SHA1 Message Date
Lars Wirzenius d96861408c fix: update status page atomically
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-02-20 09:41:28 +02:00
Lars Wirzenius 43b434fadd feat: allow config file to set a status page update interval
Default is now 10 seconds.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-02-20 09:36:01 +02:00
Lars Wirzenius 5d3aa44a92 feat: update status page in a background thread
Previously, we updated the status page only when we got a new broker
event, or after a CI run finished. This made it unsuitable as a "is
the broker alive?" service.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-02-19 20:54:47 +02:00
Lars Wirzenius 2dafe88a84 fix: list formatting
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-02-16 14:18:37 +02:00
Lars Wirzenius 729e054222 fix: formatting of list
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-02-16 14:16:44 +02:00
Lars Wirzenius 24fb53b395 docs: clarify wording
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-02-16 13:54:54 +02:00
Lars Wirzenius d6be37d7ee feat: update a status page, if configured
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-02-15 18:36:00 +02:00
Lars Wirzenius 15ddf5d0e7 chore: add deb packaging
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-02-12 12:17:22 +02:00
Lars Wirzenius ab5197b7e4 fix: use git dependency on radicle, drop features
With this, importing radicle::prelude::RepoId works for me again.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-02-08 17:24:32 +02:00
Lars Wirzenius 0e80ed89e2 fix: import RepoId from identity module
rust-analyzer gets confused for me when it's imported from prelude.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-02-05 13:26:19 +02:00
Lars Wirzenius b483ab914d style: add note to errors.rs about module specific error types
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-02-05 13:24:48 +02:00
Lars Wirzenius 1c87d349ef fix: if no adapter is available, print error message, don't give up
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-02-02 20:23:45 +02:00
Lars Wirzenius 9886cfd48b refactor(src/bin/ci-broker.rs): use new modules in main program
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-02-02 17:44:15 +02:00
Lars Wirzenius f298cc3ebd feat(src/lib.rs): allow use of new modules
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-02-02 17:43:59 +02:00
Lars Wirzenius 30ea57549e feat(src/error.rs): add errors from new modules
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-02-02 17:43:44 +02:00
Lars Wirzenius 7c562e1cbf feat(src/broker.rs): capture CI broker business logic
Implement a type to capture the business logic of the CI broker in a
way that is reasonable to test in isolation rather than as part of a
full Radicle network.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-02-02 17:42:38 +02:00
Lars Wirzenius 1c90e35cef feat(src/adapter.rs): run a CI adapter
Add module to represent a CI adapter and execute it. Add tests for a
variety of test cases.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-02-02 17:41:52 +02:00
Lars Wirzenius b096d9fb6f feat(src/run.rs): represent metadata about a CI run
This captures all the metadata about a CI run that the CI broker needs
to know. It can also be updated piecemeal.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-02-02 17:40:37 +02:00
Lars Wirzenius 13e2c2488e tests(src/msg.rs): use test helpers from test.rs
This simplifies the test code somewhat.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-02-02 17:39:46 +02:00
Lars Wirzenius c468331c10 feat(src/test.rs): add module with test helpers
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-02-02 17:39:30 +02:00
Lars Wirzenius fbd1911e2f feat(src/msg.rs): add a Response constructor from string slice
This will make it easier to process adapter output line by line.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-02-02 17:38:26 +02:00
Lars Wirzenius 1321c25f29 feat(src/msg.rs): add helpers to get repo, commit from Request
This relieves uses for a Request from having to unpack it with pattern
matching. The helpers are much more convenient, when they are sufficient.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-02-02 17:37:20 +02:00
Lars Wirzenius 84051a2f1d feat(src/msg.rs): make RunResult implement Eq
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-02-02 17:36:40 +02:00
Lars Wirzenius b53cf99e22 feat(src/msg.rs): set a uuid as the RunId by default
This will be useful for tests in a near-future commit.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-02-02 17:35:57 +02:00
Lars Wirzenius cd3c81222a refactor: Config::envs returns a ref to hashmap
This turns out to be more convenient in a near-future commit.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-02-02 17:34:31 +02:00
Lars Wirzenius 0b862ab0ed refactor: add a ConfigError type for config.rs
It's more tidy if every module has its own error type, to avoid
unnecessary coupling and tangling between modules.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-01-29 16:37:52 +02:00
Lars Wirzenius f31ac159e0 refactor: combine event.rs and filter.rs
The division of concerns between the two was artificial and unclear.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-01-29 16:18:13 +02:00
Lars Wirzenius de92f988b3 chore: drop src/bin/node-events.rs
filter-events.rs is almost identical, but a little bit more flexible.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-01-29 15:29:51 +02:00
Lars Wirzenius e43dfc9a98 chore: drop unused dummy-adapter.rs
I doesn't even work well as an example, as it's too simplistic.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-01-29 15:27:02 +02:00
Lars Wirzenius a6da02f852 refactor: move message related errors from error.rs to msg.rs
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-01-26 17:16:27 +02:00
Lars Wirzenius 833be8d0cc docs: add documentation comments for everything in msg.src
FIXMEs mostly now.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-01-26 15:33:13 +02:00
Lars Wirzenius fe08cb9248 fix: use `` to prevent placeholder from being interpreted as HTML
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-01-26 15:06:54 +02:00
jchrist c3d223d7fc feat(adapter): enrich adapter run context
Include context information to the adapter(s) about the trigger, distinguishing a trigger for a patch and a trigger for a push (possibly to a patch), according to the architecture.

Specifically, add push information for git pushes, including commit(s) and author.
For patches, add information about the specific patch that was updated, its revisions, along with the latest revision and the commits it includes.
2024-01-25 08:54:16 +02:00
Lars Wirzenius c7a2572e80 fix: adapt to radicle's Id->RepoId rename
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-01-23 17:21:21 +02:00
Lars Wirzenius a3a8a222a6 chore: add rust-toolchain 2024-01-23 17:08:26 +02:00
Lars Wirzenius da51901b85 fix: use std:io:Error for error type from node event subscription
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-01-15 12:08:57 +02:00
Lars Wirzenius c73447a745 fix: type of errors returned from node::subscribe
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-01-12 15:39:58 +02:00
Lars Wirzenius 4ffa6115e7 chore: drop useless example file 2024-01-02 08:30:18 +02:00
Michalis Zampetakis e11a62ead1 Fix some letter casing in doc/architecture.md 2023-12-22 13:28:35 +02:00
Lars Wirzenius 0c6ce32472 Merge branch 'patch/df4563f' 2023-12-18 20:07:39 +02:00
Yorgos Saslis a00212538b enriches broker request payload to enable complex workflows in external CI
Signed-off-by: Yorgos Saslis <yorgo@proton.me>
2023-12-18 19:42:39 +02:00
Yorgos Saslis 93654fa547 fixes config path
Signed-off-by: Yorgos Saslis <yorgo@proton.me>
2023-12-18 19:42:38 +02:00
Lars Wirzenius 77860a8c28 docs: explain about the config file and filters in README
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2023-12-18 19:41:01 +02:00
Lars Wirzenius b2862d2290 refactor(ci-broker): drop unused imports and other useless code
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2023-12-18 19:30:47 +02:00
Lars Wirzenius 43d1a0851b refactor(filter-events): drop unused imports and other useless code
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2023-12-18 19:30:25 +02:00
Lars Wirzenius 6c5012453e refactor: move config stuff into src/config.rs
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2023-12-18 19:19:39 +02:00
Lars Wirzenius a4047dc968 feat: more flexible filtering
Add filters on a specific branch, any patch, a specific branch, and
allow combining filters with AND, OR, NOT, and document the motivation
for each of these in requirements.md.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2023-12-18 18:58:36 +02:00
Lars Wirzenius 176235883e feat: add helper program to show events after filtering
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2023-12-18 18:58:36 +02:00
Lars Wirzenius c7153deb3f fix: rename binary to broker-messages
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2023-12-18 16:54:13 +02:00
Lars Wirzenius acfa963774 feat: add3d program to write out examples of JSON messages
These may change, so having code seems better than copy-pasting them
into static documentation.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2023-12-18 16:52:21 +02:00