A node's worker label is worker, so a device is only a paired one
- NodeDef `device`/`device_policy` become `worker`/`worker_policy`, the issue `ignored_device` becomes `ignored_worker`, and the SDK's `@node` takes `worker=` and `worker_policy=` - FlowStore._migrate renames the keys in published and draft documents once, bumping their version; a queued run's `needs` reads the old key - placement passes the label as `label`, client regenerated - docs: worker placement wording, MCP issuer without DOMAIN, device rows in the CLI data directory and the API table, device links in compose comments
This commit is contained in:
@@ -172,8 +172,10 @@ class FlowStore:
|
||||
"""Rewrite node types and settings stored under a name they no longer have.
|
||||
|
||||
On 2026-10-15 the node type ``trigger`` became ``debounce`` and the mqtt
|
||||
setting ``publish_queue_size`` became ``send_queue_size``, with no alias
|
||||
left for the old names. Each published and draft document is read as
|
||||
setting ``publish_queue_size`` became ``send_queue_size``. On 2026-10-16
|
||||
a node's ``device`` and ``device_policy`` became ``worker`` and
|
||||
``worker_policy``, so that a device is only ever a paired one. No alias
|
||||
is left for the old names. Each published and draft document is read as
|
||||
plain JSON and only the matching node changes, so a field this version
|
||||
does not model survives, and the old document stays in git. The version
|
||||
goes up by one, so an editor still holding the old document gets a
|
||||
@@ -192,25 +194,36 @@ class FlowStore:
|
||||
if n.get("type") == "mqtt"
|
||||
and "publish_queue_size" in (n.get("params") or {})
|
||||
]
|
||||
placed = [
|
||||
n for n in data["nodes"] if "device" in n or "device_policy" in n
|
||||
]
|
||||
except Exception:
|
||||
# Unreadable to the engine too, which reports it when it loads.
|
||||
continue
|
||||
if not nodes and not queues:
|
||||
if not nodes and not queues and not placed:
|
||||
continue
|
||||
for node in nodes:
|
||||
node["type"] = "debounce"
|
||||
for params in queues:
|
||||
params["send_queue_size"] = params.pop("publish_queue_size")
|
||||
for node in placed:
|
||||
for old in ("device", "device_policy"):
|
||||
if old in node:
|
||||
node[old.replace("device", "worker")] = node.pop(old)
|
||||
data["version"] = data.get("version", 1) + 1
|
||||
path.write_text(json.dumps(data, indent=2, ensure_ascii=False) + "\n")
|
||||
changed.append(f"{path.parent.name}/{path.name}")
|
||||
if changed:
|
||||
logger.warning(
|
||||
"Renamed node type 'trigger' to 'debounce' and mqtt "
|
||||
"'publish_queue_size' to 'send_queue_size' in %s",
|
||||
"Renamed node type 'trigger' to 'debounce', mqtt "
|
||||
"'publish_queue_size' to 'send_queue_size' and a node's "
|
||||
"'device' to 'worker' in %s",
|
||||
", ".join(changed),
|
||||
)
|
||||
self._commit("Rename 'trigger' nodes and mqtt 'publish_queue_size'")
|
||||
self._commit(
|
||||
"Rename 'trigger' nodes, mqtt 'publish_queue_size' and a "
|
||||
"node's 'device'"
|
||||
)
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# git
|
||||
|
||||
Reference in New Issue
Block a user