Commit Graph
652 Commits
Author SHA1 Message Date
Lars Wirzenius d1e28dcd8a docs(README.md): add link to the Ambient adapter
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-05-13 09:38:37 +03:00
Arnaud Bailly d90b609b41 doc: link doc/ directory from README 2025-05-13 09:00:51 +03:00
Tshepang Mbambo 0e746060fe process-events help: add missing space 2025-05-13 08:59:38 +03:00
Tshepang Mbambo 1d4442d42f avoid confusing terminology
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.
2025-05-13 08:58:27 +03:00
Tshepang Mbambo b80a97d146 typo 2025-05-02 23:55:09 +02:00
Lars Wirzenius 22451b4b3a refactor: drop unused Broker::all_runs method
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-05-02 12:22:35 +03:00
Lars Wirzenius 768af45e7e chore: prepare release 0.16.0
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-04-17 17:31:01 +03:00
Lars Wirzenius 8d7989cc6a Revert "fix: "cibtool run list" shows ids without loading run info"
This reverts commit 900a457157.
2025-04-17 17:04:46 +03:00
Lars Wirzenius d035b4fd8d ci(.radicle/ambient.yaml): add Radicle bin directory to path
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>
2025-04-17 14:02:21 +03:00
Lars Wirzenius dafd585a30 doc(README.md): drop obsolete disclaimer
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-04-10 17:06:57 +03:00
Lars Wirzenius 9f0adbdc58 fix(debian/rules): run "cargo install" with --locked
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-04-09 08:47:02 +03:00
Lars Wirzenius 4e99a74674 chore(Cargo.lock): update to use specific dependencies
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>
2025-04-09 08:32:19 +03:00
Lars Wirzenius 15058d3d7f chore(Cargo.lock): cargo update 2025-04-09 07:46:33 +03:00
Lars Wirzenius 904f4bb249 refactor: make a proper new type for TagName
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>
2025-04-07 16:02:03 +03:00
Lars Wirzenius 0bda319b54 refactor: add a TagName type alias
Slightly better self-documentation in code, even if not actually
stronger typing.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-04-07 16:02:03 +03:00
Lars Wirzenius 765e6b606c fix: "cibtool run remove" removed only by broker run id by default
We need to parse the run info in the database as JSON to get at the
adapter run info. This fails if the run info can't be parsed. That can
happen if the database has run info from a development version. Change
`cibtool run remove` so that it takes only broker run ids by default
so that we can delete using those even if the run info is broken.
Allow removing by adapter run id with the `--adapter` option.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-04-07 15:35:47 +03:00
Lars Wirzenius 900a457157 fix: "cibtool run list" shows ids without loading run info
If the run info can't be parsed as JSON, loading it will fail. Change
`cibtool run list` so that it only lists the run ids by default.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-04-07 15:34:57 +03:00
Lars Wirzenius 756d7ac81d fix: Subplot step to run git in sub directory
Subplot's Rust lib/runcmd library currently sets HOME to the directory
in which a command is run. If the step is "when I run, in foo, git",
then git is run with HOME set to point to the sub-directory foo under
the per-scenario data directory. I suspect this is a bug in Subplot,
but until that is confirmed and fixed by Subplot, and the fix included
in a release, we can avoid that by running "env -C foo git" instead.
This has the effect of changing the working directory to foo before
running git, without affecting any environment variables, which is
what we want.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-04-04 15:00:38 +03:00
Lars Wirzenius 6ec75d1978 doc(doc/userguide.md): document new tag events and filters
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-04-04 11:51:04 +03:00
Lars Wirzenius a7d02c18c4 feat: make Tag event filter take a regular expression
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-04-04 11:42:11 +03:00
Lars Wirzenius b783ef65d7 feat: events for created, updated, deleted Git tags
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-04-04 10:59:07 +03:00
Lars Wirzenius daa73ab7c2 refactor: use new Git ref parser to simplify from_node_event constructor
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-04-02 19:51:22 +03:00
Lars Wirzenius 504f13262c feat(src/ci_event.rs): add parser for Git refs for patch, branch, tag
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-04-02 19:21:05 +03:00
Lars Wirzenius 6dc057e27f doc: add a "Getting started" section to the user guide
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-03-31 15:46:41 +03:00
Lars Wirzenius 7cab201b41 feat: version number now includes Git commit short id
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-03-31 15:04:06 +03:00
Lars Wirzenius 5a83c3d9d4 chore: prepare release 0.15.1
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-03-26 08:40:42 +02:00
Lars Wirzenius 5038769a41 feat(src/msg.rs): allow logging to stderr in AdminLog
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-03-26 07:56:43 +02:00
Lars Wirzenius 68a7a596bf feat: if Adminlog is null, don't log to stderr either
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-03-25 16:35:20 +02:00
Lars Wirzenius 19575f49f2 chore: prepare release 0.15.0
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-03-25 08:37:07 +02:00
Lars Wirzenius 2450f7b764 feat: log a warning if report directory does not exist
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-03-25 08:31:19 +02:00
Lars Wirzenius 33b4b65b0f fix(src/pages.rs): if report dir does not exist, silently do nothing
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-03-24 18:11:36 +02:00
Lars Wirzenius 88d819d556 fix(src/bin/cib.rs): log failure of page updater thread
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-03-24 18:07:38 +02:00
Lars Wirzenius 29c37f9095 test(ci-broker.md): add scenario to run cib without a report dir
We want to make sure this works.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-03-24 18:05:06 +02:00
Lars Wirzenius 47fc131186 feat: log thread start/end at info level normally
This makes them more obvious than at the debug level. These are not
messages that repeat, so they won't be log spam.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-03-24 18:02:19 +02:00
Lars Wirzenius 192af400ed feat(src/logger.rs): report thread ending with error at error level
Previously, errors were reported at debug level. The error level makes
errors more obvious.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-03-24 17:57:34 +02:00
Lars Wirzenius bcbd2ffcfa chore: prepare release 0.14.0
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-03-24 12:31:05 +02:00
Lars Wirzenius 6e0d8853d0 fix(src/ci_event.rs): don't error if namespaced ref is not branch
When we get a CI event, we parse the namespaced name in the event to
see if it's a patch, or branch update. However, if might not be a
either: it might, for example, be a sigrefs update. Create a
branch event only if it's a branch event. Previously we would assume
it's branch event if not a patch event, and return an error if it's
not actually a branch.

If it's not a patch or branch change, ignore the event, as there's
nothing useful we can do about it, at least for now.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-03-24 11:42:27 +02:00
Lars Wirzenius 041e736a23 feat: when CI event source closes, log the error
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-03-24 11:40:02 +02:00
Lars Wirzenius 6ef5675a2a feat: reduce log spam
Don't log unstructured messages from various places in processing
events and the execution of a CI run. I think these are unnecessary
messages anyway, by now. If it turns out we need them, we'll add them
back as structured log messages.

Drop the now-unused logger::debug, debug2, trace, and trace2
functions, may the never return.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-03-24 11:37:59 +02:00
Lars Wirzenius 3e51c02d04 feat: make event queue processing use structured log messages
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-03-24 11:37:16 +02:00
Lars Wirzenius e17b467b37 fix(src/queueproc.rs): always drop a picked event from queue
Previously, we might not remove the event from the queue if something
went wrong while processing it. This could result in the CI broker
picking again in the future, and it might fail again, and repeat ad
nauseam.

It's better to remove the event from the queue at once, and log any
problems while processing it, and let humans deal with failures, and
decide if re-processing is needed.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-03-24 11:34:25 +02:00
Lars Wirzenius 11bb07ddf7 feat: always log thread start and result for page updating thread
This means that even if the thread ends due to an error, the error
gets logged. This will help with diagnosing problems.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-03-24 11:34:25 +02:00
Lars Wirzenius fb03457460 feat: always log the start and end result in the queueproc thread
This means that even if the thread ends due to an error, the error
gets logged. This will help with diagnosing problems.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-03-24 11:34:25 +02:00
Lars Wirzenius 923a4f1637 feat: always log thread start, end, result of queueadd thread
This means that even if the thread ends due to an error, the error
gets logged. This will help with diagnosing problems.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-03-24 11:34:23 +02:00
Lars Wirzenius b73d00df9d refactor: drop unused function ci_event_source_eof
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-03-24 11:30:56 +02:00
Lars Wirzenius c22a12f085 feat: add a "kind" field to log messages that don't have it
Only queueproc_filter_decision and queueproc_filter_predicate seemed
to be missing it.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-03-24 11:30:56 +02:00
Lars Wirzenius 0d1d3291cc fix: use new Git refs module, fix bugs found
This is a huge change, but it's mostly a few kinds of similar changes
in a lot of places. Unfortunately, they were not easy to tease apart
into small, easily reviewed commits.

Use the Git ref types created by the new refs module. Fix problems
this exposes.

The CiEvent enum variants for branch events now use the BranchName
type for branch names. In other words, they have a plain branch name.
The CiEvent::from_node_event constructor also always sets the branch
name to a plain branch name, instead of a name spaced ref for updated
or deleted branches. The ci_event.rs module's unit tests have been
fixed to use the correct kind of Git ref in each test. (It used to be
a mess.)

The CI event filter "Branch" now contains a BranchName, previously a
RefString. This should not break anything, as a RefString will always
work as a BranchName.

The DefaultBranch filter now works, because it compares plain branch
names, where it previously would compare a plain and a name spaced
branch name, and those are never equal.

"cibtool trigger" and "cibtool event add" now add branch events with a plain
branch instead of a name spaced ref.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-03-20 18:33:39 +02:00
Lars Wirzenius 9222f6d332 feat: module for manipulating Git refs
Add helper functions to construct plain branch names ("main"), full
branch refs ("refs/heads/main"), and namespaced full branch
names ("refs/namespaces/$NID/refs/heads/main").

Keeping track of while only using RefStrings is too hard to get right.
We need to use the types provided by the radicle crate: BranchName,
Qualified, and Namespaced. Even if I find the type names less than
obvious, they're much better than plain RefStrings.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-03-20 17:57:29 +02:00
Lars Wirzenius b0adc805ec doc(doc/userguide.md): add a chapter on configuration
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-03-13 18:03:06 +02:00
Lars Wirzenius 4f98127322 feat: RSS feeds now only contain up to ten entries
Very long RSS feeds can cause problems for some readers. Apparently
they forget they've already seen very old entries and show them as
new. To work around this, only include the ten newest CI runs.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-03-13 12:05:14 +02:00