Skip to content

Refactor diagram generation functions to use updated naming conventions#86

Closed
rebelinux wants to merge 3 commits intoAsBuiltReport:devfrom
rebelinux:dev
Closed

Refactor diagram generation functions to use updated naming conventions#86
rebelinux wants to merge 3 commits intoAsBuiltReport:devfrom
rebelinux:dev

Conversation

@rebelinux
Copy link
Copy Markdown
Collaborator

  • Updated function calls from Add-Dia* to Add-* for consistency across diagram generation scripts.
  • Changed Remove-SpecialChar to Remove-SpecialCharacter for improved clarity in Get-AbrOntapClusterDiagram.ps1.
  • Adjusted edge and node creation methods in Get-AbrOntapClusterReplicationDiagram.ps1, Get-AbrOntapNodeAggrDiagram.ps1, and Get-AbrOntapNodeNetworkDiagram.ps1 to reflect new naming.
  • Enhanced readability and maintainability of the code by standardizing function names and parameters.

- Updated function calls from `Add-Dia*` to `Add-*` for consistency across diagram generation scripts.
- Changed `Remove-SpecialChar` to `Remove-SpecialCharacter` for improved clarity in `Get-AbrOntapClusterDiagram.ps1`.
- Adjusted edge and node creation methods in `Get-AbrOntapClusterReplicationDiagram.ps1`, `Get-AbrOntapNodeAggrDiagram.ps1`, and `Get-AbrOntapNodeNetworkDiagram.ps1` to reflect new naming.
- Enhanced readability and maintainability of the code by standardizing function names and parameters.
Copilot AI review requested due to automatic review settings March 16, 2026 16:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors several NetApp ONTAP diagram-generation scripts to align with updated naming conventions in the diagram helper functions (moving from Add-Dia* to Add-*, and Remove-SpecialChar to Remove-SpecialCharacter), plus updates the diagram export path to use the new diagram creation/aspect-ratio helpers.

Changes:

  • Updated multiple diagram builders to use Add-* / Add-Html* helper function names.
  • Renamed special-character sanitization usage to Remove-SpecialCharacter in cluster/replication diagram flows.
  • Updated diagram export generation from New-Diagrammer/Get-DiaBestImageAspectRatio to New-AbrDiagram/Get-BestImageAspectRatio.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
Src/Private/Get-AbrOntapNodeNetworkDiagram.ps1 Renames node/subgraph/edge helper calls to Add-* equivalents.
Src/Private/Get-AbrOntapNodeAggrDiagram.ps1 Renames HTML node/subgraph helper calls to Add-Html* equivalents.
Src/Private/Get-AbrOntapClusterReplicationDiagram.ps1 Renames HTML node/subgraph/edge helper calls and switches to Remove-SpecialCharacter.
Src/Private/Get-AbrOntapClusterDiagram.ps1 Renames helper calls and sanitization, and updates edge creation calls.
Src/Private/Export-AbrOntapDiagram.ps1 Switches to new diagram creation and aspect ratio helper functions.
Comments suppressed due to low confidence (1)

Src/Private/Get-AbrOntapClusterDiagram.ps1:128

  • In the HA-pair branch, node labels still call Add-DiaNodeIcon while the rest of this refactor switches to the new Add-* naming. If Add-DiaNodeIcon has been renamed/removed (as implied by this PR), this path will fail at runtime; update these remaining calls to the new function name for consistency and to avoid broken HA-pair diagrams.
                                    Node $HAName @{Label = Add-DiaNodeIcon -Name $HA.Name -AditionalInfo ($NodeAdditionalInfo | Where-Object { $_.NodeName -eq $HA.Name }).AdditionalInfo -ImagesObj $Images -IconType 'Ontap_Node' -Align 'Center' -IconDebug $IconDebug -FontSize 18; shape = 'plain'; fillColor = 'transparent'; fontsize = 14 }

                                    Node $HAPartner @{Label = Add-DiaNodeIcon -Name $HA.Partner -AditionalInfo ($NodeAdditionalInfo | Where-Object { $_.NodeName -eq $HA.Partner }).AdditionalInfo -ImagesObj $Images -IconType 'Ontap_Node' -Align 'Center' -IconDebug $IconDebug -FontSize 18; shape = 'plain'; fillColor = 'transparent'; fontsize = 14 }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines 193 to 197
if (-not $PerPortLifs) {
$PerPortLifs = Add-DiaNodeIcon -Name "$($Port.NodeName)_$($Port.PortName)_NoLifs" -LabelName 'No LIFs Assigned' -ImagesObj $Images -IconType 'Ontap_Network_Nic' -IconDebug $IconDebug -FontSize 12 -ImageSizePercent 50 -AditionalInfo @() -IconPath $IconPath
$PerPortLifs = Add-NodeText -Name "$($Port.NodeName)_$($Port.PortName)_NoLifs" -Text 'No LIFs Assigned' -IconDebug $IconDebug -FontSize 14 -FontBold
}

if ($PerPortLifs.Count -eq 1) { $PerPortLifsColumnSize = 1 } elseif ($Options.DiagramColumnSize) { $PerPortLifsColumnSize = $Options.DiagramColumnSize } else { $PerPortLifsColumnSize = $PerPortLifs.Count }
Comment on lines +115 to +116
$ClusterNetworkImage = Add-NodeImage -Name 'ClusterSwitch1' -ImagesObj $Images -IconType 'Ontap_Cluster_Network' -IconDebug $IconDebug -TableBackgroundColor '#a1e3fd'
Add-HtmlSubGraph -Name 'ClusterNetwork' -TableArray $ClusterNetworkImage -Label 'Cluster Network' -LabelPos top -ImagesObj $Images -IconDebug $IconDebug -NodeObject -TableBorder 1 -FontSize 16 -TableBorderColor '#71797E' -TableStyle 'rounded,dashed' -FontColor 'darkblue' -FontBold -FontName 'Segoe Ui Bold' -TableBackgroundColor '#a1e3fd'
@rebelinux rebelinux closed this Mar 16, 2026
@rebelinux rebelinux reopened this Mar 16, 2026
@rebelinux rebelinux closed this Mar 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants