You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 2217770
Browse filesBrowse the repository at this point in the historyBrowse files
# Daily Support Check Script Simplification Implementation Plan
2
+
3
+
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
4
+
5
+
**Goal:** Remove repeated status-icon and HTTP endpoint configuration validation logic without changing script behavior.
6
+
7
+
**Architecture:** Keep the script standalone. Add one status-icon helper covering the current status aliases and one HTTP endpoint configuration helper used by the three sections that currently validate both `BaseUrl` and `TimeoutSeconds`.
-[x] Add `Get-SupportStatusIcon` with the approved mapping and replace only the three existing HTML status-icon switches.
36
+
-[x] Add `Assert-HttpEndpointConfiguration`; preserve the exact URI and timeout validation logic and error messages.
37
+
-[x] Replace the repeated validation blocks for `HealthMonitoring`, `SubscriptionService`, and `KurrentDbProjections` with helper calls while keeping their existing property checks, ordering, domain-specific validation, and early returns.
38
+
-[x] Parse the updated script with PowerShell's parser, review the diff for behavior changes, and run `git diff --check`; do not run tests.
Make repeated presentation and configuration-validation logic easier to maintain in `Invoke-DailySupportCheck.ps1` without changing report output, configuration behavior, or how the standalone script is deployed.
6
+
7
+
## Goals
8
+
9
+
- Replace the three duplicated status-to-icon switches in HTML report generation with one helper that preserves the current mappings: `Passed`/`Healthy` → green, `Warning`/`Degraded` → orange, `Failed`/`Unhealthy` → red, and all other values → white.
10
+
- Replace the repeated absolute-URI and positive-timeout validation for `HealthMonitoring`, `SubscriptionService`, and `KurrentDbProjections` with one helper.
11
+
- Preserve the current validation order, messages, optional-section behavior, and early return when a present section is disabled.
12
+
- Keep `Invoke-DailySupportCheck.ps1` as a single self-contained script.
13
+
14
+
## Non-goals
15
+
16
+
- Split the script into modules or change installation/sourcing requirements.
17
+
- Change any check's request, status calculation, fallback, report or email behavior.
18
+
- Rewrite the entire configuration validator as a table-driven framework.
19
+
- Change KurrentDB write-activity validation, which has no matching timeout requirement.
20
+
21
+
## Chosen approach
22
+
23
+
Add a small `Get-SupportStatusIcon` helper for the existing icon mappings and an `Assert-HttpEndpointConfiguration` helper that accepts the section name, base URL, and timeout. Call the endpoint helper from the three existing validation blocks while leaving their order, enable checks, optional settings, and early returns in place. Replace only the repeated icon switches with helper calls; leave HTML structure and text encoding as they are.
24
+
25
+
## Alternatives considered
26
+
27
+
1.**Extract the repeated helpers in the existing script (chosen).** Reduces duplicated logic with minimal behavioral and packaging risk.
28
+
2.**Split checks, reporting, and transports into separate files.** Could improve navigation further, but changes how callers load and deploy the script and exceeds this focused cleanup.
29
+
3.**Rewrite all validation as declarative metadata.** More compact, but risks changing validation order and disabled-section short-circuit behavior for little added value.
30
+
31
+
## Constraints and implementation calls
32
+
33
+
- Preserve current user-visible messages and configuration behavior byte-for-byte where applicable.
34
+
- Keep the current script API and deployment layout.
35
+
- The existing PR #843 is the target branch and should receive this cleanup as a follow-up commit.
36
+
- Do not add or run tests; use static inspection and syntax parsing if needed.
0 commit comments