Refactor to src/ layout, SPSTrust.Common module, tests, CI and docs (v2.0.0)#9
Merged
Merged
Conversation
…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>
Pester Test Results54 tests 54 ✅ 1s ⏱️ Results for commit 62a2465. |
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
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
scripts/→src/; monolithicsps.util.psm1/util.psm1split into a singleSPSTrust.Commonmodule (Public/18 functions +Private/Invoke-SPSCommand+ psm1 loader + psd1 manifest). Version is now the single source of truth in the manifest (read viaGet-Module). Config migrated from JSON →.psd1(Import-PowerShellDataFile). New-LogRetentionDaysparameter wiresClear-SPSLogFolderinto cleanup.tests/) +PSScriptAnalyzerSettings.psd1. 54 tests pass, 0 analyzer findings.release.ymlpackagessrc/contents,checkout@v7,action-gh-release@v3, explicit permissions;wiki.ymlbumped tocheckout@v7; newpester.yml(tests + code-quality on PRs)._Sidebar.md+Release-Process.md, rewrite Home/Getting-Started/Configuration/Usage for the new layout, fix copy/paste bugs (SPSWeather.ps1→SPSTrust.ps1, missing-FarmAccountin-CleanServicesexample).Breaking changes
scripts/→src/(release ZIP now extracts toSPSTrust.ps1+Modules/)..psd1(-ConfigFilenow validates*.psd1).Validation
Out of scope / follow-up
Closes #2
Closes #3
Closes #4
Closes #5
Closes #6
Closes #7