Radish alpha
r
Radicle CI broker
Radicle
Git (anonymous pull)
Log in to clone via SSH
test(ci-broker.md): verify event filter Branch
Lars Wirzenius committed 1 year ago
commit d1e9b5e159cbc0ef58012534efd8a6f03181885f
parent 59deeed8c13b8eae054fdeb033266dce7c0775ef
1 file changed +35 -0
modified ci-broker.md
@@ -841,6 +841,41 @@ sed -i "s/NODEID/$rid/g" "$yaml"
~~~


+
## Filter predicate `Branch`
+

+
_Want:_ We can allow an event that is about a specific branch.
+

+
_Why:_ We want to constrain CI to specific branches, such as the
+
`main` branch.
+

+
~~~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 a Git repository other in the Radicle node
+

+
given file config.yaml from filter-branch.yaml
+

+
when I run cibtool --db ci-broker.db trigger --repo xyzzy
+
when I run cibtool --db ci-broker.db trigger --repo other --ref oksa
+

+
when I run ./env.sh cib --config config.yaml queued
+

+
when I run cibtool --db ci-broker.db run list --json
+
then stdout contains ""repo_name": "xyzzy""
+
then stdout doesn't contain ""repo_name": "other""
+
~~~
+

+
~~~{#filter-branch.yaml .file .json}
+
db: ci-broker.db
+
adapters:
+
  default:
+
    command: ./adapter.sh
+
triggers:
+
  - adapter: default
+
    filters:
+
      - !Branch "main"
+
~~~
+

# Acceptance criteria for test tooling

The event synthesizer is a helper to feed the CI broker node events in