Skip to content

feat(#99): enhance adapter architecture for external dependencies#129

Merged
stiwicourage merged 3 commits into
developfrom
feature/99-extract-clearer-adapters-around-external-dependencies-such-as-git-httppackage-upload-publishing-filesystem-and-environment-access
Apr 28, 2026
Merged

feat(#99): enhance adapter architecture for external dependencies#129
stiwicourage merged 3 commits into
developfrom
feature/99-extract-clearer-adapters-around-external-dependencies-such-as-git-httppackage-upload-publishing-filesystem-and-environment-access

Conversation

@stiwicourage

Copy link
Copy Markdown
Owner

Summary

  • What changed?
    • Refactored several internal Nova workflows to isolate external dependency access behind smaller adapter-style helpers.
    • Added clearer seams around git, raw upload request execution, repository publish execution, module self-update execution,
      settings JSON persistence, and CLI environment-variable access.
    • Updated targeted tests to mock the new seams directly, and renamed new helper functions to satisfy
      PSScriptAnalyzer singular-noun rules so the local quality flow stays green.
  • Why was this change needed?
    • The workflow logic had direct coupling to external tools and system APIs in a few high-value areas, which made tests
      broader than necessary and made change points less explicit.
    • The refactor keeps outward behavior stable while making release, upload, publish, update, and environment-dependent
      paths easier to reason about, isolate, and evolve.
  • Link the issue, discussion, or follow-up work (for example Closes #123).
    • Follow-up implementation from plan.md.

Affected area

  • nova CLI or command routing
  • Public PowerShell cmdlet behavior
  • Scaffolding or project.json handling
  • Build, test, analyzer, coverage, or CI helper flow
  • Package, raw upload, or package metadata workflow
  • Publish, release, semantic-release, or GitHub Actions automation
  • Self-update or notification preference behavior
  • Contributor documentation (README.md, CONTRIBUTING.md, repository workflow docs)
  • End-user docs (docs/*.html)
  • Command help (docs/NovaModuleTools/en-US/*.md)
  • src/resources/example/
  • Dependency or manifest changes (package.json, workflow dependencies, release tooling)
  • Security-sensitive change
  • Documentation-only change
  • Other

Review guidance

  • Start with the new shared and execution-seam helpers:
    • src/private/shared/InvokeNovaGitCommand.ps1
    • src/private/shared/InvokeNovaJsonFile.ps1
    • src/private/package/InvokeNovaPackageUploadRequest.ps1
    • src/private/release/InvokeNovaRepositoryPublishCommand.ps1
    • src/private/update/InvokeNovaModuleUpdateCommand.ps1
  • Then review the migrated workflows that now depend on those seams:
    • src/private/release/GetGitCommitMessagesForVersionBump.ps1
    • src/private/release/GetNovaVersionLabelForBump.ps1
    • src/private/release/InitiateGitRepo.ps1
    • src/private/release/PublishNovaBuiltModuleToRepository.ps1
    • src/private/package/InvokeNovaPackageArtifactUpload.ps1
    • src/private/update/InvokeNovaModuleSelfUpdate.ps1
    • src/private/update/ReadNovaUpdateNotificationPreference.ps1
    • src/private/update/WriteNovaUpdateNotificationPreference.ps1
    • src/private/cli/ConfirmNovaCliAction.ps1
    • src/private/cli/GetNovaCliInstallDirectory.ps1
    • src/private/cli/TestNovaCliDirectoryOnPath.ps1
  • Focused tests were added or updated in:
    • tests/CoverageGaps.ReleaseInternals.Tests.ps1
    • tests/NovaCommandModel.PackageUpload.Tests.ps1
    • tests/NovaCommandModel.ReleasePublish.Tests.ps1
    • tests/UpdateNotification.Tests.ps1
    • tests/CoverageGaps.Cli.Tests.ps1
  • Trade-offs / limitations:
    • This is intentionally an internal maintainability refactor, so behavior changes were avoided where possible.
    • The main risk area is delegation wiring: git history lookup, upload request execution, repository publish execution,
      self-update execution, and settings/environment resolution now flow through helper boundaries instead of direct calls.

Validation

  • Invoke-NovaBuild
  • Test-NovaBuild
  • ./scripts/build/Invoke-ScriptAnalyzerCI.ps1
  • ./scripts/build/ci/Invoke-NovaModuleToolsCI.ps1
  • Targeted Nova workflow validated (% nova build, % nova test, % nova merge, % nova deploy,
    % nova publish,
    % nova release, % nova update, % nova notification, or % nova init as relevant)
  • Docs/example only; executable validation not needed

Validation notes:

Primary end-to-end validation:
- pwsh -NoLogo -NoProfile -File ./run.ps1
  - Passed with exit code 0
  - Final result: Tests Passed: 548, Failed: 0, Skipped: 0

Focused validation run during implementation:
- 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'
- pwsh -NoLogo -NoProfile -Command 'Invoke-Pester ./tests/CoverageGaps.Cli.Tests.ps1 -Output Detailed'
- pwsh -NoLogo -NoProfile -Command 'Invoke-Pester ./tests/RemainingCommandCoverage.Tests.ps1 -Output Detailed'
- pwsh -NoLogo -NoProfile -Command 'Invoke-Pester ./tests/CoverageCompletion.Tests.ps1 -Output Detailed'

Other checks:
- git --no-pager diff --check
- Local Code Health safeguard passed

Skipped:
- Full CI entrypoint script was not run from this summary task
- No live publish/upload/release against external services was exercised

Documentation and release follow-up

  • README.md reviewed and updated if contributor workflow, architecture, CI, release, or automation changed
  • CONTRIBUTING.md reviewed and updated if contribution expectations or review guidance changed
  • CHANGELOG.md reviewed and updated if the change matters to users, maintainers, or contributors
  • docs/NovaModuleTools/en-US/ help updated if a public command or CLI behavior changed
  • docs/*.html updated if end-user workflows or examples changed
  • src/resources/example/ reviewed and updated if the real-world project layout, package model, or upload workflow
    changed
  • No documentation, changelog, or example updates were needed

Maintainability, compatibility, and risk

  • Code Health / maintainability impact considered
  • No breaking change
  • Breaking change
  • Security-sensitive change
  • CI, workflow, or release-pipeline impact
  • Dependency-review impact

Risk, rollout, or rollback notes:

Compatibility impact:
- No intended user-facing behavior change. This change primarily restructures internal execution seams.

Main risk areas:
- git command delegation in version bump/repository-init paths
- raw upload request delegation
- repository publish delegation
- module self-update delegation
- settings JSON persistence and environment-variable lookup delegation

Rollback / maintainer follow-up:
- Rollback is straightforward because the change is mostly seam extraction and helper renaming.
- The final analyzer-related follow-up was a naming cleanup so run.ps1 no longer fails on PSScriptAnalyzer warnings.
- Branch-level PR pre-flight Code Health may still need separate cleanup for pre-existing test-file global-conditionals debt.

Important

Do not use a public pull request to disclose a vulnerability before coordinated handling.
Use the private reporting path in SECURITY.md for new security issues.

- Isolate external workflow execution behind smaller internal adapters for clearer change points.
- Refactor CLI environment access and Git command interactions for improved maintainability.
- Introduce shared JSON file handling functions for better configuration management.
@github-actions

github-actions Bot commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

codescene-delta-analysis[bot]

This comment was marked as outdated.

@codecov

codecov Bot commented Apr 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.00000% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/private/cli/ConfirmNovaCliAction.ps1 90.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

- Isolate external workflow execution behind smaller internal adapters for clearer change points.
- Refactor CLI environment access and Git command interactions for improved maintainability.
- Introduce shared JSON file handling functions for better configuration management.
codescene-delta-analysis[bot]

This comment was marked as outdated.

- verify default console read delegate returns correct type
- ensure delegate output matches expected format

@codescene-delta-analysis codescene-delta-analysis Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Gates Passed
6 Quality Gates Passed

See analysis details in CodeScene

Quality Gate Profile: Pay Down Tech Debt
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.

@stiwicourage
stiwicourage merged commit 51d6147 into develop Apr 28, 2026
11 of 12 checks passed
github-actions Bot pushed a commit that referenced this pull request Apr 29, 2026
# [2.0.0](Version_1.9.1...Version_2.0.0) (2026-04-29)

* Standardize Nova command model, enhance workflows, and update docs ([#27](#27)) ([e627d4c](e627d4c)), closes [#6](#6) [#8](#8) [#9](#9) [#10](#10) [#11](#11) [#12](#12) [#13](#13) [#14](#14) [#15](#15)

### Bug Fixes

* **#109:** update CI workflow and test cases ([9f1d950](9f1d950)), closes [#109](#109)
* **#113:** standardize CLI option syntax for `--what-if` and `--confirm` ([#116](#116)) ([787b155](787b155)), closes [#113](#113) [#113](#113)
* **#63:** correct wording in documentation for clarity ([74b9e7e](74b9e7e)), closes [#63](#63)
* **#63:** update CHANGELOG to include UNRELEASED changes for next release ([70b7307](70b7307)), closes [#63](#63)
* **#63:** update documentation for clarity ([d41e22a](d41e22a)), closes [#63](#63)
* **#63:** update NovaModuleTools installation parameters ([787a14b](787a14b)), closes [#63](#63)
* **#66:** update version format in project.json ([653de4e](653de4e)), closes [#66](#66)
* **#75:** improve update command behavior and output ([217e900](217e900)), closes [#75](#75)
* **#75:** update CHANGELOG to remove outdated entries ([7de2df6](7de2df6)), closes [#75](#75)
* **#75:** update dependabot configuration to change update interval ([8164f34](8164f34)), closes [#75](#75)
* **#75:** update Nova test output handling and configuration ([09cba8f](09cba8f)), closes [#75](#75)
* **#75:** update security policy for version support ([bf7185d](bf7185d)), closes [#75](#75)
* **#75:** update version to 2.0.0-prerelease4 in project.json ([2bc6613](2bc6613)), closes [#75](#75)
* **#81:** update tests to verify renamed public commands and remove unapproved verb warnings ([85c4e37](85c4e37)), closes [#81](#81)
* **#90:** improve version bumping functionality ([2ecfd6c](2ecfd6c)), closes [#90](#90)
* **#develop:** update .gitignore to include .tmp-nova-bin directory ([305f77a](305f77a)), closes [#develop](https://github.com/stiwicourage/NovaModuleTools/issues/develop)
* **#develop:** update ProjectUri in project.json to new domain ([c71c4f4](c71c4f4)), closes [#develop](https://github.com/stiwicourage/NovaModuleTools/issues/develop)
* bump to next version ([7c6fceb](7c6fceb))
* improve CodeScene analysis script functionality ([7b7e903](7b7e903))
* Merge remote-tracking branch 'origin/develop' into develop ([d0ba30c](d0ba30c))
* update BuildOptions test support to use global variable ([80acb8f](80acb8f))
* update ProjectUri to point to main branch ([026d236](026d236))

### Features

* **#101:** add Codecov action to upload test results ([484b77e](484b77e)), closes [#101](#101)
* **#101:** add Codecov badge to CONTRIBUTING.md ([1f1ec4d](1f1ec4d)), closes [#101](#101)
* **#101:** bump version to 2.0.0-preview10 ([e95255e](e95255e)), closes [#101](#101)
* **#101:** implement opt-in preview bump mode for nova bump ([#102](#102)) ([b335bda](b335bda)), closes [#101](#101)
* **#101:** update prerelease versioning for nova bump ([8026dde](8026dde)), closes [#101](#101)
* **#104:** implement package upload file selection utilities ([#131](#131)) ([0890639](0890639)), closes [#104](#104)
* **#105:** consolidate CLI helper functions for improved command handling ([#132](#132)) ([9335979](9335979)), closes [#105](#105)
* **#111:** introduce build-before-test option for nova test command ([#118](#118)) ([c33c908](c33c908)), closes [#111](#111) [#111](#111)
* **#112:** clean up PowerShell help content ([#120](#120)) ([707c989](707c989)), closes [#112](#112)
* **#112:** update project version to 2.0.0-preview96 ([88ba978](88ba978)), closes [#112](#112)
* **#112:** update project version to 2.0.0-preview99 ([176456d](176456d)), closes [#112](#112)
* **#120:** add CLI help system with short and long command help forms ([7ffbcc6](7ffbcc6)), closes [#120](#120)
* **#122:** add skip tests option to Publish and ignore main/develop branches in Tests ([#124](#124)) ([1b39325](1b39325)), closes [#122](#122)
* **#122:** enhance CI workflows with continuous integration options ([5f49ab5](5f49ab5)), closes [#122](#122)
* **#133:** update CHANGELOG and project version for beta release ([1f1b36d](1f1b36d)), closes [#133](#133)
* **#140:** update Node.js version requirements for release automation ([6e23423](6e23423)), closes [#140](#140)
* **#177:** add Import-BuiltCiModule script for module import process ([654875c](654875c)), closes [#177](#177)
* **#177:** enhance CI workflows and assertions ([85b5eff](85b5eff)), closes [#177](#177)
* **#177:** enhance CI workflows with verbose output ([27ae413](27ae413)), closes [#177](#177)
* **#177:** enhance module publishing and versioning commands ([402656f](402656f)), closes [#177](#177)
* **#177:** remove Publish-NovaModule command from Publish.yml ([c356f58](c356f58)), closes [#177](#177)
* **#177:** simplify Publish-NovaModule command in Publish.yml ([79ad899](79ad899)), closes [#177](#177)
* **#177:** streamline CI build and versioning commands ([fcb1cbc](fcb1cbc)), closes [#177](#177)
* **#177:** update CI workflow for NovaModuleTools testing ([171105a](171105a)), closes [#177](#177)
* **#177:** update project version to 2.0.0-preview9901 ([bccba76](bccba76)), closes [#177](#177)
* **#177:** update project version to 2.0.0-preview9907 ([48afb27](48afb27)), closes [#177](#177)
* **#177:** update Publish.yml for module publishing process ([7a5475a](7a5475a)), closes [#177](#177)
* **#177:** update Publish.yml for module publishing process ([5ec5e14](5ec5e14)), closes [#177](#177)
* **#177:** update Publish.yml for module publishing process ([877bae1](877bae1)), closes [#177](#177)
* **#63:** add license information to documentation and update links ([c4cc55e](c4cc55e)), closes [#63](#63)
* **#63:** add Release Notes page and update navigation links ([334abaf](334abaf)), closes [#63](#63)
* **#63:** Adding -AllowPrerelease to GitHub Actions installation of NovaModuleTools. ([1abcb3a](1abcb3a)), closes [#63](#63)
* **#63:** enhance site branding and improve documentation links ([7366f91](7366f91)), closes [#63](#63)
* **#63:** update documentation for PowerShell module workflows ([2d7a4cb](2d7a4cb)), closes [#63](#63)
* **#63:** update documentation structure and improve contributor guidance ([7c0e962](7c0e962)), closes [#63](#63)
* **#63:** update NovaModuleTools installation to include -Force option ([3c068ba](3c068ba)), closes [#63](#63)
* **#63:** update project version to 1.10.3 ([fa4b858](fa4b858)), closes [#63](#63)
* **#65:** extend local publish behavior to reload module in PowerShell ([#69](#69)) ([4c2d9c8](4c2d9c8)), closes [#65](#65)
* **#68:** allow users to update NovaModuleTools directly from a Nova command ([#72](#72)) ([06de070](06de070)), closes [#68](#68)
* **#73:** enhance Nova CLI testing support ([#75](#75)) ([643a016](643a016)), closes [#73](#73)
* **#75:** add bug report and feature request templates ([18a5f1b](18a5f1b)), closes [#75](#75)
* **#75:** add Code of Conduct document ([2e3d9a7](2e3d9a7)), closes [#75](#75)
* **#75:** add pull request template and update contributing guidelines ([526ecfc](526ecfc)), closes [#75](#75)
* **#75:** enhance update command feedback and documentation ([40a3bbb](40a3bbb)), closes [#75](#75)
* **#75:** update NovaModuleTools self-update handling and documentation ([493c914](493c914)), closes [#75](#75)
* **#75:** update version and enhance update warning functionality ([70a141e](70a141e)), closes [#75](#75)
* **#89:** add required modules to project configuration ([61565a7](61565a7)), closes [#89](#89)
* **#92:** centralize project.json writing and improve serialization ([#103](#103)) ([a865a91](a865a91)), closes [#92](#92)
* **#94:** add codecov configuration for coverage status target ([17896b9](17896b9)), closes [#94](#94)
* **#94:** add Get-NovaPackageUploadArtifact function and enhance upload invocation orchestration ([6225a75](6225a75)), closes [#94](#94)
* **#94:** add Get-NovaPackageUploadTargetSettingBundle function and update target resolution logic ([0fd8c0e](0fd8c0e)), closes [#94](#94)
* **#94:** add test for Get-NovaModuleSelfUpdateWorkflowContext error handling ([c51bef2](c51bef2)), closes [#94](#94)
* **#94:** clarify boundaries between public commands, domain logic, and infrastructure concerns ([3da9b97](3da9b97)), closes [#94](#94)
* **#94:** clarify command layering and enhance CLI invocation handling ([396b4b4](396b4b4)), closes [#94](#94)
* **#94:** clarify command layering and enhance notification preference handling ([8bbed2b](8bbed2b)), closes [#94](#94)
* **#94:** clarify command layering and enhance Nova module initialization workflows ([02f9dcd](02f9dcd)), closes [#94](#94)
* **#94:** clarify command layering and introduce Nova CLI installation workflow ([7df398c](7df398c)), closes [#94](#94)
* **#94:** clarify command layering and introduce project info context functions ([df9d0b1](df9d0b1)), closes [#94](#94)
* **#94:** clarify command layering and introduce self-update workflow context functions ([5a83ae2](5a83ae2)), closes [#94](#94)
* **#94:** clarify notification preference command layering and introduce context functions ([d069c55](d069c55)), closes [#94](#94)
* **#94:** clarify package workflow orchestration and context handling ([a0e51fe](a0e51fe)), closes [#94](#94)
* **#94:** clarify Test-NovaBuild orchestration and improve workflow context handling ([c146eba](c146eba)), closes [#94](#94)
* **#94:** enhance Deploy-NovaPackage orchestration and workflow context handling ([b11a2f1](b11a2f1)), closes [#94](#94)
* **#94:** enhance Nova package upload and workflow context tests ([98cd6b2](98cd6b2)), closes [#94](#94)
* **#94:** enhance NovaPackage upload logic and testing ([ed88091](ed88091)), closes [#94](#94)
* **#94:** enhance version update workflow and clarify command orchestration ([4d9e94a](4d9e94a)), closes [#94](#94)
* **#94:** refactor build process to improve project info handling ([b06fb60](b06fb60)), closes [#94](#94)
* **#94:** update author details in project manifest ([d1e243a](d1e243a)), closes [#94](#94)
* **#94:** update codecov configuration to include patch target ([b294166](b294166)), closes [#94](#94)
* **#94:** update codecov configuration to include patch target ([cb94147](cb94147)), closes [#94](#94)
* **#94:** update codecov target configuration to use auto ([2371ffc](2371ffc)), closes [#94](#94)
* **#94:** update project version to 2.0.0-preview92 ([8b44b0b](8b44b0b)), closes [#94](#94)
* **#94:** update project version to 2.0.0-preview93 and modify author details ([700b7f3](700b7f3)), closes [#94](#94)
* **#95:** rename GetNovaCliOptions.ps1 to ConvertFromNovaCliArgument.ps1 ([6133d5f](6133d5f)), closes [#95](#95)
* **#96:** centralize configuration and secret resolution for NovaMod… ([#126](#126)) ([3c4d789](3c4d789)), closes [#96](#96) [#96](#96)
* **#97:** clean up output and result contracts for structured data ([#127](#127)) ([75c4e44](75c4e44)), closes [#97](#97) [#97](#97)
* **#98:** refactor CLI argument handling for improved consistency and scalability ([#128](#128)) ([d80c47c](d80c47c)), closes [#98](#98)
* **#99:** enhance adapter architecture for external dependencies ([#129](#129)) ([51d6147](51d6147)), closes [#99](#99) [#99](#99)
* **#develop:** reorganize project structure in README.md ([1830b59](1830b59)), closes [#develop](https://github.com/stiwicourage/NovaModuleTools/issues/develop)
* enhance NovaModuleTools with new features and improvements ([cd812ec](cd812ec))
* enhance release notes page with Markdown support and styling ([184a37b](184a37b))
* enhance test support for BuildOptions and NovaCommandModel ([75ed34e](75ed34e))

### BREAKING CHANGES

* The codebase is now fully centered on the Nova command model instead of a mixed MT/Nova
implementation.
Internal source files were reorganized into clearer areas such as build, CLI, release, shared, scaffold, and duplicate
validation.
Publish-NovaModule and Invoke-NovaRelease now use a cleaner publish flow that resolves targets before build/test
steps run.
New-NovaModule was refactored into smaller pieces, improving maintainability and bringing its Code Health back to
10.0.
README and command documentation were refreshed to consistently use the Nova command names and describe the
CLI/release workflow more clearly.
Release and test automation files were updated to better support the new Nova workflow.
The repository example, local helper workflow, and command documentation were updated to better reflect how
NovaModuleTools
is intended to be used in day-to-day development.
Removed

Removed the legacy MT command implementation in favor of the Nova equivalents, including:
Get-MTProjectInfo
Invoke-MTBuild
Invoke-MTTests
New-MTModule
Publish-MTLocal
Update-MTModuleVersion / UpdateModVersion
Removed the remaining MT-oriented internal layout and replaced it with the reorganized Nova-focused structure.
Replaced legacy MT command documentation with Nova command documentation.
Fixed

Fixed local publishing so Publish-NovaModule -Local no longer falls back to the legacy publish path.
Fixed build-time resource lookup so schema and template files are found in project src/resources when building from
the repository root.
Fixed local publish/release flows so the local module path is resolved before build/test steps can reload helper
functions.
Fixed ShouldProcess support in Update-NovaModuleVersion, Set-NovaModuleVersion, and New-NovaModule.
Fixed ScriptAnalyzer issues caused by empty catch blocks and noncompliant helper naming.
Fixed local test/build support imports and command-model regressions uncovered during the Nova standardization work.
Fixed generated help activation so module and command help can be loaded with Get-Help after build/import.
Fixed manifest handling so unsupported Manifest keys now fail fast with a clear validation error instead of being
silently tolerated.
Documentation

Updated README.md with:
a dedicated Publish-NovaModule section
local and repository publish examples
guidance for importing the built dist module during local development
notes about build-time resource lookup from src/resources
Added README guidance for the working example/ project, stricter manifest validation, built help expectations, and
the
separate ScriptAnalyzer CI workflow.
Replaced the outdated New-NovaModule screenshot in README.md with a concrete project.json example that shows the
expected NovaModuleTools output more clearly.
Refreshed the README.md contribution guidance so contributors are clearly asked to follow the Nova workflow, run the
local quality loop, update documentation, and keep the codebase maintainable.
Renamed and refreshed command documentation to match the Nova command model.
@stiwicourage
stiwicourage deleted the feature/99-extract-clearer-adapters-around-external-dependencies-such-as-git-httppackage-upload-publishing-filesystem-and-environment-access branch May 12, 2026 06:09
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.

Extract clearer adapters around external dependencies such as git, HTTP/package upload, publishing, filesystem, and environment access.

1 participant