ci: test docs build on PRs (strict) and rename to docs.yml#1463
ci: test docs build on PRs (strict) and rename to docs.yml#1463wakame1367 wants to merge 2 commits into
Conversation
The conformance endpoint had a docstring `Returns:` section but no return type annotation, which makes griffe emit a warning and fails `mkdocs build --strict`. Match the sibling `landing` endpoint (summary-only docstring, no annotation) so the strict docs build passes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Rename `deploy_mkdocs.yml` -> `docs.yml` and add a `test` job that runs `mkdocs build --strict` on pull requests, so broken docs are caught before they reach main. The existing deploy job is preserved and now gated behind `needs: test` (push to main only). Refs developmentseed#1408 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| paths: | ||
| # Only rebuild/deploy the website when docs have changed | ||
| - 'README.md' | ||
| - 'CHANGES.md' | ||
| - 'CONTRIBUTING.md' | ||
| - 'deployment/**' | ||
| - 'docs/**' | ||
| - '.github/workflows/docs.yml' | ||
| pull_request: | ||
| paths: | ||
| # Test the docs build whenever something that feeds the docs changes. | ||
| # The API reference and OpenAPI schema are generated from the source, | ||
| # so source/dependency changes can break the strict build too. | ||
| - 'README.md' | ||
| - 'CHANGES.md' | ||
| - 'CONTRIBUTING.md' | ||
| - 'deployment/**' | ||
| - 'docs/**' | ||
| - 'src/titiler/**' | ||
| - 'pyproject.toml' | ||
| - 'uv.lock' | ||
| - '.github/workflows/docs.yml' |
|
Note on the red benchmark job: it fails with |
|
Correction to my earlier note — I was imprecise about the mechanism, and the details actually matter here. The benchmark job didn't fail simply because this is a fork PR (my earlier #1448 was also from a fork and its benchmark passed). What actually happened:
So this is still unrelated to the change (a docs-only diff can't affect runtime; |
Part of #1408 (aligning the workflows with the stac-auth-proxy layout), opened as a draft while the overall scope is confirmed in the issue.
What
Today the docs are only built when they are deployed on push to
main(deploy_mkdocs.yml), so a PR that breaks the documentation build is only discovered after it is merged. This adds a docs build check on pull requests.deploy_mkdocs.yml→docs.yml;testjob that runsmkdocs build --strictonpull_request(path-filtered to inputs that feed the docs:docs/**,README.md,CHANGES.md,CONTRIBUTING.md,deployment/**,src/titiler/**,pyproject.toml,uv.lock, and the workflow itself);needs: testandif: github.event_name == 'push' && github.ref == 'refs/heads/main'— so deploy still only runs on push tomain.Prerequisite fix
mkdocs build --strictcurrently fails onmainwith a single griffe warning:The
conformanceendpoint has a docstringReturns:section but no return-type annotation. The first commit drops that section, which makes the strict build pass.I went with removing the section rather than adding an annotation because that's what matches the existing conventions:
titiler/xarray/main.pyis the onlymain.pywith an API reference page indocs/mkdocs.yml(api/titiler/xarray/main.md), which is why only this one is scanned by griffe — the identicalconformanceintitiler/application/main.pyisn't affected;conformancewas the only function in that file carrying aReturns:section — its siblinglanding, which returns the same HTML-or-JSON union, has a summary-only docstring;create_html_response(...)or adictcarries a return annotation, and annotating it would mean naming starlette's private_TemplateResponsein a union.Happy to add a return-type annotation instead if you'd rather have the type than the prose.
Notes / scoping
zizmor --min-severity medium(the repo's pre-commit gate) passes ondocs.yml. Pedantic reports one lowconcurrency-limitsnote, which I left off to stay consistent with the existingci.yml/ previousdeploy_mkdocs.yml(also no concurrency block) and to avoid cancelling an in-flight gh-pages deploy.Verified locally:
mkdocs build --strict -f docs/mkdocs.ymlsucceeds after the docstring fix, andpre-commit run(ruff/mypy/zizmor) passes on the changed files.🤖 Generated with Claude Code