feat: make CI events versioned
This will help us avoid breaking changes in the future, when CI events need to be modified, and CI broker instances need to cope with the event queues in their databases.
Previously we had
enum CiEvent {
BranchCreated { ... },
BranchUpdatee { ... },
....
}
Change that to:
enum CiEvent {
V1(CiEventV1),
}
enum CiEventV1 {
BranchCreated { ... },
BranchUpdatee { ... },
....
}
This will allow us to add new version variants to CiEvent, without losing access to the already enqueued V1 events.
Signed-off-by: Lars Wirzenius liw@liw.fi
refactor: make BrokerError::NotTrigger not be so large
It’s awkward if enum variants have wildly different sizes. Change BrokerError::NotTrigger to store the Request value in a Box, so that it’s not in the enum directly. This makes all variants about the same size, and thus the decorators that allow the clippy::large_enum_variant can be dropped.
Signed-off-by: Lars Wirzenius liw@liw.fi
11 files changed
+109
-102
5e813f73
→
320c4269
modified src/bin/cib.rs
@@ -273,7 +273,6 @@ impl ProcessEventsCmd {
|
|
|
|
|
|
| - | |
|
|
|
|
|
modified src/bin/cibtool.rs
@@ -30,7 +30,7 @@ use radicle_git_ext::Oid;
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -240,7 +240,6 @@ enum RunSubCmd {
|
|
|
|
|
|
| - | |
|
|
|
|
|
modified src/bin/cibtoolcmd/event.rs
@@ -291,7 +291,7 @@ pub struct Shutdown {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
modified src/broker.rs
@@ -127,7 +127,6 @@ fn now() -> Result<String, time::error::Format> {
|
|
|
|
|
|
| - | |
|
|
|
|
|
@@ -151,7 +150,7 @@ pub enum BrokerError {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
modified src/ci_event.rs
@@ -15,6 +15,11 @@ use radicle::{
|
|
|
|
|
|
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -55,13 +60,13 @@ impl CiEvent {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -73,14 +78,14 @@ impl CiEvent {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
|
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -107,14 +112,14 @@ impl CiEvent {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
|
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -129,7 +134,7 @@ impl CiEvent {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -137,7 +142,7 @@ impl CiEvent {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -149,14 +154,14 @@ impl CiEvent {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
|
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -325,12 +330,12 @@ mod test {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -360,13 +365,13 @@ mod test {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -395,7 +400,7 @@ mod test {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -425,12 +430,12 @@ mod test {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -460,12 +465,12 @@ mod test {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
modified src/filter.rs
@@ -5,7 +5,10 @@ use serde::{Deserialize, Serialize};
|
|
|
|
|
|
| - | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -64,32 +67,32 @@ impl EventFilter {
|
|
|
|
|
|
| - | |
| - | |
| + | |
| + | |
|
|
|
|
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -166,7 +169,7 @@ mod test {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -178,32 +181,32 @@ mod test {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
|
|
|
| - | |
| - | |
| + | |
| + | |
|
|
|
|
|
|
|
|
|
|
| - | |
| - | |
| - | |
| + | |
| + | |
| + | |
|
|
|
|
|
|
|
|
| - | |
| - | |
| + | |
| + | |
|
|
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -248,9 +251,9 @@ mod test {
|
|
|
|
|
|
| - | |
| - | |
| - | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -283,7 +286,7 @@ mod test {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -297,7 +300,7 @@ mod test {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -311,7 +314,7 @@ mod test {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -325,7 +328,7 @@ mod test {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -339,7 +342,7 @@ mod test {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -353,7 +356,7 @@ mod test {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -368,7 +371,8 @@ mod test {
|
|
|
|
|
|
| - | |
| + | |
| + | |
|
|
|
|
|
@@ -391,7 +395,8 @@ mod test {
|
|
|
|
|
|
| - | |
| + | |
| + | |
|
|
|
|
|
@@ -406,7 +411,7 @@ mod test {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -420,7 +425,7 @@ mod test {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -434,7 +439,7 @@ mod test {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -448,7 +453,7 @@ mod test {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
modified src/msg.rs
@@ -31,7 +31,7 @@ use radicle::{
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -132,12 +132,12 @@ impl<'a> RequestBuilder<'a> {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -170,13 +170,13 @@ impl<'a> RequestBuilder<'a> {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -227,12 +227,12 @@ impl<'a> RequestBuilder<'a> {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -317,12 +317,12 @@ impl<'a> RequestBuilder<'a> {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -908,7 +908,7 @@ pub enum MessageError {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -930,14 +930,14 @@ pub mod trigger_from_ci_event_tests {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
|
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -981,7 +981,7 @@ pub mod trigger_from_ci_event_tests {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -989,7 +989,7 @@ pub mod trigger_from_ci_event_tests {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -1048,12 +1048,12 @@ pub mod trigger_from_ci_event_tests {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -1120,12 +1120,12 @@ pub mod trigger_from_ci_event_tests {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
modified src/pages.rs
@@ -28,7 +28,7 @@ use radicle::{
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -179,33 +179,35 @@ impl PageData {
|
|
|
|
|
|
| - | |
| - | |
| + | |
| + | |
|
|
|
|
|
|
|
|
| - | |
| - | |
| + | |
| + | |
|
|
|
|
|
|
|
|
|
|
| - | |
| - | |
| - | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
|
|
|
| - | |
| - | |
| + | |
| + | |
|
|
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -546,11 +548,11 @@ impl StatusPage {
|
|
|
|
|
|
| - | |
| - | |
| - | |
| - | |
| - | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
modified src/queueproc.rs
@@ -12,7 +12,7 @@ use radicle::Profile;
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -119,16 +119,16 @@ impl QueueProcessor {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -140,13 +140,13 @@ impl QueueProcessor {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -170,7 +170,6 @@ impl QueueProcessor {
|
|
|
|
|
|
| - | |
|
|
|
|
|
modified src/test.rs
@@ -5,7 +5,7 @@ use std::{
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -64,14 +64,14 @@ pub fn trigger_request() -> TestResult<Request> {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
|
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
modified src/util.rs
@@ -89,7 +89,6 @@ pub fn now() -> Result<String, UtilError> {
|
|
|
|
|
|
| - | |
|
|
|
|
|