mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-06 10:59:59 +00:00
fix(sys-svc-rdbms): own the handler topic it notifies
dedicated.yml notifies compose-up but registers no handler for it, so a
caller that reaches sys-svc-rdbms before any compose consumer has loaded
the sys-svc-compose block dies with "The requested handler 'compose-up'
was not found" and no PLAY RECAP. 95186163aa guarded only the
sys-stk-backend caller; web-app-matrix's ansible flavor includes
sys-svc-rdbms directly in 03_database.yml and still hit it as the first
compose consumer of its play (run 33751742070, job 100643400267).
Register the owner as the first task of the notifying file. In the
sys-stk-backend path this lands before the pre-flush rebind, so the app's
copy stays the last registration.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
a703e3fc80
commit
63f7f962bf
2 files changed
+12
No files matched your search
@@ -1,4 +1,10 @@
|
||||
---
|
||||
- name: "📂 For '{{ application_id }}/{{ _database_consumer_id }}': register the compose handler owner before notifying it"
|
||||
ansible.builtin.include_role:
|
||||
name: sys-svc-compose
|
||||
tasks_from: none.yml
|
||||
handlers_from: main
|
||||
|
||||
- name: "✅ Ensure env dir exists: {{ _container_env_dir }}"
|
||||
ansible.builtin.file:
|
||||
path: "{{ _container_env_dir }}"
|
||||
|
||||
@@ -10,6 +10,7 @@ from utils.cache.yaml import load_yaml_str
|
||||
from utils.roles.mapping import ROLE_FILE_TASKS_MAIN
|
||||
|
||||
BACKEND = PROJECT_ROOT / "roles/sys-stk-backend" / ROLE_FILE_TASKS_MAIN
|
||||
RDBMS_DEDICATED = PROJECT_ROOT / "roles/sys-svc-rdbms/tasks/dedicated.yml"
|
||||
COMPOSE_OWNER = "sys-svc-compose"
|
||||
_NOTIFY = re.compile(r"^\s*notify:\s*(?:\[\s*)?['\"]?(compose-[\w-]+)", re.MULTILINE)
|
||||
|
||||
@@ -50,6 +51,11 @@ class TestHandlerRegistrationOrder(unittest.TestCase):
|
||||
self.assertEqual(loader.get("name"), COMPOSE_OWNER)
|
||||
self.assertEqual(loader.get("handlers_from"), "main")
|
||||
|
||||
def test_the_notifier_registers_the_owner_before_its_first_notify(self) -> None:
|
||||
loader = _role_include(load_yaml_str(read_text(str(RDBMS_DEDICATED)))[0])
|
||||
self.assertEqual(loader.get("name"), COMPOSE_OWNER)
|
||||
self.assertEqual(loader.get("handlers_from"), "main")
|
||||
|
||||
def test_the_owner_still_holds_every_compose_topic_that_is_notified(self) -> None:
|
||||
owner = ""
|
||||
for path, content in iter_project_files_with_content(
|
||||
|
||||
Reference in new issue
Block a user