Commit Graph
416 Commits
Author SHA1 Message Date
Lars Wirzenius d2324ca652 feat: log received node events
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-10-08 14:21:54 +03:00
Lars Wirzenius 21b14a2328 feat: log when a NodeSourceEvent is created
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-10-08 14:14:11 +03:00
Lars Wirzenius 92bee78f78 fix: drop pushing a shutdown event into queue, when node conn closes
For bad historical reasons, the CI broker was using a synthetic
"shutdown" event to signal from one thread to another that the node
connection has been disconnected. At an earlier stage of development,
this the only way for the "read node events" thread to notify the
"process queued events" thread that there would never be any more
events.

Now we have inter-thread message channels and we can use their closing
to do the signaling.

However, this meant that the queue would have a spurious shutdown
event. This led to the following sequence of things happening:

* node shuts down
* CI broker notices this, adds a shutdown event to queue, then
  terminates the event-reading thread, thereby closing the message
  channel
* the queue processing notices the message channel is closed, and
  terminates
* the CI broker process terminates
* systemd restarts the CI broker
* the CI broker finds a shutdown event in the queue and terminates

The shutdown event is still needed so that the node admin has a
convenient way to tell the CI broker to terminate, even if they don't
have the privilege to stop systemd units.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-10-08 13:43:05 +03:00
Lars Wirzenius 51a0834b7f feat: log the picked event when processing queue
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-10-08 11:29:56 +03:00
Lars Wirzenius 69f10e3eb2 docs: start user guide; document CI events and filters 2024-09-30 14:01:03 +03:00
Lars Wirzenius f147c77d32 chore: drop old broker event code, which isn't used anymore
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-09-30 14:01:03 +03:00
Lars Wirzenius 07612f53e9 feat(src/pages.rs): use CI events in HTML report pages
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-09-30 14:00:51 +03:00
Lars Wirzenius d44877da78 feat: verify there are no unprocessed broker events in the db
To process old queued events, run older version of CI broker until
queue is empty ("cib queued"), then upgrade.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-09-30 13:58:13 +03:00
Lars Wirzenius 31e930aecf tests(ci-broker.md): update acceptance criteria for new CI events 2024-09-30 12:58:16 +03:00
Lars Wirzenius 41375b8bb6 feat: change cibtool subcommands to use new CI events 2024-09-30 12:58:16 +03:00
Lars Wirzenius e82652b522 feat: add new CI event source 2024-09-30 12:58:16 +03:00
Lars Wirzenius 1876b0f186 feat(src/queueproc.rs): process CI events 2024-09-30 12:58:16 +03:00
Lars Wirzenius c75c87030b feat(src/queueadd.rs): add CI events to queue 2024-09-30 12:58:16 +03:00
Lars Wirzenius 42d6184967 feat(src/msg.rs): build trigger message from CI event 2024-09-30 12:58:16 +03:00
Lars Wirzenius 31ee715d30 feat(src/logger.rs): update to log CI event 2024-09-30 12:58:16 +03:00
Lars Wirzenius ef8384b05b feat(src/db.rs): add queue for CI events
Add a new table for a queue of CI events. Drop most of the methods
that operate on the old queue of broker events, but leave a method to
check if its empty.

We can't use the existing table event_queue, as that contains
serialized broker events, which are entirely incompatible with CI
events.
2024-09-30 12:58:16 +03:00
Lars Wirzenius 1274368a20 feat(src/config.rs): use new CI event filter in config 2024-09-30 12:58:16 +03:00
Lars Wirzenius 426a9d3315 feat: add new CI events and filter for them
These will eventually replace the old broker events.
2024-09-30 12:58:16 +03:00
Lars Wirzenius 96c17ea7af chore(src/bin/cib.rs): tell clippy it's OK variants vary in size
Some day the BrokerError error type should probably be made smaller.
Some day.
2024-09-27 19:50:01 +03:00
Lars Wirzenius b78b3631a1 chore(src/broker.rs): drop unused error variant 2024-09-27 19:50:01 +03:00
Lars Wirzenius 975ce518fe tests: verify that cib produces expected log messages
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-09-23 09:24:52 +03:00
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