Commit Graph
395 Commits
Author SHA1 Message Date
Lars Wirzenius e2a5d91d47 fix: allow log level trace and debug in release builds
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-09-23 09:15:50 +03:00
Lars Wirzenius bc710c36f1 chore: drop use or RUST_LOG, RADICLE_CI_BROKER_LOG
Neither is used by the CI broker any more.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-09-23 09:10:44 +03:00
Richard Levitte 1a46a855e1 doc: RefsUpdated → RefsFetched
Since that's what's actually looked at (and RefsUpdated isn't an existing
type anyway).
2024-09-17 17:43:15 +02:00
Lars Wirzenius cdc4af1462 Merge branch 'patch/6704143' 2024-09-17 17:42:19 +02:00
Michalis Zampetakis 11f36aab73 Add zulip adapter entry in adapters list 2024-09-16 21:03:44 +03:00
Lars Wirzenius 13d37ce087 chore: prepare release 0.6.3
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-09-16 11:40:34 +03:00
Lars Wirzenius b8a9aa6dc8 chore(src/event.rs): drop unused BrokerEventError variants
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-09-13 10:40:10 +03:00
Lars Wirzenius 29be34bd1a fix(src/event.rs): fix new name of type
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-09-13 10:22:58 +03:00
Lars Wirzenius 1ef04663a2 fix(src/event.rs): update module comment to match reality
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-09-13 10:22:20 +03:00
Lars Wirzenius 50e82fc411 refactor: drop BrokerEventSource::node_event, use NodeEventSource
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-09-13 10:19:41 +03:00
Lars Wirzenius 5017e2cc77 refactor: rename module to have a clearer name
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-09-13 10:12:32 +03:00
Lars Wirzenius 72f09aa9f6 refactor: use shorter name for NodeEventError
Previously, needed to use a full path, because of a type name clash.
Now that the clash is gone, we can import and use the name directly.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-09-13 10:03:06 +03:00
Lars Wirzenius edc6cb407d refactor: rename NodeEventError to BrokerEventError, for clarity
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-09-13 09:59:11 +03:00
Lars Wirzenius 54618c6250 refactor: move node event source functionality into its own type
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-09-13 09:54:30 +03:00
Lars Wirzenius 72c6a3396f refactor: rename NodeEventSource to BrokerEventSource
It returns broker events, not node events, so the new name is clearer.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-09-13 09:33:03 +03:00
Lars Wirzenius c7b0b39367 feat: add cibtool subcommand to use filters on recorded events
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-09-12 13:44:54 +03:00
Lars Wirzenius 6981c483c6 feat: add cibtool subcommand to show broker events from node ones
"cibtool event broker" is a complement to "cibtool event record".

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-09-12 13:44:54 +03:00
Lars Wirzenius 795dc1c97a feat: add cibtool subcommand for recording node events
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-09-12 13:44:54 +03:00
Lars Wirzenius e5873fd0ea refactor: drop the PageBuilder type
After various previous changes, the PageBuilder::build now only calls
StatusPage::new, so there's no point in the type. Drop it.

Also replace StatusPage::new with StatusPage::default, for better
style.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-09-12 13:38:48 +03:00
Lars Wirzenius 12d7409828 fix(src/pages.rs): use broker run id, always there
Co-worker reported that the unwrap of the optional adapter run id
triggered a panic for them.

Each run has a unique broker run id, and an optional, non-unique
adapter run id. Use the broker run id instead.

Actually, the whole PageBuilder type is now useless, but I'll tackle
that separately.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-09-12 13:36:57 +03:00
Lars Wirzenius 84029fe19a chore: update radicle in Cargo.lock 2024-09-11 09:23:08 +03:00
Lars Wirzenius f2b86a4c01 chore: prepare release 0.6.2
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-09-10 13:59:11 +03:00
Lars Wirzenius a979033cea fix(ci-broker.md): make dummy adapter read trigger message
Change the dummy adapter to read the trigger message from its stdin.
This prevents a race condition where the adapter exits before the CI
broker has time to write the trigger message to the adapter.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-09-10 13:46:14 +03:00
Yorgos Saslis 98ba35e4af docs(README.md): add missing dependency
Signed-off-by: Yorgos Saslis <yorgos.work@proton.me>
2024-09-03 18:14:54 +03:00
Lars Wirzenius 31c2b58cc3 docs(README.md): list programs needed by the test suite
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-09-03 13:47:12 +03:00
Lars Wirzenius 3f426a71f5 chore: release 0.6.1 with updated dependencies
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-09-02 14:02:09 +03:00
Lars Wirzenius dd677bfd2a chore: bump dependencies on Radicle crates
To get this to work, I had to remove Cargo.lock and let it be
re-created:

rm Cargo.lock && cargo add radicle@0.13.0 radicle-git-ext@0.8.0 radicle-surf@0.22.0

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-09-02 13:55:23 +03:00
Lars Wirzenius 057650b9a4 fix(debian/changelog): add new release
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-09-02 11:00:11 +03:00
Lars Wirzenius 5532037180 chore: prepare release 0.6.0
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-09-02 10:54:28 +03:00
Lars Wirzenius 89b89ac6b2 tests(ci-broker.md): add upgrade testing of current source dir HEAD
This doesn't test the uncommitted changes in the source tree, but it's
good enough for now.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-09-02 10:32:20 +03:00
Lars Wirzenius a2975ab6a4 docs(README.md): add a list of known adatpers
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-09-02 09:32:43 +03:00
Lars Wirzenius 17b7aef6a1 Merge branch 'verify-upgrade' 2024-09-02 09:25:21 +03:00
Lars Wirzenius b0dc2b9f83 fix: log message about thread ending shouldn't say it's starting
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-08-31 16:27:23 +03:00
Lars Wirzenius 6232422f21 feat: log GIT_HEAD when cib starts
This means the version is in the log file. Was useful for me when
debugging cache problem.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-08-31 16:04:02 +03:00
Lars Wirzenius 26f6edf06a tests: verify that CI broker can be upgraded
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-08-31 16:04:02 +03:00
Lars Wirzenius e82503bf95 fix(ci-broker.md): mock node control socket handling in helper
The test suite didn't work on Macs. A fundamental problem was using
"sleep 0.1" to wait for a background process to do something: this is
never a good idea. Either the wait time is too short, resulting in
spurious test failures, or it's so long it makes test take
unnecessarily long. I should have known better. A better approach is
to loop for a sufficiently long time and check if the background
process has done its thing every so often, and stop looping when it
has.

There were some other, more incidental incompatibility problems too.

To fix all this, replace use of "nc", a common tool with many
incompatible variants, by adding a "client mode" to
synthetic-events.rs that connects to the daemon and closes the
connection neatly, then waits for the daemon to delete the socket.
Also, change how it does what it does so that it works both Linux and
Mac. This includes removing setting a read timeout that failed on Mac,
but doesn't seem to be necessary now.

Also, change synthetic-events to log more and more detailed messages
to aid remote debugging of test suite failures in the future. The
daemon logs errors from fallible operations, instead of discarding
them and terminating, and the client outputs the daemon log if the
client fails, while waiting for the daemon to remove the socket.

Finally, during the furious debugging, refactor the code into smaller
functions so its easier to understand when nothing makes sense.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-08-29 12:58:10 +03:00
Lars Wirzenius 58ceb33620 fix: typo in log message
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-08-28 09:31:25 +03:00
Lars Wirzenius 609e33c13b feat: log adapter stderr output
The CI broker now logs the standard error output of the adapter, and
the adapter exit status, to the broker's own log. The log messages
look like this:

  {"msg":"adapter exit code","level":"DEBG","ts":"2024-08-27T17:38:26.762222386Z","exit_code":1}
  {"msg":"adapter stderr","level":"DEBG","ts":"2024-08-27T17:38:26.762289242Z","stderr":"woe be me\n"}

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-08-28 09:31:25 +03:00
Lars Wirzenius dd043e0154 feat: add --json to cibtool event list
Add a --json option to allow "cibtool event list" to output JSON, for
easier post-processing by other programs. Keep the --verbose, to avoid
making a breaking change, but hide it from --help output.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-08-27 19:14:50 +03:00
Lars Wirzenius 2c70b462bc tests(ci-broker.md): verify that cibtool checks repo exists
When adding an event, via "cibtool event add" or "cibtool trigger",
verify the tool checks that the repository the event is for actually
exists. The check was already there, this just adds a verification
scenario for that.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-08-27 18:25:15 +03:00
Lars Wirzenius 40cb793a54 fix: make test suite run on Macs
Change the radenv.sh script to use tilde expansion instead of getent.
Macs do not have a getent - that's a tool that's specific to glibc, so
it's mostly only available on Linux systems. But we don't need that:
Bash can do the expansion directly.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-08-26 14:39:24 +03:00
Lars Wirzenius c7cbcb0071 chore: update dependency on Subplot to 0.11.0
Also change required Rust version to be 1.80. This matches heartwood,
but is also necessary for Subplot dependencies.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-08-26 10:45:36 +03:00
Lars Wirzenius 968207a5f1 chore: prepare release 0.5.0
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-08-26 09:31:57 +03:00
Lars Wirzenius 0e4aeb832e docs(NEWS.md): fix heading level for previous release notes
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-08-26 09:10:16 +03:00
Lars Wirzenius 14aa655341 fix: heading markup typo
I missed this before merging. I was not careful.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-08-26 09:02:09 +03:00
Lars Wirzenius 2501340228 docs(ci-broker.md): update stakeholder groups: node-ops, devs,
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-08-23 16:16:53 +03:00
Lars Wirzenius 1da1308655 feat: add length of event queue to status.json
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-08-23 10:15:27 +03:00
Lars Wirzenius 85414e8673 feat: switch to structured logging only
Replace all use of log and env-logger crates with structured logging
using slog and slog-json.

Change the recently introduced logger module to use the slog-scope
crate. This avoids having to pass a reference to logger::Logging to
every place that needs to do any logging.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-08-23 10:03:49 +03:00
Lars Wirzenius f0a995900e fix: allow alias for Run::repo_name to mach old field name
This should allow painless upgrading from previous release.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-08-21 14:13:23 +03:00
Lars Wirzenius 07b3a48a5e feat: add table with current event queue to front report page
Add a table of pending events in the event queue. except for ones for
private repositories.

The public queue allows people to have a idea of how long they will
have to wait for CI to run for their change.

The table leaks the event queue, commit IDs, branch names, and patch
IDs, but if that's a problem, we can make this a table configurable,
on a per node basis.
2024-08-21 13:57:46 +03:00