Commit Graph
1000 Commits
Author SHA1 Message Date
Lars Wirzenius e57c1e1ed7 feat: add an admin log to msg::helper
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>
2025-03-05 09:07:30 +02:00
Lars Wirzenius 43306e1513 feat: output trigger event to stdout, file
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-03-04 18:43:57 +02:00
Lars Wirzenius fe9ffca3d2 feat: cibool run remove
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>
2025-03-04 17:43:05 +02:00
Lars Wirzenius e167d05e04 feat: msg::helper::runcmd takes a non-empty argv vector
This makes is the empty-argv mistake that much easier to avoid.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-03-04 12:14:29 +02:00
Lars Wirzenius 23ad83a969 chore(deny.toml): allow multiple versions
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>
2025-02-26 17:48:48 +02:00
Lars Wirzenius c7d4f192ea chore(deny.toml): drop unused allowed licenses
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-02-26 17:48:48 +02:00
Lars Wirzenius e9a4070b5b chore(deny.toml): ignore advisory: unmaintained proc-macro-error
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>
2025-02-26 17:48:48 +02:00
Lars Wirzenius c45291bc6a feat: use the same Oid type everywhere
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>
2025-02-26 17:41:08 +02:00
Lars Wirzenius 00ca0e8fcc feat: produce RSS feed of unfinished CI runs
That's CI runs that have been triggered, are running, but have not
finished.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-02-19 17:26:39 +02:00
Lars Wirzenius e69262d186 feat: add metadata about CI run to RSS feed entries
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-02-19 17:26:39 +02:00
Lars Wirzenius 0c5eaeb8fa doc(README.md): replace now-faulty examples with pointer to subplot
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-02-18 16:51:31 +02:00
Lars Wirzenius 08bcf70308 refactor: simplify patch related constructors for CiEvent
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-02-18 16:34:58 +02:00
Lars Wirzenius a01aa8ce49 doc(doc/userguide.md): add DefaultBranch, HasFile, NoneOf, AnyOf, AllOf
Also sort table alphabetically, for easier skimming.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-02-18 15:55:31 +02:00
Lars Wirzenius 3fffb2fcdc chore: prepare release 0.13.0
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-02-18 10:19:43 +02:00
Lars Wirzenius 2778011d40 trigger
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-02-17 14:45:41 +02:00
Lars Wirzenius 322766897a build(.radicle/ambient.yaml): reduce test threads
Having trouble getting this to pass CI.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-02-17 14:08:11 +02:00
Lars Wirzenius 2c0ef93a20 build(.radicle/ambient.yaml): don't build docs for dependencies
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-02-17 13:59:58 +02:00
Lars Wirzenius 918e24d90f build: drop CI spec for native CI adapter
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-02-17 13:14:04 +02:00
Lars Wirzenius 94b3de7385 fix: DefaultBranch event filter didn't work with namespaced refs
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>
2025-02-17 12:25:36 +02:00
Lars Wirzenius cfac437f3b feat: add more helper functions
The less these need to be duplicated between adapters, the better.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-02-06 16:29:56 +02:00
Lars Wirzenius 5a9fdb2a79 test: drop old release from upgrade tests
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-02-05 14:48:18 +02:00
Lars Wirzenius 9b35d11637 feat: clearer aliases for event filter boolean operators
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>
2025-02-04 19:25:48 +02:00
Lars Wirzenius 623e590c2c feat: HasFile event filter predicte
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-02-04 18:46:19 +02:00
Lars Wirzenius c7ae4fbb23 refactor: drop debug log messages
Not useful.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-02-04 18:38:14 +02:00
Lars Wirzenius 74097d6026 refactor(src/filter.rs): rename local variable to avoid typo
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-02-04 17:03:14 +02:00
Lars Wirzenius 2ef02467f8 feat: add predicate DefaultBranch
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-02-04 16:59:22 +02:00
Lars Wirzenius 14ad23cc83 feat: refuse configuration files with unknown fields
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-02-04 14:45:05 +02:00
Lars Wirzenius a3dbd8f8be feat: log event filter evaluation in more detail
This is a step towards making filters more transparent.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-01-31 11:52:02 +02:00
Lars Wirzenius f97b3da6de feat: log filter decision more clearly, at info level
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-01-31 11:24:58 +02:00
Lars Wirzenius 9e84afecbf feat! change the "Not" event filter to take a list of filters
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>
2025-01-30 15:36:57 +02:00
Fintan Halpenny 3edb0ed017 chore: rountrip property test for EventFilter
Introduce the use of the `qcheck` crate to generate examples of `EventFilter`,
so that a YAML roundtrip test can be added.
2025-01-30 15:00:54 +02:00
Fintan Halpenny d31347d179 fix: fix (de)serialization of EventFilter
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.
2025-01-30 15:00:54 +02:00
Lars Wirzenius d0c6a8c8c1 test(ci-broker.md): verify event filter Not
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-01-29 18:00:01 +02:00
Lars Wirzenius d97f1c6720 test(ci-broker.md): verify event filter Or
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-01-29 18:00:01 +02:00
Lars Wirzenius 42bded3825 test(ci-broker.md): verify event filter And
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-01-29 18:00:01 +02:00
Lars Wirzenius 28ee4580e0 test(ci-broker.md): verify event filter Deny
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-01-29 17:42:49 +02:00
Lars Wirzenius 568592aabc test(ci-broker.md): verify event filter Allow
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-01-29 17:42:49 +02:00
Lars Wirzenius e0a967af68 test(ci-broker.md): verify event filter BranchDeleted
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-01-29 17:42:49 +02:00
Lars Wirzenius 791b7cad6d test(ci-broker.md): verify event filter BranchUpdated
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-01-29 17:42:49 +02:00
Lars Wirzenius bb5cf1273a test(ci-broker.md): verify event filter BranchCreated
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-01-29 17:42:47 +02:00
Lars Wirzenius d1e9b5e159 test(ci-broker.md): verify event filter Branch
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-01-29 17:42:37 +02:00
Lars Wirzenius 59deeed8c1 test(ci-broker.md): verify event filter Node
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-01-29 17:41:37 +02:00
Lars Wirzenius 2ea38588ad test(ci-broker.md): verify event filter Repository
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-01-29 17:41:16 +02:00
Lars Wirzenius c4bae7b09b test(ci-broker.md): use cibtool trigger option defaults
"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>
2025-01-29 17:41:06 +02:00
Lars Wirzenius c045335b69 feat: make log message about patch COB not found clearer
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-01-29 17:41:06 +02:00
Lars Wirzenius d491111726 feat(src/config.rs): make the "env" field for an adapter optional
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-01-29 17:41:06 +02:00
Lars Wirzenius 88e7d75a59 refactor: make Config fields env, sensitive_env private
We already have getters so no other change.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-01-29 17:39:54 +02:00
Lars Wirzenius f65a5b83b3 tests: trim releases for upgrade testing
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-01-29 11:27:58 +02:00
Lars Wirzenius 64e76a97a8 chore: prepare release 0.12.0
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-01-29 11:08:29 +02:00
Lars Wirzenius 030a390159 fix(src/config.rs): use dedicated constant for default interval
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>
2025-01-29 10:50:59 +02:00