Repository navigation
Package Storage Metrics as a module (Phase 5) - #41
Open
tjsullivan1 wants to merge 4 commits into
Open
tjsullivan1 wants to merge 4 commits into
tjsullivan1 wants to merge 4 commits into
Conversation
Extract private helpers with explicit inputs, preserve dot-source entry points and flat exports, and add typed table views plus record/status references. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 2fe9508c-dba1-4dd4-a425-ac46a9581943
Move fixture setup to BeforeAll, retain module-scoped offline mocks, and route UTC reads through an internal clock. Preserve all 190 original tests and add retry-date and polling-deadline coverage. Pin Pester 5.7.1 in CI and verification docs. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: bab1d34b-d8d8-4bd1-8a3a-5e44f606ee9d
There was a problem hiding this comment.
🟡 Changes recommended
Mixed-record output bypasses the separate compact table views and falls back to full-property lists.
1 open issue
What changed in this PR
Packages the existing Azure Storage collectors and cost estimator as a reusable module, preserving dot-source entry points and flat export schemas.
Changes:
- Separates public commands, private helpers and versioned classification policy.
- Adds display metadata and table views for 21 record types.
- Updates documentation and module-scoped regression tests.
| File | Description |
|---|---|
| PowerShell/StorageMetrics/tests/StorageMetrics.Module.Tests.ps1 | Tests exports, shims and view registration. |
| PowerShell/StorageMetrics/tests/Get-AzStorageWorkloadBaseline.Tests.ps1 | Adds module mocks and export checks. |
| PowerShell/StorageMetrics/tests/Get-AzStorageTransactionMetric.Tests.ps1 | Tests schemas, metadata and policy reuse. |
| PowerShell/StorageMetrics/tests/Get-AzStorageRedundancyCost.Tests.ps1 | Tests typed estimate exports. |
| PowerShell/StorageMetrics/tests/Get-AzStorageCostComparison.Tests.ps1 | Moves mocks into module scope. |
| PowerShell/StorageMetrics/tests/Get-AzStorageCapacity.Tests.ps1 | Updates mocks and error-type checks. |
| PowerShell/StorageMetrics/StorageTransactionMetrics.md | Documents module layout and aggregation rules. |
| PowerShell/StorageMetrics/StorageTransactionCostComparison.ps1 | Removes the former companion implementation. |
| PowerShell/StorageMetrics/StorageMetrics.psm1 | Loads policy, helpers and public commands. |
| PowerShell/StorageMetrics/StorageMetrics.psd1 | Defines exports and formatting registration. |
| PowerShell/StorageMetrics/StorageMetrics.format.ps1xml | Adds record-specific table views. |
| PowerShell/StorageMetrics/Quickstart.md | Documents module import and packaging. |
| PowerShell/StorageMetrics/Public/Get-AzStorageTransactionMetric.ps1 | Integrates explicit helper inputs and record types. |
| PowerShell/StorageMetrics/Public/Get-AzStorageRedundancyCost.ps1 | Integrates policy-backed products and typed output. |
| PowerShell/StorageMetrics/PSScriptAnalyzerSettings.psd1 | Removes blanket unused-parameter suppression. |
| PowerShell/StorageMetrics/Private/Set-StorageRecordType.ps1 | Attaches display-only type metadata. |
| PowerShell/StorageMetrics/Private/Set-RetailCost.ps1 | Extracts pricing with explicit observation time. |
| PowerShell/StorageMetrics/Private/New-TransactionRecord.ps1 | Constructs records from explicit metadata. |
| PowerShell/StorageMetrics/Private/New-EstimateRecord.ps1 | Constructs records from explicit assumptions. |
| PowerShell/StorageMetrics/Private/New-CostMeter.ps1 | Applies billing classification policy. |
| PowerShell/StorageMetrics/Private/Invoke-StorageMetricRequest.ps1 | Extracts response parsing and retry inputs. |
| PowerShell/StorageMetrics/Private/Invoke-StorageArmGet.ps1 | Adds comment-based help. |
| PowerShell/StorageMetrics/Private/Import-CostRows.ps1 | Extracts billing CSV import. |
| PowerShell/StorageMetrics/Private/Get-TransactionSeries.ps1 | Extracts transaction response validation. |
| PowerShell/StorageMetrics/Private/Get-TransactionChunkRecords.ps1 | Makes collection dependencies explicit. |
| PowerShell/StorageMetrics/Private/Get-StorageWorkloadBaseline.ps1 | Moves workload normalization into Private. |
| PowerShell/StorageMetrics/Private/Get-StorageTransactionCostComparison.ps1 | Coordinates private billing helpers. |
| PowerShell/StorageMetrics/Private/Get-StorageCapacityRecord.ps1 | Delegates to extracted capacity helpers. |
| PowerShell/StorageMetrics/Private/Get-SeriesCount.ps1 | Extracts request-count validation. |
| PowerShell/StorageMetrics/Private/Get-RetailCatalog.ps1 | Builds catalog queries from policy. |
| PowerShell/StorageMetrics/Private/Get-ReportHeader.ps1 | Extracts report-header access. |
| PowerShell/StorageMetrics/Private/Get-LiveCostRows.ps1 | Extracts report polling and downloads. |
| PowerShell/StorageMetrics/Private/Get-CostLookupKey.ps1 | Extracts normalized billing keys. |
| PowerShell/StorageMetrics/Private/Get-CostField.ps1 | Extracts billing field resolution. |
| PowerShell/StorageMetrics/Private/Get-CostDecimal.ps1 | Extracts invariant decimal parsing. |
| PowerShell/StorageMetrics/Private/Get-CapacityWindow.ps1 | Extracts hourly capacity reconciliation. |
| PowerShell/StorageMetrics/Private/Get-CapacitySeries.ps1 | Makes context and retries explicit. |
| PowerShell/StorageMetrics/Private/Get-CapacityPoints.ps1 | Extracts capacity sample validation. |
| PowerShell/StorageMetrics/Private/ConvertTo-MonthlyRecord.ps1 | Makes aggregation boundaries explicit. |
| PowerShell/StorageMetrics/Private/ConvertTo-CostMeterRecord.ps1 | Extracts flat billing-record conversion. |
| PowerShell/StorageMetrics/Get-AzStorageTransactionMetric.ps1 | Becomes a compatibility import shim. |
| PowerShell/StorageMetrics/Get-AzStorageRedundancyCost.ps1 | Becomes a compatibility import shim. |
| PowerShell/StorageMetrics/Data/StoragePricingPolicy.psd1 | Centralizes versioned mappings and sources. |
Review effort: Balanced
| </View> | ||
| <View> | ||
| <Name>StorageMetrics.Summary</Name> | ||
| <ViewSelectedBy><TypeName>StorageMetrics.Summary</TypeName></ViewSelectedBy> |
There was a problem hiding this comment.
Added a shared mixed-record table view and Out-String coverage. Commit: 38456e8.
…hase-6 Storage Metrics phase 6: migrate to Pester 5
Co-authored-by: tjsullivan1 <191369+tjsullivan1@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Get-AzStorageTransactionMetricandGet-AzStorageRedundancyCost; keep both existing.ps1files as dot-source-compatible import shims.Privatewith explicit account, time-window, context, retry and policy inputs. Move classification/product tables into versioned policy data with source URLs and retrieval dates, loaded once per import.StorageMetrics.<RecordType>display metadata and compact table views for all 21 record types without changing ordered CSV/JSON properties.This is Phase 5 only. Phase 4 (#40) merged into master before this PR was opened. The branch adds one distinct Phase 5 commit after
dcec962; no Phase 4 commits were changed and this PR is not stacked.Verification
Standards review
No documented-standard violations. The reviewer noted the existing category switches in retail meter selection as a possible repeated-switch smell. Those switches are unchanged behavior moved into
Publicand are outside Phase 5's requested policy tables, so they remain unchanged.Spec review
No significant issues or missing Phase 5 requirements found. No Phase 6 work included.