PR previews show main's cached pages instead of the pull request's changes
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 1-2 天
- 新手友好度
- 53/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- github, github-actions, yaml
- 领域
- ci-cd
调研方向
Read ci.yml and compare its “Clear stale Sphinx environment” step with the corresponding step in publish.yml; the issue identifies the missing _build/html cleanup and gives the intended command. Check how the preview links are configured in Netlify and the CI workflow, then validate on a PR that edits an existing lecture: its preview should show the change and each PR should have one working preview link.
由索引模型根据 Issue 内容生成。
描述
What happens
A pull request's Netlify preview does not show the pull request's changes to an existing lecture. The Build HTML step in ci.yml writes a page only when that lecture has no page in the downloaded build cache, so every other page in the preview is the cached copy built from main.
Evidence from #304, which changed var_dmd.md and measurement_models.md:
- Its CI run (Actions run 39720429073) wrote six pages:
gallant_tauchen,intro,lq_mean_field_games,lucas_prescott_investment,optimal_growth_uncertaintyandsocial_security_depletion. Neither changed lecture was among them. - On the preview it deployed,
var_dmd.htmlcontains 113 of the 114 phrases the PR removed and 6 of the 154 it added. The page shows the old translation.
#305's preview of sir_model looked right only by coincidence. Its run did not rewrite that page either, but the cache predated #302, so it already held the wording #305 restored.
Cause
The Clear stale Sphinx environment step removes _build/.doctrees but leaves the cached _build/html. The notebook build then reads every source and saves the shared Sphinx environment, so the HTML build reads nothing (updating environment: 0 added, 0 changed, 0 removed) and writes a page only if its source file is newer than the cached HTML file. The cache is unpacked after checkout, so the cached HTML always looks newer.
publish.yml does not have this problem. Its clear step removes both directories, and the publish-2026oct22 run wrote all 150 pages.
What to change
- In
ci.yml, make the clear step remove_build/htmlas well, matchingpublish.yml:
- name: Clear stale Sphinx environment
shell: bash -l {0}
run: rm -rf _build/.doctrees _build/html
The execution cache (_build/.jupyter_cache) is kept, so no notebook re-executes. The HTML step then writes all 150 pages.
-
Remove the second, broken preview link. Netlify's own app also comments on each PR ("Deploy Preview for astonishing-narwhal-a8fc64 ready!"), and its
deploy-preview-Nlink returns 404 (checked 2026-10-23 on #304 and #305). The working preview is the latergithub-actionscomment ("🚀 Deployed on …"). Turn off deploy previews for this site in Netlify's settings, so the CI deploy is the only one. -
Optional: replace
nwtgck/actions-netlifywithquantecon/actions/[email protected], as QuantEcon/lecture-python-programming.fr does. It posts a stablepr-NURL and a link to each lecture the PR changes, which is the page a reviewer opens. It needspull-requests: writeon the job and a Node setup step, as in the frci.yml. On QuantEcon/lecture-python-programming.fr#94 its preview shows the PR's text.
Done when
- A PR that edits an existing lecture shows the edited text in its preview, checked on one PR.
- Each PR carries one preview link, and it works.
- 主要语言
- TeX
- 星标
- 5
- 派生
- 4
- 平均合并
- 6 天 22 小时
- 30 天内合并 PR
- 20
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
QuantEcon/lecture-python.zh-cn 的其他 Issue
-
Phase 2 tidy-up: revert intersphinx-qualified references once their target lectures are translated未关闭
难度 2/5 1-3 小时 新手友好度 76/100
QuantEcon/lecture-python.zh-cn#173 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 35/100
QuantEcon/lecture-python.zh-cn#306 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 72/100
QuantEcon/lecture-python.zh-cn#271 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 28/100
QuantEcon/lecture-python.zh-cn#268 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 55/100
QuantEcon/lecture-python.zh-cn#267 ·
维护者通常 1 天内回复
查看 QuantEcon/lecture-python.zh-cn 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
VictoriaMetrics/operator#2772 ·
维护者通常 1 天内回复
-
admission-deferred priority: medium status: ready work-class: scoped
难度 2/5 1-3 小时 新手友好度 70/100
melodic-software/claude-code-plugins#10887 · 4 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
allows image
难度 2/5 1-3 小时 新手友好度 78/100
DaoCloud/public-image-mirror#46272 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
bobadilla-tech/biasmarket.com#402 ·
维护者通常 1 天内回复