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
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