fix(infra): correlate the delivery on the object URL, not the record reference (refs #152)
CI / build (pull_request) Successful in 1m14s
CI / lint (pull_request) Successful in 1m30s
CI / unit (pull_request) Successful in 1m34s
CI / frontend (pull_request) Successful in 3m14s
CI / mutation (pull_request) Successful in 6m21s
CI / verify-stack (pull_request) Successful in 8m48s

The publish chain works — the sink received it:

  {"kanaal": "objecten", "resource": "object", "kenmerken": {"objectType": "…"},
   "hoofdObject": "http://objecten.local:8000/api/v2/objects/a68d4c46-…", …}

The check just looked for the wrong thing. An NRC notification carries hoofdObject /
resourceUrl and kenmerken — never the record data — so the `reference` inside the
RegisterRecord it wrote was never going to appear in the delivered message. Grep the sink
for the object URL instead, which is what identifies the write.
This commit is contained in:
not
2026-08-28 11:50:07 +02:00
parent d76abf2df2
commit a5fd47e546
2 changed files with 12 additions and 8 deletions
+4 -2
View File
@@ -4,7 +4,7 @@
Registers an abonnement on the `objecten` kanaal pointing at the webhook sink, then writes a Registers an abonnement on the `objecten` kanaal pointing at the webhook sink, then writes a
RegisterRecord object exactly as the ACL's ObjectenGateway does (S-19a). The caller RegisterRecord object exactly as the ACL's ObjectenGateway does (S-19a). The caller
(run-objecten-notifications-check.sh) watches the sink for the delivery — this only sets it up, (run-objecten-notifications-check.sh) watches the sink for the delivery — this only sets it up,
and prints `REFERENCE <value>` for the caller to grep on. and prints `OBJECT_URL <url>` for the caller to grep on.
Delivery exercises the whole chain: Objecten → its celery worker → NRC → nrc-beat → the callback. Delivery exercises the whole chain: Objecten → its celery worker → NRC → nrc-beat → the callback.
Anything missing (broker, worker, kanaal, notifications config) shows up as a non-delivery. Anything missing (broker, worker, kanaal, notifications config) shows up as a non-delivery.
@@ -111,7 +111,9 @@ def main():
}, },
}, crs=True) }, crs=True)
print(f">> wrote RegisterRecord {created['url']}") print(f">> wrote RegisterRecord {created['url']}")
print(f"REFERENCE {reference}") # An NRC notification carries no record data — only hoofdObject/resourceUrl — so the object
# URL, not the reference in its data, is what the caller can correlate the delivery on.
print(f"OBJECT_URL {created['url']}")
return 0 return 0
+8 -6
View File
@@ -58,22 +58,24 @@ drv="$(docker create --network "$net" --name rr-overify \
python:3-slim python /driver.py)" python:3-slim python /driver.py)"
docker cp "$here/objecten-notifications-check.py" "$drv:/driver.py" >/dev/null docker cp "$here/objecten-notifications-check.py" "$drv:/driver.py" >/dev/null
docker start -a "$drv" docker start -a "$drv"
reference="$(docker logs rr-overify 2>/dev/null | sed -n 's/^REFERENCE //p' | head -1)" object_url="$(docker logs rr-overify 2>/dev/null | sed -n 's/^OBJECT_URL //p' | head -1)"
docker rm -f rr-overify >/dev/null docker rm -f rr-overify >/dev/null
[ -n "$reference" ] || { echo "FAIL — the driver did not write a RegisterRecord" >&2; exit 1; } [ -n "$object_url" ] || { echo "FAIL — the driver did not write a RegisterRecord" >&2; exit 1; }
echo ">> wrote reference $reference" echo ">> wrote $object_url"
# Correlate on the object URL: a notification carries hoofdObject/resourceUrl, never the record
# data, so the reference inside the record is not in the delivered message.
echo ">> waiting for the notification to reach the sink" echo ">> waiting for the notification to reach the sink"
for _ in $(seq 1 "${NOTIFICATION_TRIES:-40}"); do for _ in $(seq 1 "${NOTIFICATION_TRIES:-40}"); do
if docker logs rr-osink 2>&1 | grep -q "$reference"; then if docker logs rr-osink 2>&1 | grep -qF "$object_url"; then
echo "OK — Objecten published to NRC and the abonnement delivered it:" echo "OK — Objecten published to NRC and the abonnement delivered it:"
docker logs rr-osink 2>&1 | grep "$reference" | tail -1 | cut -c1-500 docker logs rr-osink 2>&1 | grep -F "$object_url" | tail -1 | cut -c1-500
exit 0 exit 0
fi fi
sleep 2 sleep 2
done done
echo "FAIL — no 'objecten' notification for $reference reached the sink." >&2 echo "FAIL — no 'objecten' notification for $object_url reached the sink." >&2
echo " Objecten accepted the write, so the gap is downstream: the celery broker/worker," >&2 echo " Objecten accepted the write, so the gap is downstream: the celery broker/worker," >&2
echo " the kanaal registration, or Objecten's notifications_config." >&2 echo " the kanaal registration, or Objecten's notifications_config." >&2
echo "--- sink log ---" >&2; docker logs rr-osink 2>&1 | tail -8 >&2 echo "--- sink log ---" >&2; docker logs rr-osink 2>&1 | tail -8 >&2