Skip to content

FIX Restore docs build validation - #2493

Closed
hannahwestra25 wants to merge 3 commits into
microsoft:mainfrom
hannahwestra25:hannahwestra25-fix-docs-build-gate
Closed

FIX Restore docs build validation#2493
hannahwestra25 wants to merge 3 commits into
microsoft:mainfrom
hannahwestra25:hannahwestra25-fix-docs-build-gate

Conversation

@hannahwestra25

@hannahwestra25 hannahwestra25 commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Root cause

Lazy package exports made the aggregate pyrit JSON contain both direct members and submodules. _expand_module() stopped at the parent as soon as it saw direct API, so generation emitted only api/pyrit.md and failed TOC validation. Separately, the docs workflow always checked out each configured ref, so pull requests validated the base branch rather than their merge revision.

Behavior change

  • Expand mixed aggregate modules to the existing public API page frontier while retaining unique direct API and removing symbols already represented by descendant package pages.
  • On pull requests, replace the configured matrix entry matching github.base_ref with github.sha. Main PRs replace latest; release PRs replace their release entry. Missing or unconfigured base refs fail explicitly.
  • Preserve configured refs for push and workflow-dispatch builds.
  • Add focused regression coverage for mixed module expansion, duplicate suppression, main/release PR targeting, invalid PR bases, and non-PR behavior.

Validation

  • python -m pytest tests\unit\build_scripts\test_gen_api_md.py tests\unit\build_scripts\test_resolve_docs_matrix.py -q — 63 passed
  • python -m ruff check ... and python -m ruff format --check ... — passed
  • ty check ... — passed (repository-config compatibility warnings only)
  • Parsed .github/workflows/docs.yml with PyYAML
  • Exercised main-target, release-target, push, missing-base, and unconfigured-base matrix resolution locally
  • python -m build_scripts.pydoc2json pyrit --submodules -o doc\_api\pyrit_all.json
  • python -m build_scripts.gen_api_md — generated the expected 27 pages; TOC and orphan validation passed

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@hannahwestra25
hannahwestra25 marked this pull request as ready for review August 25, 2026 20:10
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: b8b8833c-24dc-44bf-980b-8273b0f7ef4f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant