Skip to content

Refactor to src/ layout, SPSTrust.Common module, tests, CI and docs (v2.0.0)#9

Merged
luigilink merged 5 commits into
mainfrom
feature/restructure-src-modules
Jul 10, 2026
Merged

Refactor to src/ layout, SPSTrust.Common module, tests, CI and docs (v2.0.0)#9
luigilink merged 5 commits into
mainfrom
feature/restructure-src-modules

Conversation

@luigilink

Copy link
Copy Markdown
Owner

Summary

Refactor SPSTrust to the current luigilink toolkit standard (SPSUpdate / SPSCleanDependencies), shipped as a major 2.0.0 release. Consolidated PR covering issues #2#7.

What changed

Breaking changes

  • Package layout scripts/src/ (release ZIP now extracts to SPSTrust.ps1 + Modules/).
  • Configuration format JSON → .psd1 (-ConfigFile now validates *.psd1).

Validation

Pester:   Passed=54 Failed=0 Total=54
Analyzer: 0 findings (with PSScriptAnalyzerSettings.psd1)
Manifest: SPSTrust.Common 2.0.0

Out of scope / follow-up

Closes #2
Closes #3
Closes #4
Closes #5
Closes #6
Closes #7

luigilink and others added 5 commits July 10, 2026 13:24
…t.Common

Align SPSTrust with the SPSUpdate / SPSCleanDependencies package layout.

- Move scripts/ to src/.
- Split the monolithic sps.util.psm1 / util.psm1 into a single
  SPSTrust.Common module (Public/ + Private/ + psm1 loader + psd1 manifest):
  - Public: the 16 trust SPS* functions, Get-SPSServer, and a generic
    Clear-SPSLogFolder (replacing the unused Clear-SPSLog).
  - Private: Invoke-SPSCommand (CredSSP remoting helper), hidden from callers.
- Version is now the single source of truth in the manifest (ModuleVersion = 2.0.0);
  the script banner reads it from Get-Module instead of a hard-coded string.
- Migrate config from JSON to a PowerShell data file (.psd1) with
  CONTOSO-PROD.example.psd1; -ConfigFile now validates *.psd1 and the script
  loads it via Import-PowerShellDataFile.
- Wire Clear-SPSLogFolder into the cleanup phase with a new -LogRetentionDays
  parameter (default 180, 0 disables pruning).

Refs #2

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- tests/Modules/SPSTrust.Common.Tests.ps1: manifest/loader shape, public export
  surface (18 functions), private Invoke-SPSCommand hidden, and behavioural tests
  for Clear-SPSLogFolder (retention 0, missing path, age window, extension filter).
- tests/SPSTrust.Tests.ps1: entry-script existence/syntax/metadata, param contract
  (ConfigFile .psd1 + mandatory, FarmAccount, CleanServices switch, LogRetentionDays),
  and example .psd1 config integrity (required keys, farm/trust cross-references).
- PSScriptAnalyzerSettings.psd1: exclude PSUseShouldProcessForStateChangingFunctions
  with a documented rationale (thin CredSSP remoting wrappers driven by -Ensure).

54 tests pass; PSScriptAnalyzer reports no findings on src/.

Refs #3

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- release.yml: bump actions/checkout@v4 -> @v7 and softprops/action-gh-release@v2
  -> @V3; package the *contents* of src/ (archive extracts to SPSTrust.ps1 +
  Modules/, no src/ wrapper); add explicit 'permissions: contents: write'.
- wiki.yml: bump actions/checkout@v4 -> @v7.
- pester.yml (new): run the Pester suite and a PSScriptAnalyzer code-quality job
  on pull requests touching src/, tests/ or PSScriptAnalyzerSettings.psd1.

Refs #4

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Wiki (#5):
- Add _Sidebar.md navigation and Release-Process.md (SemVer policy, manifest-driven
  version, tag/release checklist) mirroring the SPSCleanDependencies standard.
- Rewrite Home, Getting-Started, Configuration and Usage for the 2.0.0 layout:
  src/ package, .psd1 configuration (Import-PowerShellDataFile), module overview,
  four-stage flow, and the -LogRetentionDays parameter.
- Fix copy/paste bugs: Usage referenced .\SPSWeather.ps1 (now SPSTrust.ps1) and the
  -CleanServices example omitted the mandatory -FarmAccount.

README (#6):
- Remove the inaccurate 'class-based resources' wording (SPSTrust is a script, not a
  DSC module); keep it short and defer to the wiki.

Refs #5, #6

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Document the 2.0.0 major release in CHANGELOG.md (Added/Changed/Fixed/Removed),
  highlighting the breaking scripts/ -> src/ layout and JSON -> .psd1 config changes.
- Replace RELEASE-NOTES.md with the 2.0.0 section only (used verbatim as the GitHub
  Release body), including an upgrade note about converting JSON config to .psd1.

The module manifest ModuleVersion was already set to 2.0.0 in the restructure commit.

Refs #7

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

Pester Test Results

54 tests   54 ✅  1s ⏱️
10 suites   0 💤
 1 files     0 ❌

Results for commit 62a2465.

@luigilink luigilink merged commit aaa2e34 into main Jul 10, 2026
3 checks passed
@luigilink luigilink deleted the feature/restructure-src-modules branch July 10, 2026 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment