Skip to content

Commit 83f144c

Browse files
committed
PR_26175_CHARLIE_019-environment-capabilities
1 parent 68b6dd9 commit 83f144c

14 files changed

Lines changed: 386 additions & 210 deletions

admin/system-health.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ <h2>Admin</h2>
4040
<div class="accordion-body content-stack">
4141
<p>Environment Identity</p>
4242
<p>Environment Map</p>
43+
<p>Environment Capabilities</p>
4344
<p>Health API Contract</p>
4445
<p>Service Health</p>
4546
<p>Configuration Summary</p>
@@ -106,6 +107,21 @@ <h2 id="admin-system-health-title">System Health Tables</h2>
106107
</tbody>
107108
</table>
108109
</div>
110+
<div class="table-wrapper">
111+
<table class="data-table" aria-label="Environment capabilities">
112+
<caption>Environment Capabilities</caption>
113+
<thead>
114+
<tr>
115+
<th scope="col">Capability</th>
116+
<th scope="col">Current Deployment</th>
117+
<th scope="col">Status</th>
118+
</tr>
119+
</thead>
120+
<tbody data-admin-system-health-capability-rows>
121+
<tr><td>Environment Capabilities</td><td>Waiting for safe API status</td><td data-health-status="PENDING" title="Reason: environment capabilities have not loaded yet." aria-label="PENDING: environment capabilities have not loaded yet.">PENDING</td></tr>
122+
</tbody>
123+
</table>
124+
</div>
109125
<div class="table-wrapper">
110126
<table class="data-table" aria-label="Health API contract">
111127
<caption>Health API Contract</caption>

assets/theme-v2/js/admin-system-health.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ class AdminSystemHealthController {
6464
]));
6565
this.historyRows = root.querySelector("[data-admin-system-health-history-rows]");
6666
this.apiContractRows = root.querySelector("[data-admin-system-health-api-contract-rows]");
67+
this.capabilityRows = root.querySelector("[data-admin-system-health-capability-rows]");
6768
this.actionRows = root.querySelector("[data-admin-system-health-action-rows]");
6869
this.actionButtons = Array.from(root.querySelectorAll("[data-admin-system-health-action]"));
6970
this.configurationRows = root.querySelector("[data-admin-system-health-configuration-rows]");
@@ -144,6 +145,7 @@ class AdminSystemHealthController {
144145
this.renderStartupPending(reason);
145146
this.renderStoragePending(reason);
146147
this.renderRuntimeHealthPending(reason);
148+
this.renderEnvironmentCapabilitiesPending(reason);
147149
this.renderApiContractPending(reason);
148150
this.renderServiceHealthPending(reason);
149151
this.renderConfigurationSummaryPending(reason);
@@ -285,6 +287,45 @@ class AdminSystemHealthController {
285287
this.apiContractRows.replaceChildren(fragment);
286288
}
287289

290+
renderEnvironmentCapabilitiesPending(reason) {
291+
if (!this.capabilityRows) {
292+
return;
293+
}
294+
const row = document.createElement("tr");
295+
row.append(
296+
this.createCell("Environment Capabilities"),
297+
this.createCell("not available"),
298+
this.createStatusCell("PENDING", reason),
299+
);
300+
this.capabilityRows.replaceChildren(row);
301+
}
302+
303+
renderEnvironmentCapabilities(environmentCapabilities = {}) {
304+
if (!this.capabilityRows) {
305+
return;
306+
}
307+
if (environmentCapabilities?.secretsExposed === true || environmentCapabilities?.secretEditingAllowed === true) {
308+
this.renderEnvironmentCapabilitiesPending("Safe environment capabilities response was blocked because it exposed secret controls.");
309+
return;
310+
}
311+
const rows = Array.isArray(environmentCapabilities.rows) ? environmentCapabilities.rows : [];
312+
if (!rows.length) {
313+
this.renderEnvironmentCapabilitiesPending("Safe Admin System Health API returned no environment capability rows.");
314+
return;
315+
}
316+
const fragment = document.createDocumentFragment();
317+
rows.forEach((capabilityRow) => {
318+
const row = document.createElement("tr");
319+
row.append(
320+
this.createCell(capabilityRow.capability),
321+
this.createCell(capabilityRow.value),
322+
this.createStatusCell(capabilityRow.status, environmentCapabilities.message),
323+
);
324+
fragment.append(row);
325+
});
326+
this.capabilityRows.replaceChildren(fragment);
327+
}
328+
288329
renderServiceHealthPending(reason) {
289330
if (!this.serviceCards) {
290331
return;
@@ -706,6 +747,7 @@ class AdminSystemHealthController {
706747
this.renderStorageStatus(data?.storageStatus || {});
707748
this.runStorageDiagnostics();
708749
this.renderRuntimeHealth(data?.runtimeHealth || {});
750+
this.renderEnvironmentCapabilities(data?.environmentCapabilities || {});
709751
this.renderApiContract(data?.apiContract || {});
710752
this.renderServiceHealth(data?.serviceHealth || {});
711753
this.renderConfigurationSummary(data?.configurationSummary || {});
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# PR_26175_CHARLIE_019 Branch Validation
2+
3+
- PASS: Continued on `pr/26175-CHARLIE-010-system-health-history-and-closeout`.
4+
- PASS: Stacked on PR_26175_CHARLIE_018.
5+
- PASS: No merge performed.
6+
- PASS: No rebase performed.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# PR_26175_CHARLIE_019 Manual Validation Notes
2+
3+
- Verified Environment Capabilities table renders after Environment Map.
4+
- Verified the table reflects the current deployment only.
5+
- Verified no `/uat`, `/prd`, or peer environment checks appear in current capability rows.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# PR_26175_CHARLIE_019 Requirement Checklist
2+
3+
- PASS: Added current environment capabilities.
4+
- PASS: Did not add peer environment checks.
5+
- PASS: Browser renders API-owned capability state.
6+
- PASS: Not Configured placeholders do not fake success.
7+
- PASS: Required reports generated.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# PR_26175_CHARLIE_019 Validation Report
2+
3+
## Commands
4+
5+
- PASS: `node --check src/dev-runtime/server/local-api-router.mjs`
6+
- PASS: `node --check assets/theme-v2/js/admin-system-health.js`
7+
- PASS: `git diff --check`
8+
- Result: no whitespace errors; CRLF conversion warnings only.
9+
- PASS: `node --test tests/dev-runtime/AdminHealthOperations.test.mjs`
10+
- Result: 4 passed.
11+
- PASS: `npx playwright test tests/playwright/tools/AdminHealthOperationsPage.spec.mjs --workers=1 --reporter=line`
12+
- Result: 3 passed.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# PR_26175_CHARLIE_019 Environment Capabilities
2+
3+
## Scope
4+
5+
Team: Charlie
6+
7+
Purpose: Add current-environment capability summary to Admin System Health.
8+
9+
## Changes
10+
11+
- Added server-owned `environmentCapabilities` to the System Health status API.
12+
- Added Environment Capabilities table to the System Health page.
13+
- Covered Hosting, API, Database, Storage, Authentication, Scheduled Monitoring, and Notifications.
14+
- Updated API and Playwright tests.
15+
16+
## Validation
17+
18+
- PASS: Targeted System Health API/unit tests.
19+
- PASS: Targeted System Health Playwright tests.
20+
- PASS: Syntax checks.
21+
- PASS: `git diff --check`.
22+
23+
## Artifact
24+
25+
- `tmp/PR_26175_CHARLIE_019-environment-capabilities_delta.zip`

docs_build/dev/reports/codex_changed_files.txt

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,25 @@ M admin/system-health.html
66
M src/dev-runtime/server/local-api-router.mjs
77
M tests/dev-runtime/AdminHealthOperations.test.mjs
88
M tests/playwright/tools/AdminHealthOperationsPage.spec.mjs
9-
?? docs_build/dev/reports/PR_26175_CHARLIE_018-health-api-contract-cleanup-branch-validation.md
10-
?? docs_build/dev/reports/PR_26175_CHARLIE_018-health-api-contract-cleanup-manual-validation-notes.md
11-
?? docs_build/dev/reports/PR_26175_CHARLIE_018-health-api-contract-cleanup-requirement-checklist.md
12-
?? docs_build/dev/reports/PR_26175_CHARLIE_018-health-api-contract-cleanup-validation.md
13-
?? docs_build/dev/reports/PR_26175_CHARLIE_018-health-api-contract-cleanup.md
9+
?? docs_build/dev/reports/PR_26175_CHARLIE_019-environment-capabilities-branch-validation.md
10+
?? docs_build/dev/reports/PR_26175_CHARLIE_019-environment-capabilities-manual-validation-notes.md
11+
?? docs_build/dev/reports/PR_26175_CHARLIE_019-environment-capabilities-requirement-checklist.md
12+
?? docs_build/dev/reports/PR_26175_CHARLIE_019-environment-capabilities-validation.md
13+
?? docs_build/dev/reports/PR_26175_CHARLIE_019-environment-capabilities.md
1414

1515
# git ls-files --others --exclude-standard
16-
docs_build/dev/reports/PR_26175_CHARLIE_018-health-api-contract-cleanup-branch-validation.md
17-
docs_build/dev/reports/PR_26175_CHARLIE_018-health-api-contract-cleanup-manual-validation-notes.md
18-
docs_build/dev/reports/PR_26175_CHARLIE_018-health-api-contract-cleanup-requirement-checklist.md
19-
docs_build/dev/reports/PR_26175_CHARLIE_018-health-api-contract-cleanup-validation.md
20-
docs_build/dev/reports/PR_26175_CHARLIE_018-health-api-contract-cleanup.md
16+
docs_build/dev/reports/PR_26175_CHARLIE_019-environment-capabilities-branch-validation.md
17+
docs_build/dev/reports/PR_26175_CHARLIE_019-environment-capabilities-manual-validation-notes.md
18+
docs_build/dev/reports/PR_26175_CHARLIE_019-environment-capabilities-requirement-checklist.md
19+
docs_build/dev/reports/PR_26175_CHARLIE_019-environment-capabilities-validation.md
20+
docs_build/dev/reports/PR_26175_CHARLIE_019-environment-capabilities.md
2121

2222
# git diff --stat
2323
admin/system-health.html | 16 ++++++
24-
assets/theme-v2/js/admin-system-health.js | 42 +++++++++++++++
24+
assets/theme-v2/js/admin-system-health.js | 42 ++++++++++++++
2525
.../dev/reports/coverage_changed_js_guardrail.txt | 2 +-
26-
.../dev/reports/playwright_v8_coverage_report.txt | 6 +--
27-
src/dev-runtime/server/local-api-router.mjs | 60 ++++++++++++++++++++++
28-
tests/dev-runtime/AdminHealthOperations.test.mjs | 12 +++++
29-
.../tools/AdminHealthOperationsPage.spec.mjs | 6 +++
30-
7 files changed, 140 insertions(+), 4 deletions(-)
26+
.../dev/reports/playwright_v8_coverage_report.txt | 6 +-
27+
src/dev-runtime/server/local-api-router.mjs | 64 ++++++++++++++++++++++
28+
tests/dev-runtime/AdminHealthOperations.test.mjs | 7 +++
29+
.../tools/AdminHealthOperationsPage.spec.mjs | 8 +++
30+
7 files changed, 141 insertions(+), 4 deletions(-)

0 commit comments

Comments
 (0)