Commit Graph
33 Commits
Author SHA1 Message Date
Lars Wirzenius 402d58eea0 feat: start adding structured logging to cib
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>
2024-08-14 18:48:26 +03:00
Lars Wirzenius a80ab49d7d chore: bump dependency on html-page crate 2024-08-08 17:53:40 +03:00
Lars Wirzenius 8ee42c7cc2 chore: switch from serde-yaml to serde-yml
serde-yml is maintainted, serde-yaml isn't.
2024-08-08 17:52:16 +03:00
Lars Wirzenius 2d4bf57936 chore: depend on current release version of Subplot
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>
2024-07-29 12:02:24 +03:00
Lars Wirzenius 912347a564 chore: bump dependency on radicle to 0.12.0
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-29 11:55:47 +03:00
Lars Wirzenius a3953e4b95 refactor: use env_logger instead of pretty_env_logger
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>
2024-07-22 13:11:42 +03:00
Lars Wirzenius 285047d5a5 chore: bump version to 0.3.0, for release
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-18 17:55:13 +03:00
Lars Wirzenius fbb123d953 docs: add help for all subcommands and options
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-16 20:38:37 +03:00
Lars Wirzenius d4e4091509 add dep on env_logger
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-03 18:01:13 +03:00
Lars Wirzenius 1386c94189 feat: rewrite database abstraction
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.
2024-07-02 19:55:35 +03:00
Lars Wirzenius 96499aa1ba chore: bump version number
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-06-06 18:08:28 +03:00
Lars Wirzenius e16308414b chore: update dependency on radicle to 0.11.0
Small fixes to adapt to API changes in the radicle crate.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-06-06 14:39:45 +03:00
Michalis Zampetakis 8adca82fe3 Change the way that the broker perceives a patch
Instead of checking for changes in patch cob, check if push is at
`/refs/heads/patches/`.

Adds AnyPushRef filter.
2024-05-23 21:15:43 +03:00
Lars Wirzenius f837f29ce4 chore: update Cargo.lock 2024-05-20 17:30:49 +03:00
Lars Wirzenius 89beb82a5a chore: cargo update 2024-05-13 07:40:56 +03:00
Lars Wirzenius defea3a784 chore: add dependencies and update Cargo.lock
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>
2024-05-07 19:01:29 +03:00
Lars Wirzenius 9085ada0db chore: update to html-gen API changes
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-04-11 09:37:56 +03:00
Lars Wirzenius 5d7efc43fa chore: cargo update
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-04-03 09:37:46 +03:00
Lars Wirzenius 68fd1877e6 chore: depend on the radicle crate via crates.io
If nothing else, this is necessary for publishing the broker to
crates.io.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-03-31 11:22:36 +03:00
Lars Wirzenius 23be5b2133 feat! make list of CI runs in broker be persistent
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>
2024-03-06 19:36:26 +02:00
Lars Wirzenius f0cb3d2944 fix: call to create patch in test to use COB cache
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-03-04 19:01:41 +02:00
Lars Wirzenius 7861fdff9e fix: update Cargo.lock to drop radicle-native-ci
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-03-04 18:50:13 +02:00
Lars Wirzenius 443bf0b184 feat! generate HTML report pages
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>
2024-03-04 16:43:51 +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 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
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 b4fb1e347b This is a combination of 2 commits.
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>
2023-12-14 20:18:21 +02:00
Lars Wirzenius af03df8517 chore: drop anyhow in favor of just thiserror
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2023-12-14 16:11:33 +02:00
Lars Wirzenius 46e3afad6b chore: "cargo update" to update Cargo.lock
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2023-12-14 11:39:43 +02:00
Lars Wirzenius a9baf73eb6 chore: set radicle to use a git repository instead of file path
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2023-12-14 11:34:25 +02:00
Lars Wirzenius 87b93de078 feat: add start of CI broker, and helper programs
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2023-12-06 17:49:56 +02:00