Previously, needed to use a full path, because of a type name clash.
Now that the clash is gone, we can import and use the name directly.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
After various previous changes, the PageBuilder::build now only calls
StatusPage::new, so there's no point in the type. Drop it.
Also replace StatusPage::new with StatusPage::default, for better
style.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
Co-worker reported that the unwrap of the optional adapter run id
triggered a panic for them.
Each run has a unique broker run id, and an optional, non-unique
adapter run id. Use the broker run id instead.
Actually, the whole PageBuilder type is now useless, but I'll tackle
that separately.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
Change the dummy adapter to read the trigger message from its stdin.
This prevents a race condition where the adapter exits before the CI
broker has time to write the trigger message to the adapter.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
To get this to work, I had to remove Cargo.lock and let it be
re-created:
rm Cargo.lock && cargo add radicle@0.13.0 radicle-git-ext@0.8.0 radicle-surf@0.22.0
Signed-off-by: Lars Wirzenius <liw@liw.fi>
The test suite didn't work on Macs. A fundamental problem was using
"sleep 0.1" to wait for a background process to do something: this is
never a good idea. Either the wait time is too short, resulting in
spurious test failures, or it's so long it makes test take
unnecessarily long. I should have known better. A better approach is
to loop for a sufficiently long time and check if the background
process has done its thing every so often, and stop looping when it
has.
There were some other, more incidental incompatibility problems too.
To fix all this, replace use of "nc", a common tool with many
incompatible variants, by adding a "client mode" to
synthetic-events.rs that connects to the daemon and closes the
connection neatly, then waits for the daemon to delete the socket.
Also, change how it does what it does so that it works both Linux and
Mac. This includes removing setting a read timeout that failed on Mac,
but doesn't seem to be necessary now.
Also, change synthetic-events to log more and more detailed messages
to aid remote debugging of test suite failures in the future. The
daemon logs errors from fallible operations, instead of discarding
them and terminating, and the client outputs the daemon log if the
client fails, while waiting for the daemon to remove the socket.
Finally, during the furious debugging, refactor the code into smaller
functions so its easier to understand when nothing makes sense.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
The CI broker now logs the standard error output of the adapter, and
the adapter exit status, to the broker's own log. The log messages
look like this:
{"msg":"adapter exit code","level":"DEBG","ts":"2024-08-27T17:38:26.762222386Z","exit_code":1}
{"msg":"adapter stderr","level":"DEBG","ts":"2024-08-27T17:38:26.762289242Z","stderr":"woe be me\n"}
Signed-off-by: Lars Wirzenius <liw@liw.fi>
Add a --json option to allow "cibtool event list" to output JSON, for
easier post-processing by other programs. Keep the --verbose, to avoid
making a breaking change, but hide it from --help output.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
When adding an event, via "cibtool event add" or "cibtool trigger",
verify the tool checks that the repository the event is for actually
exists. The check was already there, this just adds a verification
scenario for that.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
Change the radenv.sh script to use tilde expansion instead of getent.
Macs do not have a getent - that's a tool that's specific to glibc, so
it's mostly only available on Linux systems. But we don't need that:
Bash can do the expansion directly.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
Also change required Rust version to be 1.80. This matches heartwood,
but is also necessary for Subplot dependencies.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
Replace all use of log and env-logger crates with structured logging
using slog and slog-json.
Change the recently introduced logger module to use the slog-scope
crate. This avoids having to pass a reference to logger::Logging to
every place that needs to do any logging.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
Add a table of pending events in the event queue. except for ones for
private repositories.
The public queue allows people to have a idea of how long they will
have to wait for CI to run for their change.
The table leaks the event queue, commit IDs, branch names, and patch
IDs, but if that's a problem, we can make this a table configurable,
on a per node basis.