Report a published node that has no code of its own
The store answers the new-node template when nothing was ever written for a
node, so such a node ran — returning {} on every call, reporting active and
ok, and saying nothing anywhere. Unreachable through `fluksio sync`, which
writes every body before it publishes; the editor end was open.
A run of a flow holding one is now refused, and the flow carries a
missing_source issue so it is visible before anybody runs it. A draft is
exempt: a node being written legitimately has no published body yet.
The generated client is regenerated for the new issue code, which also
catches up the drift left by earlier backend work (resources, code_digest,
idempotency_key).
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -140,6 +140,9 @@ class LoadedNode:
|
||||
#: so only an acknowledgement clears it, not a good run and not a rebuild.
|
||||
last_error: str = ""
|
||||
last_error_ts: float | None = None
|
||||
#: Published, and with no body of its own — so what runs is the new-node
|
||||
#: template, which returns nothing at all.
|
||||
missing_source: bool = False
|
||||
|
||||
|
||||
@dataclass
|
||||
@@ -972,6 +975,12 @@ class FlowController:
|
||||
else:
|
||||
owner, local = flow, node_def.id
|
||||
code = self.store.read_node_source(flow, node_def.id, draft=draft)
|
||||
# The store answers the new-node template when nothing was
|
||||
# written, which is what an editor should open with and not
|
||||
# something to run. A draft legitimately has none yet.
|
||||
entry.missing_source = not draft and not self.store.has_node_source(
|
||||
flow, node_def.id
|
||||
)
|
||||
|
||||
# What a node produces before it returns comes back as frames;
|
||||
# this puts them through the node's own ports.
|
||||
@@ -1679,6 +1688,21 @@ def _collect_issues(
|
||||
and entry.node.mode == HttpNode.Mode.TRIGGER
|
||||
and not entry.node.secret
|
||||
]
|
||||
# A node whose body was never stored runs the new-node template, which
|
||||
# returns nothing — quietly, and looking healthy the whole time.
|
||||
issues += [
|
||||
ValidationIssue(
|
||||
code="missing_source",
|
||||
message=(
|
||||
f"Node '{entry.id.rpartition('.')[2]}' has no stored code. It "
|
||||
"runs as an empty node and publishes nothing."
|
||||
),
|
||||
flow=entry.flow,
|
||||
node=entry.id,
|
||||
)
|
||||
for entry in loaded.values()
|
||||
if entry.missing_source
|
||||
]
|
||||
return issues
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user