A sync that changed nothing says so again
Comparing the per-node digest against an engine that does not record one is comparing against nothing, and reporting every node as changed on every sync for ever — which is what a client newer than its engine did, since `NodeDef` drops fields it has never heard of. A node is named now only when both sides carry a digest, so a no-op sync is `unchanged` again and the signal one syncs for is back. That silence had also been the only sign of the mismatch, so sync now names it: one line saying the engine stored no record of what a node's code reaches, with both versions in it and what to run. Bumped to 0.1.6 — the digest changed the stored document's shape, and a version that does not move makes two different engines indistinguishable, which is the thing it was made load-bearing for a day ago. `— draft` was printed whenever there was simply nothing to publish, which reads as work left unfinished. It is said only when a draft is genuinely there, and `— published` when one was.
This commit is contained in:
@@ -104,6 +104,25 @@ def test_a_node_whose_helper_moved_is_named_by_sync():
|
||||
assert _moved_code(None, document) == []
|
||||
|
||||
|
||||
def test_an_engine_that_records_no_digest_is_not_a_change_every_time():
|
||||
"""It drops the field on parse, so comparing against it reports for ever.
|
||||
|
||||
Which is what an engine older than this client does, and what a node
|
||||
drawn on the canvas looks like — neither is a helper somebody edited.
|
||||
"""
|
||||
from fluksio.sdk.client import _moved_code
|
||||
|
||||
older = {"definition": {"nodes": [{"id": "fit"}, {"id": "prepare"}]}}
|
||||
document = {
|
||||
"nodes": [
|
||||
{"id": "fit", "code_digest": "ccc"},
|
||||
{"id": "prepare", "code_digest": ""},
|
||||
]
|
||||
}
|
||||
|
||||
assert _moved_code(older, document) == []
|
||||
|
||||
|
||||
def test_a_second_sync_changes_nothing_and_commits_nothing(api, flows):
|
||||
sync([flows["train"]], api, origin=ORIGIN)
|
||||
before = commits()
|
||||
|
||||
Reference in New Issue
Block a user