18 releases (breaking)

new 0.13.1 Mar 5, 2025
0.12.0 Jan 29, 2025
0.10.0 Dec 5, 2024
0.9.0 Nov 21, 2024
0.3.0 Jul 18, 2024

#204 in Build Utils

Download history 144/week @ 2024-11-17 14/week @ 2024-11-24 139/week @ 2024-12-01 61/week @ 2024-12-08 2/week @ 2024-12-15 247/week @ 2025-01-05 52/week @ 2025-01-12 113/week @ 2025-01-26 37/week @ 2025-02-02 14/week @ 2025-02-09 128/week @ 2025-02-16 15/week @ 2025-02-23 151/week @ 2025-03-02

310 downloads per month
Used in 3 crates (2 directly)

MIT/Apache and GPL-3.0-or-later

375KB
9K SLoC

radicle-ci-broker

Add integration to CI engines/systems/services to Radicle, a distributed git hosting and collaboration system.

This is not quite production ready code yet, but it will eventually become a thing that listens for changes in a Radicle node, and triggers CI on the relevant ones.

Architecture

See the doc directory for architecture documentation. Quick summary: the CI broker gets events from the Radicle node, filters them based on its own config, and for any event that gets past the filter, runs the configured adapter executable. The broker and adapter use a simple JSON based message protocol over stdin/stdout. Each CI system has its own adapter.

To build the documentation, run make in the doc directory. You'll need some tools installed: Pandoc, graphviz (dot), PlantUML, pikchr-cli. The others are widely packaged, pikchr-cli is a Rust crate, so you can install it with cargo install pikchr-cli

Build and publish the documentation like this:

RADICLE_CI_BROKER_WEBROOT=/tmp/ci make -C doc publish

Binaries

The crate contains several binaries:

  • cib --- the actual CI broker
    • this is the only one you need to care about, the rest are for debugging
  • cibtool --- management tool for node operators, for managing the CI broker
  • synthetic-events --- test tool for CI broker developers

Packaging

There is simple, simplistic, rudimentary, personal-use-only packaging for Debian in the debian directory, used by Lars to build packages for his own use.

Running from the source tree

To run cib or cibtool from the source tree:

cargo run --bin cib -- --config config.yaml process-events
cargo run --bin cibtool -- --db ci-broker.db event list

Note the -- argument. It tells cargo run that all the arguments that follow are to be passed to the program being run, and not used by cargo itself.

Running tests

To run the test suite for the CI broker:

cargo test

(The usual way, for a Rust program.)

In addition to the usual Unix command line tools, you need the following programs installed for the test suite:

  • jq
  • git
  • sqlite3
  • rad (from Radicle)
  • git-remote-rad (from Radicle)

Configuration

The configuration file is named on the command line. It is a YAML file. See ci-broker.md for examples. Those examples are verified to work every time the test suite runs.

Adapters

You need to use an "adapter" together with the CI broker to actually run CI on projects. At least the following adapters for external CI systems are known:

See also the radicle-ci-integrations-docs repository with guides for project maintainers and node operators about using Radicle CI. They too list CI adapters.

License

Radicle CI broker is distributed under the terms of both the MIT license and the Apache License (Version 2.0).

See LICENSE-APACHE and LICENSE-MIT for details.

Dependencies

~58–89MB
~1.5M SLoC