Radish alpha
r
rad:zwTxygwuz5LDGBq255RA2CbNGrz8
Radicle CI broker
Radicle
Git
chore: drop unused doc/publish.sh
Merged liw opened 6 months ago

This was a remenant from an older era of Radicle CI.

build(Makefile): build subplot as HTML

tests(ci-broker.md): add scenario for empty queue

test(ci-broker.md): change shutdown scenario to verify cleanliness

3 files changed +15 -29 91358ed2 e8217e8c
modified ci-broker.md
@@ -151,6 +151,8 @@ of the adapter.
set -eu
cat > /dev/null
echo '{"response":"triggered","run_id":{"id":"xyzzy"}}'
+
# Simulate a CI run that takes a while.
+
sleep 2
echo '{"response":"finished","result":"success"}'
(
echo "This is an adapter error: Mordor" 
@@ -977,30 +979,28 @@ then command is successful
~~~


-
## Shuts down when requested
+
## Can shut down cleanly

-
_Want:_ The test suite can request the CI broker to shut down
-
cleanly, and it doesn't result in an error.
+
_Want:_ The node operator can instrut the running CI broker to shut down after
+
currently executing runs finish.

-
_Why:_ In the integration test suite, we need to start and
-
stop the CI broker many times. We need to easily detect errors.
+
_Why:_This is useful for both the CI broker test suite and for operators to
+
shut down service for maintenance.

-
_Who:_ `cib-devs`
+
_Who:_ `cib-devs`, `node-ops`

-
We use a special magic fake node event to signal shutdown: a
-
`RefsFetched` event with a skipped update for a ref "`shutdown`" and
-
an object id of all zeros. This should be sufficiently impossible to
-
happen in real life.
+
We verify this by starting a relatively long-running CI run and also telling
+
`cib` to shut down, and then verifying the CI run finished successfully.

~~~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 the Radicle node emits a refsUpdated event for xyzzy
-
when I run ./env.sh synthetic-events synt.sock event.json --log log.txt
-
when I try to run ./env.sh cib --config broker.yaml insert
+
when I run cibtool --db ci-broker.db trigger --repo xyzzy --commit HEAD
+
when I run cibtool --db ci-broker.db event shutdown
+
when I try to run ./env.sh cib --config broker.yaml queued
then command is successful
-
when I run cibtool --db ci-broker.db run list
-
then stdout is empty
+
when I run cibtool --db ci-broker.db run list --json
+
then stdout contains "success"
~~~


modified doc/Makefile
@@ -16,9 +16,6 @@

all: architecture.html userguide.html overview.html

-
publish: all
-
	bash publish.sh
-

architecture.html: architecture.subplot architecture.md Makefile messages.md

messages.md: messages.sh messages.txt
deleted doc/publish.sh
@@ -1,11 +0,0 @@
-
#!/bin/bash
-

-
set -xeuo pipefail
-

-
if [ "${RADICLE_CI_BROKER_WEBROOT:-unset}" != unset ]; then
-
	echo web root set, publishing arch doc there
-
	install -d -m 0755 "$RADICLE_CI_BROKER_WEBROOT"
-
	install -m 0644 ./*.html "$RADICLE_CI_BROKER_WEBROOT"
-
else
-
	echo web root is not set, not publishing arch doc
-
fi