Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion PLAN.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ Learned from the independent validation ([#45](https://github.com/QuantEcon/data
| CPython — intro site notebooks, Colab, every other series | any resolving form; `github.com/…/raw/` is fine |
| Browser — `lecture-wasm` code-cell reads | `raw.githubusercontent.com/QuantEcon/data-lectures/main/lectures/<file>`, or `media.githubusercontent.com/media/…` for LFS-tracked files |

`{download}` targets and prose links are plain navigations — CORS does not apply, and the `github.com` form is fine there. The audit classifies references by org/repo across all URL forms, so both spellings count as the same pattern: the strict check **cannot enforce this rule**; the repoint PR has to. Quick test from any `quantecon.github.io` page console: `fetch('<url>')` — the bad form rejects, the good form resolves.
`{download}` targets and prose links are plain navigations — CORS does not apply, and the `github.com` form is fine there. The audit classifies references by org/repo across all URL forms, so both spellings count as the same pattern — but the strict build now also checks the *form*: any `lecture-wasm` code-cell read via a `github.com/…` URL fails the audit. That is a **post-merge net, not a gate** — the scan reads each lecture repo's `main`, so a violation turns the dashboard red at the next audit run rather than blocking the offending PR; the repoint PR remains the place the rule is actually upheld. Quick test from any `quantecon.github.io` page console: `fetch('<url>')` — the bad form rejects, the good form resolves.

Phase 4 inherits the requirement: `data.quantecon.org` must serve `access-control-allow-origin: *` before `lecture-wasm` can cut over to it — recorded as an acceptance criterion on [#37](https://github.com/QuantEcon/data-lectures/issues/37).

Expand Down
15 changes: 15 additions & 0 deletions scripts/build_audit.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,21 @@ def scan(repos_dir: Path):
f"{fname}: in pending wave {wave.get('pilot')} but already "
f"read from data-lectures")

# Repoint rule 5 (PLAN): lecture-wasm executes code cells in the reader's
# browser, where the github.com/*/raw/ redirect fails CORS before it is
# followed — wasm reads must use raw.githubusercontent.com, or
# media.githubusercontent.com for LFS files. Only code-cell reads are
# scanned, so {download} and prose links (navigations, CORS-exempt) can
# never trip this.
for d in datasets:
for r in d["refs"]:
if (r["repo"] == "lecture-wasm"
and (r.get("url_form") or "").startswith("github.com/")):
mig_problems.append(
f"{d['file']}: lecture-wasm {r['lecture']} reads via "
f"{r['url_form']} — fails CORS in the browser "
f"(repoint rule 5)")

audit = {
"generated": date.today().isoformat(),
"repos": {n: {"sha": repos[n]["sha"],
Expand Down
Loading