add Fabric read model rollback activation
All checks were successful
CI Smoke / host-smoke (push) Successful in 0s
CI Smoke / container-smoke (push) Successful in 1s
Build and Publish Multi-Context Image / build-and-push (push) Successful in 27s

Assistant: codex
Assistant-Model: gpt-5.6-sol
Assistant-Session: 01a053ff-1d6f-7fe2-ac1c-a6eb40a42a0c
This commit is contained in:
tegwick 2026-08-31 23:07:10 +02:00
parent cf40c7bb4e
commit cdff3b7e08
5 changed files with 133 additions and 0 deletions

View file

@ -1545,6 +1545,33 @@ class TestFabricGraphReadModel:
assert latest_flags[first_id] is False
assert latest_flags[second_id] is True
async def test_retained_valid_import_can_be_activated_for_rollback(self, client):
r = await client.post("/fabric/graph-exports", json=_fabric_graph_export())
first_id = r.json()["import_run"]["id"]
r = await client.post("/fabric/graph-exports", json=_fabric_graph_export(extra_node=True))
second_id = r.json()["import_run"]["id"]
r = await client.post(
f"/fabric/graph-exports/{first_id}/activate",
json={"requested_by": "cutover-test"},
)
assert r.status_code == 200, r.text
assert r.json()["activated"] is True
assert r.json()["idempotent"] is False
assert r.json()["previous_import_id"] == second_id
assert r.json()["import_run"]["id"] == first_id
assert (await client.get("/fabric/graph/summary")).json()["node_count"] == 3
r = await client.post(f"/fabric/graph-exports/{first_id}/activate")
assert r.status_code == 200, r.text
assert r.json()["activated"] is False
assert r.json()["idempotent"] is True
r = await client.post(f"/fabric/graph-exports/{second_id}/activate")
assert r.status_code == 200, r.text
assert r.json()["previous_import_id"] == first_id
assert (await client.get("/fabric/graph/summary")).json()["node_count"] == 4
async def test_read_only_queries_filter_graph_without_mutating_state_hub_entities(self, client):
await _create_domain(client)
topic = await _create_topic(client)