fix(transport): symmetric blocker-scan fixes in Apply-time validator
RunSemanticValidationAsync's Pass 1 minimal-name-resolution scan duplicated DetectBlockersAsync's heuristic but had the same two bugs fixed in the previous two commits: it was scanning TemplateAttribute.DataSourceReference (an OPC UA address-space path, not script source) and it was missing the KnownNonReferenceNames denylist. As a result, an import that passed the diff-step blocker check would still fail at Apply with the same 30+ identifiers reappearing as "Bundle semantic validation failed" errors. Apply the same two fixes here so the diff preview and the Apply-time validator agree.
This commit is contained in:
@@ -1650,8 +1650,12 @@ public sealed class BundleImporter : IBundleImporter
|
||||
foreach (var s in t.Scripts) CollectCallIdentifiers(s.Code, referenced);
|
||||
foreach (var a in t.Attributes)
|
||||
{
|
||||
// Value can hold script-callable design-time expressions;
|
||||
// DataSourceReference is an OPC UA address-space path (e.g.
|
||||
// "ns=3;s=Tank.Level") and must NOT be scanned, or the dot
|
||||
// delimiter will flag tag-path segments as missing references.
|
||||
// Symmetric with DetectBlockersAsync.
|
||||
CollectCallIdentifiers(a.Value, referenced);
|
||||
CollectCallIdentifiers(a.DataSourceReference, referenced);
|
||||
}
|
||||
}
|
||||
foreach (var m in content.ApiMethods)
|
||||
@@ -1664,6 +1668,7 @@ public sealed class BundleImporter : IBundleImporter
|
||||
foreach (var candidate in referenced.OrderBy(n => n, StringComparer.Ordinal))
|
||||
{
|
||||
if (!LooksLikeResourceName(candidate)) continue;
|
||||
if (KnownNonReferenceNames.Contains(candidate)) continue;
|
||||
if (sharedScriptNames.Contains(candidate) || externalSystemNames.Contains(candidate)) continue;
|
||||
errors.Add(
|
||||
$"Script references SharedScript or ExternalSystem '{candidate}' not present in bundle or target.");
|
||||
|
||||
Reference in New Issue
Block a user