Skip to content

chore(web): regenerate course data from current chapters - #621

Closed
lihanyu1715446406-afk wants to merge 1 commit into
shareAI-lab:mainfrom
lihanyu1715446406-afk:chore/regenerate-web-data
Closed

lihanyu1715446406-afk wants to merge 1 commit into
shareAI-lab:mainfrom
lihanyu1715446406-afk:chore/regenerate-web-data

Conversation

@lihanyu1715446406-afk

Copy link
Copy Markdown

Fixes #620

Regenerated the committed web data at main (7226f55) by running the repository's own extractor, with no hand edits:

cd web
npm ci
npm run extract

What changed

  • web/src/data/generated/versions.json — all 17 chapter source snapshots now match sNN_*/code.py, together with their loc / functions / classes metadata and the per-chapter diffs.
  • web/src/data/generated/docs.json — content updated for s04/s05/s06 (zh) and s07/s08/s16 (en/zh/ja), picking up README edits that had not been regenerated.

The drift came from recent lesson changes (the OS-aware ENVIRONMENT_PROMPT from #587, REPL quit handling, the s08 compaction work in #603) landing in code.py / README without re-running the extractor.

Why it matters

  • main's Test workflow is currently red: tests/test_web_scenarios.py::test_generated_s16_metadata_extends_s15_without_registry_false_positives fails because generated sources lag the chapters. With this change that test passes.
  • The website stops serving older lesson code than the repository.

Verification

  • npm run extract on 7226f55 produces only these two files.
  • python -m pytest tests/test_web_scenarios.py -q — the generated-data test passes. On my Windows machine the two lesson-loading tests still fail for the unrelated missing anthropic / fcntl modules; they pass on CI's Ubuntu runner.
  • No hand edits to generated files; no changes to chapters, READMEs, tests, or build config.

AI assistance: Claude Code was used to inspect the repository, compare the generated output against every chapter, and prepare this PR; the extractor itself was run locally.

@lihanyu1715446406-afk

Copy link
Copy Markdown
Author

Re-verified on the current branch (upstream main is still 7226f55, so the snapshot is current):

  • cd web && npm run extract produces no diff — the committed versions.json / docs.json are exactly what the extractor generates (17 versions, 16 diffs, 51 docs).
  • All 17 generated source entries match their sNN_*/code.py byte for byte.

Three workflows are still waiting on maintainer action:

  • Test and CI are action_required (first-time contributor approval).
  • The two Vercel deployments fail with Account is blocked, which is account-level rather than a problem with this change. Re-enabling/relinking the Vercel account should be enough once the workflows are approved.

Could a maintainer approve the workflow runs and re-enable the Vercel project when convenient? Happy to adjust anything if CI surfaces an issue.

@lihanyu1715446406-afk

Copy link
Copy Markdown
Author

Closing this, since the change is now superseded.

I rebased onto the current main (448c75b) and regenerated web/src/data/generated/ with npm run extract. The output is byte-for-byte identical to what is already on main — docs.json and versions.json both hash to the same blobs as origin/main's versions. The conflict came from #624, which changed s13/s15/s16 and regenerated the course data in the same commit, so this PR's content is fully included there.

Nothing left to merge, so I'll close it rather than push an empty commit. Thanks for the review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

web: generated course data is stale again, leaving main Test CI red

1 participant