Skip to content

Commit d4f4279

Browse files
authored
Merge pull request #155 from ToolboxAid/pr/26175-CHARLIE-010-system-health-history-and-closeout
PR_26175_CHARLIE_010-system-health-history-and-closeout + 011-admin-submenu-alphabetical-order
2 parents 9740705 + 250b32f commit d4f4279

20 files changed

Lines changed: 629 additions & 163 deletions

admin/system-health.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ <h2>Admin</h2>
4343
<p>Local API Startup</p>
4444
<p>Database Health</p>
4545
<p>Storage Health</p>
46+
<p>Health Check History</p>
4647
<p>Runtime Environment</p>
4748
<p>Limits &amp; Capacity</p>
4849
<p>Diagnostics Plan</p>
@@ -152,6 +153,23 @@ <h2 id="admin-system-health-title">System Health Tables</h2>
152153
</tbody>
153154
</table>
154155
</div>
156+
<div class="table-wrapper">
157+
<table class="data-table" aria-label="Health check history">
158+
<caption>Health Check History</caption>
159+
<thead>
160+
<tr>
161+
<th scope="col">Time</th>
162+
<th scope="col">Environment</th>
163+
<th scope="col">Area</th>
164+
<th scope="col">Result</th>
165+
<th scope="col">Summary</th>
166+
</tr>
167+
</thead>
168+
<tbody data-admin-system-health-history-rows>
169+
<tr><td>Loading</td><td>Loading</td><td>Current environment</td><td data-health-status="PENDING" title="Reason: health check history has not loaded yet." aria-label="PENDING: health check history has not loaded yet.">PENDING</td><td>Waiting for safe API status.</td></tr>
170+
</tbody>
171+
</table>
172+
</div>
155173
<div class="table-wrapper">
156174
<table class="data-table" aria-label="Runtime environment">
157175
<caption>Runtime Environment - Alphabetical Variables</caption>

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

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ class AdminSystemHealthController {
4747
node.dataset.adminSystemHealthStorageStatus,
4848
node,
4949
]));
50+
this.historyRows = root.querySelector("[data-admin-system-health-history-rows]");
5051
this.startupRows = root.querySelector("[data-admin-system-health-startup-rows]");
5152
this.runtimeRows = root.querySelector("[data-admin-system-health-runtime-rows]");
5253
}
@@ -107,6 +108,7 @@ class AdminSystemHealthController {
107108
});
108109
this.renderStartupPending(reason);
109110
this.renderStoragePending(reason);
111+
this.renderHistoryPending(reason);
110112
}
111113

112114
renderEnvironmentIdentity(environmentIdentity = {}) {
@@ -222,6 +224,45 @@ class AdminSystemHealthController {
222224
}
223225
}
224226

227+
renderHistoryPending(reason) {
228+
if (!this.historyRows) {
229+
return;
230+
}
231+
const row = document.createElement("tr");
232+
row.append(
233+
this.createCell("not available"),
234+
this.createCell("current environment"),
235+
this.createCell("Health Check History"),
236+
this.createStatusCell("PENDING", reason),
237+
this.createCell("Safe health check history is not available."),
238+
);
239+
this.historyRows.replaceChildren(row);
240+
}
241+
242+
renderHealthCheckHistory(historyRows = []) {
243+
if (!this.historyRows) {
244+
return;
245+
}
246+
const rows = Array.isArray(historyRows) ? historyRows : [];
247+
if (!rows.length) {
248+
this.renderHistoryPending("Safe Admin System Health API returned no current-environment health check history rows.");
249+
return;
250+
}
251+
const fragment = document.createDocumentFragment();
252+
rows.forEach((historyRow) => {
253+
const row = document.createElement("tr");
254+
row.append(
255+
this.createCell(historyRow.checkedAt),
256+
this.createCell(historyRow.environmentName),
257+
this.createCell(historyRow.area),
258+
this.createStatusCell(historyRow.result || historyRow.status, historyRow.summary),
259+
this.createCell(historyRow.summary),
260+
);
261+
fragment.append(row);
262+
});
263+
this.historyRows.replaceChildren(fragment);
264+
}
265+
225266
runStorageDiagnostics() {
226267
STORAGE_DIAGNOSTIC_ACTIONS.forEach(({ key }) => {
227268
this.setStorageStatus(key, "PENDING", "R2 diagnostic is running through the safe Admin System Health API.");
@@ -302,6 +343,7 @@ class AdminSystemHealthController {
302343
this.renderStartupDiagnostics(data?.localApiStartup || {});
303344
this.renderStorageStatus(data?.storageStatus || {});
304345
this.runStorageDiagnostics();
346+
this.renderHealthCheckHistory(data?.healthCheckHistory || []);
305347
this.renderRuntimeEnvironment(data?.runtimeEnvironment || {});
306348
} catch (error) {
307349
const message = error instanceof Error ? error.message : "Safe Admin System Health API is unavailable.";
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# PR_26175_CHARLIE_010 System Health History and Closeout
2+
3+
## Scope
4+
5+
Team: Charlie
6+
7+
Purpose: Add current-environment Health Check History and close out the System Health stacked expansion chain.
8+
9+
## Chain
10+
11+
- `PR_26175_CHARLIE_006-project-instructions-system-health-infrastructure`
12+
- Branch: `PR_26175_CHARLIE_006-project-instructions-system-health-infrastructure`
13+
- Commit: `c870b812faded383094fb13fc60ae9cfc7f14889`
14+
- Result: pushed to origin, not merged.
15+
- `PR_26175_CHARLIE_007-system-health-environment-identity`
16+
- Branch: `pr/26175-CHARLIE-007-system-health-environment-identity`
17+
- Commit: `6556e73efcd8ae13b51b56288416c88688e67634`
18+
- Draft PR: https://github.com/ToolboxAid/HTML-JavaScript-Gaming/pull/151
19+
- `PR_26175_CHARLIE_008-system-health-current-database-health`
20+
- Branch: `pr/26175-CHARLIE-008-system-health-current-database-health`
21+
- Commit: `2603aeb6e5a7ccca516051953cbd70a5a6c94c4b`
22+
- Draft PR: https://github.com/ToolboxAid/HTML-JavaScript-Gaming/pull/152
23+
- `PR_26175_CHARLIE_009-system-health-current-r2-health`
24+
- Branch: `pr/26175-CHARLIE-009-system-health-current-r2-health`
25+
- Commit: `9740705fbe73dffd43744ab66338f8e4a925eed4`
26+
- Draft PR: https://github.com/ToolboxAid/HTML-JavaScript-Gaming/pull/153
27+
- `PR_26175_CHARLIE_010-system-health-history-and-closeout`
28+
- Branch: `pr/26175-CHARLIE-010-system-health-history-and-closeout`
29+
- Commit and draft PR URL are assigned after this report is committed and pushed.
30+
31+
## Changes
32+
33+
- Added Health Check History to the Admin System Health page.
34+
- Health Check History is derived from the current deployment only:
35+
- Environment Summary
36+
- Database Health
37+
- Storage Health
38+
- Runtime Health
39+
- Warning and failure rows are generated only from current-environment health rows.
40+
- Creator sessions remain blocked from Admin System Health and do not trigger status or storage health requests.
41+
42+
## Governance
43+
44+
- PASS: System Health is one page per deployed environment.
45+
- PASS: Each deployment actively checks only itself.
46+
- PASS: The Environment Map remains a static reference for Local, DEV, IST, UAT, and PRD.
47+
- PASS: System Health does not actively check peer databases or peer R2 folders.
48+
- PASS: Cancelled initiatives remain not doing:
49+
- Environment Isolation & Developer Experience
50+
- multi-port workspace framework
51+
- Alpha/Beta/User runtime separation
52+
- runtime port management initiative
53+
54+
## Validation
55+
56+
- PASS: `node --check src/dev-runtime/server/local-api-router.mjs`
57+
- PASS: `node --check assets/theme-v2/js/admin-system-health.js`
58+
- PASS: `git diff --check`
59+
- PASS: `node --test tests/dev-runtime/AdminHealthOperations.test.mjs`
60+
- PASS: `node --test tests/dev-runtime/PublicEnvironmentConfig.test.mjs`
61+
- PASS: `npx playwright test tests/playwright/tools/AdminHealthOperationsPage.spec.mjs --workers=1 --reporter=line`
62+
63+
## Artifacts
64+
65+
- `tmp/PR_26175_CHARLIE_007-system-health-environment-identity_delta.zip`
66+
- `tmp/PR_26175_CHARLIE_008-system-health-current-database-health_delta.zip`
67+
- `tmp/PR_26175_CHARLIE_009-system-health-current-r2-health_delta.zip`
68+
- `tmp/PR_26175_CHARLIE_010-system-health-history-and-closeout_delta.zip`
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# PR_26175_CHARLIE_011 Branch Validation
2+
3+
## Start Gate
4+
5+
- PASS: Current branch was `pr/26175-CHARLIE-010-system-health-history-and-closeout`.
6+
- PASS: Worktree was clean before implementation.
7+
- PASS: Build remained on the current Charlie continuation branch.
8+
- PASS: No rebase was performed.
9+
- PASS: No new root branch was created.
10+
11+
## Final Branch Target
12+
13+
- Branch to push: `pr/26175-CHARLIE-010-system-health-history-and-closeout`
14+
- Expected draft PR to update: https://github.com/ToolboxAid/HTML-JavaScript-Gaming/pull/155
15+
- Merge status: no merge requested or performed.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# PR_26175_CHARLIE_011 Manual Validation Notes
2+
3+
## Admin Submenu Order
4+
5+
Visible labels after the change:
6+
7+
`Admin Tools`, `Analytics`, `Controls`, `Creators`, `DB Viewer`, `Environments`, `Game Migration`, `Infrastructure`, `Invites`, `Moderation`, `Operations`, `Platform Settings`, `Ratings`, `Responsibilities`, `Site Setup`, `System Health`, `Tool Votes`
8+
9+
## Route Preservation
10+
11+
The only source navigation reorder moved this existing item:
12+
13+
- `Creators`
14+
- path remained `admin/users.html`
15+
- route remained `admin-users`
16+
- label remained `Creators`
17+
18+
All other Admin navigation objects remained unchanged.
19+
20+
## Open-Page Check
21+
22+
The targeted Playwright navigation test collected every active Admin submenu href from the rendered submenu and requested each page through the local test server. Every response returned a status below HTTP 400.
23+
24+
## Duplicate Check
25+
26+
The targeted Playwright navigation test checks for duplicate rendered labels and duplicate active hrefs. The targeted unit script also checks duplicate labels and existing active paths.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# PR_26175_CHARLIE_011 Requirement Checklist
2+
3+
## Branch Rules
4+
5+
- PASS: Continued on `pr/26175-CHARLIE-010-system-health-history-and-closeout`.
6+
- PASS: Did not return to `main`.
7+
- PASS: Did not rebase.
8+
- PASS: Did not create a new root branch.
9+
- PASS: Hard stop conditions were checked before implementation.
10+
11+
## Objective
12+
13+
- PASS: Admin submenu entries are alphabetized by displayed text.
14+
15+
## Scope
16+
17+
- PASS: Located Admin submenu definition in `src/api/admin-owner-navigation.js`.
18+
- PASS: Sorted submenu entries by displayed text.
19+
- PASS: Preserved routes, URLs, IDs, CSS classes, Theme V2 styling, and existing renderer behavior.
20+
- PASS: Did not rename pages.
21+
- PASS: Did not rename folders.
22+
- PASS: Did not modify page content.
23+
- PASS: No unrelated cleanup.
24+
25+
## Validation
26+
27+
- PASS: Verified submenu labels are alphabetical.
28+
- PASS: Verified every Admin page path exists and every Admin submenu href opens below HTTP 400 in targeted Playwright.
29+
- PASS: Verified no duplicate labels or hrefs.
30+
- PASS: Ran affected Playwright navigation tests.
31+
- PASS: Ran affected targeted unit tests.
32+
33+
## Artifacts
34+
35+
- PASS: `docs_build/dev/reports/codex_review.diff`
36+
- PASS: `docs_build/dev/reports/codex_changed_files.txt`
37+
- PASS: `docs_build/dev/reports/PR_26175_CHARLIE_011-admin-submenu-alphabetical-order.md`
38+
- PASS: validation report
39+
- PASS: branch validation report
40+
- PASS: requirement checklist
41+
- PASS: manual validation notes
42+
- PASS: repository ZIP under `tmp/`
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# PR_26175_CHARLIE_011 Validation Report
2+
3+
## Commands
4+
5+
- PASS: `node --check src/api/admin-owner-navigation.js`
6+
- PASS: `node --input-type=module` alphabetical/duplicate/path verification script
7+
- Result: `PASS labels=17 active=16`
8+
- Order: `Admin Tools | Analytics | Controls | Creators | DB Viewer | Environments | Game Migration | Infrastructure | Invites | Moderation | Operations | Platform Settings | Ratings | Responsibilities | Site Setup | System Health | Tool Votes`
9+
- PASS: `git diff --check`
10+
- Result: no whitespace errors; CRLF conversion warnings only.
11+
- PASS: `node --test tests/dev-runtime/ApiMenuPathCleanup.test.mjs`
12+
- Result: 6 passed.
13+
- PASS: `node --test --test-name-pattern "Admin and Owner navigation are shared" tests/dev-runtime/ArchitectureCleanupApiNavInvitations.test.mjs`
14+
- Result: 1 passed.
15+
- PASS: `npx playwright test tests/playwright/tools/AdminOwnerNavigationBoundary.spec.mjs --workers=1 --reporter=line`
16+
- Result: 4 passed.
17+
- PASS: `npx playwright test tests/playwright/tools/AdminInvitationsNavPage.spec.mjs --workers=1 --reporter=line`
18+
- Result: 3 passed.
19+
20+
## Note
21+
22+
A non-targeted full-file run of `tests/dev-runtime/ArchitectureCleanupApiNavInvitations.test.mjs` was not used for final validation because its first non-navigation test fails on a pre-existing missing `src/engine/api` directory assertion. The affected navigation subtest passed by name.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# PR_26175_CHARLIE_011 Admin Submenu Alphabetical Order
2+
3+
## Scope
4+
5+
Team: Charlie
6+
7+
Purpose: Alphabetize the Admin submenu by visible menu labels only.
8+
9+
## Branch
10+
11+
- Continuation branch: `pr/26175-CHARLIE-010-system-health-history-and-closeout`
12+
- Start gate: PASS
13+
- Current branch matched the expected Charlie continuation branch.
14+
- Worktree was clean before implementation.
15+
16+
## Changes
17+
18+
- Moved `Creators` into its alphabetical position in `src/api/admin-owner-navigation.js`.
19+
- Preserved each Admin menu item label, path, route id, disabled state, and renderer behavior.
20+
- Updated affected navigation tests that pin visible Admin menu label order.
21+
- Added Playwright coverage of:
22+
- alphabetical visible label order
23+
- duplicate detection
24+
- duplicate href detection
25+
- each Admin submenu href opening with an HTTP status below 400
26+
27+
## Non-Changes
28+
29+
- No page files were renamed.
30+
- No folders were renamed.
31+
- No page content was modified.
32+
- No routes, URLs, permissions, icons, IDs, CSS classes, Theme V2 styling, or event handlers were changed.
33+
- No menu outside the Admin submenu was reordered.
34+
35+
## Validation Summary
36+
37+
- PASS: Admin labels are alphabetical.
38+
- PASS: No duplicate Admin labels.
39+
- PASS: No duplicate Admin hrefs.
40+
- PASS: Every active Admin submenu item points to an existing page path.
41+
- PASS: Every Admin submenu href opened with an HTTP status below 400 in the targeted Playwright navigation test.
42+
- PASS: Targeted unit tests passed.
43+
- PASS: Targeted Playwright navigation tests passed.
44+
45+
## Artifact
46+
47+
- `tmp/PR_26175_CHARLIE_011-admin-submenu-alphabetical-order_delta.zip`
Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
# git status --short
2-
3-
4-
# git diff --name-status main...HEAD
5-
A docs_build/dev/reports/PR_26175_OWNER_049-governance-report-merge-batch.md
6-
7-
# git diff --stat main...HEAD
8-
...6175_OWNER_049-governance-report-merge-batch.md | 128 +++++++++++++++++++++
9-
1 file changed, 128 insertions(+)
1+
docs_build/dev/reports/codex_changed_files.txt
2+
docs_build/dev/reports/codex_review.diff
3+
docs_build/dev/reports/coverage_changed_js_guardrail.txt
4+
docs_build/dev/reports/playwright_v8_coverage_report.txt
5+
docs_build/dev/reports/PR_26175_CHARLIE_011-admin-submenu-alphabetical-order.md
6+
docs_build/dev/reports/PR_26175_CHARLIE_011-admin-submenu-alphabetical-order-branch-validation.md
7+
docs_build/dev/reports/PR_26175_CHARLIE_011-admin-submenu-alphabetical-order-manual-validation-notes.md
8+
docs_build/dev/reports/PR_26175_CHARLIE_011-admin-submenu-alphabetical-order-requirement-checklist.md
9+
docs_build/dev/reports/PR_26175_CHARLIE_011-admin-submenu-alphabetical-order-validation.md
10+
src/api/admin-owner-navigation.js
11+
tests/dev-runtime/ApiMenuPathCleanup.test.mjs
12+
tests/dev-runtime/ArchitectureCleanupApiNavInvitations.test.mjs
13+
tests/playwright/tools/AdminInvitationsNavPage.spec.mjs
14+
tests/playwright/tools/AdminOwnerNavigationBoundary.spec.mjs

0 commit comments

Comments
 (0)