From d97f1c6720deeffde3a49d99db101f1ff77668d1 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Wed, 29 Jan 2025 17:33:42 +0200 Subject: [PATCH] test(ci-broker.md): verify event filter Or Signed-off-by: Lars Wirzenius --- ci-broker.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/ci-broker.md b/ci-broker.md index 2744d580..fc491905 100644 --- a/ci-broker.md +++ b/ci-broker.md @@ -1085,6 +1085,43 @@ triggers: ~~~ +## Filter predicate `Or` + +_Want:_ We can allow a combination of events if any of them are +allowed individually. + +_Why:_ This is for consistency. + +~~~scenario +given a Radicle node, with CI configured with broker.yaml and adapter dummy.sh +given a Git repository xyzzy in the Radicle node + +given file config.yaml from filter-or.yaml + +when I run cibtool --db ci-broker.db event add --repo xyzzy --ref main --commit HEAD --kind branch-deleted +when I run cibtool --db ci-broker.db event add --repo xyzzy --ref oksa --commit HEAD --kind branch-created + +when I run ./env.sh cib --config config.yaml queued + +when I run cibtool --db ci-broker.db run list --json +then stdout contains "main" +then stdout contains "oksa" +~~~ + +~~~{#filter-or.yaml .file .json} +db: ci-broker.db +adapters: + default: + command: ./adapter.sh +triggers: + - adapter: default + filters: + - !Or + - !Allow + - !Deny +~~~ + + # Acceptance criteria for test tooling The event synthesizer is a helper to feed the CI broker node events in