Task
Implement a maintainability improvement: extract clearer adapters around external dependencies such as git, HTTP/package upload, publishing, filesystem, and environment access.
The goal is to reduce direct coupling between workflow logic and external systems so the code becomes easier to test, reason about, and evolve.
Why this follow-up is needed
NovaModuleTools interacts with several external systems:
- git
- filesystem
- environment variables
- package upload endpoints / HTTP-like targets
- PowerShell publishing commands / repositories
Those interactions are necessary, but maintainability improves when they are isolated behind smaller, testable adapters instead of being spread across workflow code.
Goal
After this change:
- external system access should be more explicit and isolated
- workflow logic should depend less on raw shell or direct external calls
- tests should require fewer broad mocks of unrelated behavior
- future changes to external integrations should have clearer change points
Likely files to inspect first
Git-related flows
src/private/release/GetGitCommitMessagesForVersionBump.ps1
src/private/release/GetNovaVersionLabelForBump.ps1
- other release/git helpers under
src/private/release/
Package upload / HTTP-related flows
src/private/package/ResolveNovaPackageUploadTarget.ps1
src/private/package/ResolveNovaPackageUploadHeaders.ps1
src/private/package/GetNovaPackageUploadToken.ps1
src/private/package/DeployNovaPackage*.ps1 or related package upload helpers
Publishing-related flows
src/private/release/PublishNovaBuiltModuleToRepository.ps1
src/private/release/PublishNovaBuiltModule.ps1
Filesystem-heavy flows
src/private/scaffold/
src/private/build/
src/private/package/
src/private/update/
Environment access hotspots
src/private/update/GetNovaUpdateSettingsFilePath.ps1
src/private/release/PublishNovaBuiltModuleToRepository.ps1
src/private/cli/ConfirmNovaCliBumpAction.ps1
src/private/release/GetLocalModulePathEntryList.ps1
Tests likely relevant
tests/CoverageGaps.ReleaseInternals.Tests.ps1
tests/NovaCommandModel.PackageUpload.Tests.ps1
tests/NovaCommandModel.ReleasePublish.Tests.ps1
tests/UpdateNotification.Tests.ps1
What to do
- Identify the most important external dependencies used directly in workflow logic.
- Group them by integration type:
- git
- filesystem
- publishing
- upload/network
- environment/settings
- Extract small adapter-style helpers where the separation adds clear value.
- Refactor the highest-value flows first.
- Keep the change focused and avoid introducing an over-engineered abstraction layer.
- Add/update tests to reflect clearer seams around external calls.
- Review docs/changelog if public behavior changes.
Design constraints
- Keep the refactor incremental and practical.
- Prefer small focused adapters over a large framework-like abstraction.
- Preserve existing behavior unless there is a clear bug or inconsistency.
- Do not hide important failure behavior.
- Keep PowerShell code readable and idiomatic.
Expected implementation shape
A good solution will likely:
- isolate direct git command execution more clearly
- isolate upload/publish side effects more clearly
- isolate environment access where it materially improves testability
- keep core workflow code more focused on decisions than on external mechanics
Testing requirements
Add or update tests to cover at least these scenarios:
- Refactored workflows still behave correctly.
- External interaction boundaries are easier to mock.
- Git-dependent logic can be tested with clearer seams.
- Upload/publish flows still resolve auth, headers, and targets correctly.
- Environment-dependent behavior remains correct.
Validation steps
Start with focused validation:
pwsh -NoLogo -NoProfile -Command 'Invoke-NovaBuild'
pwsh -NoLogo -NoProfile -Command 'Invoke-Pester ./tests/CoverageGaps.ReleaseInternals.Tests.ps1 -Output Detailed'
pwsh -NoLogo -NoProfile -Command 'Invoke-Pester ./tests/NovaCommandModel.PackageUpload.Tests.ps1 -Output Detailed'
pwsh -NoLogo -NoProfile -Command 'Invoke-Pester ./tests/NovaCommandModel.ReleasePublish.Tests.ps1 -Output Detailed'
pwsh -NoLogo -NoProfile -Command 'Invoke-Pester ./tests/UpdateNotification.Tests.ps1 -Output Detailed'
Also run:
git --no-pager diff --check
Documentation review requirements
After code changes, review and update if needed:
README.md
CHANGELOG.md
- command help/docs for any affected publish/upload/update flows
If no doc updates are needed, state that they were reviewed and why no change was necessary.
Definition of done
The task is only done when all of the following are true:
- High-value external interactions are better isolated.
- Workflow code is less tightly coupled to raw external calls.
- Tests benefit from clearer seams.
- Targeted tests pass.
Invoke-NovaBuild passes.
git diff --check passes.
Final report format
When done, report back with:
- External dependency problems addressed
- Files changed
- Adapter boundaries introduced
- Flows migrated
- Tests added/updated
- Validation commands run and results
- Documentation reviewed/updated
- Remaining follow-up ideas
Task
Implement a maintainability improvement: extract clearer adapters around external dependencies such as git, HTTP/package upload, publishing, filesystem, and environment access.
The goal is to reduce direct coupling between workflow logic and external systems so the code becomes easier to test, reason about, and evolve.
Why this follow-up is needed
NovaModuleToolsinteracts with several external systems:Those interactions are necessary, but maintainability improves when they are isolated behind smaller, testable adapters instead of being spread across workflow code.
Goal
After this change:
Likely files to inspect first
Git-related flows
src/private/release/GetGitCommitMessagesForVersionBump.ps1src/private/release/GetNovaVersionLabelForBump.ps1src/private/release/Package upload / HTTP-related flows
src/private/package/ResolveNovaPackageUploadTarget.ps1src/private/package/ResolveNovaPackageUploadHeaders.ps1src/private/package/GetNovaPackageUploadToken.ps1src/private/package/DeployNovaPackage*.ps1or related package upload helpersPublishing-related flows
src/private/release/PublishNovaBuiltModuleToRepository.ps1src/private/release/PublishNovaBuiltModule.ps1Filesystem-heavy flows
src/private/scaffold/src/private/build/src/private/package/src/private/update/Environment access hotspots
src/private/update/GetNovaUpdateSettingsFilePath.ps1src/private/release/PublishNovaBuiltModuleToRepository.ps1src/private/cli/ConfirmNovaCliBumpAction.ps1src/private/release/GetLocalModulePathEntryList.ps1Tests likely relevant
tests/CoverageGaps.ReleaseInternals.Tests.ps1tests/NovaCommandModel.PackageUpload.Tests.ps1tests/NovaCommandModel.ReleasePublish.Tests.ps1tests/UpdateNotification.Tests.ps1What to do
Design constraints
Expected implementation shape
A good solution will likely:
Testing requirements
Add or update tests to cover at least these scenarios:
Validation steps
Start with focused validation:
Also run:
Documentation review requirements
After code changes, review and update if needed:
README.mdCHANGELOG.mdIf no doc updates are needed, state that they were reviewed and why no change was necessary.
Definition of done
The task is only done when all of the following are true:
Invoke-NovaBuildpasses.git diff --checkpasses.Final report format
When done, report back with: