The examples in README.md need an overhaul
I tried a configuration from one of the examples:
filters:
- !And
- !Repository "rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5"
- !Or
- !Branch "main"
- !AnyPatchRef
Running cib process-events on that configuration gave me these error
lines:
{"timestamp":"2025-02-11T12:25:06.642623Z","level":"INFO","fields":{"message":"CI broker starts","msg_id":"CibStart","kind":"startup","version":"cfac437"}}
{"timestamp":"2025-02-11T12:25:06.643168Z","level":"ERROR","fields":{"message":"ERROR: failed to read configuration file /tmp/tmp.wa8Rdh4Dtb/cib.yaml"}}
{"timestamp":"2025-02-11T12:25:06.643196Z","level":"ERROR","fields":{"message":"caused by: failed to parse configuration file as YAML: /tmp/tmp.wa8Rdh4Dtb/cib.yaml"}}
{"timestamp":"2025-02-11T12:25:06.643218Z","level":"ERROR","fields":{"message":"caused by: filters.\\[0\\].\\[1\\]: unknown variant `AnyPatchRef`, expected one of `Repository`, `Branch`, `DefaultBranch`, `BranchCreated`, `BranchUpdated`, `BranchDeleted`, `Patch`, `PatchCreated`, `PatchUpdated`, `Node`, `HasFile`, `Allow`, `Deny`, `NoneOf`, `Not`, `AllOf`, `And`, `AnyOf`, `Or` at line 13 column 7"}}
{"timestamp":"2025-02-11T12:25:06.643252Z","level":"ERROR","fields":{"message":"CI broker ends in unrecoverable error","msg_id":"CibEndFailure","kind":"shutdown","success":false}}
I think the best way to handle this is
README.mdtodoc/userguide.mdThe first is easier, but needs a bit of thought to come up with a sensible example. The second needs more work.
Actually, we already tested examples in
ci-broker.md. I’ll change theREADME.mdto point at those.