Skip to content

Release/1.4.0 — results history + HTML report#9

Merged
luigilink merged 4 commits into
mainfrom
Release/1.4.0
Jul 9, 2026
Merged

Release/1.4.0 — results history + HTML report#9
luigilink merged 4 commits into
mainfrom
Release/1.4.0

Conversation

@luigilink

Copy link
Copy Markdown
Owner

Closes #8

Summary

Follow-up to the 1.3.0 module refactor. The audit no longer overwrites its output blindly: it now keeps a timestamped history of past results and generates a self-contained HTML report. Reuses the conventions already proven across the sibling luigilink projects. Target release: 1.4.0.

What changed

History (Public, pattern from SPSUserSync/SPSWeather)

  • Backup-SPSJsonFile — archive Results\<FileName>.json into Results\history\ with a yyyyMMdd-HHmm suffix before the fresh audit overwrites it.
  • Clear-SPSLogFolder — single retention/rotation implementation reused for logs (*.log) and snapshots (*.json); Retention = 0 disables pruning.

HTML report (Private helpers + Public exporter, pattern from SPSUpdate.Common)

  • Private: ConvertTo-SPSHtmlEncoded, Get-SPSReportHtmlHead, Get-SPSReportCardHtml, Get-SPSReportHtmlScript.
  • Public: Export-SPSCleanDependenciesReport — summary card per dependency category + filterable/sortable table per non-empty category, or a clean "nothing to clean" state. Dependency-free (offline), atomic write. All farm values HTML-encoded.

Entry script

  • Audit run: archive previous results → run audit → write Results\<FileName>.html → prune history/logs.
  • The current Results\<FileName>.json stays stable (still the exact -Clean input); only history copies are timestamped.
  • New -HistoryRetentionDays (default 30) and -LogRetentionDays (default 180); 0 disables pruning.

Tests & docs

  • Pester: 100/100 green locally, 0 PSScriptAnalyzer Error/Warning.
  • CHANGELOG / RELEASE-NOTES for 1.4.0; new wiki page Reports & History + sidebar/cross-links; Usage parameters; Home key features.

Commits (atomic)

  1. new module functions (history + HTML helpers/exporter) + manifest 1.4.0
  2. entry-script wiring
  3. Pester coverage
  4. docs + wiki

Notes

  • Behaviour of the existing -Clean flow is unchanged.
  • Manifest already bumped to 1.4.0; tag v1.4.0 from main after merge.

Do not merge without review.

luigilink and others added 4 commits July 9, 2026 16:42
…encies.Common

Add the building blocks for issue #8 (results history + HTML report), reusing the
conventions proven across the sibling luigilink projects:

History (Public):
- Backup-SPSJsonFile: archive the current results JSON into Results/history with a
  yyyyMMdd-HHmm timestamp before it is overwritten (pattern from SPSUserSync).
- Clear-SPSLogFolder: single rotation implementation reused for transcript logs
  (*.log) and archived snapshots (*.json); Retention = 0 disables pruning.

HTML report (Private helpers + Public exporter, pattern from SPSUpdate.Common):
- ConvertTo-SPSHtmlEncoded, Get-SPSReportHtmlHead, Get-SPSReportCardHtml,
  Get-SPSReportHtmlScript.
- Export-SPSCleanDependenciesReport: renders the results JSON as a self-contained,
  dependency-free HTML file - one summary card per dependency category plus a
  filterable/sortable table per non-empty category, or a clean 'nothing to clean'
  state. Atomic write (temp file + Move-Item).

Bump the module manifest to 1.4.0 and export the three new public functions.

Refs #8

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
In the audit branch (no -Clean), the entry script now:
- archives the previous Results\<FileName>.json into Results\history (timestamped)
  before the fresh audit overwrites it;
- generates a Results\<FileName>.html report from the new results;
- prunes old history snapshots and transcript logs.

The current Results\<FileName>.json is kept stable (it remains the exact input
consumed by the -Clean run); only the history copies are timestamped. Retention
is configurable via the new -HistoryRetentionDays (default 30) and
-LogRetentionDays (default 180) parameters; 0 disables pruning.

Refs #8

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Extend the Pester suite for the 1.4.0 feature:

- Module tests: add Backup-SPSJsonFile (no-op on missing source, timestamped
  archive leaving the original in place), Clear-SPSLogFolder (retention prune,
  Retention=0 no-op, ShouldProcess), Export-SPSCleanDependenciesReport (section
  per non-empty category, HTML-encoding of result values, clean empty state,
  throw on missing input) and the private HTML helpers; refresh the exported-set
  and FunctionsToExport assertions.
- Entry-script tests: assert the new -HistoryRetentionDays/-LogRetentionDays
  parameters and the audit-branch wiring (Backup-SPSJsonFile,
  Export-SPSCleanDependenciesReport, Clear-SPSLogFolder).

100/100 green locally.

Refs #8

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- CHANGELOG: add the 1.4.0 entry (history backup + retention, HTML report,
  new -HistoryRetentionDays/-LogRetentionDays parameters).
- RELEASE-NOTES: rewrite for 1.4.0 (used verbatim as the GitHub Release body).
- Wiki: new Reports-and-History page (report layout, history folder, retention),
  add it to the sidebar and cross-link from Usage/Dependency-Types; document the
  two new parameters in Usage; refresh the Home key-features list.

Refs #8

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

100 tests   100 ✅  1s ⏱️
 23 suites    0 💤
  1 files      0 ❌

Results for commit c253408.

@luigilink luigilink merged commit 40728c1 into main Jul 9, 2026
3 checks passed
@luigilink luigilink deleted the Release/1.4.0 branch July 9, 2026 14:49
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.

Feature: results history + HTML report

1 participant