Skip to content

Commit 9382b05

Browse files
committed
PR_26175_CHARLIE_021-runtime-feature-flags
1 parent 9fd5396 commit 9382b05

14 files changed

Lines changed: 312 additions & 168 deletions

admin/system-health.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ <h2>Admin</h2>
4343
<p>Environment Capabilities</p>
4444
<p>Health API Contract</p>
4545
<p>Admin API Registry</p>
46+
<p>Runtime Feature Flags</p>
4647
<p>Service Health</p>
4748
<p>Configuration Summary</p>
4849
<p>Manual Health Actions</p>
@@ -154,6 +155,21 @@ <h2 id="admin-system-health-title">System Health Tables</h2>
154155
</tbody>
155156
</table>
156157
</div>
158+
<div class="table-wrapper">
159+
<table class="data-table" aria-label="Runtime feature flags">
160+
<caption>Runtime Feature Flags</caption>
161+
<thead>
162+
<tr>
163+
<th scope="col">Flag</th>
164+
<th scope="col">Current Deployment</th>
165+
<th scope="col">Status</th>
166+
</tr>
167+
</thead>
168+
<tbody data-admin-system-health-feature-flag-rows>
169+
<tr><td>Runtime Feature Flags</td><td>Waiting for safe API status</td><td data-health-status="PENDING" title="Reason: runtime feature flags have not loaded yet." aria-label="PENDING: runtime feature flags have not loaded yet.">PENDING</td></tr>
170+
</tbody>
171+
</table>
172+
</div>
157173
<section class="content-stack" aria-label="Service health summary">
158174
<div>
159175
<div class="kicker">Current Deployment</div>

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

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ class AdminSystemHealthController {
6666
this.apiContractRows = root.querySelector("[data-admin-system-health-api-contract-rows]");
6767
this.apiRegistryRows = root.querySelector("[data-admin-system-health-api-registry-rows]");
6868
this.capabilityRows = root.querySelector("[data-admin-system-health-capability-rows]");
69+
this.featureFlagRows = root.querySelector("[data-admin-system-health-feature-flag-rows]");
6970
this.actionRows = root.querySelector("[data-admin-system-health-action-rows]");
7071
this.actionButtons = Array.from(root.querySelectorAll("[data-admin-system-health-action]"));
7172
this.configurationRows = root.querySelector("[data-admin-system-health-configuration-rows]");
@@ -149,6 +150,7 @@ class AdminSystemHealthController {
149150
this.renderEnvironmentCapabilitiesPending(reason);
150151
this.renderApiContractPending(reason);
151152
this.renderAdminApiRegistryPending(reason);
153+
this.renderRuntimeFeatureFlagsPending(reason);
152154
this.renderServiceHealthPending(reason);
153155
this.renderConfigurationSummaryPending(reason);
154156
this.renderScheduledMonitoringPending(reason);
@@ -369,6 +371,45 @@ class AdminSystemHealthController {
369371
this.apiRegistryRows.replaceChildren(fragment);
370372
}
371373

374+
renderRuntimeFeatureFlagsPending(reason) {
375+
if (!this.featureFlagRows) {
376+
return;
377+
}
378+
const row = document.createElement("tr");
379+
row.append(
380+
this.createCell("Runtime Feature Flags"),
381+
this.createCell("not available"),
382+
this.createStatusCell("PENDING", reason),
383+
);
384+
this.featureFlagRows.replaceChildren(row);
385+
}
386+
387+
renderRuntimeFeatureFlags(runtimeFeatureFlags = {}) {
388+
if (!this.featureFlagRows) {
389+
return;
390+
}
391+
if (runtimeFeatureFlags?.secretsExposed === true || runtimeFeatureFlags?.secretEditingAllowed === true) {
392+
this.renderRuntimeFeatureFlagsPending("Safe runtime feature flags response was blocked because it exposed secret controls.");
393+
return;
394+
}
395+
const rows = Array.isArray(runtimeFeatureFlags.rows) ? runtimeFeatureFlags.rows : [];
396+
if (!rows.length) {
397+
this.renderRuntimeFeatureFlagsPending("Safe Admin System Health API returned no runtime feature flag rows.");
398+
return;
399+
}
400+
const fragment = document.createDocumentFragment();
401+
rows.forEach((featureRow) => {
402+
const row = document.createElement("tr");
403+
row.append(
404+
this.createCell(featureRow.flag),
405+
this.createCell(featureRow.value),
406+
this.createStatusCell(featureRow.status, runtimeFeatureFlags.message),
407+
);
408+
fragment.append(row);
409+
});
410+
this.featureFlagRows.replaceChildren(fragment);
411+
}
412+
372413
renderServiceHealthPending(reason) {
373414
if (!this.serviceCards) {
374415
return;
@@ -793,6 +834,7 @@ class AdminSystemHealthController {
793834
this.renderEnvironmentCapabilities(data?.environmentCapabilities || {});
794835
this.renderApiContract(data?.apiContract || {});
795836
this.renderAdminApiRegistry(data?.adminApiRegistry || {});
837+
this.renderRuntimeFeatureFlags(data?.runtimeFeatureFlags || {});
796838
this.renderServiceHealth(data?.serviceHealth || {});
797839
this.renderConfigurationSummary(data?.configurationSummary || {});
798840
this.renderScheduledMonitoring(data?.scheduledMonitoring || {});
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# PR_26175_CHARLIE_021 Branch Validation
2+
3+
- PASS: Continued on `pr/26175-CHARLIE-010-system-health-history-and-closeout`.
4+
- PASS: Stacked on PR_26175_CHARLIE_020.
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_021 Manual Validation Notes
2+
3+
- Verified Runtime Feature Flags table renders on System Health.
4+
- Verified completed System Health flags show Enabled.
5+
- Verified scheduled monitoring and notifications remain Not Configured.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# PR_26175_CHARLIE_021 Requirement Checklist
2+
3+
- PASS: Added runtime feature flags.
4+
- PASS: Flags are read-only.
5+
- PASS: Flags are server-owned.
6+
- PASS: Not Configured placeholders do not fake enabled behavior.
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_021 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_021 Runtime Feature Flags
2+
3+
## Scope
4+
5+
Team: Charlie
6+
7+
Purpose: Add read-only runtime feature flags to Admin System Health.
8+
9+
## Changes
10+
11+
- Added server-owned `runtimeFeatureFlags` to the System Health status API.
12+
- Added Runtime Feature Flags table to the System Health page.
13+
- Reported completed System Health features as Enabled and placeholders as Not Configured.
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_021-runtime-feature-flags_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_020-admin-api-registry-branch-validation.md
10-
?? docs_build/dev/reports/PR_26175_CHARLIE_020-admin-api-registry-manual-validation-notes.md
11-
?? docs_build/dev/reports/PR_26175_CHARLIE_020-admin-api-registry-requirement-checklist.md
12-
?? docs_build/dev/reports/PR_26175_CHARLIE_020-admin-api-registry-validation.md
13-
?? docs_build/dev/reports/PR_26175_CHARLIE_020-admin-api-registry.md
9+
?? docs_build/dev/reports/PR_26175_CHARLIE_021-runtime-feature-flags-branch-validation.md
10+
?? docs_build/dev/reports/PR_26175_CHARLIE_021-runtime-feature-flags-manual-validation-notes.md
11+
?? docs_build/dev/reports/PR_26175_CHARLIE_021-runtime-feature-flags-requirement-checklist.md
12+
?? docs_build/dev/reports/PR_26175_CHARLIE_021-runtime-feature-flags-validation.md
13+
?? docs_build/dev/reports/PR_26175_CHARLIE_021-runtime-feature-flags.md
1414

1515
# git ls-files --others --exclude-standard
16-
docs_build/dev/reports/PR_26175_CHARLIE_020-admin-api-registry-branch-validation.md
17-
docs_build/dev/reports/PR_26175_CHARLIE_020-admin-api-registry-manual-validation-notes.md
18-
docs_build/dev/reports/PR_26175_CHARLIE_020-admin-api-registry-requirement-checklist.md
19-
docs_build/dev/reports/PR_26175_CHARLIE_020-admin-api-registry-validation.md
20-
docs_build/dev/reports/PR_26175_CHARLIE_020-admin-api-registry.md
16+
docs_build/dev/reports/PR_26175_CHARLIE_021-runtime-feature-flags-branch-validation.md
17+
docs_build/dev/reports/PR_26175_CHARLIE_021-runtime-feature-flags-manual-validation-notes.md
18+
docs_build/dev/reports/PR_26175_CHARLIE_021-runtime-feature-flags-requirement-checklist.md
19+
docs_build/dev/reports/PR_26175_CHARLIE_021-runtime-feature-flags-validation.md
20+
docs_build/dev/reports/PR_26175_CHARLIE_021-runtime-feature-flags.md
2121

2222
# git diff --stat
23-
admin/system-health.html | 17 +++++++++
24-
assets/theme-v2/js/admin-system-health.js | 44 ++++++++++++++++++++++
23+
admin/system-health.html | 16 +++++++++
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 | 4 +-
27-
src/dev-runtime/server/local-api-router.mjs | 28 ++++++++++++++
28-
tests/dev-runtime/AdminHealthOperations.test.mjs | 13 +++++++
26+
.../dev/reports/playwright_v8_coverage_report.txt | 6 ++--
27+
src/dev-runtime/server/local-api-router.mjs | 22 ++++++++++++
28+
tests/dev-runtime/AdminHealthOperations.test.mjs | 12 +++++++
2929
.../tools/AdminHealthOperationsPage.spec.mjs | 7 ++++
30-
7 files changed, 112 insertions(+), 3 deletions(-)
30+
7 files changed, 103 insertions(+), 4 deletions(-)

0 commit comments

Comments
 (0)