feat(composer): admit GalaxyMxGateway-backed equipment alias tags (+byte-parity)
This commit is contained in:
@@ -471,8 +471,11 @@ public static class DeploymentArtifact
|
||||
if (isEquipment) equipmentNamespaces.Add(id!);
|
||||
}
|
||||
|
||||
// driverInstanceId → namespaceId
|
||||
// driverInstanceId → namespaceId, and driverInstanceId → DriverType. The DriverType map admits
|
||||
// a Galaxy alias (a GalaxyMxGateway-backed equipment-scoped tag) that lives in a SystemPlatform
|
||||
// namespace — byte-parity with the composer's `di.DriverType == "GalaxyMxGateway"` clause.
|
||||
var driverToNamespace = new Dictionary<string, string>(StringComparer.Ordinal);
|
||||
var driverToType = new Dictionary<string, string>(StringComparer.Ordinal);
|
||||
foreach (var el in diArr.EnumerateArray())
|
||||
{
|
||||
if (el.ValueKind != JsonValueKind.Object) continue;
|
||||
@@ -480,6 +483,9 @@ public static class DeploymentArtifact
|
||||
var ns = el.TryGetProperty("NamespaceId", out var nsEl) ? nsEl.GetString() : null;
|
||||
if (!string.IsNullOrWhiteSpace(id) && !string.IsNullOrWhiteSpace(ns))
|
||||
driverToNamespace[id!] = ns!;
|
||||
var dtype = el.TryGetProperty("DriverType", out var dtEl) ? dtEl.GetString() : null;
|
||||
if (!string.IsNullOrWhiteSpace(id) && !string.IsNullOrWhiteSpace(dtype))
|
||||
driverToType[id!] = dtype!;
|
||||
}
|
||||
|
||||
var result = new List<EquipmentTagPlan>(tagsArr.GetArrayLength());
|
||||
@@ -502,7 +508,10 @@ public static class DeploymentArtifact
|
||||
|
||||
if (string.IsNullOrWhiteSpace(tagId) || string.IsNullOrWhiteSpace(di) || string.IsNullOrWhiteSpace(name)) continue;
|
||||
if (!driverToNamespace.TryGetValue(di!, out var nsId)) continue;
|
||||
if (!equipmentNamespaces.Contains(nsId)) continue;
|
||||
// A GalaxyMxGateway-backed alias qualifies even though its namespace is SystemPlatform-kind
|
||||
// (not Equipment) — byte-parity with the composer's broadened equipment-tag filter.
|
||||
var isGalaxyAlias = driverToType.TryGetValue(di!, out var dtype2) && dtype2 == "GalaxyMxGateway";
|
||||
if (!equipmentNamespaces.Contains(nsId) && !isGalaxyAlias) continue;
|
||||
|
||||
result.Add(new EquipmentTagPlan(
|
||||
TagId: tagId!,
|
||||
|
||||
Reference in New Issue
Block a user