Commit Graph
488 Commits
Author SHA1 Message Date
Lars Wirzenius d5f684b2ec chore: inline variables to format strings
Found by new clippy.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-06-27 08:41:19 +03:00
Lars Wirzenius 073b652f7c fix: serialize only the adapter config, not the adapter spec
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-06-12 16:59:41 +03:00
Lars Wirzenius ccfa86101b feat: log the filename and content of adapter config
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-06-12 15:48:22 +03:00
Lars Wirzenius d1db5e96ac feat: allow configuring adapters in the cib configuration file
This makes it easier to specify several adapters, with varying
configurations, by not having to put the configuration for each
specification in a separate file.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-06-12 14:44:39 +03:00
Lars Wirzenius e61f38c726 chore: deny unused imports in cibtool commands
Drop the pragma that allows them. Drop any imports that aren't needed.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-06-09 15:23:49 +03:00
Lars Wirzenius 246068c689 refactor: use custom type instead of boolean, for clarity
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-06-09 07:27:58 +03:00
Lars Wirzenius 9a45e3fcc8 refactor: use worker abstraction for queueproc
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-06-09 07:27:58 +03:00
Lars Wirzenius a1de334746 refactor: use worker abstraction in pages
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-06-09 07:26:27 +03:00
Lars Wirzenius 663de6013f refactor: use worker abstraction in queueadd
Also update `src/bin/cib.rs` to use new interface.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-06-09 07:26:27 +03:00
Lars Wirzenius beb35a1b11 feat: add abstraction for worker threads
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-06-09 07:23:46 +03:00
Lars Wirzenius 5f8b73e9dc feat: log lines adapter writes to its stdout
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-06-03 10:23:55 +03:00
Lars Wirzenius abffecf17d chore: update dependencies on radicle, radicle-crypto, fix problem
Drop now-unnecessary import from src/test.rs.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-06-03 10:23:35 +03:00
Lars Wirzenius 6d94467d51 chore: drop rust-toolchain, fix problems found newer toolchain
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-06-03 08:43:34 +03:00
Lars Wirzenius 5f203cd2d7 feat: check that all adapters in triggers are defined
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-05-29 14:17:23 +03:00
Lars Wirzenius b7dd71b27a feat: improve logging in queueproc helper threads
This was useful for figuring out my actual problem, which was a
configuration issue.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-05-29 13:59:40 +03:00
Lars Wirzenius 2e3101a0db feat: log exit code of every command that is run
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-05-26 14:56:48 +03:00
Lars Wirzenius b93695ff43 fix: parse "concurrent_adapters" in config correctly
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>
2025-05-19 16:51:51 +03:00
Lars Wirzenius 4577682fd6 refactor(src/pull_queue.rs): drop "end" method, add Drop impl
This makes it harder to forget to close the producer end.

Suggested-by: Fintan
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-05-14 13:17:20 +03:00
Lars Wirzenius 19ede6dfed refactor(src/pull_queue.rs): avoid asserts
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>
2025-05-14 08:45:34 +03:00
Lars Wirzenius 582bd54b73 refactor: drop commented-out constants
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-05-14 08:20:05 +03:00
Lars Wirzenius e5723448d4 feat(src/queueproc.rs): log reason why waiting for adapter fails
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-05-14 08:16:01 +03:00
Lars Wirzenius e494961227 refactor: drop unnecessary pragma for allowing dead code
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-05-14 08:06:48 +03:00
Lars Wirzenius 62faeeec02 refactor: drop now-unnecessary pragma to allow unused imports
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-05-14 08:00:21 +03:00
Lars Wirzenius c493ec4928 fix(src/queueproc.rs): rewrite to avoid unimplemented!
This should never trigger, but just in case, we don't ever want it to
trigger in production.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-05-14 07:55:44 +03:00
Lars Wirzenius fd845f7e44 refactor: use more idiomatic Rust to check result of operation
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-05-14 07:52:14 +03:00
Lars Wirzenius 1f8978186a refactor: use a type to capture non-zero count of concurrent adapters
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-05-14 07:44:42 +03:00
Lars Wirzenius 06449445ec feat: enable adapter concurrency in cib
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-05-13 09:02:12 +03:00
Lars Wirzenius 55023f2e4f refactor: rewrite the timeoutcmd module for simplicity
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>
2025-05-13 09:02:12 +03:00
Lars Wirzenius b73ab44962 refactor(src/broker.rs): add accessors, drop unnecessary mut
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-05-13 09:02:12 +03:00
Lars Wirzenius 0cf160d3d1 feat: implement concurrently running adapters
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-05-13 09:02:12 +03:00
Lars Wirzenius c16e9b0af7 feat: add log messages for thread start/end, log exit status in full
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-05-13 09:02:12 +03:00
Lars Wirzenius ccb82c8890 feat: implement cloning of a NotififcationSender
This will be useful later.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-05-13 09:02:12 +03:00
Lars Wirzenius c7dbff55e5 feat: add a "pull queue" data type
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>
2025-05-13 09:02:12 +03:00
Lars Wirzenius 5ce95bc360 feat: add "concurrent_adapters" to configuration file
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>
2025-05-13 09:02:12 +03:00
Tshepang Mbambo 0e746060fe process-events help: add missing space 2025-05-13 08:59:38 +03: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 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 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 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 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 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 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