microsoft / microsoft/finops-toolkit
Break New-FinOpsTestData into smaller composable commands
Nobody has claimed this yet.
- Dominant language
- PowerShell
- Stars
- 603
- Forks
- 248
- Avg merge
- 7d 11h
- Merged PRs (30d)
- 11
Description
Summary
Refactor New-FinOpsTestData into smaller, composable commands — one per dataset type — to improve maintainability and allow independent use.
Motivation
New-FinOpsTestData is a large (~2,400+ line) monolithic function that generates all 5 FOCUS datasets. Breaking it into smaller commands would:
- Make each dataset generator independently testable and usable
- Reduce complexity per function
- Allow users to generate only the datasets they need
- Follow PowerShell best practices for single-responsibility commands
Proposed commands
New-FinOpsTestCostData— generates Costs dataset rowsNew-FinOpsTestPriceData— generates Prices dataset rowsNew-FinOpsTestCommitmentData— generates CommitmentDiscountUsage dataset rowsNew-FinOpsTestRecommendationData— generates Recommendations dataset rowsNew-FinOpsTestTransactionData— generates Transactions dataset rowsNew-FinOpsTestData— orchestrator that calls the above and handles file output, storage upload, and manifest generation
Considerations
- Shared helper logic (provider templates, column definitions, FOCUS version filtering) should be extracted into internal/private functions
- Each sub-command should accept common parameters (
-Providers,-FocusVersion,-Months,-Seed, etc.) - Maintain backward compatibility —
New-FinOpsTestDatashould continue to work as-is
Context
Deferred from PR #2006 (New-FinOpsTestData and Remove-FinOpsTestData).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the New-FinOpsTestData command and reviewing the deferred work from PR #2006. Trace how it generates the five FOCUS datasets and handles file output, storage upload, and manifest generation. Done means the five dataset commands are independently usable while New-FinOpsTestData preserves backward-compatible behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- tooling
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100