Skip to content

Implement and schedule Daily Support Checks #784

Description

@StuartFerguson

Summary

Implement and document the Daily Support Checks scheduled task and reporting workflow.

What was added

  • A PowerShell-based Daily Support Check runner under ScheduledTasks/DailySupportCheck.
  • Configurable checks for:
    • PowerShell runtime availability
    • Report output directory
    • Disk space
    • Health Monitoring services
    • Subscription service status
    • KurrentDB projections
    • Scheduled tasks
    • KurrentDB write activity
    • Template/configuration validation
  • Configuration-driven enablement and settings through daily-support-check.json.
  • Environment-variable-based secret handling for KurrentDB and Brevo credentials; secrets are not stored in the JSON configuration.

Reporting

  • JSON reports retain detailed check results and diagnostics.
  • HTML reports use a compact three-column layout: check name, traffic-light status icon, and short summary.
  • Failure summaries are kept short while full details remain available in JSON.
  • Email subjects include overall status, server name, and report date:
    Daily Support Check - <Status> - <ServerName> - <YYYY-MM-DD>
  • Brevo API is used for email delivery.
  • Report retention is configurable through ReportRetentionDays, with a default of 7 days.

Scheduling and CI/CD

  • Added DailySupportCheck.xml for Windows Task Scheduler.
  • The task runs daily at 09:00 using PowerShell 7 and the configured report output path.
  • Pull request workflow runs the Daily Support Check Pester tests.
  • Push-to-main and release workflows package the scheduled task, script, and base configuration.
  • Machine-local secrets and overrides remain outside the repository configuration.

Fixes included

  • Corrected handling of the subscription-service response so all subscriptions are evaluated rather than treating the response as a single subscription object.
  • Replaced the flagged ConvertTo-SecureString -AsPlainText call with a read-only SecureString built directly for the PSCredential boundary.
  • Added a focused test proving the secure-string conversion remains read-only and round-trips correctly for authentication use.

Verification

Known follow-up

Codacy still reports a security annotation related to the previous plaintext conversion pattern, despite the call being removed from the implementation. The remaining Codacy result should be reviewed as a stale or mislocated analyzer finding and cleared or documented in Codacy as appropriate.

Acceptance criteria

  • Daily checks can be run manually and from Windows Task Scheduler.
  • Reports are generated in JSON and compact HTML formats.
  • Brevo email delivery works using environment-provided credentials.
  • Reports older than the configured retention period are removed.
  • Pull request and release workflows include the required script, configuration, tests, and schedule definition.
  • All automated checks pass, including resolution of the remaining Codacy finding.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions