Skip to content

Release/1.3.0 — module refactor (SPSCleanDependencies.Common), src/ layout, CI bump#7

Merged
luigilink merged 7 commits into
mainfrom
Release/1.3.0
Jul 9, 2026
Merged

Release/1.3.0 — module refactor (SPSCleanDependencies.Common), src/ layout, CI bump#7
luigilink merged 7 commits into
mainfrom
Release/1.3.0

Conversation

@luigilink

Copy link
Copy Markdown
Owner

Closes #6

Summary

Structural refactor of the toolkit into a clean, versioned module aligned on the SPSUpdate pattern. No behaviour change on a real SharePoint farm. Target release: 1.3.0.

What changed

Module (src/Modules/SPSCleanDependencies.Common)

  • One function per file under Public/ (Get-SPSInstalledProductVersion, Get-SPSMissingServerDependencies, the six Remove-SPS*), internal SQL helpers under Private/ (Get-SQLMissing*, no longer exported).
  • Loader .psm1 dot-sources Private + Public and exports only the public functions.
  • Clean .psd1 manifest (ModuleVersion 1.3.0, correct FunctionsToExport) replacing the mis-named, never-imported SPSCleanDependencies.util.util.psd1.
  • Former module-level classes / ArrayLists / jsonObject folded into Get-SPSMissingServerDependencies → no module-level mutable state.

Entry script (src/SPSCleanDependencies.ps1)

  • Imports the module via its manifest; version sourced from (Get-Module SPSCleanDependencies.Common).Version (was hard-coded '1.2.0').
  • Import-time prelude (admin check, powercfg, SharePoint snap-in load) relocated from the module into the script → the module is import-safe by design.

Tests

  • Renamed SPSCleanDependencies.Common.Tests.ps1, adapted to the manifest import, InModuleScope for the now-private SQL helpers, and FunctionsToExport assertion.
  • Entry-script tests point at src/ and assert manifest-based import + version sourcing.
  • 74/74 green locally (Pester 5), 0 PSScriptAnalyzer Error/Warning.

CI

  • Workflows adapted to the src/ layout (paths, analyzer targets, release ZIP of src/ contents).
  • Deprecated actions bumped: checkout@v4→v7, upload-artifact@v4→v7, action-gh-release@v2→v3 — closes the separate 'CI: bump deprecated actions' backlog item.

Docs

  • CHANGELOG / RELEASE-NOTES for 1.3.0.
  • New wiki: _Sidebar.md, Release-Process.md, Dependency-Types.md, Troubleshooting.md; Home/Usage cross-links.

Commits (atomic)

  1. module split + manifest
  2. entry script relocation + manifest wiring + prelude
  3. tests updated
  4. CI workflows + action bump
  5. docs (CHANGELOG/RELEASE-NOTES/Home)
  6. wiki sidebar + reference pages

Out of scope (follow-up)

  • Results history + HTML report (the results JSON is currently overwritten each run) — to be captured as a future issue.

Do not merge without review.

luigilink and others added 6 commits July 9, 2026 16:02
…c/Private + manifest)

Introduce src/Modules/SPSCleanDependencies.Common aligned on the SPSUpdate
pattern: one function per file under Public/ (Get-SPSInstalledProductVersion,
Get-SPSMissingServerDependencies and the six Remove-SPS* cleanups) and the
internal SQL helpers under Private/ (Get-SQLMissing*). A loader .psm1
dot-sources Private + Public and exports only the public functions, and a clean
.psd1 manifest (ModuleVersion 1.3.0, correct FunctionsToExport) replaces the
mis-named, never-imported .util.util.psd1.

The former module-level classes, ArrayLists and jsonObject are folded into
Get-SPSMissingServerDependencies (their only consumer) so the module holds no
mutable state, and the import-time prelude is dropped from the module (relocated
to the entry script in a follow-up commit) making the module import-safe.

Refs #6

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

Move SPSCleanDependencies.ps1 to src/ and import the SPSCleanDependencies.Common
module through its manifest (.psd1) instead of the old flat .psm1. The script
version is now sourced from the module manifest via
(Get-Module SPSCleanDependencies.Common).Version, replacing the hard-coded
'1.2.0' string.

The import-time prelude (administrator check, High Performance power plan and
SharePoint snap-in / SharePointServer module load) is relocated from the module
into the entry script, running after the module import so it can call the public
Get-SPSInstalledProductVersion. Module cleanup now targets the named module
instead of Remove-Module *. The former scripts/ tree (flat util module and old
entry script) is removed.

Refs #6

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Point the entry-script tests at src/SPSCleanDependencies.ps1 and assert it now
imports SPSCleanDependencies.Common via its manifest and sources the version
from (Get-Module SPSCleanDependencies.Common).Version.

Rename the module test file to SPSCleanDependencies.Common.Tests.ps1 and adapt
it to the new structure: import via the .psd1 manifest, resolve the internal
Get-SQLMissing* helpers through InModuleScope (they are now Private and no longer
exported), assert FunctionsToExport matches the exported set, and match the
SPMissing* class definitions against Public/Get-SPSMissingServerDependencies.ps1.

Refs #6

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Update the CI workflows for the new src/ module layout and refresh the GitHub
Actions that GitHub had deprecated (Node 20 runtime warnings):

- pester.yml: trigger on src/** (plus PSScriptAnalyzerSettings.psd1), point
  PSScriptAnalyzer at ./src/SPSCleanDependencies.ps1 and the
  ./src/Modules/SPSCleanDependencies.Common module, add the checks/pull-requests
  permissions and make the publish step continue-on-error;
  actions/checkout@v4 -> v7, actions/upload-artifact@v4 -> v7.
- release.yml: zip the *contents* of src/ (extracts straight to Modules/ and
  SPSCleanDependencies.ps1) and add contents: write permission;
  actions/checkout@v4 -> v7, softprops/action-gh-release@v2 -> v3.
- wiki.yml: actions/checkout@v4 -> v7.

Closes the separate 'CI: bump deprecated GitHub actions' backlog item for this repo.

Refs #6

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add the 1.3.0 entry to CHANGELOG.md and rewrite RELEASE-NOTES.md for this
release: the SPSCleanDependencies.Common module restructure (Public/Private +
manifest), the src/ entry-script relocation with manifest-based versioning, the
relocated prelude, the test updates and the CI layout/action-bump changes.

Also correct wiki/Home.md to describe the WebParts and Orphaned Sites cleanups as
implemented (they stopped being placeholders in 1.2.0).

Refs #6

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add a _Sidebar.md navigation aligned with the sibling luigilink projects, plus
new reference pages:

- Release-Process.md: how to ship a version (manifest-driven ModuleVersion, v*
  tag, release workflow).
- Dependency-Types.md: reference for the seven dependency categories the tool
  detects and cleans, their remediation and the results JSON shape.
- Troubleshooting.md: common issues (SqlServer module, elevation, missing JSON,
  -WhatIf preview, audit-only MissingSiteDefinition, log locations).

Cross-link the new pages from Home.md and Usage.md, and correct the Home key
features list.

Refs #6

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

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

Pester Test Results

74 tests   74 ✅  1s ⏱️
16 suites   0 💤
 1 files     0 ❌

Results for commit 1918a95.

♻️ This comment has been updated with latest results.

Combine the two-argument (positional) Write-Output calls in
Remove-SPSMissingFeature/Configuration/SetupFile into single interpolated
strings, clearing the PSAvoidUsingPositionalParameters findings that failed the
Code Quality job on Windows PowerShell (PSScriptAnalyzer reports these at
Information severity, which the CI job treats as a failure). No behaviour change.

Refs #6

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@luigilink luigilink merged commit 9a26e5e into main Jul 9, 2026
3 checks passed
@luigilink luigilink deleted the Release/1.3.0 branch July 9, 2026 14:26
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.

Refactor: restructure module into Public/Private + clean manifest (src/ layout)

1 participant