fix(web): validate release archive layout against release revision #12788

Merged
voidlakhan merged 2 commits from upstream-pr/12788 into main 2026-10-30 11:51:45 +00:00
voidlakhan commented 2026-10-29 09:07:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by voidlakhan on 2026-10-29T09:07:19Z.


What

Follow-up hardening after #12783.

PR #12783 fixed the immediate GitHub Pages deployment failure by allowing older release archives to omit files added to the current WEB_FILES list.

This PR strengthens that validation by checking downloaded web release archives against the exact WEB_FILES definition from the release revision recorded in web-release.json, using:

git show <revision>:tools/package_release.py

This provides stricter validation than #12783 in one direction and better historical compatibility in another:

  • Stricter archive completeness: An archive missing any file required by its own recorded release revision is rejected, rather than being accepted as an incomplete subset.
  • Historical compatibility: Files added, renamed, or removed from the current WEB_FILES definition do not incorrectly invalidate archives that were valid when their release was built.
  • Git history requirement: tools/build_web.py --release requires the recorded release revision to exist in the local Git history. The GitHub Pages deployment workflow (.github/workflows/pages.yml) uses fetch-depth: 0 to provide the full history.
  • Archive validation and safety: Rejects duplicate entries, path traversal components, backslashes, malformed path definitions, unexpected files, and empty files before extraction.
  • Error handling: Distinguishes unresolvable release revisions from invalid historical WEB_FILES definitions and fails with concise diagnostics without modifying the existing published site.

Tested

  • Live verification: python tools/build_web.py --build build-wasm --release successfully published v0.1.3 using its historical file layout.
  • Unit tests: python -m unittest tools/tests/test_build_web.py tools/tests/test_web_release.py — 68 tests passed.
  • Convention checks: python tools/check_conventions.py --base upstream/main — passed.
  • Diff hygiene: git diff --check upstream/main..HEAD — clean.

Relationship to #12783

This PR builds on the immediate deployment fix delivered by #12783. It does not reimplement the original issue fix. Instead, it makes archive validation reflect the file set that was actually defined at the time each release was produced.

Checklist

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5065266631 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12788). Originally posted by [voidlakhan](https://github.com/voidlakhan) on 2026-10-29T09:07:19Z. --- ### What Follow-up hardening after #12783. PR #12783 fixed the immediate GitHub Pages deployment failure by allowing older release archives to omit files added to the current `WEB_FILES` list. This PR strengthens that validation by checking downloaded web release archives against the exact `WEB_FILES` definition from the release revision recorded in `web-release.json`, using: `git show <revision>:tools/package_release.py` This provides stricter validation than #12783 in one direction and better historical compatibility in another: - **Stricter archive completeness:** An archive missing any file required by its own recorded release revision is rejected, rather than being accepted as an incomplete subset. - **Historical compatibility:** Files added, renamed, or removed from the current `WEB_FILES` definition do not incorrectly invalidate archives that were valid when their release was built. - **Git history requirement:** `tools/build_web.py --release` requires the recorded release revision to exist in the local Git history. The GitHub Pages deployment workflow (`.github/workflows/pages.yml`) uses `fetch-depth: 0` to provide the full history. - **Archive validation and safety:** Rejects duplicate entries, path traversal components, backslashes, malformed path definitions, unexpected files, and empty files before extraction. - **Error handling:** Distinguishes unresolvable release revisions from invalid historical `WEB_FILES` definitions and fails with concise diagnostics without modifying the existing published site. ### Tested - Live verification: `python tools/build_web.py --build build-wasm --release` successfully published v0.1.3 using its historical file layout. - Unit tests: `python -m unittest tools/tests/test_build_web.py tools/tests/test_web_release.py` — 68 tests passed. - Convention checks: `python tools/check_conventions.py --base upstream/main` — passed. - Diff hygiene: `git diff --check upstream/main..HEAD` — clean. ### Relationship to #12783 This PR builds on the immediate deployment fix delivered by #12783. It does not reimplement the original issue fix. Instead, it makes archive validation reflect the file set that was actually defined at the time each release was produced. ### Checklist - [x] Based on current `main`; no other open PR implements the same functionality - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [[technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md)](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [[technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt)](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files, or images added to the repository - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: #12783 - [x] Follow-up to: #12783 - [x] GPUs tested: n/a - [x] AI-assisted: yes
XairRrR commented 2026-10-29 11:28:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-10-29T11:28:33Z.

Review: APPROVED


Reviewed — approved

The rebased change validates a web release archive against the WEB_FILES of the revision recorded in its web-release.json. It merges cleanly onto current main (which already has #12783), the two affected test suites pass, and a targeted negative control fails.

What I ran

  • Head: 44c43e75a3239fce74b105a9dadace8907f34143
  • main: ba5b5330b37724bca4b99f30faab504653635a04 (contains #12783, merge 89dce2838dfc7bd7c785ffd14e4e6aaf81bf8bc1)
  • Machine: Arch Linux 7.2.11-zen, GCC 16.2.1, Intel Core i9-14900KF, NVIDIA GeForce RTX 4070 Ti SUPER (driver 615.78.08). This is a Python-only change, so I built no C++. The tests ran in a sandbox without network access.
git fetch origin main pull/12788/head:refs/review/12788
git checkout --detach origin/main
git merge --no-ff --no-edit refs/review/12788
git diff --check origin/main...refs/review/12788
python3 tools/check_conventions.py --base origin/main
ctest --test-dir build -R '^web_(release|library_assets)$' --output-on-failure
(cd tools/tests && python3 -m unittest -v test_build_web test_web_release)
# release_web_files against real history
python3 -c 'import build_web; print(sorted(build_web.release_web_files("3fd1cc393b8512c2e989860053f30dee5a8cd1aa")))'
# negative controls, see below

Results

Check Result
Merge onto main Clean; no conflicts. tools/build_web.py and tools/tests/test_build_web.py in the merged tree match the head commit
git diff --check Clean
check_conventions.py --base origin/main All conventions checks passed.
ctest web_release, web_library_assets 2/2 passed (0.24 s, 0.19 s)
unittest for both files Ran 65 tests, OK, matching the description
release_web_files("3fd1cc393b…") against real history Returns the nine v0.1.3 files, without failure-report.mjs
release_web_files(HEAD) Equals the current WEB_FILES
release_web_files("f" * 40) ValueError: Cannot resolve release revision: ffff…
ctest
    Start 90: web_release
1/2 Test #90: web_release ......................   Passed    0.24 sec
    Start 91: web_library_assets
2/2 Test #91: web_library_assets ...............   Passed    0.19 sec

100% tests passed out of 2
real-history probe
['app.css', 'app.mjs', 'archive.mjs', 'batch.mjs', 'index.html', 'native/relinker_wasm.mjs', 'native/relinker_wasm.wasm', 'output-directory.mjs', 'worker.mjs']
True
Cannot resolve release revision: ffffffffffffffffffffffffffffffffffffffff

I checked the earlier review by oneandonlydean against the rebased head:

  1. REQUIRED_WEB_FILES and the issuperset/issubset check from #12783 are gone, and one duplicate-entry check remains.
  2. The six WebReleaseLayoutTests now patch release_web_files. The older-release case passes the reduced set.
  3. A WEB_FILES definition that cannot be used now gets its own error, Invalid web release definition in revision.
  4. test_historical_release_missing_later_files_is_accepted now patches release_web_files, so it no longer depends on clone depth.

Negative control

  1. Restored tools/build_web.py from main: 3 failures and 46 errors. Most of these are AttributeErrors because the patched release_web_files does not exist, so this control is weak.

  2. Targeted control, kept the PR's code but changed one line: expected_files = release_web_files(metadata["revision"]) became expected_files = set(WEB_FILES). That is the behaviour this PR replaces. Result: FAILED (failures=2, errors=2). The failing tests are:

    • test_release_lacking_a_newer_web_file_is_published_as_shipped
    • test_historical_release_missing_later_files_is_accepted
    • test_unavailable_historical_revision_fails_cleanly_without_traceback_or_site_mutation
    • test_invalid_web_files_definition_fails_cleanly_without_traceback_or_site_mutation

    This shows the tests depend on the revision lookup. After both controls I restored the merged files.

Findings

Blocking

None.

Non-blocking

  1. A TypeError escapes from release_web_files. In tools/build_web.py:47-54, len(set(value)) runs before the isinstance(item, str) check. A definition such as WEB_FILES = ([1],) therefore raises TypeError: cannot use 'list' as a set element, which I reproduced. main() catches only (OSError, ValueError) at tools/build_web.py:284-285, so the user gets a traceback instead of the clean error the description promises. The input comes from repository history, so the risk is low. Suggested fix: run the all(isinstance(item, str) …) check before the set() duplicate check, or add TypeError to the except clause.

  2. The import of WEB_FILES is now unused in production code. tools/build_web.py:16 imports it, but after this change only the tests read it, through build_web.WEB_FILES. Suggested fix: have the tests import it from package_release and drop the import here.

  3. test_current_release_with_expected_files_is_accepted depends on the git checkout. At tools/tests/test_build_web.py:472-480 the test runs real git rev-parse HEAD and git show HEAD:tools/package_release.py. It errors outside a git checkout. It also fails while WEB_FILES has uncommitted local edits, because the committed HEAD copy no longer matches the working tree. It does have a useful side effect: it fails as soon as a commit makes WEB_FILES something ast.literal_eval cannot read, such as BASE + (...), which would otherwise break the next release's Pages deploy. If that guard is the intent, a test that parses the working-tree tools/package_release.py with the same parser would keep it without needing git.

  4. The two CLI tests duplicate the release setup. tools/tests/test_build_web.py:493-566 rebuilds the responses/release dictionaries that WebReleaseValidationTests.publish already builds. A shared helper that returns them would cut about 50 lines.

  5. The description could be clearer about the change from #12783. As requested in the earlier review, it could name #12783 and spell out the trade-off:

    • Stricter: an archive missing a file from its own revision's WEB_FILES is now rejected.
    • More tolerant: a later rename or removal in WEB_FILES no longer breaks an older release.

    The full-history requirement is already stated.

Not verified

  • I did not repeat the live build_web.py --release publication of v0.1.3, because the sandbox has no network.
  • I did not run the GitHub Pages workflow. I confirmed only that .github/workflows/pages.yml checks out with fetch-depth: 0.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5696936767 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12788#pullrequestreview-5696936767). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-10-29T11:28:33Z. **Review:** APPROVED --- # Reviewed — approved The rebased change validates a web release archive against the `WEB_FILES` of the revision recorded in its `web-release.json`. It merges cleanly onto current `main` (which already has #12783), the two affected test suites pass, and a targeted negative control fails. ## What I ran - Head: `44c43e75a3239fce74b105a9dadace8907f34143` - `main`: `ba5b5330b37724bca4b99f30faab504653635a04` (contains #12783, merge `89dce2838dfc7bd7c785ffd14e4e6aaf81bf8bc1`) - Machine: Arch Linux 7.2.11-zen, GCC 16.2.1, Intel Core i9-14900KF, NVIDIA GeForce RTX 4070 Ti SUPER (driver 615.78.08). This is a Python-only change, so I built no C++. The tests ran in a sandbox without network access. ```sh git fetch origin main pull/12788/head:refs/review/12788 git checkout --detach origin/main git merge --no-ff --no-edit refs/review/12788 git diff --check origin/main...refs/review/12788 python3 tools/check_conventions.py --base origin/main ctest --test-dir build -R '^web_(release|library_assets)$' --output-on-failure (cd tools/tests && python3 -m unittest -v test_build_web test_web_release) # release_web_files against real history python3 -c 'import build_web; print(sorted(build_web.release_web_files("3fd1cc393b8512c2e989860053f30dee5a8cd1aa")))' # negative controls, see below ``` ## Results | Check | Result | |---|---| | Merge onto `main` | Clean; no conflicts. `tools/build_web.py` and `tools/tests/test_build_web.py` in the merged tree match the head commit | | `git diff --check` | Clean | | `check_conventions.py --base origin/main` | `All conventions checks passed.` | | ctest `web_release`, `web_library_assets` | 2/2 passed (0.24 s, 0.19 s) | | `unittest` for both files | `Ran 65 tests`, `OK`, matching the description | | `release_web_files("3fd1cc393b…")` against real history | Returns the nine v0.1.3 files, without `failure-report.mjs` | | `release_web_files(HEAD)` | Equals the current `WEB_FILES` | | `release_web_files("f" * 40)` | `ValueError: Cannot resolve release revision: ffff…` | <details><summary>ctest</summary> ``` Start 90: web_release 1/2 Test #90: web_release ...................... Passed 0.24 sec Start 91: web_library_assets 2/2 Test #91: web_library_assets ............... Passed 0.19 sec 100% tests passed out of 2 ``` </details> <details><summary>real-history probe</summary> ``` ['app.css', 'app.mjs', 'archive.mjs', 'batch.mjs', 'index.html', 'native/relinker_wasm.mjs', 'native/relinker_wasm.wasm', 'output-directory.mjs', 'worker.mjs'] True Cannot resolve release revision: ffffffffffffffffffffffffffffffffffffffff ``` </details> I checked the earlier review by oneandonlydean against the rebased head: 1. `REQUIRED_WEB_FILES` and the `issuperset`/`issubset` check from #12783 are gone, and one duplicate-entry check remains. 2. The six `WebReleaseLayoutTests` now patch `release_web_files`. The older-release case passes the reduced set. 3. A `WEB_FILES` definition that cannot be used now gets its own error, `Invalid web release definition in revision`. 4. `test_historical_release_missing_later_files_is_accepted` now patches `release_web_files`, so it no longer depends on clone depth. ## Negative control 1. **Restored `tools/build_web.py` from `main`:** 3 failures and 46 errors. Most of these are `AttributeError`s because the patched `release_web_files` does not exist, so this control is weak. 2. **Targeted control, kept the PR's code but changed one line:** `expected_files = release_web_files(metadata["revision"])` became `expected_files = set(WEB_FILES)`. That is the behaviour this PR replaces. Result: `FAILED (failures=2, errors=2)`. The failing tests are: - `test_release_lacking_a_newer_web_file_is_published_as_shipped` - `test_historical_release_missing_later_files_is_accepted` - `test_unavailable_historical_revision_fails_cleanly_without_traceback_or_site_mutation` - `test_invalid_web_files_definition_fails_cleanly_without_traceback_or_site_mutation` This shows the tests depend on the revision lookup. After both controls I restored the merged files. ## Findings ### Blocking None. ### Non-blocking 1. **A `TypeError` escapes from `release_web_files`.** In [`tools/build_web.py:47-54`](https://github.com/boykopovar/AnyPS5/blob/44c43e75a3239fce74b105a9dadace8907f34143/tools/build_web.py#L47-L54), `len(set(value))` runs before the `isinstance(item, str)` check. A definition such as `WEB_FILES = ([1],)` therefore raises `TypeError: cannot use 'list' as a set element`, which I reproduced. `main()` catches only `(OSError, ValueError)` at [`tools/build_web.py:284-285`](https://github.com/boykopovar/AnyPS5/blob/44c43e75a3239fce74b105a9dadace8907f34143/tools/build_web.py#L284-L285), so the user gets a traceback instead of the clean error the description promises. The input comes from repository history, so the risk is low. Suggested fix: run the `all(isinstance(item, str) …)` check before the `set()` duplicate check, or add `TypeError` to the `except` clause. 2. **The import of `WEB_FILES` is now unused in production code.** [`tools/build_web.py:16`](https://github.com/boykopovar/AnyPS5/blob/44c43e75a3239fce74b105a9dadace8907f34143/tools/build_web.py#L16) imports it, but after this change only the tests read it, through `build_web.WEB_FILES`. Suggested fix: have the tests import it from `package_release` and drop the import here. 3. **`test_current_release_with_expected_files_is_accepted` depends on the git checkout.** At [`tools/tests/test_build_web.py:472-480`](https://github.com/boykopovar/AnyPS5/blob/44c43e75a3239fce74b105a9dadace8907f34143/tools/tests/test_build_web.py#L472-L480) the test runs real `git rev-parse HEAD` and `git show HEAD:tools/package_release.py`. It errors outside a git checkout. It also fails while `WEB_FILES` has uncommitted local edits, because the committed `HEAD` copy no longer matches the working tree. It does have a useful side effect: it fails as soon as a commit makes `WEB_FILES` something `ast.literal_eval` cannot read, such as `BASE + (...)`, which would otherwise break the next release's Pages deploy. If that guard is the intent, a test that parses the working-tree `tools/package_release.py` with the same parser would keep it without needing git. 4. **The two CLI tests duplicate the release setup.** [`tools/tests/test_build_web.py:493-566`](https://github.com/boykopovar/AnyPS5/blob/44c43e75a3239fce74b105a9dadace8907f34143/tools/tests/test_build_web.py#L493-L566) rebuilds the `responses`/`release` dictionaries that `WebReleaseValidationTests.publish` already builds. A shared helper that returns them would cut about 50 lines. 5. **The description could be clearer about the change from #12783.** As requested in the earlier review, it could name #12783 and spell out the trade-off: - Stricter: an archive missing a file from its own revision's `WEB_FILES` is now rejected. - More tolerant: a later rename or removal in `WEB_FILES` no longer breaks an older release. The full-history requirement is already stated. ## Not verified - I did not repeat the live `build_web.py --release` publication of v0.1.3, because the sandbox has no network. - I did not run the GitHub Pages workflow. I confirmed only that `.github/workflows/pages.yml` checks out with `fetch-depth: 0`.
XairRrR commented 2026-10-29 12:43:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-10-29T12:43:52Z.

Review: APPROVED


Re-checked — approved

The new commit c1801ba709 fixes the TypeError I reported last time: release_web_files now checks entry types before the duplicate check, also catches TypeError, and has a regression subtest for it. The merged tree passes the web tests, and the new subtest fails against the previous head.

What changed since my last review

  • One new commit, c1801ba7098ab5af55984daaf5e34f8ff95bca31, "fix(web): validate file path types before checking duplicates", on top of the previously reviewed 44c43e75a3239fce74b105a9dadace8907f34143. No rebase.
    • tools/build_web.py:47-56: len(value) == len(set(value)) now runs after the all(isinstance(item, str) …) check, and the except clause is now (ValueError, SyntaxError, TypeError).
    • tools/tests/test_build_web.py:587: adds a 'WEB_FILES = ([1],)' case to test_historical_web_files_parser_rejects_invalid_or_duplicate_entries.
  • No new author comments, and the description is the same as before.

What I ran

  • Head: c1801ba7098ab5af55984daaf5e34f8ff95bca31
  • main: 5454cd2e455994d992aca39335ce60507eeda1eb
  • Machine: Arch Linux 7.2.11-zen, GCC 16.2.1, Intel Core i9-14900KF, NVIDIA GeForce RTX 4070 Ti SUPER (driver 615.78.08). This is a Python-only change, so I built no C++. The tests ran in a sandbox without network access.
git fetch origin main pull/12788/head:refs/review/12788
git diff 44c43e75a3239fce74b105a9dadace8907f34143 c1801ba7098ab5af55984daaf5e34f8ff95bca31
git checkout --detach origin/main
git merge --no-ff --no-edit refs/review/12788
git diff --check origin/main...refs/review/12788
python3 tools/check_conventions.py --base origin/main
ctest --test-dir build -R '^web_(release|library_assets)$' --output-on-failure
(cd tools/tests && python3 -m unittest test_build_web test_web_release)
# negative controls, see below

Results

Check Result
Merge onto main Clean. The three PR files in the merged tree match the head commit
git diff --check Clean
check_conventions.py --base origin/main All conventions checks passed.
ctest web_release, web_library_assets 2/2 passed (0.21 s each)
unittest for both files Ran 65 tests, OK (the new case is a subtest, so the count is unchanged)
ctest
    Start 93: web_release
1/2 Test #93: web_release ......................   Passed    0.21 sec
    Start 94: web_library_assets
2/2 Test #94: web_library_assets ...............   Passed    0.21 sec

100% tests passed out of 2

Negative control

  1. Restored tools/build_web.py from the previous head 44c43e75a3 and kept the new test. The parser test fails on the new subtest, as expected:

    ERROR: test_historical_web_files_parser_rejects_invalid_or_duplicate_entries (...) (code='WEB_FILES = ([1],)')
    TypeError: cannot use 'list' as a set element (unhashable type: 'list')
    FAILED (errors=1)
    
  2. Kept the reorder and dropped TypeError from the except clause: the test passes. The reorder alone fixes the reported case. The extra TypeError catch still helps with inputs such as WEB_FILES = {[1]}, where ast.literal_eval itself raises TypeError.

I restored the merged files after both controls.

Previous findings

  1. TypeError escapes from release_web_files: Resolved. The negative control above shows the new subtest fails on the old code and passes now.
  2. Unused production import of WEB_FILES (tools/build_web.py:16): Still open. Non-blocking.
  3. test_current_release_with_expected_files_is_accepted depends on the git checkout (tools/tests/test_build_web.py:472-480): Still open. Non-blocking.
  4. The two CLI tests duplicate the release setup: Still open. Non-blocking.
  5. The description does not name #12783 or the stricter and more tolerant trade-off: Still open, because the description has not changed. Non-blocking.

New findings

Blocking

None.

Non-blocking

None.

Not verified

  • I did not repeat the live build_web.py --release publication of v0.1.3, because the sandbox has no network.
  • I did not run the GitHub Pages workflow.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5697865319 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12788#pullrequestreview-5697865319). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-10-29T12:43:52Z. **Review:** APPROVED --- # Re-checked — approved The new commit `c1801ba709` fixes the `TypeError` I reported last time: `release_web_files` now checks entry types before the duplicate check, also catches `TypeError`, and has a regression subtest for it. The merged tree passes the web tests, and the new subtest fails against the previous head. ## What changed since my last review - One new commit, `c1801ba7098ab5af55984daaf5e34f8ff95bca31`, "fix(web): validate file path types before checking duplicates", on top of the previously reviewed `44c43e75a3239fce74b105a9dadace8907f34143`. No rebase. - [`tools/build_web.py:47-56`](https://github.com/boykopovar/AnyPS5/blob/c1801ba7098ab5af55984daaf5e34f8ff95bca31/tools/build_web.py#L47-L56): `len(value) == len(set(value))` now runs after the `all(isinstance(item, str) …)` check, and the `except` clause is now `(ValueError, SyntaxError, TypeError)`. - [`tools/tests/test_build_web.py:587`](https://github.com/boykopovar/AnyPS5/blob/c1801ba7098ab5af55984daaf5e34f8ff95bca31/tools/tests/test_build_web.py#L587): adds a `'WEB_FILES = ([1],)'` case to `test_historical_web_files_parser_rejects_invalid_or_duplicate_entries`. - No new author comments, and the description is the same as before. ## What I ran - Head: `c1801ba7098ab5af55984daaf5e34f8ff95bca31` - `main`: `5454cd2e455994d992aca39335ce60507eeda1eb` - Machine: Arch Linux 7.2.11-zen, GCC 16.2.1, Intel Core i9-14900KF, NVIDIA GeForce RTX 4070 Ti SUPER (driver 615.78.08). This is a Python-only change, so I built no C++. The tests ran in a sandbox without network access. ```sh git fetch origin main pull/12788/head:refs/review/12788 git diff 44c43e75a3239fce74b105a9dadace8907f34143 c1801ba7098ab5af55984daaf5e34f8ff95bca31 git checkout --detach origin/main git merge --no-ff --no-edit refs/review/12788 git diff --check origin/main...refs/review/12788 python3 tools/check_conventions.py --base origin/main ctest --test-dir build -R '^web_(release|library_assets)$' --output-on-failure (cd tools/tests && python3 -m unittest test_build_web test_web_release) # negative controls, see below ``` ## Results | Check | Result | |---|---| | Merge onto `main` | Clean. The three PR files in the merged tree match the head commit | | `git diff --check` | Clean | | `check_conventions.py --base origin/main` | `All conventions checks passed.` | | ctest `web_release`, `web_library_assets` | 2/2 passed (0.21 s each) | | `unittest` for both files | `Ran 65 tests`, `OK` (the new case is a subtest, so the count is unchanged) | <details><summary>ctest</summary> ``` Start 93: web_release 1/2 Test #93: web_release ...................... Passed 0.21 sec Start 94: web_library_assets 2/2 Test #94: web_library_assets ............... Passed 0.21 sec 100% tests passed out of 2 ``` </details> ### Negative control 1. **Restored `tools/build_web.py` from the previous head `44c43e75a3`** and kept the new test. The parser test fails on the new subtest, as expected: ``` ERROR: test_historical_web_files_parser_rejects_invalid_or_duplicate_entries (...) (code='WEB_FILES = ([1],)') TypeError: cannot use 'list' as a set element (unhashable type: 'list') FAILED (errors=1) ``` 2. **Kept the reorder and dropped `TypeError` from the `except` clause:** the test passes. The reorder alone fixes the reported case. The extra `TypeError` catch still helps with inputs such as `WEB_FILES = {[1]}`, where `ast.literal_eval` itself raises `TypeError`. I restored the merged files after both controls. ## Previous findings 1. **`TypeError` escapes from `release_web_files`:** Resolved. The negative control above shows the new subtest fails on the old code and passes now. 2. **Unused production import of `WEB_FILES`** ([`tools/build_web.py:16`](https://github.com/boykopovar/AnyPS5/blob/c1801ba7098ab5af55984daaf5e34f8ff95bca31/tools/build_web.py#L16)): Still open. Non-blocking. 3. **`test_current_release_with_expected_files_is_accepted` depends on the git checkout** ([`tools/tests/test_build_web.py:472-480`](https://github.com/boykopovar/AnyPS5/blob/c1801ba7098ab5af55984daaf5e34f8ff95bca31/tools/tests/test_build_web.py#L472-L480)): Still open. Non-blocking. 4. **The two CLI tests duplicate the release setup:** Still open. Non-blocking. 5. **The description does not name #12783 or the stricter and more tolerant trade-off:** Still open, because the description has not changed. Non-blocking. ## New findings ### Blocking None. ### Non-blocking None. ## Not verified - I did not repeat the live `build_web.py --release` publication of v0.1.3, because the sandbox has no network. - I did not run the GitHub Pages workflow.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!12788
No description provided.