Merge remote-tracking branch 'origin/feat/arbiter-emits-events' into naprawa-53
This commit is contained in:
@@ -57,7 +57,7 @@ def test_push_checks_each_module_with_its_own_lists(slug):
|
||||
def test_each_module_is_checked_in_its_own_tier():
|
||||
push = PUSH.read_text(encoding="utf-8")
|
||||
assert 'case $slug in lexicon) IDENTITY_CHECK_ARGS="$IDENTITY_CHECK_ARGS --model-provider-keys" ;; esac' in push
|
||||
assert "case $slug in galena|agora|parafa|workflow)" in push
|
||||
assert "case $slug in galena|agora|parafa|workflow|arbiter)" in push
|
||||
assert 'case $slug in panorama) IDENTITY_CHECK_ARGS="$IDENTITY_CHECK_ARGS --events-reader" ;; esac' in push
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ def test_the_hub_template_lists_each_in_exactly_its_tier():
|
||||
|
||||
def test_init_add_puts_each_module_in_its_tier():
|
||||
init = INIT.read_text(encoding="utf-8")
|
||||
assert "case $ADD in galena|agora|parafa|workflow)" in init
|
||||
assert "case $ADD in galena|agora|parafa|workflow|arbiter)" in init
|
||||
assert 'add_to_list "$OUT/env/atrium.env" MODULE_EVENT_READER_ROLES "$ROLE_PREFIX${ADD}_app"' in init
|
||||
assert '"env/atrium.env:MODULE_EVENT_READER_ROLES"' in init
|
||||
|
||||
|
||||
@@ -66,8 +66,8 @@ def test_the_evidence_lists_as_shipped():
|
||||
|
||||
def test_parafa_is_an_emitter_and_scribe_is_in_no_tier():
|
||||
push, init = PUSH.read_text(encoding="utf-8"), INIT.read_text(encoding="utf-8")
|
||||
assert "case $slug in galena|agora|parafa|workflow)" in push
|
||||
assert "case $ADD in galena|agora|parafa|workflow)" in init
|
||||
assert "case $slug in galena|agora|parafa|workflow|arbiter)" in push
|
||||
assert "case $ADD in galena|agora|parafa|workflow|arbiter)" in init
|
||||
assert "parafa_app" in _list("MODULE_EVENT_EMITTER_ROLES")
|
||||
assert "parafa_app" not in _list("MODULE_EVENT_READER_ROLES")
|
||||
for key in OPT_INS:
|
||||
|
||||
@@ -160,7 +160,7 @@ HUB_ON_THE_PLATFORM = {
|
||||
"IDENTITY_READER_ROLES": ",".join(f"{app}_app" for app in FAMILY[1:]),
|
||||
"IDENTITY_MIGRATOR_ROLES": ",".join(f"{app}_migrator" for app in FAMILY[1:]),
|
||||
# The modules taking part in the shared event log (dredd-core 0.20.0), init.sh's default.
|
||||
"MODULE_EVENT_EMITTER_ROLES": "galena_app,agora_app,parafa_app,workflow_app",
|
||||
"MODULE_EVENT_EMITTER_ROLES": "galena_app,agora_app,parafa_app,workflow_app,arbiter_app",
|
||||
# The event log's reader tier (dredd-core 0.23.0) and the model-provider key readers.
|
||||
"MODULE_EVENT_READER_ROLES": "panorama_app",
|
||||
"MODEL_PROVIDER_KEY_READER_ROLES": "arbiter_app,lexicon_app",
|
||||
|
||||
Vendored
+3
-2
@@ -83,8 +83,9 @@ MODEL_PROVIDER_MIGRATOR_ROLES=arbiter_migrator
|
||||
# not listed reaches nothing in the log. Re-applied on every migrate (python -m app.identity_grants).
|
||||
# Agora writes `negotiation.round_received` when the other side sends a round, so agora_app is listed;
|
||||
# Parafa writes `document.signed` when a PDF is signed, so parafa_app is listed too; Workflow writes
|
||||
# its run events (dredd_core.workflow_contract), so workflow_app is listed as well.
|
||||
MODULE_EVENT_EMITTER_ROLES=galena_app,agora_app,parafa_app,workflow_app
|
||||
# its run events (dredd_core.workflow_contract), so workflow_app is listed as well; Arbiter writes
|
||||
# `analysis.accepted` when a lawyer accepts an analysis, so arbiter_app is listed too.
|
||||
MODULE_EVENT_EMITTER_ROLES=galena_app,agora_app,parafa_app,workflow_app,arbiter_app
|
||||
# The event log's READER tier (dredd-core 0.23.0): SELECT and nothing else, for a module that reports
|
||||
# on the log and says nothing itself — Panorama's trends. Joined the same way; a role is an emitter or
|
||||
# a reader, never both (the grant block refuses the overlap). push.sh checks it with --events-reader.
|
||||
|
||||
+4
-4
@@ -429,8 +429,8 @@ write_app_files() {
|
||||
# The modules that take part in the shared event log (dredd-core 0.20.0, revision 0011); like
|
||||
# the opt-ins above, each takes effect once its role is also an identity reader.
|
||||
# Agora emits (a round from the other side), Parafa too (document.signed), and Workflow (every
|
||||
# step of a run, dredd_core.workflow_contract); Panorama only reads (dredd-core 0.23.0's reader tier).
|
||||
set_key "$runtime" MODULE_EVENT_EMITTER_ROLES "$ROLE_PREFIX"galena_app,"$ROLE_PREFIX"agora_app,"$ROLE_PREFIX"parafa_app,"$ROLE_PREFIX"workflow_app
|
||||
# step of a run, dredd_core.workflow_contract), and Arbiter (analysis.accepted); Panorama only reads (dredd-core 0.23.0's reader tier).
|
||||
set_key "$runtime" MODULE_EVENT_EMITTER_ROLES "$ROLE_PREFIX"galena_app,"$ROLE_PREFIX"agora_app,"$ROLE_PREFIX"parafa_app,"$ROLE_PREFIX"workflow_app,"$ROLE_PREFIX"arbiter_app
|
||||
set_key "$runtime" MODULE_EVENT_READER_ROLES "$ROLE_PREFIX"panorama_app
|
||||
# The shared counterparty register (dredd-core 0.21.0, revision 0012): Sygna writes, and its
|
||||
# migrator moves its own counterparties in. No reader since Workflow (Compass) was retired.
|
||||
@@ -534,8 +534,8 @@ if [ -n "$ADD" ]; then
|
||||
add_to_list "$OUT/env/atrium.env" IDENTITY_READER_ROLES "$ROLE_PREFIX${ADD}_app"
|
||||
add_to_list "$OUT/env/atrium.env" IDENTITY_MIGRATOR_ROLES "$ROLE_PREFIX${ADD}_migrator"
|
||||
CHANGED="$CHANGED\n env/atrium.env IDENTITY_READER_ROLES += $ROLE_PREFIX${ADD}_app, IDENTITY_MIGRATOR_ROLES += $ROLE_PREFIX${ADD}_migrator"
|
||||
# Galena, Agora, Parafa and Workflow take part in the shared event log (push.sh checks them with --events).
|
||||
case $ADD in galena|agora|parafa|workflow)
|
||||
# Galena, Agora, Parafa, Workflow and Arbiter take part in the shared event log (push.sh checks them with --events).
|
||||
case $ADD in galena|agora|parafa|workflow|arbiter)
|
||||
add_to_list "$OUT/env/atrium.env" MODULE_EVENT_EMITTER_ROLES "$ROLE_PREFIX${ADD}_app"
|
||||
CHANGED="$CHANGED\n env/atrium.env MODULE_EVENT_EMITTER_ROLES += $ROLE_PREFIX${ADD}_app" ;;
|
||||
esac
|
||||
|
||||
+6
-4
@@ -390,11 +390,12 @@ app_setup() { # sets the per-app globals for $1
|
||||
# Arbiter (the split plan's M1) lives at apps/arbiter of its repository (which also carries the
|
||||
# analysis engine's packages/*), so SUBDIR is set: the checkout root is not the app root. Its evidence is
|
||||
# app.models APPEND_ONLY_TABLES / NO_DELETE_TABLES — the lists its 0002, 0005 and 0006 grant from
|
||||
# (test_deploy_arbiter_check_args.py compares them). Its 0001 runs CREATE EXTENSION IF NOT EXISTS
|
||||
# (test_deploy_arbiter_check_args.py compares them); its event tables are Agora's case
|
||||
# (analysis.accepted: --events). Its 0001 runs CREATE EXTENSION IF NOT EXISTS
|
||||
# "pgcrypto", which Galena's provisioning has already put in the database, and its committed
|
||||
# provision.sql declares no extension — Insider's case exactly, so none is asked for here.
|
||||
arbiter) UP=ARBITER; EXTENSIONS=""
|
||||
CHECK_EXTRA="--append-only audit_log analysis_signoff agent_version frozen_card --no-delete analysis"
|
||||
CHECK_EXTRA="--append-only audit_log analysis_signoff agent_version frozen_card module_event module_event_receipt --no-delete analysis"
|
||||
SUBDIR=apps/arbiter ;;
|
||||
# Lexicon, Agora and Panorama (the split plan's M2, M3, M4): each app.models APPEND_ONLY_TABLES /
|
||||
# NO_DELETE_TABLES, the lists their 0002 grants from and their CI's managed check passes
|
||||
@@ -467,8 +468,9 @@ app_setup() { # sets the per-app globals for $1
|
||||
# Only once the module itself pins dredd-core 0.20.0 or later: an older pin's `managed check` has
|
||||
# no --events flag and would refuse the whole check.
|
||||
# Agora emits too (a round from the other side; it pins 0.22.0, so always --events), and Parafa
|
||||
# (document.signed; it pins 0.23.0), and Workflow (its runs' events; it pins 0.24.0).
|
||||
case $slug in galena|agora|parafa|workflow)
|
||||
# (document.signed; it pins 0.23.0), and Workflow (its runs' events; it pins 0.24.0), and Arbiter
|
||||
# (analysis.accepted; it pins 0.25.0).
|
||||
case $slug in galena|agora|parafa|workflow|arbiter)
|
||||
pin=$(sed -n 's/^dredd-core @ .*@v\([0-9.]*\).*/\1/p' "$MODULE/backend/requirements.txt" 2>/dev/null | head -1 || true)
|
||||
case $pin in 0.[0-9].*|0.1[0-9].*) ;; *) IDENTITY_CHECK_ARGS="$IDENTITY_CHECK_ARGS --events" ;; esac ;;
|
||||
esac
|
||||
|
||||
Reference in New Issue
Block a user