Rename journal, steps and recovery: rename.json (RENAME_JOURNAL_FILE) records each step, documents are written whole and committed alone (FlowStore.replace_documents, identity.write_documents) and rolled back before the journal goes forward; history per run scoped by flow id, alert ledger, alerts.json, state and queue steps idempotent and checkpointed; audit row once per op; recover_documents before assign_ids and recover_runtime before the engine is built, retried until done; repeated requests get the stored result, stale ones 409; plan refuses rename_in_progress; alerts.json written atomically; completeness scanner in the test utilities
This commit is contained in:
@@ -943,6 +943,25 @@ class FlowStore:
|
||||
self._commit(f"Delete flow {named(key, flow_id)}")
|
||||
return key
|
||||
|
||||
def replace_documents(self, texts: dict[str, str], message: str) -> bool:
|
||||
"""Write flow and dashboard documents whole, *texts* by path relative
|
||||
to the store, and commit those paths alone with *message*.
|
||||
|
||||
A key rename's (`fluksio.flow.rename`): each text carries its version
|
||||
already, and whatever else is uncommitted stays so. False when the
|
||||
commit failed. A store without git counts as committed.
|
||||
"""
|
||||
# Here rather than at the top: it reads where dashboards live, and
|
||||
# the dashboards module imports this one.
|
||||
from fluksio.flow.identity import write_documents
|
||||
|
||||
with self._write_lock:
|
||||
try:
|
||||
return write_documents(self.root, texts, message)
|
||||
finally:
|
||||
# Whatever got written, the caches are to read it again.
|
||||
self.revision += 1
|
||||
|
||||
def duplicate_flow(
|
||||
self, flow_id: str, busy: Callable[[str], bool] | None = None
|
||||
) -> FlowDef:
|
||||
|
||||
Reference in New Issue
Block a user