fix(deploy): address M2.2 review nits — backup endpoint in diff summary + null-oldConfig test (#10)
- FormatConnection now includes BackupConfigurationJson so a backup-only change no longer renders identical Before/After cells (covers all 4 ConnectionsEqual fields) - add ComputeConnectionsDiff(null, newConfig) first-deploy unit test
This commit is contained in:
@@ -892,13 +892,20 @@
|
||||
}
|
||||
|
||||
// Compact summary of a connection's deployment-relevant fields for the diff
|
||||
// table's Before/After cells: protocol, primary endpoint config, and the
|
||||
// failover retry count. Mirrors the fields ConnectionsEqual compares.
|
||||
// table's Before/After cells. Surfaces all four fields ConnectionsEqual
|
||||
// compares — protocol, primary endpoint config, failover retry count, and
|
||||
// the backup endpoint — so a backup-only change doesn't show identical
|
||||
// Before/After cells. The backup segment is omitted when there is no backup.
|
||||
private static string FormatConnection(
|
||||
ZB.MOM.WW.ScadaBridge.Commons.Types.Flattening.ConnectionConfig c)
|
||||
{
|
||||
var endpoint = string.IsNullOrWhiteSpace(c.ConfigurationJson) ? "—" : c.ConfigurationJson;
|
||||
return $"{c.Protocol} · {endpoint} · failover ×{c.FailoverRetryCount}";
|
||||
var summary = $"{c.Protocol} · {endpoint} · failover ×{c.FailoverRetryCount}";
|
||||
if (!string.IsNullOrWhiteSpace(c.BackupConfigurationJson))
|
||||
{
|
||||
summary += $" · backup {c.BackupConfigurationJson}";
|
||||
}
|
||||
return summary;
|
||||
}
|
||||
|
||||
// Renders one change section (a heading plus a Bootstrap change-table) for a
|
||||
|
||||
Reference in New Issue
Block a user