Radish alpha
r
rad:zwTxygwuz5LDGBq255RA2CbNGrz8
Radicle CI broker
Radicle
Git
fix: add missing event filters for tag events
Lars Wirzenius committed 7 months ago
commit eb4d4a33e21b1e3f4f582f182215908d767351df
parent a2dec1a
1 file changed +21 -0
modified src/filter.rs
@@ -80,6 +80,15 @@ pub enum EventFilter {
    /// Patch was updated,
    PatchUpdated,

+
    /// Annotated tag was created.
+
    TagCreated,
+

+
    /// Annotated tag was updated.
+
    TagUpdated,
+

+
    /// Annotated tag was deleted.
+
    TagDeleted,
+

    /// Change originated from specific node.
    Node(NodeId),

@@ -206,6 +215,18 @@ impl EventFilter {
                let allowed = matches!(event, CiEvent::V1(CiEventV1::BranchDeleted { .. }));
                Decision::new("BranchDeleted", allowed, "")
            }
+
            Self::TagCreated => {
+
                let allowed = matches!(event, CiEvent::V1(CiEventV1::TagCreated { .. }));
+
                Decision::new("BranchCreated", allowed, "")
+
            }
+
            Self::TagUpdated => {
+
                let allowed = matches!(event, CiEvent::V1(CiEventV1::TagUpdated { .. }));
+
                Decision::new("BranchUpdated", allowed, "")
+
            }
+
            Self::TagDeleted => {
+
                let allowed = matches!(event, CiEvent::V1(CiEventV1::TagDeleted { .. }));
+
                Decision::new("BranchDeleted", allowed, "")
+
            }
            Self::Patch(wanted) => {
                let actual = event.patch_id();
                let allowed = Some(&PatchId::from(wanted)) == actual;