Skip to content

run_api_docs crashes on documented duplicate reexports #24

Description

@ChrisRackauckas-Claude

Summary

run_api_docs can throw while checking a documented object that is reexported through more than one module. The failure occurs before it can decide whether the object has a docstring:

Constant binding was imported from multiple modules

The throw originates in SciMLTesting's _has_docstring binding-based lookup.

Reproduction

On OrdinaryDiffEq.jl master 5265a6c54232db89d6e57e7a2c69f5f20d55a172, Julia 1.12.6, the exact QA groups for StochasticDiffEqLowOrder, StochasticDiffEqRODE, StochasticDiffEqWeak, and StochasticDiffEqMilstein all reproduce this failure. For example:

ENV["GROUP"] = "StochasticDiffEqLowOrder_QA"
using Pkg
Pkg.test()

The affected surface includes aliases such as SDEAlgTypes, SDEIntegrator, and SDEOptions. Their owning objects already have docstrings, but constructing Docs.Binding(pkg, name) through a package that receives the same binding from multiple reexport paths is ambiguous and throws.

Expected behavior

run_api_docs should recognize the documentation attached to the object and continue checking the package. A duplicate reexport should not crash the documentation audit.

Suggested fix

Have _has_docstring first resolve getproperty(pkg, name) and query the object's documentation (for example, Docs.doc(object)) before falling back to a package/name Docs.Binding. Add a regression fixture in which one documented object is reexported into the checked module through two modules.

This should preserve strict docs enforcement; disabling api_docs or swallowing the error would hide real missing documentation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions