Commit 0d3d6b0
authored
Remove docs.json update logic (#2566)
## 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 logic1 parent ebd7b2f commit 0d3d6b0
8 files changed
Lines changed: 696 additions & 491 deletions
File tree
- .github/workflows
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
11 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
12 | 16 | | |
13 | 17 | | |
14 | 18 | | |
| |||
101 | 105 | | |
102 | 106 | | |
103 | 107 | | |
104 | | - | |
| 108 | + | |
105 | 109 | | |
106 | 110 | | |
107 | 111 | | |
| |||
128 | 132 | | |
129 | 133 | | |
130 | 134 | | |
131 | | - | |
132 | | - | |
133 | | - | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
134 | 139 | | |
135 | 140 | | |
136 | 141 | | |
| |||
195 | 200 | | |
196 | 201 | | |
197 | 202 | | |
198 | | - | |
199 | | - | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
200 | 206 | | |
201 | 207 | | |
202 | 208 | | |
203 | 209 | | |
204 | | - | |
205 | | - | |
| 210 | + | |
| 211 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
29 | 28 | | |
30 | | - | |
31 | 29 | | |
32 | 30 | | |
33 | 31 | | |
34 | 32 | | |
35 | 33 | | |
36 | 34 | | |
| 35 | + | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
51 | | - | |
| 52 | + | |
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
55 | | - | |
| 56 | + | |
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
| |||
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
| 105 | + | |
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
| 111 | + | |
| 112 | + | |
112 | 113 | | |
113 | 114 | | |
114 | 115 | | |
115 | 116 | | |
116 | | - | |
| 117 | + | |
117 | 118 | | |
118 | 119 | | |
119 | 120 | | |
| |||
158 | 159 | | |
159 | 160 | | |
160 | 161 | | |
161 | | - | |
| 162 | + | |
162 | 163 | | |
163 | 164 | | |
164 | 165 | | |
165 | 166 | | |
166 | | - | |
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| 170 | + | |
| 171 | + | |
170 | 172 | | |
171 | 173 | | |
172 | 174 | | |
173 | 175 | | |
174 | 176 | | |
175 | 177 | | |
176 | 178 | | |
177 | | - | |
178 | 179 | | |
179 | 180 | | |
180 | 181 | | |
| |||
185 | 186 | | |
186 | 187 | | |
187 | 188 | | |
188 | | - | |
| 189 | + | |
189 | 190 | | |
190 | | - | |
| 191 | + | |
| 192 | + | |
191 | 193 | | |
192 | 194 | | |
193 | 195 | | |
| |||
0 commit comments