Skip to content

Commit d51c34a

Browse files
committed
Enforce storage path error state before R2 env setup - PR_26168_221-storage-path-error-rule-and-r2-env-ready
1 parent 551ac75 commit d51c34a

9 files changed

Lines changed: 438 additions & 716 deletions

docs_build/dev/codex_commands.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2150,3 +2150,33 @@ Required reports:
21502150

21512151
Packaging:
21522152
- `tmp/PR_26168_220-promotion-lanes-storage-path-status_delta.zip`
2153+
2154+
2155+
## PR_26168_221-storage-path-error-rule-and-r2-env-ready
2156+
2157+
Changes:
2158+
- Read `docs_build/dev/PROJECT_INSTRUCTIONS.md`.
2159+
- Verified the current branch is `main`.
2160+
- Tightened Admin Infrastructure storage path status logic so missing or invalid `GAMEFOUNDRY_ASSET_STORAGE_PATH` values render every lane row as `ERROR`.
2161+
- Preserved exact-match behavior where `/dev/projects/`, `/ist/projects/`, `/uat/projects/`, or `/prod/projects/` activates only the matching lane.
2162+
- Added targeted Playwright coverage for missing, invalid, DEV, and IST storage path cases.
2163+
- Added manual report note that R2 `.env` setup is ready only after this validation passes.
2164+
2165+
Validation:
2166+
- `node --check src/dev-runtime/server/local-api-router.mjs`
2167+
- `node --check tests/playwright/tools/AdminPlatformToolsWireframes.spec.mjs`
2168+
- `node --check assets/theme-v2/js/admin-infrastructure.js`
2169+
- Admin Infrastructure static contract check for exact lane paths, invalid-path all-ERROR logic, and no inline HTML script/style/event handlers.
2170+
- `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|Infrastructure storage path status reports invalid env path as ERROR|Infrastructure storage path status reports DEV match only|Infrastructure storage path status reports IST match only"`
2171+
- `git diff --check`
2172+
- Full samples smoke skipped because sample JSON and sample runtime behavior were not touched.
2173+
2174+
Required reports:
2175+
- `docs_build/dev/reports/PR_26168_221-storage-path-error-rule-and-r2-env-ready.md`
2176+
- `docs_build/dev/reports/codex_changed_files.txt`
2177+
- `docs_build/dev/reports/codex_review.diff`
2178+
- `docs_build/dev/reports/playwright_v8_coverage_report.txt`
2179+
- `docs_build/dev/reports/coverage_changed_js_guardrail.txt`
2180+
2181+
Packaging:
2182+
- `tmp/PR_26168_221-storage-path-error-rule-and-r2-env-ready_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-
Promotion lanes and storage path status - PR_26168_220-promotion-lanes-storage-path-status
1+
Storage path error rule and R2 env readiness - PR_26168_221-storage-path-error-rule-and-r2-env-ready
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# PR_26168_221-storage-path-error-rule-and-r2-env-ready
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: PR221 is scoped to Admin Infrastructure storage path status validation.
14+
15+
- Missing `GAMEFOUNDRY_ASSET_STORAGE_PATH` still renders all lane rows as `ERROR`.
16+
- Invalid `GAMEFOUNDRY_ASSET_STORAGE_PATH` values now render all lane rows as `ERROR`.
17+
- Exact `/dev/projects/` and `/ist/projects/` matches were covered by targeted Playwright cases.
18+
- No R2 credentials or `.env` files were added or modified.
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+
| Missing `GAMEFOUNDRY_ASSET_STORAGE_PATH` makes all rows `ERROR` | PASS | Existing missing-path logic preserved; Playwright case `Infrastructure storage path status reports missing env path as ERROR` passed. |
27+
| Invalid `GAMEFOUNDRY_ASSET_STORAGE_PATH` makes all rows `ERROR` | PASS | `projectAssetStoragePathStatus()` now requires an exact match before rendering yes/no; Playwright invalid `/qa/projects/` case passed with all rows `ERROR`. |
28+
| Exact `/dev/projects/` shows DEV yes and others no | PASS | Playwright case `Infrastructure storage path status reports DEV match only` passed. |
29+
| Exact `/ist/projects/` shows IST yes and others no | PASS | Playwright case `Infrastructure storage path status reports IST match only` passed. |
30+
| Non-matching valid-lane rows show no/false/blank | PASS | DEV and IST Playwright cases verify non-matching rows render `no`. |
31+
| Add clear manual note/report section that R2 `.env` setup is ready only after validation passes | PASS | See `R2 .env Readiness Note` and Manual Validation Notes below. |
32+
| Do not expose secrets | PASS | Browser rows still render only lane, path, and status value; no credentials, keys, passwords, or connection strings are rendered. |
33+
| Do not add new R2 credentials in repo | PASS | No `.env` files changed; no credential variables or secret values were added. |
34+
| Do not add unrelated promotion/package behavior | PASS | Changes are limited to Admin Infrastructure path status logic, targeted tests, coverage reports, and required PR artifacts. |
35+
| Do not run full samples smoke | PASS | Full samples smoke was skipped because sample JSON and sample runtime behavior were not touched. |
36+
37+
## Validation Lane Report
38+
39+
PASS: `node --check src/dev-runtime/server/local-api-router.mjs`
40+
41+
PASS: `node --check tests/playwright/tools/AdminPlatformToolsWireframes.spec.mjs`
42+
43+
PASS: `node --check assets/theme-v2/js/admin-infrastructure.js`
44+
45+
PASS: Admin Infrastructure static contract check
46+
47+
- Router defines exact lane paths: `/dev/projects/`, `/ist/projects/`, `/uat/projects/`, `/prod/projects/`.
48+
- Router computes `invalidPath` before rendering rows.
49+
- Router returns all `ERROR` rows when the path is missing or invalid.
50+
- Router returns `PASS` only when the path exactly matches one configured lane.
51+
- Playwright spec contains the missing, invalid, DEV, and IST path cases.
52+
- Admin Infrastructure HTML still has no inline scripts, style blocks, inline style attributes, or inline event handlers.
53+
54+
PASS: targeted Admin Infrastructure Playwright
55+
56+
Command:
57+
58+
`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|Infrastructure storage path status reports invalid env path as ERROR|Infrastructure storage path status reports DEV match only|Infrastructure storage path status reports IST match only"`
59+
60+
Result:
61+
62+
- 5 passed.
63+
- Covered missing path = all `ERROR`.
64+
- Covered invalid path `/qa/projects/` = all `ERROR`.
65+
- Covered `/dev/projects/` = DEV `yes`, IST/UAT/PROD `no`.
66+
- Covered `/ist/projects/` = IST `yes`, DEV/UAT/PROD `no`.
67+
68+
PASS: `git diff --check`
69+
70+
- Exit code 0.
71+
- Git reported expected Windows line-ending warnings only.
72+
73+
PASS: Playwright V8 coverage report produced at `docs_build/dev/reports/playwright_v8_coverage_report.txt`.
74+
75+
- `(80%) assets/theme-v2/js/admin-infrastructure.js`
76+
- `(100%) src/engine/api/admin-infrastructure-api-client.js`
77+
- `(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.
78+
79+
SKIP: Full samples smoke was not run because this PR changes only Admin Infrastructure storage path validation logic and targeted tests.
80+
81+
## R2 .env Readiness Note
82+
83+
R2 `.env` setup is ready only after `GAMEFOUNDRY_ASSET_STORAGE_PATH` validation passes with one exact lane match:
84+
85+
- `/dev/projects/`
86+
- `/ist/projects/`
87+
- `/uat/projects/`
88+
- `/prod/projects/`
89+
90+
If the variable is missing, blank, misspelled, or points to any other path, Admin Infrastructure must show all lane rows as `ERROR` and R2 setup should not be treated as ready.
91+
92+
## Manual Validation Notes
93+
94+
PASS: Static inspection confirmed the stricter invalid path rule lives in the Local API status logic, not in page-local browser data.
95+
96+
PASS: Static inspection confirmed no R2 credentials, access keys, secret keys, passwords, or full connection strings were added to tracked files.
97+
98+
PASS: Static inspection confirmed no `.env`, `.env.dev`, `.env.ist`, `.env.uat`, or `.env.prd` file was modified.
99+
100+
PASS: Required review artifacts were produced: `docs_build/dev/reports/codex_review.diff` and `docs_build/dev/reports/codex_changed_files.txt`.
Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,24 @@
1-
# git status --short
2-
M admin/infrastructure.html
3-
M assets/theme-v2/js/owner-operations.js
1+
# git status --short --untracked-files=all
42
M docs_build/dev/codex_commands.md
53
M docs_build/dev/commit_comment.txt
64
M docs_build/dev/reports/codex_changed_files.txt
75
M docs_build/dev/reports/codex_review.diff
86
M docs_build/dev/reports/coverage_changed_js_guardrail.txt
97
M docs_build/dev/reports/playwright_v8_coverage_report.txt
10-
M owner/operations.html
118
M src/dev-runtime/server/local-api-router.mjs
129
M tests/playwright/tools/AdminPlatformToolsWireframes.spec.mjs
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
10+
?? docs_build/dev/reports/PR_26168_221-storage-path-error-rule-and-r2-env-ready.md
1611

1712
# git ls-files --others --exclude-standard
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
13+
docs_build/dev/reports/PR_26168_221-storage-path-error-rule-and-r2-env-ready.md
2114

2215
# git diff --stat
23-
admin/infrastructure.html | 13 +-
24-
assets/theme-v2/js/owner-operations.js | 2 +-
25-
docs_build/dev/codex_commands.md | 33 +
16+
docs_build/dev/codex_commands.md | 30 +
2617
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(-)
18+
docs_build/dev/reports/codex_changed_files.txt | 32 +-
19+
docs_build/dev/reports/codex_review.diff | 879 +++++----------------
20+
.../dev/reports/coverage_changed_js_guardrail.txt | 4 +-
21+
.../dev/reports/playwright_v8_coverage_report.txt | 11 +-
22+
src/dev-runtime/server/local-api-router.mjs | 9 +-
23+
.../tools/AdminPlatformToolsWireframes.spec.mjs | 87 +-
24+
8 files changed, 337 insertions(+), 717 deletions(-)

0 commit comments

Comments
 (0)