Skip to content

fix(docs): CD docs build fails in mkdocstrings source highlight on api/auth.md #512

@wphillipmoore-vergil-agent

Description

@wphillipmoore-vergil-agent

Summary

The CD docs job fails at mkdocs build (via mike deploy) rendering
api/auth.md, crashing in the mkdocstrings-python source highlighter:

ERROR - Error reading page 'api/auth.md': 'NoneType' object has no attribute 'replace'
  File ".../mkdocstrings_handlers/python/_internal/handler.py", line 264, in render
  File ".../mkdocstrings_handlers/python/templates/material/_base/class.html.jinja", line 272, in block 'source'
  File ".../mkdocstrings/_internal/handlers/rendering.py", line 120, in highlight
AttributeError: 'NoneType' object has no attribute 'replace'
error: Command '['mkdocs', 'build', '--clean', '--config-file', '.../mike-mkdocs....yml']' returned non-zero exit status 1

Context

Locked docs toolchain (uv.lock)

  • mkdocs 1.6.1, mkdocs-material 9.7.3
  • mkdocstrings 1.0.3, mkdocstrings-python 2.0.3
  • pymdown-extensions 10.21, pygments 2.20.0

pyproject.toml pins only mkdocs-material and mkdocstrings[python]
(unversioned), so uv resolved the latest majors (mkdocstrings 1.0,
mkdocstrings-python 2.0). The crash is in the source block highlight, i.e.
show_source rendering of an object documented in api/auth.md
(pymqrest.auth).

Plan

  1. Investigate root cause first (no changes yet): reproduce locally, and
    determine exactly why highlight() receives None for api/auth.md — a
    specific object/docstring construct vs. a mkdocstrings-python 2.0 regression.
  2. Choose the fix from findings: pin the docs toolchain to the last building
    version (preferred if it's a regression), adjust mkdocstrings options, or fix
    a source construct — and report upstream if it's a library bug.

Acceptance

  • CD docs job builds and deploys cleanly on develop.
  • Fix validated (docs build green) before merge.

References

  • Exposed by: mq-rest-admin-python#510 → PR #511 (item 7 secrets: inherit)
  • Fleet epic: mq-rest-admin-project/.github#14

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions