Skip to content

Commit 551ac75

Browse files
committed
Fix promotion lanes and asset storage path status display - PR_26168_220-promotion-lanes-storage-path-status
1 parent 44a654b commit 551ac75

14 files changed

Lines changed: 1212 additions & 341 deletions

admin/infrastructure.html

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,14 @@ <h3 id="admin-infrastructure-image-zoom-title">Game Foundry Infrastructure</h3>
7777
<tr>
7878
<th scope="col">Lane</th>
7979
<th scope="col">Path</th>
80-
<th scope="col">.env variable</th>
80+
<th scope="col">Current .env match</th>
8181
</tr>
8282
</thead>
83-
<tbody>
84-
<tr><td>DEV</td><td>/dev/projects/</td><td><code>GAMEFOUNDRY_ASSET_STORAGE_PATH</code></td></tr>
85-
<tr><td>IST</td><td>/ist/projects/</td><td><code>GAMEFOUNDRY_ASSET_STORAGE_PATH</code></td></tr>
86-
<tr><td>UAT</td><td>/uat/projects/</td><td><code>GAMEFOUNDRY_ASSET_STORAGE_PATH</code></td></tr>
87-
<tr><td>PROD</td><td>/prod/projects/</td><td><code>GAMEFOUNDRY_ASSET_STORAGE_PATH</code></td></tr>
83+
<tbody data-admin-storage-path-status-rows>
84+
<tr><td>DEV</td><td>/dev/projects/</td><td>Loading</td></tr>
85+
<tr><td>IST</td><td>/ist/projects/</td><td>Loading</td></tr>
86+
<tr><td>UAT</td><td>/uat/projects/</td><td>Loading</td></tr>
87+
<tr><td>PROD</td><td>/prod/projects/</td><td>Loading</td></tr>
8888
</tbody>
8989
</table>
9090
</div>
@@ -120,6 +120,7 @@ <h2>Inspector</h2>
120120
<script src="assets/theme-v2/js/gamefoundry-partials.js" defer></script>
121121
<script src="assets/theme-v2/js/tool-display-mode.js" defer></script>
122122
<script src="assets/theme-v2/js/image-zoom-dialog.js" defer></script>
123+
<script type="module" src="assets/theme-v2/js/admin-infrastructure.js"></script>
123124
</body>
124125

125126
</html>
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
import {
2+
readAdminInfrastructureStoragePathStatus
3+
} from "../../../src/engine/api/admin-infrastructure-api-client.js";
4+
5+
const STORAGE_PATH_LANES = Object.freeze([
6+
Object.freeze({ lane: "DEV", path: "/dev/projects/" }),
7+
Object.freeze({ lane: "IST", path: "/ist/projects/" }),
8+
Object.freeze({ lane: "UAT", path: "/uat/projects/" }),
9+
Object.freeze({ lane: "PROD", path: "/prod/projects/" }),
10+
]);
11+
12+
class AdminInfrastructureStoragePathStatus {
13+
constructor(root) {
14+
this.root = root;
15+
this.rows = root.querySelector("[data-admin-storage-path-status-rows]");
16+
}
17+
18+
init() {
19+
if (!this.rows) {
20+
return;
21+
}
22+
this.load();
23+
}
24+
25+
renderRows(rows) {
26+
this.rows.replaceChildren();
27+
rows.forEach((row) => {
28+
const tableRow = document.createElement("tr");
29+
[
30+
row.lane || "",
31+
row.path || "",
32+
row.value || "ERROR",
33+
].forEach((value) => {
34+
const cell = document.createElement("td");
35+
cell.textContent = value;
36+
tableRow.append(cell);
37+
});
38+
this.rows.append(tableRow);
39+
});
40+
}
41+
42+
renderFailure(message) {
43+
this.renderRows(STORAGE_PATH_LANES.map((lane) => ({
44+
...lane,
45+
value: `ERROR: ${message}`,
46+
})));
47+
}
48+
49+
load() {
50+
try {
51+
const payload = readAdminInfrastructureStoragePathStatus();
52+
const rows = Array.isArray(payload.rows) ? payload.rows : [];
53+
this.renderRows(rows.length ? rows : STORAGE_PATH_LANES.map((lane) => ({
54+
...lane,
55+
value: "ERROR",
56+
})));
57+
} catch (error) {
58+
this.renderFailure(error instanceof Error ? error.message : "Storage path status unavailable.");
59+
}
60+
}
61+
}
62+
63+
document.addEventListener("DOMContentLoaded", () => {
64+
const root = document.querySelector("[data-admin-wireframe='infrastructure']");
65+
if (!root) {
66+
return;
67+
}
68+
new AdminInfrastructureStoragePathStatus(root).init();
69+
});

assets/theme-v2/js/owner-operations.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ class OwnerOperationsController {
107107
`${step.safetyStatus || "WARN"}: ${step.safetyDiagnostic || promotionFoundation.safetyMessage || "Promotion safety validation unavailable."}`,
108108
`${promotionFoundation.ownerOnly === true ? "Owner-only" : "Restricted"}; ${promotionFoundation.browserExecutionAllowed === false ? "browser execution disabled" : "browser execution unknown"}; ${promotionFoundation.destructiveOperationsAllowed === false ? "destructive operations disabled" : "destructive operations unknown"}; ${step.message || promotionFoundation.message || "Promotion foundation planning."}`,
109109
])
110-
: [["DEV/UAT/PROD", "Planning", promotionFoundation.status || "WARN", promotionFoundation.safetyMessage || "Promotion safety validation unavailable.", promotionFoundation.message || "Promotion foundation status unavailable."]];
110+
: [["DEV/IST/UAT/PROD", "Planning", promotionFoundation.status || "WARN", promotionFoundation.safetyMessage || "Promotion safety validation unavailable.", promotionFoundation.message || "Promotion foundation status unavailable."]];
111111
this.promotionFoundationRows.replaceChildren();
112112
rows.forEach((row) => {
113113
const tableRow = document.createElement("tr");

docs_build/dev/codex_commands.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2117,3 +2117,36 @@ Required reports:
21172117

21182118
Packaging:
21192119
- `tmp/PR_26167_184-delete-sqlite-local-db-runtime-debt_delta.zip`
2120+
2121+
2122+
## PR_26168_220-promotion-lanes-storage-path-status
2123+
2124+
Changes:
2125+
- Read `docs_build/dev/PROJECT_INSTRUCTIONS.md`.
2126+
- Verified the current branch is `main`.
2127+
- Removed `Promote DEV to UAT` from Owner Operations HTML and Local API actions.
2128+
- Added `Promote DEV to IST` and `Promote IST to UAT` as manual-only Owner Operations actions.
2129+
- Added Owner Operations copy explaining promotion of project metadata, asset references, and project asset storage objects between lanes.
2130+
- Added read-only Admin Infrastructure storage path status rendering through external Theme V2 JavaScript and a Local API route.
2131+
- Kept Admin Infrastructure path rows to lane/path/status values only, with `GAMEFOUNDRY_ASSET_STORAGE_PATH` identified in section copy.
2132+
2133+
Validation:
2134+
- `node --check assets/theme-v2/js/admin-infrastructure.js`
2135+
- `node --check assets/theme-v2/js/owner-operations.js`
2136+
- `node --check src/engine/api/admin-infrastructure-api-client.js`
2137+
- `node --check src/dev-runtime/server/local-api-router.mjs`
2138+
- `node --check tests/playwright/tools/AdminPlatformToolsWireframes.spec.mjs`
2139+
- Admin/Owner static contract check for no inline HTML script/style/event handlers, v1-3-only infrastructure image, storage path copy, and `.env` path status handling.
2140+
- `git diff --check`
2141+
- `npx playwright test tests/playwright/tools/AdminPlatformToolsWireframes.spec.mjs -g "Infrastructure Admin wireframe preserves template structure|Infrastructure storage path status reports missing env path as ERROR|Owner Operations exposes owner-only connection validation and manual operation actions"`
2142+
- Full samples smoke skipped because sample JSON and sample runtime behavior were not touched.
2143+
2144+
Required reports:
2145+
- `docs_build/dev/reports/PR_26168_220-promotion-lanes-storage-path-status.md`
2146+
- `docs_build/dev/reports/codex_changed_files.txt`
2147+
- `docs_build/dev/reports/codex_review.diff`
2148+
- `docs_build/dev/reports/playwright_v8_coverage_report.txt`
2149+
- `docs_build/dev/reports/coverage_changed_js_guardrail.txt`
2150+
2151+
Packaging:
2152+
- `tmp/PR_26168_220-promotion-lanes-storage-path-status_delta.zip`

docs_build/dev/commit_comment.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Delete SQLite/Local DB runtime debt - PR_26167_184-delete-sqlite-local-db-runtime-debt
1+
Promotion lanes and storage path status - PR_26168_220-promotion-lanes-storage-path-status
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# PR_26168_220-promotion-lanes-storage-path-status
2+
3+
## Branch Validation
4+
5+
PASS: current branch is `main`.
6+
7+
- Expected branch: `main`
8+
- Current branch: `main`
9+
- Local branches found: `main`
10+
11+
## Scope Summary
12+
13+
PASS: PR220 is scoped to promotion lane labels/copy and Admin Infrastructure project asset storage path status.
14+
15+
- Owner Operations no longer offers `Promote DEV to UAT`.
16+
- Owner Operations now offers `Promote DEV to IST` and `Promote IST to UAT`, with status-first copy describing project metadata, asset references, and project asset storage objects.
17+
- Admin Infrastructure now renders path match status from a read-only Local API route backed by `.env` `GAMEFOUNDRY_ASSET_STORAGE_PATH`.
18+
- Browser code receives only lane, path, and yes/no/ERROR status values; no secrets or connection strings are exposed.
19+
20+
## Requirement Checklist
21+
22+
| Requirement | Status | Evidence |
23+
| --- | --- | --- |
24+
| Read `docs_build/dev/PROJECT_INSTRUCTIONS.md` first | PASS | Instructions were read before branch guard or edits. |
25+
| Hard stop unless current branch is `main` | PASS | `git branch --show-current` returned `main`; `git branch --list` showed `* main`. |
26+
| Remove `Promote DEV to UAT` from Owner Operations | PASS | `owner/operations.html` and `OWNER_OPERATION_ACTIONS` no longer include `promote-dev-to-uat`; Playwright asserts the button count is zero. |
27+
| Add `Promote DEV to IST` | PASS | Added HTML button and server action id `promote-dev-to-ist`; Playwright clicks it and receives a `SKIP` manual-only result. |
28+
| Add `Promote IST to UAT` | PASS | Added HTML button and server action id `promote-ist-to-uat`; Playwright clicks it and receives a `SKIP` manual-only result. |
29+
| Explain promotion scope | PASS | Owner Operations copy and promotion plan rows name project metadata, asset references, and project asset storage objects. |
30+
| Admin section title/copy states `Project Asset Storage Paths use GAMEFOUNDRY_ASSET_STORAGE_PATH` | PASS | Admin Infrastructure table caption contains the exact storage path variable copy. |
31+
| DEV row true/yes only for `/dev/projects/` | PASS | Playwright default status fixture with `/dev/projects/` shows DEV `yes` and all other lanes `no`. |
32+
| IST row true/yes only for `/ist/projects/` | PASS | API lane matching uses exact path comparison; non-matching IST row renders `no` in targeted Playwright. |
33+
| UAT row true/yes only for `/uat/projects/` | PASS | API lane matching uses exact path comparison; non-matching UAT row renders `no` in targeted Playwright. |
34+
| PROD row true/yes only for `/prod/projects/` | PASS | API lane matching uses exact path comparison; non-matching PROD row renders `no` in targeted Playwright. |
35+
| Missing `.env` variable makes all rows `ERROR` | PASS | Dedicated Playwright case renders DEV/IST/UAT/PROD rows with `ERROR`. |
36+
| Do not display `GAMEFOUNDRY_ASSET_STORAGE_PATH` repeatedly as row value | PASS | Rows render only lane, path, and status value; static and Playwright checks confirm row body does not contain the variable name. |
37+
| Do not expose secrets | PASS | The Admin API returns only lane/path/status and `secretsExposed:false`; no storage credentials, keys, passwords, or connection strings are rendered. |
38+
| No inline script/style/event handlers | PASS | Static check passed for no `<style>`, no inline `style=`, no inline script blocks, and no `on*=` handlers. |
39+
| Use external JS only | PASS | Admin status behavior lives in `assets/theme-v2/js/admin-infrastructure.js`; Owner behavior remains external module JS. |
40+
| Use Theme V2 only | PASS | Pages continue to use `assets/theme-v2/css/theme.css` and existing Theme V2 classes only; no CSS was added. |
41+
| Do not add unrelated storage or promotion behavior | PASS | Changes are limited to read-only status rendering, promotion lane labels/plans, tests, and required reports. |
42+
| Do not run full samples smoke | PASS | Full samples smoke was skipped because no sample JSON or sample runtime surface changed. |
43+
44+
## Validation Lane Report
45+
46+
PASS: `node --check assets/theme-v2/js/admin-infrastructure.js`
47+
48+
PASS: `node --check assets/theme-v2/js/owner-operations.js`
49+
50+
PASS: `node --check src/engine/api/admin-infrastructure-api-client.js`
51+
52+
PASS: `node --check src/dev-runtime/server/local-api-router.mjs`
53+
54+
PASS: `node --check tests/playwright/tools/AdminPlatformToolsWireframes.spec.mjs`
55+
56+
PASS: Admin/Owner static contract check
57+
58+
- Confirmed Admin Infrastructure has no inline styles, style blocks, inline script blocks, or inline event handlers.
59+
- Confirmed Admin Infrastructure keeps `assets/GFS-Infrastructure v1-3.png` and does not display `assets/GFS-Infrastructure v1-2.png`.
60+
- Confirmed storage path rows do not repeat `GAMEFOUNDRY_ASSET_STORAGE_PATH`.
61+
- Confirmed Owner Operations removed DEV to UAT and added DEV to IST / IST to UAT.
62+
- Confirmed Local API route reads `GAMEFOUNDRY_ASSET_STORAGE_PATH` from `.env` and returns `ERROR` when missing.
63+
64+
PASS: `git diff --check`
65+
66+
- Exit code 0.
67+
- Git reported expected Windows line-ending warnings only.
68+
69+
PASS: targeted Playwright UI behavior
70+
71+
Command:
72+
73+
`npx playwright test tests/playwright/tools/AdminPlatformToolsWireframes.spec.mjs -g "Infrastructure Admin wireframe preserves template structure|Infrastructure storage path status reports missing env path as ERROR|Owner Operations exposes owner-only connection validation and manual operation actions"`
74+
75+
Result:
76+
77+
- 3 passed.
78+
- Admin Infrastructure validated v1-3-only image, zoom behavior, storage path status rows, missing-env ERROR rows, external JS, and no page failures.
79+
- Owner Operations validated DavidQ owner visibility, DEV to IST and IST to UAT actions, removed DEV to UAT action, safe status/copy, and manual-only operation results.
80+
81+
NOTE: The first run of the same targeted Playwright command had 2 passed and 1 failed because the updated Owner promotion fixture omitted the existing `Local API` copy expected after validation. The copy was corrected in the server fixture and the test fixture, then the same targeted command passed.
82+
83+
PASS: Playwright V8 coverage report produced at `docs_build/dev/reports/playwright_v8_coverage_report.txt`.
84+
85+
- `(80%) assets/theme-v2/js/admin-infrastructure.js`
86+
- `(100%) assets/theme-v2/js/owner-operations.js`
87+
- `(100%) src/engine/api/admin-infrastructure-api-client.js`
88+
- `(0%) src/dev-runtime/server/local-api-router.mjs` is an advisory WARN because Playwright browser V8 coverage does not collect Node-side server runtime.
89+
90+
SKIP: Full samples smoke was not run because this PR changes Admin Infrastructure, Owner Operations, and Local API status surfaces only; sample JSON and sample runtime behavior were not touched.
91+
92+
## Manual Validation Notes
93+
94+
PASS: Static inspection confirmed Admin Infrastructure displays the storage variable only in the caption and uses lane rows for `/dev/projects/`, `/ist/projects/`, `/uat/projects/`, and `/prod/projects/`.
95+
96+
PASS: Static inspection confirmed the Admin browser code renders `yes`, `no`, or `ERROR` only; it does not render secrets or full connection strings.
97+
98+
PASS: Static inspection confirmed Owner Operations is status-first and keeps destructive/promotion work manual-only.
99+
100+
PASS: `docs_build/dev/reports/codex_review.diff` and `docs_build/dev/reports/codex_changed_files.txt` were produced for review.
Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,34 @@
1-
# git status --short
2-
M .env.example
1+
# git status --short
32
M admin/infrastructure.html
4-
M assets/theme-v2/css/dialogs.css
3+
M assets/theme-v2/js/owner-operations.js
4+
M docs_build/dev/codex_commands.md
5+
M docs_build/dev/commit_comment.txt
6+
M docs_build/dev/reports/codex_changed_files.txt
7+
M docs_build/dev/reports/codex_review.diff
8+
M docs_build/dev/reports/coverage_changed_js_guardrail.txt
59
M docs_build/dev/reports/playwright_v8_coverage_report.txt
10+
M owner/operations.html
11+
M src/dev-runtime/server/local-api-router.mjs
612
M tests/playwright/tools/AdminPlatformToolsWireframes.spec.mjs
7-
?? assets/theme-v2/js/image-zoom-dialog.js
8-
?? docs_build/dev/reports/PR_26168_219-admin-infrastructure-image-storage-path.md
13+
?? assets/theme-v2/js/admin-infrastructure.js
14+
?? docs_build/dev/reports/PR_26168_220-promotion-lanes-storage-path-status.md
15+
?? src/engine/api/admin-infrastructure-api-client.js
916

1017
# git ls-files --others --exclude-standard
11-
assets/theme-v2/js/image-zoom-dialog.js
12-
docs_build/dev/reports/PR_26168_219-admin-infrastructure-image-storage-path.md
18+
assets/theme-v2/js/admin-infrastructure.js
19+
docs_build/dev/reports/PR_26168_220-promotion-lanes-storage-path-status.md
20+
src/engine/api/admin-infrastructure-api-client.js
1321

1422
# git diff --stat
15-
.env.example | 1 +
16-
admin/infrastructure.html | 25 ++++++---
17-
assets/theme-v2/css/dialogs.css | 63 +++++++++++++++++++++-
18-
.../dev/reports/playwright_v8_coverage_report.txt | 18 +++----
19-
.../tools/AdminPlatformToolsWireframes.spec.mjs | 18 ++++++-
20-
5 files changed, 105 insertions(+), 20 deletions(-)
23+
admin/infrastructure.html | 13 +-
24+
assets/theme-v2/js/owner-operations.js | 2 +-
25+
docs_build/dev/codex_commands.md | 33 +
26+
docs_build/dev/commit_comment.txt | 2 +-
27+
docs_build/dev/reports/codex_changed_files.txt | 38 +-
28+
docs_build/dev/reports/codex_review.diff | 952 +++++++++++++++------
29+
.../dev/reports/coverage_changed_js_guardrail.txt | 13 +-
30+
.../dev/reports/playwright_v8_coverage_report.txt | 51 +-
31+
owner/operations.html | 4 +-
32+
src/dev-runtime/server/local-api-router.mjs | 134 ++-
33+
.../tools/AdminPlatformToolsWireframes.spec.mjs | 129 ++-
34+
11 files changed, 1030 insertions(+), 341 deletions(-)

0 commit comments

Comments
 (0)