Conversation
There was a problem hiding this comment.
Pull request overview
Resolves a merge conflict by integrating the new “Replication” diagram into the Sites/Replication report content and enhancing the replication diagram output/metadata.
Changes:
- Add a replication legend and edge-coloring logic to the replication topology diagram.
- Update the Sites/Replication report section to render the “Replication” diagram (instead of “SitesInventory”).
- Adjust replication connection transport protocol labeling and document the new diagram in the changelog.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| Src/Private/Get-AbrDiagReplication.ps1 | Adds an HTML legend and colors edges based on intra-site vs inter-site replication. |
| Src/Private/Get-AbrADSite.ps1 | Switches embedded diagram generation to -DiagramType 'Replication' and updates section text/messages. |
| Src/Private/Get-AbrADReplicationInfo.ps1 | Changes default TransportProtocol for null/empty InterSiteTransportProtocol. |
| CHANGELOG.md | Notes the addition of the replication diagram to the report. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| $ReplInfo = Get-AbrADReplicationInfo | ||
|
|
||
| $HTMLLegend = '<table border="0"><tr><td><font color="darkgreen">■</font> <b>IntraSite</b> <font color="darkblue">■</font> <b>InterSite</b></td></tr></table>' |
There was a problem hiding this comment.
$HTMLLegend is being passed as a plain string into the subgraph Label. Graphviz only renders HTML-like labels when they are emitted as an unquoted HTML label (e.g. label=<<TABLE>...>>); as-is this will likely render the literal <table>...</table> text or break DOT parsing depending on the exporter. Use the same helper used elsewhere for HTML labels (e.g., wrap/construct via Add-DiaHtmlLabel/signature-table helper) so the label is emitted in HTML-label form, and avoid hard-coding markup in a raw string.
| $HTMLLegend = '<table border="0"><tr><td><font color="darkgreen">■</font> <b>IntraSite</b> <font color="darkblue">■</font> <b>InterSite</b></td></tr></table>' | |
| $HTMLLegend = Add-DiaHtmlLabel -Label '<table border="0"><tr><td><font color="darkgreen">■</font> <b>IntraSite</b> <font color="darkblue">■</font> <b>InterSite</b></td></tr></table>' -SubgraphLabel |
|
|
||
| $ReplInfo = Get-AbrADReplicationInfo | ||
|
|
||
| $HTMLLegend = '<table border="0"><tr><td><font color="darkgreen">■</font> <b>IntraSite</b> <font color="darkblue">■</font> <b>InterSite</b></td></tr></table>' |
There was a problem hiding this comment.
The legend text is hard-coded in English (IntraSite/InterSite) even though the rest of the diagram strings use $reportTranslate.NewADDiagram.*. Please move these strings into the language .psd1 (e.g., add new translation keys) and build the legend from $reportTranslate so it can be localized consistently.
| $HTMLLegend = '<table border="0"><tr><td><font color="darkgreen">■</font> <b>IntraSite</b> <font color="darkblue">■</font> <b>InterSite</b></td></tr></table>' | |
| $HTMLLegend = ('<table border="0"><tr><td><font color="darkgreen">■</font> <b>{0}</b> <font color="darkblue">■</font> <b>{1}</b></td></tr></table>' -f $reportTranslate.NewADDiagram.IntraSite, $reportTranslate.NewADDiagram.InterSite) |
| AditionalInfo = $AditionalInfo | ||
| TransportProtocol = switch ([string]::IsNullOrEmpty($Conn.InterSiteTransportProtocol)) { | ||
| $true { 'Unknown' } | ||
| $true { 'RPC' } |
There was a problem hiding this comment.
InterSiteTransportProtocol is the AD inter-site transport type (typically IP or SMTP). Mapping an empty/null value to 'RPC' is misleading/inaccurate and will cause the diagram edge labels to show RPC for connections where the transport protocol is actually unknown or not applicable. Consider keeping null/empty as 'Unknown' (previous behavior) or mapping to the correct default transport (IP) only if you can reliably assert that from AD semantics.
| $true { 'RPC' } | |
| $true { 'Unknown' } |
Merge conflict