Conversation
…sBuiltReport.Diagram
… fixes Co-authored-by: rebelinux <1002783+rebelinux@users.noreply.github.com>
### Changed
- Migrate Diagrammer.Core to AsBuiltReport.Diagram for better integration and maintenance
- Update module dependencies to reflect the change
- Refactor code to use AsBuiltReport.Diagram instead of Diagrammer.Core
- Bump AsBuiltReport.Chart to version 0.3.0 to include latest charting features and improvements
- Bump AsBuiltReport.Diagram to version 1.0.2 to include latest diagramming features and improvements
- Reorganize module structure - moved module files to AsBuiltReport.System.Resources/ subdirectory
- Update zentered/bluesky-post-action to v0.4.0 for improved stability and performance
Updated version of AsBuiltReport.Diagram to 1.0.3 for latest features.
…atures and improvements
There was a problem hiding this comment.
Pull request overview
This PR prepares the v0.1.3 public release of AsBuiltReport.System.Resources, reorganizing the module structure and adding health-check reporting alongside updated diagram/chart integrations.
Changes:
- Reorganize the module into
AsBuiltReport.System.Resources/and update module loader/manifest/config for v0.1.3. - Add an uptime health check (configurable via
HealthCheck.Uptime) with warning/corrective-action output, plus updated localization strings. - Migrate diagramming from
Diagrammer.CoretoAsBuiltReport.Diagram, bumpAsBuiltReport.Chartdependency, and update the release workflow accordingly.
Reviewed changes
Copilot reviewed 50 out of 56 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| Todo.md | Marks chart/diagram work as completed. |
| Src/Public/Invoke-AsBuiltReport.System.Resources.ps1 | Removed old entry point (moved under new module folder). |
| Src/Private/Get-SystemUptime.ps1 | Removed old helper (moved under new module folder). |
| Src/Private/Get-AbrUptime.ps1 | Removed old uptime section (moved/refactored under new module folder). |
| Src/Private/Get-AbrProcessDiagram.ps1 | Removed old diagram builder (moved/refactored under new module folder). |
| README.md | Documents new diagram/chart module dependencies. |
| CHANGELOG.md | Adds v0.1.3 changelog entry. |
| AsBuiltReport.System.Resources/Src/Public/Invoke-AsBuiltReport.System.Resources.ps1 | New entry point with expanded comment-based help and relocated implementation. |
| AsBuiltReport.System.Resources/Src/Private/Get-SystemUptime.ps1 | Relocated + clarified WMI uptime fallback for Windows PowerShell. |
| AsBuiltReport.System.Resources/Src/Private/Get-AbrUptime.ps1 | Refactored uptime reporting and added health-check rendering. |
| AsBuiltReport.System.Resources/Src/Private/Get-AbrTimeZone.ps1 | Expanded help/comments and minor structure clarifications. |
| AsBuiltReport.System.Resources/Src/Private/Get-AbrPSHost.ps1 | Expanded help/comments and minor structure clarifications. |
| AsBuiltReport.System.Resources/Src/Private/Get-AbrProcessInfo.ps1 | Adds charts + diagram export integration and updates process section output. |
| AsBuiltReport.System.Resources/Src/Private/Get-AbrProcessDiagram.ps1 | New diagram builder using AsBuiltReport.Diagram/PSGraph-style DSL helpers. |
| AsBuiltReport.System.Resources/Src/Private/Get-AbrDate.ps1 | Expanded help/comments and minor structure clarifications. |
| AsBuiltReport.System.Resources/Src/Private/Export-AbrDiagram.ps1 | Updates diagram export/render path for AsBuiltReport.Diagram and aspect ratio handling. |
| AsBuiltReport.System.Resources/Language/ar-SA/SystemResources.psd1 | Adds uptime health-check strings. |
| AsBuiltReport.System.Resources/Language/cs-CZ/SystemResources.psd1 | Adds uptime health-check strings. |
| AsBuiltReport.System.Resources/Language/da-DK/SystemResources.psd1 | Adds uptime health-check strings. |
| AsBuiltReport.System.Resources/Language/de-DE/SystemResources.psd1 | Adds uptime health-check strings. |
| AsBuiltReport.System.Resources/Language/el-GR/SystemResources.psd1 | Adds uptime health-check strings. |
| AsBuiltReport.System.Resources/Language/en-GB/SystemResources.psd1 | Adds uptime health-check strings. |
| AsBuiltReport.System.Resources/Language/en-US/SystemResources.psd1 | Adds uptime health-check strings. |
| AsBuiltReport.System.Resources/Language/es-ES/SystemResources.psd1 | Adds uptime health-check strings (translated). |
| AsBuiltReport.System.Resources/Language/fi-FI/SystemResources.psd1 | Adds uptime health-check strings. |
| AsBuiltReport.System.Resources/Language/fr-FR/SystemResources.psd1 | Adds uptime health-check strings. |
| AsBuiltReport.System.Resources/Language/he-IL/SystemResources.psd1 | Adds uptime health-check strings. |
| AsBuiltReport.System.Resources/Language/hi-IN/SystemResources.psd1 | Adds uptime health-check strings. |
| AsBuiltReport.System.Resources/Language/hu-HU/SystemResources.psd1 | Adds uptime health-check strings. |
| AsBuiltReport.System.Resources/Language/it-IT/SystemResources.psd1 | Adds uptime health-check strings. |
| AsBuiltReport.System.Resources/Language/ja-JP/SystemResources.psd1 | Adds uptime health-check strings. |
| AsBuiltReport.System.Resources/Language/ko-KR/SystemResources.psd1 | Adds uptime health-check strings. |
| AsBuiltReport.System.Resources/Language/nb-NO/SystemResources.psd1 | Adds uptime health-check strings. |
| AsBuiltReport.System.Resources/Language/nl-NL/SystemResources.psd1 | Adds uptime health-check strings. |
| AsBuiltReport.System.Resources/Language/pl-PL/SystemResources.psd1 | Adds uptime health-check strings. |
| AsBuiltReport.System.Resources/Language/pt-PT/SystemResources.psd1 | Adds uptime health-check strings. |
| AsBuiltReport.System.Resources/Language/ru-RU/SystemResources.psd1 | Adds uptime health-check strings. |
| AsBuiltReport.System.Resources/Language/sv-SE/SystemResources.psd1 | Adds uptime health-check strings. |
| AsBuiltReport.System.Resources/Language/th-TH/SystemResources.psd1 | Adds uptime health-check strings. |
| AsBuiltReport.System.Resources/Language/tr-TR/SystemResources.psd1 | Adds uptime health-check strings. |
| AsBuiltReport.System.Resources/Language/vi-VN/SystemResources.psd1 | Adds uptime health-check strings. |
| AsBuiltReport.System.Resources/Language/zh-CN/SystemResources.psd1 | Adds uptime health-check strings. |
| AsBuiltReport.System.Resources/Language/zh-Hans/SystemResources.psd1 | Adds uptime health-check strings. |
| AsBuiltReport.System.Resources/Language/zh-Hant/SystemResources.psd1 | Adds uptime health-check strings. |
| AsBuiltReport.System.Resources/Icons/Process.png | Adds process icon asset for diagrams. |
| AsBuiltReport.System.Resources/Icons/no_icon.png | Adds fallback icon asset. |
| AsBuiltReport.System.Resources/Icons/AsBuiltReport_Signature.png | Adds diagram signature icon asset. |
| AsBuiltReport.System.Resources/Icons/AsBuiltReport_Logo.png | Adds diagram logo icon asset. |
| AsBuiltReport.System.Resources/AsBuiltReport.System.Resources.Style.ps1 | Adds module-specific PScribo style/cover-page layout. |
| AsBuiltReport.System.Resources/AsBuiltReport.System.Resources.psm1 | New module loader under the reorganized module structure. |
| AsBuiltReport.System.Resources/AsBuiltReport.System.Resources.psd1 | Bumps version to 0.1.3 and updates dependencies to Chart 0.3.0 + Diagram 1.0.5. |
| AsBuiltReport.System.Resources/AsBuiltReport.System.Resources.json | Adds HealthCheck.Uptime default config. |
| AsBuiltReport.System.Resources.psm1 | Removes old root module loader (superseded by new module folder layout). |
| .github/workflows/Release.yml | Updates publishing workflow for new paths and diagram module dependency. |
| .github/copilot-instructions.md | Adds repository-specific Copilot guidance and conventions. |
Comments suppressed due to low confidence (2)
AsBuiltReport.System.Resources/Src/Private/Export-AbrDiagram.ps1:98
DisableMainDiagramLogois being set to$Options.EnableDiagramMainLogo, which appears inverted (a value intended to enable the logo is being passed to a disable flag). If the called cmdlet expectsDisableMainDiagramLogo = $trueto hide the logo, this should likely be-not $Options.EnableDiagramMainLogo(or the option should be renamed for clarity).
AsBuiltReport.System.Resources/Language/ru-RU/SystemResources.psd1:72- These newly added health-check strings are still in English for this locale (and appear similarly in multiple other locale files). This results in mixed-language output when running with ru-RU. Consider providing translated values (or falling back to en-US by omitting the keys) so the report remains consistently localized.
| if ($HealthCheck.Uptime) { | ||
| $SystemUptimeInfo | Where-Object { $_.$($reportTranslate.Uptime) -lt 24 } | Set-Style -Style Warning -Property $($reportTranslate.Uptime) | ||
| } |
There was a problem hiding this comment.
$HealthCheck is referenced but never initialized anywhere in this module. This will throw (or always be null) and prevents the uptime health check from working. Consider assigning $HealthCheck = $ReportConfig.HealthCheck (or similar) in the entry point and ensuring it is available to private functions, with a safe default when the config omits it.
| foreach ($Uptime in $SystemUptime) { | ||
| $InObj = [Ordered]@{ | ||
| # Format the TimeSpan as 'XhYmZs' for a concise, readable output. | ||
| $($reportTranslate.Uptime) = $Uptime.ToString("hh'h 'mm'm 'ss's'") | ||
| } | ||
| $SystemUptimeInfo += [PSCustomObject]$InObj | ||
| } | ||
|
|
||
| if ($HealthCheck.Uptime) { | ||
| $SystemUptimeInfo | Where-Object { $_.$($reportTranslate.Uptime) -lt 24 } | Set-Style -Style Warning -Property $($reportTranslate.Uptime) |
There was a problem hiding this comment.
The health-check comparisons are being done against the formatted uptime string (e.g. "03h 45m 12s"). Comparing that string with -lt 24 will fail conversion and/or produce incorrect results. Use the underlying TimeSpan (e.g. $Uptime.TotalHours) or store a numeric hours property for filtering/styling, while keeping the formatted string only for display.
| # Configure debug styling when EnableDiagramDebug is enabled. In debug mode, edges and | ||
| # subgraph borders are drawn in red so layout issues are easy to spot. In normal mode, | ||
| # these elements are made invisible (style = 'invis') so they do not appear in the | ||
| # final diagram output. | ||
| if ($Options.EnableDiagramDebug) { | ||
| $EdgeDebug = @{style = 'filled'; color = 'red' } | ||
| $SubGraphDebug = @{style = 'dashed'; color = 'red' } | ||
| $NodeDebug = @{color = 'black'; style = 'red'; shape = 'plain' } | ||
| $NodeDebugEdge = @{color = 'black'; style = 'red'; shape = 'plain' } | ||
| $IconDebug = $true | ||
| } else { | ||
| $EdgeDebug = @{style = 'invis'; color = 'red' } | ||
| $SubGraphDebug = @{style = 'invis'; color = 'gray' } | ||
| $NodeDebug = @{color = 'transparent'; style = 'transparent'; shape = 'point' } | ||
| $NodeDebugEdge = @{color = 'transparent'; style = 'transparent'; shape = 'none' } | ||
| $IconDebug = $false | ||
| } |
There was a problem hiding this comment.
Several debug-related variables are assigned ($EdgeDebug, $SubGraphDebug, $NodeDebug, $NodeDebugEdge) but never used in the diagram construction. This adds complexity without affecting output. Either remove them or pass them into the diagram elements so EnableDiagramDebug actually changes rendering.
| Builds a Graphviz-based process hierarchy diagram showing the top 5 CPU-consuming | ||
| processes and their relationship to the host system. The diagram is constructed using | ||
| the AsBuiltReport.Diagram module's PSGraph DSL (SubGraph, Add-DiaNodeIcon, Edge). | ||
|
|
There was a problem hiding this comment.
The comment says the diagram is constructed using Add-DiaNodeIcon/Edge, but the implementation uses Add-NodeIcon/Add-NodeEdge. Please update the documentation to match the actual cmdlets being used (or vice versa) to avoid confusion for future maintenance.
[0.1.3] - 2026-04-03
Added
Changed