Commit Graph
497 Commits
Author SHA1 Message Date
Lars Wirzenius d3681d23ca fix: drop debug-prints left behind
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-07-29 09:32:01 +03:00
Lars Wirzenius 6af9c661aa feat: add a buffering feature to AdminLog
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-07-28 09:18:11 +03:00
Lars Wirzenius dd4982e8a3 fix: typo in cibtool run show help text
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-07-28 07:19:54 +03:00
Lars Wirzenius 05283ad35d fix(src/pages.rs): sort RSS feed items by time
Fix sorting of RSS feed entries so that sorting is by time stamp, not
RFS 2822 formatted date.

Bug report: "On the main RSS the entires are limited to 10, to select
the top 10 it is first sorted by the pub_date key
items.sort_by_key(|item| item.pub_date().map(|s| s.to_string()));.
However this date is formated with rfc 2822 so it's starting with the
day of the week "mon/tue/..." resulting in the sort making no sense,
when it should be sorting by latest first."

Found-by: Sean Borg

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-07-15 09:06:54 +03:00
Lars Wirzenius 4db74c77f2 fix: type in constant name
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-07-15 08:19:21 +03:00
Sean Borg 3bb98f3f7f feat: guid is not a permalink
rss guid default permalink to true so we need to explicitly set it to
false
2025-07-15 08:07:05 +03:00
Lars Wirzenius e1a741e33a feat: announce COB changes to other nodes
Add a function to `src/cob.rs` to announce changes to other nodes.
This is a separate commit as it's the most risky one so I want to make
it easy to revert.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-07-14 12:34:14 +03:00
Lars Wirzenius c55375e130 feat: create and update job COBs when adapter runs
This works, but doesn't request the node to announce the COB changes
to other nodes, yet.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-07-14 12:33:57 +03:00
Lars Wirzenius 6a4c026075 feat: add module for creating or updating job COBs
This is a convenience wrapper around `radicle-job`.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-07-14 09:32:03 +03:00
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