Skip to content

Commit 1dca23f

Browse files
d-v-bclaude
andauthored
ci(docs): fix the Read the Docs sub-site builds and skip filters (#4543)
* ci(docs): fix the Read the Docs sub-site builds and skip filters The zarr-indexing, zarr-metadata and zarr-http-server docs sites install their docs group with pip on Read the Docs, without a lockfile, so pymdown-extensions floated to 12.3, whose Highlight extension API the pinned mkdocstrings 1.0.6 cannot drive (Highlight.__init__() missing argument 'md'). No zarr-indexing build has succeeded since. Pin pymdown-extensions to 11.0.1, the version the repo-root uv.lock resolves to, and refresh the package lockfiles. The post_checkout skip filters compared the PR head against the tip of main with a two-dot diff, so any PR that was behind main appeared to touch every package and built every site. Compare against the merge base instead, after fetching full history into the shallow checkout. Also exclude zarr-http-server from the root site's filter, as the other two packages already were. Assisted-by: ClaudeCode:claude-fable-5.1 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * docs: add changelog entry for #4543 Assisted-by: ClaudeCode:claude-fable-5.1 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
1 parent 90e72a9 commit 1dca23f

11 files changed

Lines changed: 76 additions & 12 deletions

File tree

‎.readthedocs.yaml‎

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,27 @@ build:
1010
# that have their own Read the Docs projects. Exit code 183 cancels the
1111
# build and reports success to the Git provider. Scoped to PR builds
1212
# ("external" versions) because origin/main is only a meaningful diff
13-
# base there. Read the Docs strips shell quoting from commands, so the
13+
# base there. Compare against the merge base (origin/main...HEAD), not
14+
# against the tip of main: a two-dot diff also reports everything that
15+
# landed on main after the PR branched, which made every PR that was
16+
# behind main build every site. The checkout is shallow, so fetch the
17+
# full history first; without a merge base the diff fails and the build
18+
# runs, which is the safe default. Read the Docs strips shell quoting from commands, so the
1419
# exclude pathspecs must use the quote-free :! form, not ':(exclude)'.
20+
# The diff is taken against the merge base (origin/main...HEAD), not
21+
# against the tip of main: a two-dot diff also reports everything that
22+
# landed on main after the PR branched, which made every PR that was
23+
# behind main build every site. The checkout is shallow, so fetch the
24+
# full history first; without a merge base the diff fails and the build
25+
# runs, which is the safe default.
1526
- |
16-
if [ "$READTHEDOCS_VERSION_TYPE" = "external" ] && git diff --quiet origin/main -- :!packages/zarr-metadata :!packages/zarr-indexing;
27+
if [ "$READTHEDOCS_VERSION_TYPE" = "external" ];
1728
then
18-
exit 183;
29+
git fetch --quiet --unshallow origin main pull/$READTHEDOCS_VERSION_NAME/head || true;
30+
if git diff --quiet origin/main...HEAD -- :!packages/zarr-metadata :!packages/zarr-indexing :!packages/zarr-http-server;
31+
then
32+
exit 183;
33+
fi
1934
fi
2035
install:
2136
- pip install --upgrade pip

‎changes/4543.misc.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed the Read the Docs builds of the zarr-indexing, zarr-metadata and zarr-http-server documentation sites, which failed after an unpinned `pymdown-extensions` release, and made pull request builds of those sites skip when the pull request does not change the package.

‎packages/zarr-http-server/.readthedocs.yaml‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,20 @@ build:
1515
# to PR builds ("external" versions) because origin/main is only a
1616
# meaningful diff base there. The shared docs config and header script
1717
# live outside the package directory but change this site too.
18+
# The diff is taken against the merge base (origin/main...HEAD), not
19+
# against the tip of main: a two-dot diff also reports everything that
20+
# landed on main after the PR branched, which made every PR that was
21+
# behind main build every site. The checkout is shallow, so fetch the
22+
# full history first; without a merge base the diff fails and the build
23+
# runs, which is the safe default.
1824
- |
19-
if [ "$READTHEDOCS_VERSION_TYPE" = "external" ] && git diff --quiet origin/main -- packages/zarr-http-server packages/mkdocs-base.yml packages/source-version.js;
25+
if [ "$READTHEDOCS_VERSION_TYPE" = "external" ];
2026
then
21-
exit 183;
27+
git fetch --quiet --unshallow origin main pull/$READTHEDOCS_VERSION_NAME/head || true;
28+
if git diff --quiet origin/main...HEAD -- packages/zarr-http-server packages/mkdocs-base.yml packages/source-version.js;
29+
then
30+
exit 183;
31+
fi
2232
fi
2333
install:
2434
- pip install --upgrade pip

‎packages/zarr-http-server/pyproject.toml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ docs = [
7070
"mkdocs-material==9.7.7",
7171
"mkdocs==1.6.1",
7272
"mkdocstrings==1.0.6",
73+
# pymdown-extensions 12.3 changed the Highlight extension API; mkdocstrings 1.0.6
74+
# cannot drive it (Highlight.__init__() missing argument "md"). Match the
75+
# version in the repo-root uv.lock until mkdocstrings is bumped everywhere.
76+
"pymdown-extensions==11.0.1",
7377
"mkdocstrings-python==2.0.8",
7478
"griffe-inherited-docstrings==1.1.3",
7579
# mkdocstrings uses ruff to format rendered signatures

‎packages/zarr-http-server/uv.lock‎

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎packages/zarr-indexing/.readthedocs.yaml‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,20 @@ build:
1515
# to PR builds ("external" versions) because origin/main is only a
1616
# meaningful diff base there. The shared docs config and header script
1717
# live outside the package directory but change this site too.
18+
# The diff is taken against the merge base (origin/main...HEAD), not
19+
# against the tip of main: a two-dot diff also reports everything that
20+
# landed on main after the PR branched, which made every PR that was
21+
# behind main build every site. The checkout is shallow, so fetch the
22+
# full history first; without a merge base the diff fails and the build
23+
# runs, which is the safe default.
1824
- |
19-
if [ "$READTHEDOCS_VERSION_TYPE" = "external" ] && git diff --quiet origin/main -- packages/zarr-indexing packages/mkdocs-base.yml packages/source-version.js;
25+
if [ "$READTHEDOCS_VERSION_TYPE" = "external" ];
2026
then
21-
exit 183;
27+
git fetch --quiet --unshallow origin main pull/$READTHEDOCS_VERSION_NAME/head || true;
28+
if git diff --quiet origin/main...HEAD -- packages/zarr-indexing packages/mkdocs-base.yml packages/source-version.js;
29+
then
30+
exit 183;
31+
fi
2232
fi
2333
install:
2434
- pip install --upgrade pip

‎packages/zarr-indexing/pyproject.toml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ docs = [
6161
"mkdocs-material==9.7.7",
6262
"mkdocs==1.6.1",
6363
"mkdocstrings==1.0.6",
64+
# pymdown-extensions 12.3 changed the Highlight extension API; mkdocstrings 1.0.6
65+
# cannot drive it (Highlight.__init__() missing argument "md"). Match the
66+
# version in the repo-root uv.lock until mkdocstrings is bumped everywhere.
67+
"pymdown-extensions==11.0.1",
6468
"mkdocstrings-python==2.0.8",
6569
"griffe-inherited-docstrings==1.1.3",
6670
# mkdocstrings uses ruff to format rendered signatures

‎packages/zarr-indexing/uv.lock‎

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎packages/zarr-metadata/.readthedocs.yaml‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,20 @@ build:
1515
# to PR builds ("external" versions) because origin/main is only a
1616
# meaningful diff base there. The shared docs config and header script
1717
# live outside the package directory but change this site too.
18+
# The diff is taken against the merge base (origin/main...HEAD), not
19+
# against the tip of main: a two-dot diff also reports everything that
20+
# landed on main after the PR branched, which made every PR that was
21+
# behind main build every site. The checkout is shallow, so fetch the
22+
# full history first; without a merge base the diff fails and the build
23+
# runs, which is the safe default.
1824
- |
19-
if [ "$READTHEDOCS_VERSION_TYPE" = "external" ] && git diff --quiet origin/main -- packages/zarr-metadata packages/mkdocs-base.yml packages/source-version.js;
25+
if [ "$READTHEDOCS_VERSION_TYPE" = "external" ];
2026
then
21-
exit 183;
27+
git fetch --quiet --unshallow origin main pull/$READTHEDOCS_VERSION_NAME/head || true;
28+
if git diff --quiet origin/main...HEAD -- packages/zarr-metadata packages/mkdocs-base.yml packages/source-version.js;
29+
then
30+
exit 183;
31+
fi
2232
fi
2333
install:
2434
- pip install --upgrade pip

‎packages/zarr-metadata/pyproject.toml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ docs = [
5656
"mkdocs-material==9.7.7",
5757
"mkdocs==1.6.1",
5858
"mkdocstrings==1.0.6",
59+
# pymdown-extensions 12.3 changed the Highlight extension API; mkdocstrings 1.0.6
60+
# cannot drive it (Highlight.__init__() missing argument "md"). Match the
61+
# version in the repo-root uv.lock until mkdocstrings is bumped everywhere.
62+
"pymdown-extensions==11.0.1",
5963
"mkdocstrings-python==2.0.8",
6064
"griffe-inherited-docstrings==1.1.3",
6165
# mkdocstrings uses ruff to format rendered signatures

0 commit comments

Comments
 (0)