Skip to content

[modular] detect stale auto docstrings in CI + regenerate current ones#14241

Open
yiyixuxu wants to merge 3 commits into
mainfrom
regen-modular-auto-docstrings
Open

[modular] detect stale auto docstrings in CI + regenerate current ones#14241
yiyixuxu wants to merge 3 commits into
mainfrom
regen-modular-auto-docstrings

Conversation

@yiyixuxu

Copy link
Copy Markdown
Collaborator

The # auto_docstring check only verified that a docstring exists, regardless of whether its contents are up to date https://github.com/huggingface/diffusers/blob/main/utils/modular_auto_docstring.py#L254

so whenever a user updates something on the block that would cause the docstring to change (e.g., the block description field, InputParam) and forgets to run the utils/modular_auto_docstring.py --fix_and_overwrite` again, the docstring would go stale, and our CI will not catch it

this PR:
(1) regenerates the currently stale docstrings.
(2) makes check mode work like check_copies: regenerate each docstring in memory through the exact same workflow as --fix_and_overwrite (generate → insert → ruff/doc-builder format on a temp copy) and fail with the list of stale classes if the result differs from the file.

For contributors: if CI fails, run python utils/modular_auto_docstring.py --fix_and_overwrite from the repo root and push — same as make fix-copies.

yiyixuxu and others added 2 commits July 19, 2026 07:42
Mechanical output of `python utils/modular_auto_docstring.py
src/diffusers/modular_pipelines --fix_and_overwrite` on current main.
These docstrings drifted because the CI check only verifies a docstring
exists, not that its content matches the current block declarations.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…trings

Check mode now regenerates each # auto_docstring docstring the same way
--fix_and_overwrite does (generate -> insert -> ruff/doc-builder format,
on a temp copy) and compares with the checked-in file, reporting the
stale classes. Works like check_copies: forgetting to run the fixer now
fails CI on the PR that caused the drift, including when the causing
change is in another file (leaf block declarations, templates, specs).

The check now imports diffusers to evaluate doc properties, so the
check_auto_docs CI job moves to the torch container with the test job's
dependency install.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions github-actions Bot added modular-pipelines CI size/L PR with diff > 200 LOC labels Jul 19, 2026
@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@sayakpaul sayakpaul left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I think it might also make sense to add a thin test suite for the auto docstring utility in modular since it's an important user-facing feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI modular-pipelines size/L PR with diff > 200 LOC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants