Also make runcmd and get_sources log what they do, to the admin log.
This originally comes from radicle-ci-ambient, the Radicle CI adapter
for Ambient.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
Also fix Db::remove_run, which has never actually worked, because the
run id column was named wrongly. Oops.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
Everything works, binary is just a bit bigger. To avoid duplicates
would require co-ordination between various parties in the dependency
graph, and while that'd be worthwhile, it's too much work for now.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
Can't do anything about it in this crate, the git-ref-format crate or
radicle-git-ext crate needs to change.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
Previously we imported the Oid type (for Git object identifiers)
different places. This was confusing, and also meant that upgrading a
dependency (radicle-git-ext) broke, because two types with the same
name imported from different versions of the same crate are different
types.
Change this so that radicle::git::Oid is the one true Oid type we use.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
The CI event contains a namespaced ref. The default branch we get
also. The CI broker filter configuration does not. Fix
src/filter.rs::is_default_branch to compare only the un-namespaced
branch names.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
The boolean operators "And", "Or", and "Not", all take a list of
filter expressions as operands. In normal boolean logic they take
two or one, and the list case can be a little confusing to read.
Introduce aliases "AllOf", "AnyOf", and "NoneOf". These are merely
aliases for the operators, with the exact same semantics.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
Change the logical negation operator `Not` to take a list of filters
as operands. The operator returns true, if and only if all of the
operands are false. The syntax is now consistent with logical `And`
and `Or`, which simplifies code, and is expected to simplify use.
In YAML syntax, `Not` now works like this:
~~~
!Not
- !Allow
~~~
Previously, `!Not` only had one operand, so that above would have been
expressed as `!Not Allow`.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
The `EventFilter::Not` variant would not correctly deserialize, resulting in the
following error:
deserializing nested enum in EventFilter::Not from YAML is not supported yet
This can be fixed by using `#[serde(with = "serde_yml::with::singleton_map")]`
on that variant.
A test case is provided to show that a `Not` case can be deserialized correctly.
The change also includes some improvements to `EventFilter`:
- Add `PartialEq` and `Eq` for testing equality in testing
- The `And` and `Or` variants do not need the `Box`, since the `Vec` acts as a
size pointer for the recursive `Self` – unlike the `Not` variant.
"cibtool trigger" option "--ref" defaults to "main" and "--commit" to
"HEAD", and there's no need to say those explicitly.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
The default doesn't change, but it's now called
`DEFAULT_QUEUE_LEN_INTERVAL` instead of `DEFAULT_MAX_RUN_TIME`.
Signed-off-by: Lars Wirzenius <liw@liw.fi>