fix(windows-node): retain adapter schema data
This commit is contained in:
parent
d62b5e0766
commit
27f7a2fe30
|
|
@ -8,6 +8,8 @@
|
||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
|
- Windows Node 接收专业软件任务时不再因适配器契约数据被提前释放而离线,已注册节点可持续接收并校验新任务。
|
||||||
|
|
||||||
- Origin 绘图新增面积图、堆叠面积图、极坐标图、饼图和堆叠条形图;堆叠类图型改用 Origin 原生多系列分组与累计机制,跨输入数据也会先校验并对齐横坐标。
|
- Origin 绘图新增面积图、堆叠面积图、极坐标图、饼图和堆叠条形图;堆叠类图型改用 Origin 原生多系列分组与累计机制,跨输入数据也会先校验并对齐横坐标。
|
||||||
|
|
||||||
- Windows Node 不再错误显示 Origin 运行状态中的中文;本机窗口、zcbot 管理页和用户专业软件任务列表会显示 Node、Adapter 及从本机程序读取的 Origin 软件版本。
|
- Windows Node 不再错误显示 Origin 运行状态中的中文;本机窗口、zcbot 管理页和用户专业软件任务列表会显示 Node、Adapter 及从本机程序读取的 Origin 软件版本。
|
||||||
|
|
|
||||||
|
|
@ -198,8 +198,13 @@ class WindowsNodeSourceTests(unittest.TestCase):
|
||||||
def test_job_offer_is_persisted_before_acceptance(self) -> None:
|
def test_job_offer_is_persisted_before_acceptance(self) -> None:
|
||||||
inbox = (PROJECT / "JobInboxStore.cs").read_text(encoding="utf-8")
|
inbox = (PROJECT / "JobInboxStore.cs").read_text(encoding="utf-8")
|
||||||
connection = (PROJECT / "NodeConnectionLoop.cs").read_text(encoding="utf-8")
|
connection = (PROJECT / "NodeConnectionLoop.cs").read_text(encoding="utf-8")
|
||||||
|
adapters = (PROJECT / "NodeAdapters.cs").read_text(encoding="utf-8")
|
||||||
self.assertIn("adapters.Find(capability)", inbox)
|
self.assertIn("adapters.Find(capability)", inbox)
|
||||||
self.assertIn("adapter.ValidateRequest(request)", inbox)
|
self.assertIn("adapter.ValidateRequest(request)", inbox)
|
||||||
|
self.assertIn(
|
||||||
|
'JsonSchema.Build(contractRoot.GetProperty("request_schema").Clone())',
|
||||||
|
adapters,
|
||||||
|
)
|
||||||
self.assertNotIn("IsValidOriginRequest", inbox)
|
self.assertNotIn("IsValidOriginRequest", inbox)
|
||||||
self.assertNotIn("IsValidPlot", inbox)
|
self.assertNotIn("IsValidPlot", inbox)
|
||||||
self.assertIn('root.TryGetProperty("input_transfers"', inbox)
|
self.assertIn('root.TryGetProperty("input_transfers"', inbox)
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,9 @@ internal sealed record AdapterDescriptor(
|
||||||
.Where(item => ParseVersion(item.Value.GetString() ?? "0.0.0") <= currentVersion)
|
.Where(item => ParseVersion(item.Value.GetString() ?? "0.0.0") <= currentVersion)
|
||||||
.Select(item => item.Name)
|
.Select(item => item.Name)
|
||||||
.ToArray();
|
.ToArray();
|
||||||
var schema = JsonSchema.Build(contractRoot.GetProperty("request_schema"));
|
// JsonSchema may retain the source element for deferred evaluation. Give it an
|
||||||
|
// independent backing document before contractDocument is disposed.
|
||||||
|
var schema = JsonSchema.Build(contractRoot.GetProperty("request_schema").Clone());
|
||||||
var entrypointPath = ResolveFile(root, manifest.Entrypoint);
|
var entrypointPath = ResolveFile(root, manifest.Entrypoint);
|
||||||
if ((manifest.Runtime == "python"
|
if ((manifest.Runtime == "python"
|
||||||
&& !Path.GetExtension(entrypointPath).Equals(".py", StringComparison.OrdinalIgnoreCase))
|
&& !Path.GetExtension(entrypointPath).Equals(".py", StringComparison.OrdinalIgnoreCase))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue