Skip to content

Commit 648b28c

Browse files
committed
fix(release): run generate.py + mike build in the docs preview worktree
They ran in the caller's cwd — mike build would read the wrong mkdocs.yml (or fail). Test now asserts the site lands in the worktree; drops scripts/docs/site/.marker committed by accident.
1 parent 448915b commit 648b28c

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

scripts/docs/site/.marker

Lines changed: 0 additions & 1 deletion
This file was deleted.

scripts/localpibox/stack/release.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -609,13 +609,14 @@ def cmd_release_docs_ready(*, assume_yes: bool, cons: Console) -> int:
609609
if not gen.is_file():
610610
cons.error(f"{gen} missing — {DOCS_BRANCH} branch out of date?")
611611
return 1
612-
out, err, code = run_cmd([sys.executable, str(gen), "--tag", target])
612+
out, err, code = run_cmd([sys.executable, str(gen), "--tag", target],
613+
cwd=str(work))
613614
if code != 0:
614615
cons.error(f"generate.py failed: {err.strip() or out.strip()}")
615616
return 1
616617
mike = shutil.which("mike")
617618
mike_cmd = [mike] if mike else [sys.executable, "-m", "mike"]
618-
out, err, code = run_cmd(mike_cmd + ["build"])
619+
out, err, code = run_cmd(mike_cmd + ["build"], cwd=str(work))
619620
if code != 0:
620621
cons.error(f"mike build failed: {err.strip() or out.strip()}")
621622
cons.error("Install docs tooling: "

scripts/test_localpibox_release.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,8 @@ def test_docs_ready_flags_and_pushes(tmpdir):
228228
# dev content is merged into docs on the remote
229229
doc = _g(remote, "show", "refs/heads/docs:doc/x.md").stdout
230230
assert doc == "content v1\n"
231+
# mike/generate ran in the preview worktree, not the caller's cwd
232+
assert (tmpdir / "preview" / "docs" / "site" / ".marker").is_file()
231233

232234

233235
def test_docs_ready_idempotent(tmpdir):

0 commit comments

Comments
 (0)