This is the smallest useful change to add structured logging. It adds
little useful logging, but builds a foundation for adding more useful
logging later, and for converging existing log messages to structured
one later.
Add some acceptance criteria for structured logging so that we do not
accidentally change the log messages we really, really care about.
Add dependencies on the slog and slog-json crates, which exist
precisely for structured logging.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
Depend on subplot-build and subplotlib 0.10.0, drop dependency on
fehler, add dependency on culpa, and bump MSRV to 1.77 to match
radicle and be sufficiently new for Subplot.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
As of right now, env_logger has last been updated five months ago,
pretty_env_logger a year ago. We need env_logger in our dependency
graph anyway, so it seems sensible to drop pretty_env_logger.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
Add a "counter" table, to enable a rudimentary concurrency test. Used
this to verify that multiple processes can safely update the same
database. Multi-process concurrency can result in temporary, short
lived lock conflicts in transactions: deal with this by re-trying for
a short duration.
Add a persistent event queue. Add methods to the Db type to deal with
counters and event queue.
Add a new error type to allow Db methods to return errors that do not
come from SQLite.
Restructure the internals a bit to make them easier for me to follow.
Prepare Cargo.toml for an upcoming change to add an integration and
acceptance testing suite. Update Cargo.lock as well. This commit
brings no functional changes.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
This means they won't vanish when the broker is restarted.
BREAKING CHANGE: the configuration files MUST now have a field "db"
that is a path to the database file to use. The file will be created
if needed.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
Instead of only a single JSON file, updated every so often, also
generate HTML pages that show CI broker status, and lists every
repository for which the broker has run CI.
This currently assumes the native CI adapter, but that can be fixed to
be more generic later.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
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.
feat: read configuration from a file
The configuration file specifies what adapters are available, and
environment variables to set for each, and the node event filtering
that is applied.
Signed-off-by: Lars Wirzenius <liw@liw.fi>