Commit Graph
191 Commits
Author SHA1 Message Date
Lars Wirzenius d69be6f457 feat: log at info level when no allowed broker events from node one
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-18 15:17:42 +03:00
Lars Wirzenius 01cf7394a9 fix: no allowed broker events is not an end-of-file situation
If we get a node event that results in some broker events, but the
filter allows none of those, that's not a reason to assume there will
be no more node events in the future. Instead, don't return an empty
list of broker events, but wait for a new node event.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-18 15:08:07 +03:00
Lars Wirzenius d36e68768a feat: log when run finishes
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-18 14:36:00 +03:00
Lars Wirzenius cf5e61cc07 feat: reduce logspam
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-18 14:22:28 +03:00
Lars Wirzenius eb923962bb feat: adjust logging of incoming events, again
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-18 14:13:29 +03:00
Lars Wirzenius 4300fe3459 feat: tweak logging of incoming events, for debugging
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-18 13:59:40 +03:00
Lars Wirzenius c3a4c5f7aa feat: log the event we get from the node
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-18 13:56:57 +03:00
Lars Wirzenius c2b083ae42 feat: reduce logspam at info level
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-18 13:56:19 +03:00
Lars Wirzenius 9f238c4988 fix: don't wait for queue adder in cib
We should exit when the event processor exists. The adder might never
exit, if its connection to the node never breaks.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-18 13:48:33 +03:00
Lars Wirzenius 32562b7605 feat: log event gotten from queue
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-18 13:35:48 +03:00
Lars Wirzenius f4c14229c4 feat: log number of allowed broker events from node event
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-18 12:48:02 +03:00
Lars Wirzenius 5e662275b0 feat: adjust logging for usefulness, logspam
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-18 12:36:12 +03:00
Lars Wirzenius 6bd555f6d2 feat: reduce logspam about wait duration for report writing
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-18 12:29:05 +03:00
Lars Wirzenius e29dd23f75 feat: reduce logspam about wait duration for events
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-18 12:28:02 +03:00
Lars Wirzenius b46e9493a7 feat: reduce info level logspam
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-18 12:27:49 +03:00
Lars Wirzenius 11236e7c64 feat: tense for log message, drop to debug level
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-18 12:17:56 +03:00
Lars Wirzenius e85d4c7cfc feat: drop "wrote page" log messages to debug level
Reduces logspam.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-18 12:16:30 +03:00
Lars Wirzenius 800b2ffb44 feat: log when events end and when pushing a shutdown event
All to make the node operator's life easier to understand what's
happening.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-18 12:10:15 +03:00
Lars Wirzenius 866d6a879f feat: log actions when processing an event at info level
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-18 11:56:43 +03:00
Lars Wirzenius 6e37586700 feat: log when looking for events to process, or waiting to pick
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-18 11:50:40 +03:00
Lars Wirzenius 0bbfebc80d refactor(src/pages.rs): use a Duration instead of plain integer
Also, log the duration until the next update, to help impatient node
operators to know what's going on.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-18 11:30:11 +03:00
Lars Wirzenius f713e4aa6a fix(cib): tell report page thread to run indefinitely
Previously, we told it to run once and waited for it to finish before
continuing. This makes sense for cibtool, but not for cib.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-18 11:25:43 +03:00
Lars Wirzenius cb9142ac8b feat: log when picking an event and starting a run
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-18 11:01:49 +03:00
Lars Wirzenius 3812aba1f7 feat: shorten log messages for events
Format them on one line, not on many lines. This makes logs easier to
skim.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-18 10:53:13 +03:00
Lars Wirzenius 6acd11d086 feat: reduce interval for when pages get updated
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-18 10:49:14 +03:00
Lars Wirzenius 3b882c43d0 feat: log when report pages are logged, and when not
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-18 10:47:40 +03:00
Lars Wirzenius 8d622c78ed feat: log what report HTML pages are written
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-18 10:42:30 +03:00
Lars Wirzenius 1d57cc1f2f chore: drop the "given an installed ci-broker" step
It's not used anywhere now that the binary name has changed to cib.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-17 18:11:55 +03:00
Lars Wirzenius 3f755facf3 fix: extend wait time for when database is busy
Five seconds was too short for a slow machine, so make it sixty
seconds. Which might be too long, but if it turns out to be, I'll have
to make it configurable in some way.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-17 16:52:42 +03:00
Lars Wirzenius 294a04f951 fix: internal documentation link
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-17 16:32:38 +03:00
Lars Wirzenius ddbac4fd6e feat! drop "status" column from event queue
It's not currently used. It may be necessary to add this later, but
for now it's better to avoid having the cruft.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-16 20:44:43 +03:00
Lars Wirzenius fbb123d953 docs: add help for all subcommands and options
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-16 20:38:37 +03:00
Lars Wirzenius d421a6ef17 docs: make synthetic-events have a module comment
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-16 19:58:40 +03:00
Lars Wirzenius c1dc050819 docs: add documentation comments to cib and cibtool
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-16 19:58:25 +03:00
Lars Wirzenius ff33dcdb1e feat! drop barely-working helper programs
Their functionality can be added to cibtool, if there's a need.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-16 19:57:39 +03:00
Lars Wirzenius 84d868c919 refactor: use sqlite::Connection::set_busy_timeout
This replaces previous explicit loops we had. Had to increase the
timeout value to let tests pass with new code.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-16 19:46:57 +03:00
Lars Wirzenius 24ed10c6da fix: partial comment explaining Db::execute_valueless
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-16 17:39:12 +03:00
Lars Wirzenius 3303d7d873 fix: typo in error variant name
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-16 17:37:56 +03:00
Lars Wirzenius 8c055c1f3b refactor: use a typed Duration constant instead of integer
This makes it clearer what unit of time is being used.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-16 17:37:29 +03:00
Lars Wirzenius 0511e77702 fix: set node alias for reports
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-11 15:20:00 +03:00
Lars Wirzenius d1c3f1801d feat: cib reads and process events in one subcommand
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-11 12:45:33 +03:00
Lars Wirzenius 14e2eaec01 feat: treat end-of-events as end, not as an error
If there are no more events to be received from the node, treat that
as an "end of file" situation, instead of as an error. In other words,
do a normal shutdown and let a system manager restart the CI broker if
need be.

Still handle actual errors when receiving node events as errors.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-11 12:45:33 +03:00
Lars Wirzenius ad80772033 refactor: change code to produce HTML report to run in a thread
Run it once, for cibtool.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-11 12:45:33 +03:00
Lars Wirzenius 8245df4722 fix(cibtool): use node alias in reports
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-11 12:45:22 +03:00
Lars Wirzenius bbf65cb29a refactor: add Db::get_all_runs
This is needed in a few places, and it's nominally more efficient to
get all runs with one SELECT, than first get all run ids and then each
run one by one.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-10 12:43:33 +03:00
Lars Wirzenius 968d0e091b feat(cibtool): add command to produce HTML report from database
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-10 12:43:14 +03:00
Lars Wirzenius 6cd968d480 feat(cibtool): allow user to add information about a run
This is primarily going to be useful for setting up runs in the
database for testing report generation, which will happen in the near
future.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-10 12:41:37 +03:00
Lars Wirzenius 5f1ce255c0 refactor: rename *Cmd to *SubCmd, Counter/EventRun to *Cmd
This will allow use to import "crate::run::Run" later, without any
hoops to jump though.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-10 12:37:18 +03:00
Lars Wirzenius d4cbcc81ed refactor: use BrokerError only in broker.rs
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-08 19:30:31 +03:00
Lars Wirzenius 9f5db36e44 refactor(filter-events.rs): drop use of BrokerError
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-07-08 18:15:09 +03:00