Skip to content

Remove docs.json update logic#2566

Merged
dfinster merged 1 commit intomainfrom
df/kb-nav-update
Apr 28, 2026
Merged

Remove docs.json update logic#2566
dfinster merged 1 commit intomainfrom
df/kb-nav-update

Conversation

@dfinster
Copy link
Copy Markdown
Member

Summary

Stops the knowledgebase-nav pipeline from reading, writing, or parsing docs.json. Tag pages, product indexes, article tab-badge sync, and root support.mdx behavior are unchanged. When tag pages are added, removed, or renamed (treated as delete + add), the PR report (pr_report.py) now emits a docs.json update required section that lists the exact Mintlify page ids to add or remove, grouped by product (Support: <display_name>), using display names from scripts/knowledgebase-nav/config.yaml.

Motivation

Mintlify navigation in docs.json is intended to be edited by humans. The generator should not mutate navigation automatically.

Changes

scripts/knowledgebase-nav/generate_tags.py

  • Removed update_docs_json, DOCS_JSON_NAV_LANGUAGE, and the post-loop docs.json phase.
  • Pipeline is now five phases ending at support.mdx updates; docstrings and CLI help updated accordingly.

scripts/knowledgebase-nav/pr_report.py

  • Removed the docs_json bucket from categorization and the - docs.json updated. bullet.
  • Added collect_tag_page_changes() from git diff --name-status HEAD lines: maps support/<product>/tags/<slug>.mdx to page ids (strip .mdx); handles A, D, and rename/copy (R/C) as add + remove.
  • Added load_product_display_names() from config.yaml; optional --config (default <repo-root>/scripts/knowledgebase-nav/config.yaml).
  • Added build_docs_json_section() and wired into build_report_markdown; fallback body is skipped when only tag-page add/remove lists are non-empty.

.github/workflows/knowledgebase-nav.yml

  • Step renamed to Generate tag pages and product index; comments describe human docs.json edits via PR comment.
  • Auto-commit: message chore: regenerate support tag pages (matches CHORE_SUBJECT for chore-only detection); file_pattern no longer includes docs.json.

Tests

  • test_generate_tags.py: Removed TestUpdateDocsJson; fixture no longer seeds docs.json; full pipeline asserts docs.json is not created; light regression checks that update_docs_json is gone and the module does not path-open docs.json.
  • test_golden_output.py: Removed golden assertions against docs.json; fixture copies only support/ + support.mdx; asserts no docs.json appears after the run.
  • test_pr_report.py: New coverage for tag-page collection, the docs.json section, display-name fallback, YAML loading edge cases, and updated categorization (e.g. M docs.json no longer increments a docs_json bucket).

Docs

  • README.md and Architecture.md: Describe human-managed docs.json, PR comment workflow, new-product tab JSON snippet, CI file patterns, troubleshooting, and updated mermaid diagrams (no GEN --> docs.json).

Breaking change / migration

Workflow behavior: Commits from the Knowledgebase Nav workflow no longer include docs.json. Authors and reviewers must apply navigation edits manually when tag pages change.

Operational: PRs that previously relied on the bot to refresh support tabs must instead use the docs.json update required block in the PR comment (or edit docs.json locally). Rename an auto-commit subject string: anything that matched chore: regenerate support tag pages and docs.json navigation should use chore: regenerate support tag pages for chore-only / skip-comment logic.

How to verify

  • Run unit + integration tests from repo root:
    • python -m pytest scripts/knowledgebase-nav/tests/ -v
  • Run the generator locally:
    • python scripts/knowledgebase-nav/generate_tags.py --repo-root .
    • Confirm git status does not show docs.json modified.
  • Smoke-test the report (example):
    • python scripts/knowledgebase-nav/pr_report.py --repo-root . --diff-text $'A\tsupport/models/tags/foo.mdx\n' --warnings-file /dev/null
    • Confirm ### docs.json update required and grouped Support: … headings.

Risk / review focus

  • Fork PRs: Generator still runs; auto-commit remains skipped. Fork contributors must run the generator locally and edit docs.json when tag pages change (README calls this out).
  • Display names: If config.yaml is missing or malformed, headings fall back to Support: <slug>; confirm that is acceptable for edge cases.

Commit

  • e5067feb6 — Remove docs.json update logic

@dfinster dfinster requested a review from a team as a code owner April 28, 2026 16:43
@mintlify
Copy link
Copy Markdown
Contributor

mintlify Bot commented Apr 28, 2026

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
wandb 🟢 Ready View Preview Apr 28, 2026, 4:49 PM

@github-actions
Copy link
Copy Markdown
Contributor

Knowledgebase navigation update

No updates to support articles, tag pages, or product indexes from this run.

@dfinster dfinster merged commit 0d3d6b0 into main Apr 28, 2026
11 checks passed
@dfinster dfinster deleted the df/kb-nav-update branch April 28, 2026 16:49
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