Radish alpha
r
rad:zwTxygwuz5LDGBq255RA2CbNGrz8
Radicle CI broker
Radicle
Git
feat: make CI events versioned
Merged liw opened 1 year ago

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

liw opened with revision 321599d5 on base 5e813f73 +109 -102 1 year ago

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

liw merged revision 321599d5 at 320c4269 1 year ago