Oops. Brown paper bag moment.
This undoes the type mangling to ensure the field value is never zero,
in favor of doing run time logic. That should be done with types some
day, but today I need to get running.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
I didn't like having asserts, and didn't want debug_asserts. With
plain asserts, the program would have panicked. With debug_asserts, the
program would have silently overwritten the item in the queue.
Instead, change the method to return whether it was able to set, and
have the caller cope with not being able to set. The caller needs to
be able handle that (and was already doing so).
Found-by: Fintan
Signed-off-by: Lars Wirzenius <liw@liw.fi>
Have just one component description, instead of separating "external"
and "native CI". Native CI doesn't need t be mentioned anyway.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
Feed child process stdin via a temporary file. This is simpler than
opening a pipe and spawning a thread that feeds the pipe, when it's
not full.
Capture child stderr into a buffer without trying to let the
caller (another thread) process it line by line. We don't seem to have
use for that, and this simplifies things a fair bit.
Simplify the capture of child stdout to use a simpler thread and data
structure, compared to the previous multi-thread setup. Splitting
stdout into lines is now done by the thread that consumes the lines,
making the code that captures it simpler.
Also update the timeout subcommand to work with the changes. Other
callers of this code aren't yet updated.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
This will be useful for inter-thread synchronization in situations
where the producer thread should not produce anything until at least
one consumer is ready for it.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
This doesn't yet affect anything, but it's a step towards implementing
concurrent adapters. The default is 1, which will be no change from
previous behavior, once I add support.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
Got confused here, where I did not know if what was referred was the
normal node or the CI node.
Also, "seed node" is used elsewhere to refer to nodes which need to
remain online.
I previously installed Radicle from a `deb`, which meant `rad` is in
`/usr/bin`, and thus in the default `$PATH`. But now I install it with
the Radicle installer, and need to add `/root/.radicle/bin` to `$PATH`.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
For Rust 1.80 compatibility. radicle-ci-broker uses 1.80 because it
depends on heartwood that uses 1.80 and I've had radicle-ci-broker
fail to compile if the two use different versions: cargo fails to find
a compatible sqlite crate.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
Make TagName into a new type (struct), instead of a type alias for
RefString. This provide stronger type safety, for the cost of a little
more implementation work. For the needs of the CI broker, that's two
methods and two trait impls.
Signed-off-by: Lars Wirzenius <liw@liw.fi>